From 70c6bbb972cc3b9c1ec78a99cf605faeb8979e36 Mon Sep 17 00:00:00 2001 From: elia Date: Thu, 23 Nov 2023 09:59:14 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20master=20from=20@=20opal/opal.?= =?UTF-8?q?github.io@732822865e07c2a970c56772112661b56d9a70e1=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...est-6d5a4569e28824ef587523e2f6987ca9.json} | 2 +- ...c4c9b592e85ce699428a05db4d6ac425c2b09f.js} | 132 +- ...c9b592e85ce699428a05db4d6ac425c2b09f.js.gz | Bin 0 -> 141554 bytes ...7916d5e1c773e93a5a2c83db9c06d516fd80.js.gz | Bin 141549 -> 0 bytes ...b2af85b7e1de3dbb52fd1413d46dd2dca0e.css.gz | Bin 19201 -> 19201 bytes ...8d85edc3659719ed624f009ab14f21e029a.map.gz | Bin 20193 -> 20193 bytes ...95f027323aed416e47cd8a208bed1efbbea.css.gz | Bin 19296 -> 19296 bytes ...5180dcf3dd5811d11be92629e51696a0389f.js.gz | Bin 141638 -> 0 bytes ...afa4fcb29136cb9ef2e003a34a1adca26f52bd.js} | 134 +- ...a4fcb29136cb9ef2e003a34a1adca26f52bd.js.gz | Bin 0 -> 141643 bytes ...474163e862fa7b16e3d8d13ad3c1a23b4d0ce.map} | 2 +- ...4163e862fa7b16e3d8d13ad3c1a23b4d0ce.map.gz | Bin 0 -> 109831 bytes ...ef13e4bdc35d1f65975b492fe858c2136cf.map.gz | Bin 109831 -> 0 bytes ...b94fa5249c487df88ac70612b6a2a6d4b95ce60b02 | 2 +- ...a3f12b2fe9521683ac31fdc24e41a724cfdd09ac44 | 2 +- ...42fcc16d10d929138f90e5fb7cadeedf92cb6c852d | 2 +- ...d81426e7057168a0851c75a9da99cf427242cbf646 | 2 +- ...c388d91804538131387d7eab2a0f4e778ea88e72d4 | 2 +- ...a057ae97fbadd5b111efe8895ac824d46938dc3793 | 2 +- ...adb58c63d87c2f4ba36331c23b4b84d7a92a7741dd | 2 +- ...3f2809ff5602b4a492a206152a3f2dc568c79361af | 2 +- ...23e4a83727a1c7f2aff0ef255042af4e68d0409ec6 | 2 +- ...ff62bd1d72086dc6f271cd63f0da8daf654e00d7d0 | 2 +- ...d7679bfc40cc5eb11683ca41f594bf7f49453630a0 | 2 +- ...daeb9fa0be955052788dbc702db146ced433569493 | 2 +- ...4be5e22ca77533509714c7d8c87c429250b05d38ae | 2 +- ...609b3cfe5b06f6efcbeb1a6ad45e512220cc7dc2f1 | 2 +- ...b8fb20b039de8777db21ed673ffa89f09eefa6e312 | 2 +- ...15d3f6acb16d23336997324f10689e0805766cb5f7 | 2 +- ...a9d6a80f653c0bf3fd585ad080caade29b9bc17a0} | 6 +- ...88c93a14c7b1d252ccce8189f63db8dff2347672a0 | 2 +- ...021caf5fb561d30ec76415f4bfffeecce0fa593269 | 2 +- ...8af04cf02b4b81d3d4dcc7f630eb49d526fbaca7ef | 2 +- ...4cb5f279528063e7be16d55e04efa0dc608af6484e | 2 +- ...3e35ac1a4f8db519c39486c82858c555af3918d3eb | 2 +- ...263fc4d60605fcc184f6e8b898fb03117953f94b09 | 2 +- ...e2e8b015cbdb9cc8ebb450f3cc9fa0dee8dc908107 | 2 +- ...a82e5ad90502fb39e830be9c2a7d09e17e70237034 | 2 +- ...e3851e9bfc9fd8a3b153bca37073a839997e98237c | 2 +- ...fa71e8b7718c94dce141a8a87e37881aadf23b80cd | 2 +- ...1a74c11a413b88a2ae1ccb54090bc32177d141140d | 2 +- ...bdd11ab765756fcaa9c5fb6022d1421d6751b8e229 | 2 +- ...1fc1ecb610bd5584fd3a02011d2d1c39daa19ec7b8 | 2 +- ...e8a315e5f07371c55f1b6db056fc4d9b01408af5e9 | 2 +- ...7758fd8929fb02554f1a8576a782d788eb37e563dd | 2 +- ...3cde538d2a3e6839593b93ec478cc3aa24a1a963fb | 2 +- ...0485163b821e0c9f61ba12db5a121e85985475ac7d | 2 +- ...5713a278f05fe11725c23d81f705018d1c605e0f53 | 2 +- ...86243d3b60098ba2262ad2ee05069193fbc0ad99d7 | 2 +- ...7739d45d3e8d7b9d8f238c367021ff7165dd6a6446 | 2 +- ...2c3675bfb7064aeb1acd92f1f5bf40345a66f04a78 | 2 +- ...b9ddbf0bafe912d5481bf5fcf3cf6c492a3ee04bf2 | 2 +- ...78e34f6225a22e2d51a3fb7264cefb83de6e6e1939 | 2 +- ...e038960f6ef64a9a6b5df54bfa8169775c45a9ce8c | 2 +- ...c28155d26a97a3fe323091f8ead67df96b40384e2a | 2 +- ...222855ff36812379c0445dfed9bc3eac34a3b219a2 | 2 +- ...90bfdd6b05adf36ed806a67d2c575505d96a580316 | 2 +- ...54c742bde00c698b6e2f8e258551f4c5a754592378 | 2 +- ...b37d8a03a47d3170656f40e20e56e532a1a63aba3e | 2 +- ...59b1ef6cf0c1a4e9300c4ee9cf84d9102417f3a8f3 | 2 +- ...01cfefff5c4a93daa242214f233d93d7e71989134e | 2 +- ...c207e096d7378e1932f96843ea03daec8b8ffff6f2 | 2 +- ...e8c2c1fb8cc5feba389dfef0076b6d0378d81d5b6f | 2 +- ...a1444557f592c4fa03694deda96cfe068dd5014a3c | 2 +- ...4ade4b891f568b331638a038aaf7a240638a520a78 | 2 +- ...95f2d0ee867e43b1c0366563d61db7834af76f.js} | 2 +- ...0a05368d7dcf4b000fc6a688938dc4644d3eecc7ba | 2 +- ...17f8351ed4c4bf30edd2e258ce446c74091d5737a} | 8 +- ...28bea06cca9c5573fe968e8db3e8ca77a99a45ea4b | 2 +- ...201794affc5e4ff656a8e1907a352b43f0f04b0bc6 | 2 +- ...f2225c0a1b5fc455f72629c3b5f31482d4fcb09fa2 | 2 +- ...da3c3c95471675bef7c150c443c008b4fbb915cfdb | 2 +- ...eedff847682814b8e9c62ec9d95208d96584e09b4b | 2 +- ...7ea41fb3cd9dcc9fdeabcbe1e3e5a904647c90c4e6 | 2 +- ...a97ee81a610152e0a15d9b935e8bbf634f94e535fd | 2 +- ...a9585dff5d367de647b7e8e3a08410116640579941 | 2 +- ...8e4d31bf513da551ef96326e75a3e2a26dd3.js.gz | Bin 253441 -> 0 bytes ...7b25c574a2dd8c3ec18b94d46806c5cc833234.js} | 320 +- ...25c574a2dd8c3ec18b94d46806c5cc833234.js.gz | Bin 0 -> 253440 bytes ...80fad20f14a6a0baf27e5b8dfd5dfd064a91d5.js} | 320 +- ...fad20f14a6a0baf27e5b8dfd5dfd064a91d5.js.gz | Bin 0 -> 253533 bytes ...2e00a26acbbf9d6ccbbed5bd8a86bd67c911.js.gz | Bin 253533 -> 0 bytes ...0fb700c853bad86d9cd45aa2275d427807e.map.gz | Bin 254491 -> 254491 bytes ...5bcf7a57e061ad1d8822fbf5a5699707793de11cfb | 2 +- ...072bbb42036e37e7706f5459081c977c1c2c.js.gz | Bin 93 -> 93 bytes ...7be30a3fa2d2706e0259c17a65966f210e31068f4} | 6 +- ...b7587ef300f719556d4f526b805ce9dae78c367b38 | 2 +- ...ba30cb0eb19ba9ffbb4e7d511b79077250fcad421d | 2 +- ...41acabefee2259247678734a925b178509d3a4ec05 | 2 +- ...52b1b836077b0f918b3a0266dc292c1e81a717acba | 2 +- ...f2fe44beeeb0c89d3734e4a67016ba838418288fd5 | 2 +- ...4b44c669aa82652aced413b1d59af35133542353cf | 2 +- ...59a45775415cd7c8f4f323da8ce93e7ff937fa0df6 | 2 +- ...efd9c3a42aa3b15b0e8cec82d79ca0d52d3e7fb269 | 2 +- ...6979fa4eaad4fc069750f27a86cb1cef306014d6e8 | 2 +- ...c4b8a295a2dd106e0cd900f3fb9f1a582cc48d4166 | 2 +- ...14d178b62715ed77c2e443b4ab60eb25466fd0b7c0 | 2 +- ...16d31918090e9b02d9601a87da2672dda31f98053f | 2 +- ...c88df0b229ebe2ac89276b1e9c156f779b9f33029f | 2 +- ...837683e297c1469a40397653dda6fecd5a3b44dcc3 | 2 +- ...5a66f977ce76431afdcf0647da43d95d8aeea83af4 | 2 +- ...84c0aa217df51744e35ecd71d102a2fa80c8918b11 | 2 +- ...e8dbcb0266c43c4223b44400ccb5c4dcb04afac3ae | 2 +- ...a8b60cc9b20d6ee580feead711ddbb53a7bc8d85c5 | 2 +- ...a90ec17417c1a682c9e04e3e1c509d8f7318ea8d12 | 2 +- ...ef965ca281dfbf38a778c5c4878ae9b9b3d8809217 | 2 +- ...fdc935b97386d6ee9abe6138e98906d76464c76cc2 | 2 +- ...8b30d0713c373d97c244a33c71f3bc7114031f1bf8 | 2 +- ...5599afd9a7cdf9bf559704892d74cbd4cde3d07feb | 2 +- ...5d9374748cb1bb0f063ec612e91d1ba76e6c4bd14c | 2 +- ...0713e23d304c519e51be77a8a91e697c02c12b1a1b | 2 +- ...9492b5cb0f72e4bd44a214dfc1f7f8c644250cfbb6 | 2 +- ...3b9fc7257291af371e1272f88fe5454f2c66fc711c | 2 +- ...6dab3ea5f49875209f82248f77a9239f38801f5b4d | 2 +- ...1c2f04b9d58872e38219da177944baacf3162789fa | 2 +- ...4a0af760aad726e2a70bef5a28ae3541d1f56e35e2 | 2 +- ...38c5ae19f52248642f18c4b3aa9d992cebfe1772b7 | 2 +- ...8d480dd0958fdf1166dfe3911d8fe8446a65ffaf19 | 2 +- ...0c078ce43d8e455e9beabc4912546c3670cccd21ba | 2 +- ...9e63f5cd06b7d8e986a2bbe8bd379c584791f6fb6c | 2 +- ...8cc375fe94831ef7ad46a157973c7d375fe1771840 | 2 +- ...da050f5b0bd1309bbfa01d8186ce8e794787b10d95 | 2 +- ...b4ced1a560d1fe8991db9d04f1b94d25a0bdb9172c | 2 +- ...40f27179a3cbaded644124d0ffdcfe6ad5da8945e3 | 2 +- ...eb475788bf3cb6431d23d523e2d8fcfaf611303d1b | 2 +- ...35973717010f7473af2f6d111a6ab0a1c2efadc68c | 2 +- ...cef0eadbfddff59900e89850ccb1af67ffbae6ad4b | 2 +- ...cf954f1f98c871596d2949079e46ad38d7b0388583 | 2 +- ...c7b17308a3d1ea15ec5c4710df703ee42d412d4300 | 2 +- ...25109e85fbda464a49b7e322d7d6e14fa74568bfd7 | 2 +- ...375d56eeaf059dd4180ab294ff5ae932b13a393648 | 2 +- ...d6dd615c2edecd1ef8949ddb73a863ba2ff71e237e | 2 +- ...0e007b0be29328333c0e158aa9fb64352cc7441266 | 2 +- ...facfdf9c23b6107728846005bd353fa89fa211926c | 2 +- ...a5419b6b6e61848087abe6ad51379a78ad9c040949 | 2 +- ...3592c0a63738bc83dc41e289d31e62aa911246d142 | 2 +- ...3ad7e7c5908cc097bc6898374a210c996a73600239 | 2 +- ...d015ac4a3c3b685f047d73abb8f915d5190fd56cd8 | 2 +- ...9b76d8b3207a4bdfc93f7f12526959d0130b84ac1e | 2 +- ...50122ee741d9a2c897b0b750150cae548ad40d42c5 | 2 +- ...7deb8a83002c2ecd6f57eff7b0de621ccd98b5663a | 2 +- ...4b98a520c0d3f6e53ffdee44b7b75c7ed719d201ff | 2 +- ...772495cccf9acecb94413df8658815cdb26aea84a6 | 2 +- ...e9ca318e88555986cf8fe2ee263489cc906c7f0a6f | 2 +- ...9065a0c0af5c072ce62a1726b79ff876bfeb42dffd | 2 +- ...9f35d4a09f85f8d72038e7d132e54026648a2f303a | 2 +- ...ddfd203187038a4bb65a3ab5fadc7d750d4051ef08 | 2 +- ...a952c6ed64a5d92b0f7a7e983ba22ae2da965bd61a | 2 +- ...b91f7679c694d8f99c1ddf22338738d9859d4e6593 | 2 +- ...e959649499ba79a57c181f6aee839fd4adf0de02e1 | 2 +- ...295f83de67fc3a2d0fbddf2290d57a605c5693b324 | 2 +- ...24fdb50c5e02b3a6ae1149efd15c57e9bcf9c7ad2a | 2 +- ...d27ab1c730817f58b75507dbdb50d6a921e54b46fc | 2 +- ...eebb10ce46c496357ccaabfa968c2e0934bc13116e | 2 +- ...4147b694a6947e2c95bfa0cdfd376988717c9b1f3a | 2 +- ...301af73b2ef0112155f3fca52defa4be2b4cd75243 | 2 +- ...66adc46e4d235add89d752cd3f29ab97d4b7ccbe6e | 2 +- ...57ee440f0f2a9399be8c210332810e2e101aae0a77 | 2 +- ...4483dd31cd8d1ba7291d9fad606e9293da551f627e | 2 +- ...e1399693fff6049e1abb2a9e470021df972957da86 | 2 +- ...6fda6d8130fba40388e3954f4ac3edb122df6bb079 | 2 +- ...765aea0faa804b4ee5ac9c3cdcade2d5966094db57 | 2 +- ...51fae98997f6337b038f1641c1ef709834a2fe6922 | 2 +- ...0269cfff65410301602508c1ad438d6f5b3ba98e77 | 2 +- ...50b44694a654c06cd182dd5e59dc5e76ed674f5135 | 2 +- ...2bf9ea00530cca00825d5d6c0591316f8d2a178e80 | 2 +- ...1fc7e3ac44cbcbdb17d94b32963c70c072f83360df | 2 +- ...a4d5a2ee2b0c0bf02aa47f55c730c5b8b363398056 | 2 +- ...2f9f090b45dcfbbeea31f4d913a616dd48523f16a1 | 2 +- ...99b7e9af4a813b2bb9c50fb9e9df7b2f5f71efc2a8 | 2 +- ...adfbb78f281fa2dcc9c0f45e35734bfb5a09cdea39 | 2 +- ...5c748746c84240a7c921b0d183b71d1467067fbca2 | 2 +- ...ad5dba3cf5b09aa5e041f31bf571e802da54d88d21 | 2 +- ...101c89861786b403a6f46f2dd6ec8b40d45e36282c | 2 +- ...3e5455e39b446c9695ad4dfdaaadbccb536c48f8f4 | 2 +- ...fdc0328300ac6ec2230bc56e4adee3ed8cc0ef824a | 2 +- ...fe6b320ad91c6889938af14d40e90b0a3e274ee603 | 2 +- ...b136269b863bd688f923f6b03fb3dfbff1bf780489 | 2 +- ...36b9f4b8a2b7f41f71f3735ea4ba0f677da856ed67 | 2 +- ...bbb06704bccec77896d9aac98dc3b792ba829da65b | 2 +- ...aa72e18e349ca37570013261708aa029a72a052bcb | 2 +- ...03fe1cbdf94038125f5002eab3f961e8dfd57ce437 | 2 +- ...153eab2f4607a2ae0836db2d46e28cc5d7ada94af} | 4 +- ...6c3157ab798c8804e9d2b73e3492503950cb7b66d4 | 2 +- ...8d8728167e77c9ed5304843adaf9ed80b45d7a258d | 2 +- ...c1241ac618174f3d88b00d948424cb9722e1bf4dc2 | 2 +- ...5d6123879f6081ab3c9fa6ea1f6ec28d9d14a93b46 | 2 +- ...55834d0dcef7731be839ca06a26d6e21d0c9c9ab9f | 2 +- ...1193a03c1eb39dececcf3a272fa1dd7f52d81619a7 | 2 +- ...4c6bd8ed3126a3e3c95a437fea35362b3ff9fbeb5e | 2 +- ...ba3ad63ce5f4f9885677be08900b09819d9234ad8a | 2 +- ...d3e447eb28d29fd9640f3b4c6d11fd5047377464f5 | 2 +- ...d00559238172c5f5a1c89391a28d2e9f27012c87af | 2 +- ...2e30a5741e9399d3ab30deabf7a866372ad3873a6d | 2 +- ...17a0accfe71752ac87c38a4d78d7a930b85eefa212 | 2 +- ...163b94ddbb89dda14edbdb1e6a643ed70abff46a1b | 2 +- ...ac2181573768774bf1ece9d1fe352a35d7fe3e2517 | 2 +- ...343ab77fa9811872bdb249f238e9728a2f99f1d43b | 2 +- ...b9bbdb92c64fd696c41aeb17341f8a5f4c0b5d8ce8 | 2 +- ...08d2d2f927d9f1b509c6bf3b6796a2de9b9bcdde59 | 2 +- ...c0d19256976b7ea3074606a0675b47851ab4591ffd | 2 +- ...4d7ec081e192666537d74b1f8c250d358d81bdc205 | 2 +- ...dc5af59ca2b67441f92b871dd8c369a10ffac4d8d4 | 2 +- ...3cedac5393320c41a2d756f0e7c0713fd920996c16 | 2 +- ...4beb0b108bbfd5d69a3a354051075fef69a967d7ef | 2 +- ...41f31c1e9ab09ab54e85851ee20c28a54f8c230400 | 2 +- ...1d3294a38ab0211f41579763e9b4a9ec6470441680 | 2 +- ...88b20f25d64f39797cea6d29702243c94b01f6af5e | 2 +- ...bb55e13b0e04e01cdc23074a9e824fa38bdb3fb359 | 2 +- ...e58a04bcbd24309c84332d2409598511745dfc578b | 2 +- ...ea4e2bc87378b1b609ed4599b8cfe74dbcd9120aa2 | 2 +- ...19e9c5b5d3409da683c2f3d76cd439c9b37edcfa88 | 2 +- ...92c4ae0be800ab508ad349b6ce802e48802a8bda6c | 2 +- ...ee422865711e75cdd760c4bb64da46f3efe0a8f7af | 2 +- ...699ba9ef027ba3f25a9ccaf5b67b9f51b9be711167 | 2 +- ...49be545f59af09719ebc1950a7e7da1dd39500d8e9 | 2 +- ...28deeb0870d45690a9215fadcb1deabd555b23b8e7 | 2 +- ...1fcbf9a6abd1a3adf1b0b52f133359ae07df39b44c | 2 +- ...33d7d855ff85e655ac8dff96a276ee8108fe6c78f4 | 2 +- ...8e8cd3bc82c9a3f6560e44d55a9a392778ea5adebd | 2 +- ...38be50ff12290ca172b6775396215d8bd4b6fdec38 | 2 +- ...21e391fbff71530d479a11e576c845af23be52b4db | 2 +- ...b37d1457ddd9c68f76880ec836543fcd4a01e5156c | 2 +- ...b480da4b3e0589005cc5098c78a876332ec768416f | 2 +- ...ef2827852edba5bff9537d4650b6635156591124a4 | 2 +- ...80c9386050769b75ca172d7606fd012194ea9f8c1e | 2 +- ...b3870cd03f9791a8846c55884bbe7c0ab4f2c4ed44 | 2 +- ...743fd4d406fc7617f7e85b8a46d9f0af060244b772 | 2 +- ...175307289380ab70f4c9496a61b66b1f8f3bed4319 | 2 +- ...b0bac71d2b10bb884f9d760fe7b16da78afba1901d | 2 +- ...728eb38b7138a00331e9741bc7f4fb37ea1a1f3d05 | 2 +- ...ea1a4c144d3cfbdde76b72fd89470792f2bb130637 | 2 +- ...2e6805b19f51527444a150255a75b28d7de89d30d0 | 2 +- ...bc0d4c6117b6d8b81731717151e20bc2cfab348cc7 | 2 +- ...c4925d3ec2cc25b66b8e64b5e22658f401d1c8bde7 | 2 +- ...1f41766919cc6c8e2713bab6aed0384ed6ef55656b | 2 +- ...e28d805d1088e523a68a49ee4f66cb45c35e593659 | 2 +- ...4ea8cde71bef0a2e8c97a19d46d82dfad3c2db.js} | 4 +- ...8cde71bef0a2e8c97a19d46d82dfad3c2db.js.gz} | Bin 69429 -> 69428 bytes ...1f8d60da375e8c5922a1d0278af8c5be4ecc52.js} | 4 +- ...d60da375e8c5922a1d0278af8c5be4ecc52.js.gz} | Bin 69524 -> 69523 bytes ...cf91222ba6a397247d800938ad58d95a4bc.map.gz | Bin 3775 -> 3775 bytes ...891a3132fd51c363ea14e32837ab9b419eec7a6682 | 2 +- ...1f75c25c78bb939e9eda723b4b039c51d07a7700f5 | 2 +- blog/2014/05/07/promises-in-opal/index.html | 6 +- blog/2015/02/02/opal-0-7-0/index.html | 6 +- blog/2016/01/13/opal-0-9/index.html | 6 +- blog/2016/06/23/opal-0-10/index.html | 6 +- blog/2016/07/19/opal-rspec-0-5/index.html | 6 +- blog/2017/12/20/opal-0-11-0/index.html | 6 +- blog/2019/02/05/opal-rspec-0-7/index.html | 6 +- blog/2019/05/12/opal-1-0/index.html | 6 +- .../index.html | 6 +- blog/2021/08/09/opal-1-2/index.html | 6 +- blog/2021/11/03/opal-1-3/index.html | 6 +- .../index.html | 6 +- blog/2021/12/24/opal-1-4/index.html | 6 +- blog/2022/04/13/opal-1-5/index.html | 6 +- .../11/24/opal-1-6-opal-rspec-1-0/index.html | 6 +- blog/2023/01/06/opal-1-7-ruby-3-2/index.html | 6 +- .../index.html | 6 +- blog/index.html | 6 +- docs/api/v1.8.2/corelib/ArgumentError.html | 154 + docs/api/v1.8.2/corelib/Array.html | 9576 ++++++++++++++++ .../corelib/Array.self/SampleRandom.html | 269 + docs/api/v1.8.2/corelib/BasicObject.html | 1184 ++ docs/api/v1.8.2/corelib/Binding.html | 895 ++ docs/api/v1.8.2/corelib/Boolean.html | 984 ++ docs/api/v1.8.2/corelib/Class.html | 941 ++ docs/api/v1.8.2/corelib/ClosedQueueError.html | 171 + docs/api/v1.8.2/corelib/Comparable.html | 638 ++ .../v1.8.2/corelib/CompatibilityError.html | 158 + docs/api/v1.8.2/corelib/Complex.html | 2580 +++++ docs/api/v1.8.2/corelib/Dir.html | 320 + docs/api/v1.8.2/corelib/EOFError.html | 158 + docs/api/v1.8.2/corelib/Encoding.html | 1195 ++ .../Encoding/UndefinedConversionError.html | 158 + docs/api/v1.8.2/corelib/EncodingError.html | 156 + docs/api/v1.8.2/corelib/Enumerable.html | 5155 +++++++++ docs/api/v1.8.2/corelib/Enumerator.html | 1106 ++ .../Enumerator.self/ArithmeticSequence.html | 1208 ++ .../v1.8.2/corelib/Enumerator.self/Chain.html | 462 + .../v1.8.2/corelib/Enumerator.self/Lazy.html | 1277 +++ .../Lazy.self/StopLazyError.html | 142 + .../v1.8.2/corelib/Enumerator/Generator.html | 321 + .../v1.8.2/corelib/Enumerator/Yielder.html | 395 + docs/api/v1.8.2/corelib/Errno.html | 117 + docs/api/v1.8.2/corelib/Exception.html | 1120 ++ docs/api/v1.8.2/corelib/FalseClass.html | 146 + docs/api/v1.8.2/corelib/FiberError.html | 150 + docs/api/v1.8.2/corelib/File.html | 1042 ++ docs/api/v1.8.2/corelib/Float.html | 341 + docs/api/v1.8.2/corelib/FloatDomainError.html | 158 + docs/api/v1.8.2/corelib/FrozenError.html | 316 + docs/api/v1.8.2/corelib/GC.html | 190 + docs/api/v1.8.2/corelib/Hash.html | 5244 +++++++++ docs/api/v1.8.2/corelib/IO.html | 2535 +++++ docs/api/v1.8.2/corelib/IOError.html | 154 + docs/api/v1.8.2/corelib/IndexError.html | 154 + docs/api/v1.8.2/corelib/Integer.html | 415 + docs/api/v1.8.2/corelib/Interrupt.html | 150 + docs/api/v1.8.2/corelib/JS.html | 117 + docs/api/v1.8.2/corelib/Kernel.html | 6748 +++++++++++ docs/api/v1.8.2/corelib/KeyError.html | 348 + docs/api/v1.8.2/corelib/LoadError.html | 150 + docs/api/v1.8.2/corelib/LocalJumpError.html | 380 + docs/api/v1.8.2/corelib/Marshal.html | 268 + .../corelib/Marshal.self/ReadBuffer.html | 2857 +++++ .../corelib/Marshal.self/WriteBuffer.html | 1697 +++ docs/api/v1.8.2/corelib/MatchData.html | 1543 +++ docs/api/v1.8.2/corelib/Math.html | 1133 ++ docs/api/v1.8.2/corelib/Method.html | 1099 ++ docs/api/v1.8.2/corelib/Module.html | 5203 +++++++++ docs/api/v1.8.2/corelib/NameError.html | 312 + docs/api/v1.8.2/corelib/NilClass.html | 1237 +++ .../corelib/NoMatchingPatternError.html | 150 + docs/api/v1.8.2/corelib/NoMemoryError.html | 142 + docs/api/v1.8.2/corelib/NoMethodError.html | 321 + .../v1.8.2/corelib/NotImplementedError.html | 150 + docs/api/v1.8.2/corelib/Number.html | 5494 +++++++++ docs/api/v1.8.2/corelib/Numeric.html | 2712 +++++ docs/api/v1.8.2/corelib/Object.html | 131 + docs/api/v1.8.2/corelib/ObjectSpace.html | 281 + .../corelib/ObjectSpace.self/WeakMap.html | 429 + docs/api/v1.8.2/corelib/Opal.html | 1250 +++ docs/api/v1.8.2/corelib/Opal/IRB.html | 529 + .../api/v1.8.2/corelib/Opal/IRB/Silencer.html | 321 + docs/api/v1.8.2/corelib/PackUnpack.html | 117 + docs/api/v1.8.2/corelib/PatternMatching.html | 630 ++ docs/api/v1.8.2/corelib/Proc.html | 1082 ++ docs/api/v1.8.2/corelib/Process.html | 384 + docs/api/v1.8.2/corelib/Process/Status.html | 467 + docs/api/v1.8.2/corelib/Random.html | 1159 ++ .../v1.8.2/corelib/Random.self/Formatter.html | 715 ++ docs/api/v1.8.2/corelib/Range.html | 2142 ++++ docs/api/v1.8.2/corelib/RangeError.html | 154 + docs/api/v1.8.2/corelib/Rational.html | 2164 ++++ docs/api/v1.8.2/corelib/Refinement.html | 299 + docs/api/v1.8.2/corelib/Regexp.html | 1661 +++ docs/api/v1.8.2/corelib/RegexpError.html | 163 + docs/api/v1.8.2/corelib/RuntimeError.html | 154 + docs/api/v1.8.2/corelib/ScriptError.html | 156 + docs/api/v1.8.2/corelib/SecurityError.html | 142 + docs/api/v1.8.2/corelib/Set.html | 2568 +++++ docs/api/v1.8.2/corelib/Signal.html | 190 + docs/api/v1.8.2/corelib/SignalException.html | 146 + docs/api/v1.8.2/corelib/StandardError.html | 146 + docs/api/v1.8.2/corelib/StopIteration.html | 244 + docs/api/v1.8.2/corelib/String.html | 8379 ++++++++++++++ docs/api/v1.8.2/corelib/Struct.html | 1981 ++++ docs/api/v1.8.2/corelib/SyntaxError.html | 150 + docs/api/v1.8.2/corelib/SystemCallError.html | 301 + docs/api/v1.8.2/corelib/SystemExit.html | 142 + docs/api/v1.8.2/corelib/SystemStackError.html | 142 + docs/api/v1.8.2/corelib/ThreadError.html | 150 + docs/api/v1.8.2/corelib/Time.html | 2817 +++++ docs/api/v1.8.2/corelib/TracePoint.html | 664 ++ docs/api/v1.8.2/corelib/TrueClass.html | 146 + docs/api/v1.8.2/corelib/TypeError.html | 150 + docs/api/v1.8.2/corelib/UnboundMethod.html | 815 ++ .../v1.8.2/corelib/UncaughtThrowError.html | 390 + .../api/v1.8.2/corelib/ZeroDivisionError.html | 150 + docs/api/v1.8.2/corelib/_index.html | 850 ++ docs/api/v1.8.2/corelib/class_list.html | 51 + docs/api/v1.8.2/corelib/css/common.css | 1 + docs/api/v1.8.2/corelib/css/full_list.css | 58 + docs/api/v1.8.2/corelib/css/style.css | 497 + docs/api/v1.8.2/corelib/file.README.html | 87 + docs/api/v1.8.2/corelib/file.RUNTIME.html | 2726 +++++ docs/api/v1.8.2/corelib/file_list.html | 61 + docs/api/v1.8.2/corelib/frames.html | 17 + docs/api/v1.8.2/corelib/index.html | 87 + docs/api/v1.8.2/corelib/js/Error.html | 123 + docs/api/v1.8.2/corelib/js/app.js | 314 + docs/api/v1.8.2/corelib/js/full_list.js | 216 + docs/api/v1.8.2/corelib/js/jquery.js | 4 + docs/api/v1.8.2/corelib/method_list.html | 9827 +++++++++++++++++ .../v1.8.2/corelib/top-level-namespace.html | 482 + docs/api/v1.8.2/index.html | 97 + docs/api/v1.8.2/lib/AST/Processor/Mixin.html | 215 + docs/api/v1.8.2/lib/Opal.html | 1177 ++ docs/api/v1.8.2/lib/Opal/AST.html | 119 + docs/api/v1.8.2/lib/Opal/AST/Builder.html | 195 + docs/api/v1.8.2/lib/Opal/AST/Matcher.html | 509 + .../api/v1.8.2/lib/Opal/AST/Matcher/Node.html | 493 + docs/api/v1.8.2/lib/Opal/AST/Node.html | 393 + docs/api/v1.8.2/lib/Opal/Builder.html | 2199 ++++ .../lib/Opal/Builder/MissingRequire.html | 126 + .../lib/Opal/Builder/ProcessorNotFound.html | 126 + .../v1.8.2/lib/Opal/BuilderProcessors.html | 117 + .../Opal/BuilderProcessors/ERBProcessor.html | 237 + .../Opal/BuilderProcessors/JsProcessor.html | 294 + .../JsProcessor/ManualFragment.html | 476 + .../BuilderProcessors/OpalERBProcessor.html | 309 + .../lib/Opal/BuilderProcessors/Processor.html | 1116 ++ .../BuilderProcessors/RubyERBProcessor.html | 258 + .../Opal/BuilderProcessors/RubyProcessor.html | 683 ++ .../api/v1.8.2/lib/Opal/BuilderScheduler.html | 297 + .../lib/Opal/BuilderScheduler/Prefork.html | 261 + .../Opal/BuilderScheduler/Prefork/Fork.html | 875 ++ .../BuilderScheduler/Prefork/ForkSet.html | 534 + .../Prefork/OrderCorrector.html | 354 + .../lib/Opal/BuilderScheduler/Sequential.html | 220 + docs/api/v1.8.2/lib/Opal/CLI.html | 2602 +++++ docs/api/v1.8.2/lib/Opal/CLI/Evals.html | 195 + docs/api/v1.8.2/lib/Opal/CLIOptions.html | 704 ++ docs/api/v1.8.2/lib/Opal/Cache.html | 332 + docs/api/v1.8.2/lib/Opal/Cache/FileCache.html | 584 + docs/api/v1.8.2/lib/Opal/Cache/NullCache.html | 192 + docs/api/v1.8.2/lib/Opal/CliRunners.html | 586 + .../lib/Opal/CliRunners/Applescript.html | 220 + .../Applescript/MissingAppleScript.html | 134 + .../Applescript/MissingJavaScriptSupport.html | 134 + .../v1.8.2/lib/Opal/CliRunners/Chrome.html | 636 ++ .../v1.8.2/lib/Opal/CliRunners/Compiler.html | 1046 ++ docs/api/v1.8.2/lib/Opal/CliRunners/Deno.html | 228 + .../lib/Opal/CliRunners/Deno/MissingDeno.html | 134 + .../v1.8.2/lib/Opal/CliRunners/Firefox.html | 650 ++ docs/api/v1.8.2/lib/Opal/CliRunners/Gjs.html | 232 + .../lib/Opal/CliRunners/Gjs/MissingGjs.html | 134 + .../v1.8.2/lib/Opal/CliRunners/MiniRacer.html | 293 + .../v1.8.2/lib/Opal/CliRunners/Nashorn.html | 218 + .../CliRunners/Nashorn/MissingNashorn.html | 134 + .../v1.8.2/lib/Opal/CliRunners/Nodejs.html | 334 + .../Opal/CliRunners/Nodejs/MissingNodeJS.html | 134 + .../v1.8.2/lib/Opal/CliRunners/Quickjs.html | 229 + .../CliRunners/Quickjs/MissingQuickjs.html | 134 + .../lib/Opal/CliRunners/RunnerError.html | 130 + .../v1.8.2/lib/Opal/CliRunners/Safari.html | 654 ++ .../v1.8.2/lib/Opal/CliRunners/Server.html | 950 ++ .../lib/Opal/CliRunners/Server/App.html | 287 + .../api/v1.8.2/lib/Opal/CompilationError.html | 216 + docs/api/v1.8.2/lib/Opal/Compiler.html | 4807 ++++++++ docs/api/v1.8.2/lib/Opal/Config.html | 1502 +++ docs/api/v1.8.2/lib/Opal/Deprecations.html | 269 + docs/api/v1.8.2/lib/Opal/ERB.html | 270 + docs/api/v1.8.2/lib/Opal/ERB/Compiler.html | 629 ++ docs/api/v1.8.2/lib/Opal/EofContent.html | 309 + docs/api/v1.8.2/lib/Opal/Error.html | 140 + docs/api/v1.8.2/lib/Opal/Fragment.html | 955 ++ docs/api/v1.8.2/lib/Opal/GemNotFound.html | 325 + docs/api/v1.8.2/lib/Opal/Hike.html | 127 + docs/api/v1.8.2/lib/Opal/Hike/Index.html | 761 ++ docs/api/v1.8.2/lib/Opal/Hike/Trail.html | 877 ++ docs/api/v1.8.2/lib/Opal/MagicComments.html | 245 + docs/api/v1.8.2/lib/Opal/Nodes.html | 121 + docs/api/v1.8.2/lib/Opal/Nodes/AliasNode.html | 271 + .../v1.8.2/lib/Opal/Nodes/ArglistNode.html | 333 + docs/api/v1.8.2/lib/Opal/Nodes/Args.html | 119 + .../v1.8.2/lib/Opal/Nodes/Args/ArgNode.html | 257 + .../Nodes/Args/EnsureKwargsAreKwargs.html | 260 + .../lib/Opal/Nodes/Args/ExtractBlockarg.html | 264 + .../lib/Opal/Nodes/Args/ExtractKwarg.html | 271 + .../lib/Opal/Nodes/Args/ExtractKwargs.html | 268 + .../lib/Opal/Nodes/Args/ExtractKwoptarg.html | 277 + .../lib/Opal/Nodes/Args/ExtractKwrestarg.html | 333 + .../Opal/Nodes/Args/ExtractOptargNode.html | 268 + .../lib/Opal/Nodes/Args/ExtractPostArg.html | 262 + .../Opal/Nodes/Args/ExtractPostOptarg.html | 275 + .../lib/Opal/Nodes/Args/ExtractRestarg.html | 282 + .../lib/Opal/Nodes/Args/FakeArgNode.html | 263 + .../Opal/Nodes/Args/InitializeIterarg.html | 260 + .../Opal/Nodes/Args/InitializeShadowarg.html | 259 + .../lib/Opal/Nodes/Args/Parameters.html | 819 ++ .../lib/Opal/Nodes/Args/PreparePostArgs.html | 270 + docs/api/v1.8.2/lib/Opal/Nodes/ArgsNode.html | 249 + .../v1.8.2/lib/Opal/Nodes/ArityCheckNode.html | 908 ++ docs/api/v1.8.2/lib/Opal/Nodes/ArrayNode.html | 325 + .../v1.8.2/lib/Opal/Nodes/BackRefNode.html | 464 + docs/api/v1.8.2/lib/Opal/Nodes/Base.html | 2932 +++++ .../v1.8.2/lib/Opal/Nodes/BaseFlipFlop.html | 299 + .../v1.8.2/lib/Opal/Nodes/BaseSuperNode.html | 386 + .../v1.8.2/lib/Opal/Nodes/BaseYieldNode.html | 499 + docs/api/v1.8.2/lib/Opal/Nodes/BeginNode.html | 585 + .../v1.8.2/lib/Opal/Nodes/BlockPassNode.html | 243 + docs/api/v1.8.2/lib/Opal/Nodes/BreakNode.html | 243 + docs/api/v1.8.2/lib/Opal/Nodes/CallNode.html | 767 ++ .../Nodes/CallNode/DependencyResolver.html | 453 + docs/api/v1.8.2/lib/Opal/Nodes/CbaseNode.html | 254 + docs/api/v1.8.2/lib/Opal/Nodes/ClassNode.html | 381 + .../lib/Opal/Nodes/ClassVarAssignNode.html | 247 + .../lib/Opal/Nodes/ClassVariableNode.html | 261 + docs/api/v1.8.2/lib/Opal/Nodes/Closure.html | 971 ++ .../Opal/Nodes/Closure/CompilerSupport.html | 181 + .../lib/Opal/Nodes/Closure/NodeSupport.html | 984 ++ .../v1.8.2/lib/Opal/Nodes/ComplexNode.html | 254 + .../lib/Opal/Nodes/ConstAssignNode.html | 255 + docs/api/v1.8.2/lib/Opal/Nodes/ConstNode.html | 449 + docs/api/v1.8.2/lib/Opal/Nodes/DefNode.html | 571 + .../v1.8.2/lib/Opal/Nodes/DefinedNode.html | 1271 +++ .../lib/Opal/Nodes/DefinedSuperNode.html | 390 + docs/api/v1.8.2/lib/Opal/Nodes/DefsNode.html | 296 + .../lib/Opal/Nodes/DynamicStringNode.html | 287 + .../lib/Opal/Nodes/DynamicSymbolNode.html | 187 + docs/api/v1.8.2/lib/Opal/Nodes/EFlipFlop.html | 267 + .../api/v1.8.2/lib/Opal/Nodes/EnsureNode.html | 657 ++ .../lib/Opal/Nodes/ExclusiveRangeNode.html | 314 + .../lib/Opal/Nodes/GlobalAssignNode.html | 305 + .../lib/Opal/Nodes/GlobalVariableNode.html | 307 + docs/api/v1.8.2/lib/Opal/Nodes/HashNode.html | 840 ++ docs/api/v1.8.2/lib/Opal/Nodes/Helpers.html | 772 ++ docs/api/v1.8.2/lib/Opal/Nodes/IFlipFlop.html | 267 + docs/api/v1.8.2/lib/Opal/Nodes/IfNode.html | 1962 ++++ .../lib/Opal/Nodes/InclusiveRangeNode.html | 314 + .../lib/Opal/Nodes/InstanceAssignNode.html | 303 + .../lib/Opal/Nodes/InstanceVariableNode.html | 299 + .../lib/Opal/Nodes/IterArityCheckNode.html | 310 + docs/api/v1.8.2/lib/Opal/Nodes/IterNode.html | 877 ++ .../v1.8.2/lib/Opal/Nodes/JSReturnNode.html | 245 + .../api/v1.8.2/lib/Opal/Nodes/JSTempNode.html | 243 + .../v1.8.2/lib/Opal/Nodes/JsAttrAsgnNode.html | 254 + .../api/v1.8.2/lib/Opal/Nodes/JsAttrNode.html | 254 + .../api/v1.8.2/lib/Opal/Nodes/JsCallNode.html | 458 + .../v1.8.2/lib/Opal/Nodes/KwBeginNode.html | 211 + .../v1.8.2/lib/Opal/Nodes/KwSplatNode.html | 243 + .../api/v1.8.2/lib/Opal/Nodes/LambdaNode.html | 251 + .../lib/Opal/Nodes/LocalAssignNode.html | 337 + .../lib/Opal/Nodes/LocalDeclareNode.html | 245 + .../lib/Opal/Nodes/LocalVariableNode.html | 327 + .../v1.8.2/lib/Opal/Nodes/MassAssignNode.html | 538 + .../api/v1.8.2/lib/Opal/Nodes/Match3Node.html | 290 + .../lib/Opal/Nodes/MatchCurrentLineNode.html | 271 + .../api/v1.8.2/lib/Opal/Nodes/ModuleNode.html | 325 + docs/api/v1.8.2/lib/Opal/Nodes/NextNode.html | 309 + .../v1.8.2/lib/Opal/Nodes/NodeWithArgs.html | 1024 ++ .../lib/Opal/Nodes/NodeWithArgs/Shortcut.html | 631 ++ .../api/v1.8.2/lib/Opal/Nodes/NthrefNode.html | 261 + .../v1.8.2/lib/Opal/Nodes/NumericNode.html | 334 + docs/api/v1.8.2/lib/Opal/Nodes/RangeNode.html | 503 + .../v1.8.2/lib/Opal/Nodes/RationalNode.html | 254 + docs/api/v1.8.2/lib/Opal/Nodes/RedoNode.html | 363 + .../api/v1.8.2/lib/Opal/Nodes/RegexpNode.html | 892 ++ .../v1.8.2/lib/Opal/Nodes/ResBodyNode.html | 381 + .../api/v1.8.2/lib/Opal/Nodes/RescueNode.html | 646 ++ docs/api/v1.8.2/lib/Opal/Nodes/RetryNode.html | 243 + .../api/v1.8.2/lib/Opal/Nodes/ReturnNode.html | 307 + .../lib/Opal/Nodes/ReturnableYieldNode.html | 271 + docs/api/v1.8.2/lib/Opal/Nodes/ScopeNode.html | 4809 ++++++++ docs/api/v1.8.2/lib/Opal/Nodes/SelfNode.html | 243 + .../lib/Opal/Nodes/SingletonClassNode.html | 285 + docs/api/v1.8.2/lib/Opal/Nodes/SplatNode.html | 327 + .../api/v1.8.2/lib/Opal/Nodes/StringNode.html | 460 + docs/api/v1.8.2/lib/Opal/Nodes/SuperNode.html | 365 + .../api/v1.8.2/lib/Opal/Nodes/SymbolNode.html | 243 + docs/api/v1.8.2/lib/Opal/Nodes/TopNode.html | 1093 ++ docs/api/v1.8.2/lib/Opal/Nodes/UndefNode.html | 247 + docs/api/v1.8.2/lib/Opal/Nodes/UntilNode.html | 187 + .../v1.8.2/lib/Opal/Nodes/UntilPostNode.html | 195 + docs/api/v1.8.2/lib/Opal/Nodes/ValueNode.html | 332 + docs/api/v1.8.2/lib/Opal/Nodes/WhileNode.html | 305 + .../v1.8.2/lib/Opal/Nodes/WhilePostNode.html | 191 + .../v1.8.2/lib/Opal/Nodes/XStringNode.html | 582 + docs/api/v1.8.2/lib/Opal/Nodes/YieldNode.html | 256 + .../api/v1.8.2/lib/Opal/Nodes/ZsuperNode.html | 617 ++ docs/api/v1.8.2/lib/Opal/OS.html | 624 ++ .../lib/Opal/OpalBacktraceLocation.html | 625 ++ docs/api/v1.8.2/lib/Opal/Parser.html | 268 + .../v1.8.2/lib/Opal/Parser/DefaultConfig.html | 378 + .../Parser/DefaultConfig/ClassMethods.html | 262 + .../v1.8.2/lib/Opal/Parser/SourceBuffer.html | 195 + .../v1.8.2/lib/Opal/Parser/WithRubyLexer.html | 142 + docs/api/v1.8.2/lib/Opal/ParsingError.html | 151 + docs/api/v1.8.2/lib/Opal/PathReader.html | 506 + docs/api/v1.8.2/lib/Opal/REPL.html | 751 ++ docs/api/v1.8.2/lib/Opal/REPL/Silencer.html | 321 + docs/api/v1.8.2/lib/Opal/Rewriter.html | 658 ++ docs/api/v1.8.2/lib/Opal/Rewriters.html | 121 + .../v1.8.2/lib/Opal/Rewriters/Arguments.html | 1209 ++ docs/api/v1.8.2/lib/Opal/Rewriters/Base.html | 908 ++ .../Opal/Rewriters/Base/DummyLocation.html | 556 + .../Rewriters/BinaryOperatorAssignment.html | 590 + .../ConditionalSendHandler.html | 285 + .../BinaryOperatorAssignment/SendHandler.html | 290 + .../lib/Opal/Rewriters/BlockToIter.html | 229 + .../Opal/Rewriters/DeduplicateArgName.html | 380 + .../lib/Opal/Rewriters/DotJsSyntax.html | 590 + .../v1.8.2/lib/Opal/Rewriters/DumpArgs.html | 337 + .../lib/Opal/Rewriters/ForRewriter.html | 410 + .../ForRewriter/LocalVariableAssigns.html | 453 + .../lib/Opal/Rewriters/ForwardArgs.html | 749 ++ .../api/v1.8.2/lib/Opal/Rewriters/Hashes.html | 117 + .../Hashes/KeyDuplicatesRewriter.html | 432 + .../KeyDuplicatesRewriter/UniqKeysSet.html | 273 + .../v1.8.2/lib/Opal/Rewriters/InlineArgs.html | 414 + .../Rewriters/InlineArgs/Initializer.html | 1175 ++ .../lib/Opal/Rewriters/JsReservedWords.html | 956 ++ .../Rewriters/LogicalOperatorAssignment.html | 678 ++ .../ConditionalSendHandler.html | 289 + .../SendHandler.html | 290 + .../v1.8.2/lib/Opal/Rewriters/MlhsArgs.html | 421 + .../Opal/Rewriters/MlhsArgs/Arguments.html | 592 + .../Opal/Rewriters/MlhsArgs/MlhsRewriter.html | 281 + .../v1.8.2/lib/Opal/Rewriters/Numblocks.html | 303 + .../lib/Opal/Rewriters/OpalEngineCheck.html | 422 + .../lib/Opal/Rewriters/PatternMatching.html | 497 + .../PatternMatching/PatternConverter.html | 1200 ++ .../lib/Opal/Rewriters/ReturnableLogic.html | 707 ++ .../lib/Opal/Rewriters/TargetedPatches.html | 429 + .../lib/Opal/Rewriters/ThrowerFinder.html | 961 ++ docs/api/v1.8.2/lib/Opal/RewritingError.html | 155 + docs/api/v1.8.2/lib/Opal/Rubyspec.html | 117 + .../lib/Opal/Rubyspec/FiltersRewriter.html | 874 ++ docs/api/v1.8.2/lib/Opal/SimpleServer.html | 948 ++ docs/api/v1.8.2/lib/Opal/SourceMap.html | 130 + docs/api/v1.8.2/lib/Opal/SourceMap/File.html | 1008 ++ docs/api/v1.8.2/lib/Opal/SourceMap/Index.html | 489 + docs/api/v1.8.2/lib/Opal/SourceMap/Map.html | 574 + docs/api/v1.8.2/lib/Opal/SourceMap/VLQ.html | 536 + docs/api/v1.8.2/lib/Opal/SyntaxError.html | 204 + docs/api/v1.8.2/lib/Opal/TiltTemplate.html | 612 + docs/api/v1.8.2/lib/Opal/UseGem.html | 248 + docs/api/v1.8.2/lib/Opal/Util.html | 311 + .../v1.8.2/lib/Parser/Builders/Default.html | 366 + docs/api/v1.8.2/lib/Parser/Lexer.html | 222 + .../api/v1.8.2/lib/Parser/Lexer/Dedenter.html | 284 + docs/api/v1.8.2/lib/Parser/Lexer/Literal.html | 202 + docs/api/v1.8.2/lib/Parser/Source/Buffer.html | 204 + docs/api/v1.8.2/lib/_index.html | 1988 ++++ docs/api/v1.8.2/lib/class_list.html | 51 + docs/api/v1.8.2/lib/css/common.css | 1 + docs/api/v1.8.2/lib/css/full_list.css | 58 + docs/api/v1.8.2/lib/css/style.css | 497 + docs/api/v1.8.2/lib/file.History.html | 416 + docs/api/v1.8.2/lib/file.README.html | 552 + docs/api/v1.8.2/lib/file_list.html | 76 + docs/api/v1.8.2/lib/frames.html | 17 + docs/api/v1.8.2/lib/index.html | 100 + docs/api/v1.8.2/lib/js/app.js | 314 + docs/api/v1.8.2/lib/js/full_list.js | 216 + docs/api/v1.8.2/lib/js/jquery.js | 4 + docs/api/v1.8.2/lib/method_list.html | 8379 ++++++++++++++ docs/api/v1.8.2/lib/top-level-namespace.html | 177 + docs/api/v1.8.2/stdlib/Array.html | 632 ++ docs/api/v1.8.2/stdlib/Base64.html | 450 + docs/api/v1.8.2/stdlib/BasicObject.html | 238 + docs/api/v1.8.2/stdlib/Benchmark.html | 823 ++ docs/api/v1.8.2/stdlib/Benchmark/Job.html | 468 + docs/api/v1.8.2/stdlib/Benchmark/Report.html | 381 + docs/api/v1.8.2/stdlib/Benchmark/Tms.html | 1448 +++ docs/api/v1.8.2/stdlib/BigDecimal.html | 2194 ++++ docs/api/v1.8.2/stdlib/Boolean.html | 274 + docs/api/v1.8.2/stdlib/Buffer.html | 620 ++ docs/api/v1.8.2/stdlib/Buffer/Array.html | 861 ++ docs/api/v1.8.2/stdlib/Buffer/View.html | 1492 +++ docs/api/v1.8.2/stdlib/CGI.html | 171 + docs/api/v1.8.2/stdlib/CGI/Util.html | 599 + docs/api/v1.8.2/stdlib/Class.html | 258 + docs/api/v1.8.2/stdlib/Console.html | 839 ++ docs/api/v1.8.2/stdlib/Date.html | 2999 +++++ docs/api/v1.8.2/stdlib/Date/Infinity.html | 960 ++ docs/api/v1.8.2/stdlib/DateTime.html | 834 ++ docs/api/v1.8.2/stdlib/Delegator.html | 1404 +++ docs/api/v1.8.2/stdlib/Deno.html | 133 + docs/api/v1.8.2/stdlib/Dir.html | 544 + docs/api/v1.8.2/stdlib/ENV.html | 839 ++ docs/api/v1.8.2/stdlib/ERB.html | 133 + docs/api/v1.8.2/stdlib/ERB/Util.html | 228 + docs/api/v1.8.2/stdlib/Enumerable.html | 246 + .../stdlib/Exception2MessageMapper.html | 988 ++ .../api/v1.8.2/stdlib/ExceptionForMatrix.html | 144 + docs/api/v1.8.2/stdlib/File.html | 1754 +++ docs/api/v1.8.2/stdlib/File/Stat.html | 655 ++ docs/api/v1.8.2/stdlib/FileUtils.html | 444 + docs/api/v1.8.2/stdlib/Float.html | 231 + docs/api/v1.8.2/stdlib/Forwardable.html | 339 + docs/api/v1.8.2/stdlib/Hash.html | 754 ++ docs/api/v1.8.2/stdlib/IO.html | 514 + docs/api/v1.8.2/stdlib/Integer.html | 227 + docs/api/v1.8.2/stdlib/JS.html | 762 ++ docs/api/v1.8.2/stdlib/JSON.html | 629 ++ docs/api/v1.8.2/stdlib/JSON/JSONError.html | 130 + docs/api/v1.8.2/stdlib/JSON/ParserError.html | 134 + docs/api/v1.8.2/stdlib/Kernel.html | 1480 +++ docs/api/v1.8.2/stdlib/Logger.html | 1238 +++ docs/api/v1.8.2/stdlib/Logger/Formatter.html | 279 + docs/api/v1.8.2/stdlib/Logger/Severity.html | 153 + docs/api/v1.8.2/stdlib/MatchData.html | 416 + docs/api/v1.8.2/stdlib/Matrix.html | 7239 ++++++++++++ .../v1.8.2/stdlib/Matrix/CoercionHelper.html | 340 + .../stdlib/Matrix/ConversionHelper.html | 122 + .../Matrix/EigenvalueDecomposition.html | 686 ++ .../stdlib/Matrix/LUPDecomposition.html | 1077 ++ docs/api/v1.8.2/stdlib/Matrix/Scalar.html | 622 ++ docs/api/v1.8.2/stdlib/Method.html | 214 + docs/api/v1.8.2/stdlib/Module.html | 217 + docs/api/v1.8.2/stdlib/Mutex.html | 643 ++ docs/api/v1.8.2/stdlib/Nashorn.html | 107 + docs/api/v1.8.2/stdlib/Native.html | 666 ++ docs/api/v1.8.2/stdlib/Native/Array.html | 642 ++ docs/api/v1.8.2/stdlib/Native/Helpers.html | 476 + docs/api/v1.8.2/stdlib/Native/Object.html | 1160 ++ docs/api/v1.8.2/stdlib/Native/Wrapper.html | 319 + docs/api/v1.8.2/stdlib/NilClass.html | 346 + docs/api/v1.8.2/stdlib/NodeJS.html | 133 + docs/api/v1.8.2/stdlib/Numeric.html | 278 + docs/api/v1.8.2/stdlib/Object.html | 245 + docs/api/v1.8.2/stdlib/Observable.html | 759 ++ docs/api/v1.8.2/stdlib/OpenStruct.html | 1223 ++ docs/api/v1.8.2/stdlib/OpenURI.html | 584 + docs/api/v1.8.2/stdlib/OpenURI/Buffer.html | 409 + docs/api/v1.8.2/stdlib/OpenURI/HTTPError.html | 288 + docs/api/v1.8.2/stdlib/OpenURI/Meta.html | 1136 ++ docs/api/v1.8.2/stdlib/OpenURI/OpenRead.html | 285 + docs/api/v1.8.2/stdlib/OptionParser.html | 5045 +++++++++ docs/api/v1.8.2/stdlib/OptionParser/AC.html | 344 + .../stdlib/OptionParser/Acceptables.html | 118 + .../OptionParser/AmbiguousArgument.html | 174 + .../stdlib/OptionParser/AmbiguousOption.html | 166 + .../v1.8.2/stdlib/OptionParser/Arguable.html | 691 ++ .../stdlib/OptionParser/CompletingHash.html | 254 + .../stdlib/OptionParser/Completion.html | 483 + .../stdlib/OptionParser/InvalidArgument.html | 170 + .../stdlib/OptionParser/InvalidOption.html | 166 + docs/api/v1.8.2/stdlib/OptionParser/List.html | 1317 +++ .../stdlib/OptionParser/MissingArgument.html | 166 + .../stdlib/OptionParser/NeedlessArgument.html | 166 + .../v1.8.2/stdlib/OptionParser/OptionMap.html | 168 + .../stdlib/OptionParser/ParseError.html | 847 ++ .../v1.8.2/stdlib/OptionParser/Switch.html | 1416 +++ .../OptionParser/Switch/NoArgument.html | 369 + .../OptionParser/Switch/OptionalArgument.html | 245 + .../OptionParser/Switch/PlacedArgument.html | 257 + .../OptionParser/Switch/RequiredArgument.html | 245 + docs/api/v1.8.2/stdlib/PP.html | 547 + docs/api/v1.8.2/stdlib/PP/ObjectMixin.html | 443 + docs/api/v1.8.2/stdlib/PP/PPMethods.html | 1022 ++ docs/api/v1.8.2/stdlib/PP/SingleLine.html | 168 + docs/api/v1.8.2/stdlib/Pathname.html | 1981 ++++ docs/api/v1.8.2/stdlib/PrettyPrint.html | 1685 +++ .../v1.8.2/stdlib/PrettyPrint/Breakable.html | 547 + docs/api/v1.8.2/stdlib/PrettyPrint/Group.html | 614 + .../v1.8.2/stdlib/PrettyPrint/GroupQueue.html | 450 + .../v1.8.2/stdlib/PrettyPrint/SingleLine.html | 665 ++ docs/api/v1.8.2/stdlib/PrettyPrint/Text.html | 444 + docs/api/v1.8.2/stdlib/Proc.html | 334 + docs/api/v1.8.2/stdlib/Promise.html | 2456 ++++ docs/api/v1.8.2/stdlib/Promise/Trace.html | 332 + docs/api/v1.8.2/stdlib/Promise/When.html | 679 ++ docs/api/v1.8.2/stdlib/PromiseV2.html | 2736 +++++ docs/api/v1.8.2/stdlib/REPLUtils.html | 470 + .../v1.8.2/stdlib/REPLUtils/ColorPrinter.html | 737 ++ docs/api/v1.8.2/stdlib/Racc.html | 311 + docs/api/v1.8.2/stdlib/Racc/ParseError.html | 126 + docs/api/v1.8.2/stdlib/Racc/Parser.html | 2195 ++++ docs/api/v1.8.2/stdlib/Range.html | 221 + docs/api/v1.8.2/stdlib/Rational.html | 230 + docs/api/v1.8.2/stdlib/RbConfig.html | 188 + docs/api/v1.8.2/stdlib/Regexp.html | 220 + docs/api/v1.8.2/stdlib/SecureRandom.html | 250 + docs/api/v1.8.2/stdlib/Shellwords.html | 658 ++ docs/api/v1.8.2/stdlib/SimpleDelegator.html | 390 + docs/api/v1.8.2/stdlib/SingleForwardable.html | 334 + docs/api/v1.8.2/stdlib/Singleton.html | 419 + .../Singleton/SingletonClassMethods.html | 230 + docs/api/v1.8.2/stdlib/String.html | 580 + docs/api/v1.8.2/stdlib/StringIO.html | 938 ++ docs/api/v1.8.2/stdlib/StringScanner.html | 2073 ++++ docs/api/v1.8.2/stdlib/Struct.html | 390 + docs/api/v1.8.2/stdlib/Template.html | 576 + .../v1.8.2/stdlib/Template/OutputBuffer.html | 319 + docs/api/v1.8.2/stdlib/Thread.html | 843 ++ docs/api/v1.8.2/stdlib/Thread/Backtrace.html | 133 + .../stdlib/Thread/Backtrace/Location.html | 625 ++ docs/api/v1.8.2/stdlib/Thread/Queue.html | 571 + docs/api/v1.8.2/stdlib/ThreadError.html | 138 + docs/api/v1.8.2/stdlib/Time.html | 605 + docs/api/v1.8.2/stdlib/URI.html | 301 + docs/api/v1.8.2/stdlib/Vector.html | 3270 ++++++ .../v1.8.2/stdlib/Vector/ZeroVectorError.html | 126 + docs/api/v1.8.2/stdlib/YAML.html | 232 + docs/api/v1.8.2/stdlib/_index.html | 1163 ++ docs/api/v1.8.2/stdlib/class_list.html | 51 + docs/api/v1.8.2/stdlib/css/common.css | 1 + docs/api/v1.8.2/stdlib/css/full_list.css | 58 + docs/api/v1.8.2/stdlib/css/style.css | 497 + docs/api/v1.8.2/stdlib/file.LICENSE.html | 93 + docs/api/v1.8.2/stdlib/file.README.html | 108 + docs/api/v1.8.2/stdlib/file.changelog.html | 163 + docs/api/v1.8.2/stdlib/file_list.html | 121 + docs/api/v1.8.2/stdlib/frames.html | 17 + docs/api/v1.8.2/stdlib/index.html | 75 + docs/api/v1.8.2/stdlib/js/app.js | 314 + docs/api/v1.8.2/stdlib/js/full_list.js | 216 + docs/api/v1.8.2/stdlib/js/jquery.js | 4 + docs/api/v1.8.2/stdlib/method_list.html | 8371 ++++++++++++++ .../v1.8.2/stdlib/top-level-namespace.html | 525 + docs/guides/v1.8.2/async.html | 235 + docs/guides/v1.8.2/bridging.html | 243 + docs/guides/v1.8.2/cdp_common.html | 182 + docs/guides/v1.8.2/compiled_ruby.html | 544 + docs/guides/v1.8.2/compiler.html | 195 + docs/guides/v1.8.2/compiler_directives.html | 253 + docs/guides/v1.8.2/configuring_gems.html | 261 + docs/guides/v1.8.2/encoding.html | 181 + docs/guides/v1.8.2/getting_started.html | 196 + docs/guides/v1.8.2/headless_browsers.html | 249 + docs/guides/v1.8.2/index.html | 248 + docs/guides/v1.8.2/jquery.html | 336 + docs/guides/v1.8.2/opal_parser.html | 193 + docs/guides/v1.8.2/promises.html | 214 + docs/guides/v1.8.2/rails.html | 247 + docs/guides/v1.8.2/releasing.html | 242 + docs/guides/v1.8.2/roda-sprockets.html | 228 + docs/guides/v1.8.2/rspec.html | 226 + docs/guides/v1.8.2/sinatra.html | 227 + docs/guides/v1.8.2/source_maps.html | 196 + docs/guides/v1.8.2/static_applications.html | 209 + docs/guides/v1.8.2/templates.html | 257 + docs/guides/v1.8.2/unsupported_features.html | 187 + docs/guides/v1.8.2/upgrading.html | 183 + docs/guides/v1.8.2/using_sprockets.html | 229 + docs/index.html | 10 +- index.html | 6 +- javascripts/application.js | 2 +- javascripts/load-parser.js | 2 +- javascripts/try.js | 2 +- javascripts/try/examples | 2 +- libraries/index.html | 6 +- license/index.html | 6 +- try/index.html | 10 +- 820 files changed, 369035 insertions(+), 762 deletions(-) rename assets/{.sprockets-manifest-9338579b1385a55d70dbc9410f867605.json => .sprockets-manifest-6d5a4569e28824ef587523e2f6987ca9.json} (81%) rename assets/{application-74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80.js => application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js} (99%) create mode 100644 assets/application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js.gz delete mode 100644 assets/application-74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80.js.gz delete mode 100644 assets/application.debug-f885af64520b10f24d2e46f68e925180dcf3dd5811d11be92629e51696a0389f.js.gz rename assets/{application.debug-f885af64520b10f24d2e46f68e925180dcf3dd5811d11be92629e51696a0389f.js => application.debug-ff09e1eb149c682e225d3a75b7afa4fcb29136cb9ef2e003a34a1adca26f52bd.js} (99%) create mode 100644 assets/application.debug-ff09e1eb149c682e225d3a75b7afa4fcb29136cb9ef2e003a34a1adca26f52bd.js.gz rename assets/{application.js-fefc1e2760e062a33b165fb45b0e0ef13e4bdc35d1f65975b492fe858c2136cf.map => application.js-3ec4335d7b8f069f914b0d1e2db474163e862fa7b16e3d8d13ad3c1a23b4d0ce.map} (99%) create mode 100644 assets/application.js-3ec4335d7b8f069f914b0d1e2db474163e862fa7b16e3d8d13ad3c1a23b4d0ce.map.gz delete mode 100644 assets/application.js-fefc1e2760e062a33b165fb45b0e0ef13e4bdc35d1f65975b492fe858c2136cf.map.gz rename assets/corelib/{constants.source-e79144fd86e6b20f2b49c62a5d37b60ffaf47f11db81d1363991639df141a01f => constants.source-650eaa201f9284b01b7d872a9d6a80f653c0bf3fd585ad080caade29b9bc17a0} (77%) rename assets/corelib/{runtime.source-6a5a2cf851d99ea1fb6eab3f4c324f66d8fc21426515c040dca3489a5a86eb70.js => runtime.source-99051139d415b2cc01e77e875b95f2d0ee867e43b1c0366563d61db7834af76f.js} (99%) rename assets/corelib/{string.source-87d008e7c0faa9a99219a0288c20bbdf19ab4cfdebaab9121c3b1030b29e3b5a => string.source-8b4f7e8c13a7b97806d142617f8351ed4c4bf30edd2e258ce446c74091d5737a} (99%) delete mode 100644 assets/load-parser-2f3ba30138edaf9916f78766b8388e4d31bf513da551ef96326e75a3e2a26dd3.js.gz rename assets/{load-parser-2f3ba30138edaf9916f78766b8388e4d31bf513da551ef96326e75a3e2a26dd3.js => load-parser-4fb81d2f4beef3f223f340d12a7b25c574a2dd8c3ec18b94d46806c5cc833234.js} (99%) create mode 100644 assets/load-parser-4fb81d2f4beef3f223f340d12a7b25c574a2dd8c3ec18b94d46806c5cc833234.js.gz rename assets/{load-parser.debug-71c5d06adb7f7f182c8e6cad7dea2e00a26acbbf9d6ccbbed5bd8a86bd67c911.js => load-parser.debug-523d03515edac74f207e7254be80fad20f14a6a0baf27e5b8dfd5dfd064a91d5.js} (99%) create mode 100644 assets/load-parser.debug-523d03515edac74f207e7254be80fad20f14a6a0baf27e5b8dfd5dfd064a91d5.js.gz delete mode 100644 assets/load-parser.debug-71c5d06adb7f7f182c8e6cad7dea2e00a26acbbf9d6ccbbed5bd8a86bd67c911.js.gz rename assets/{native.source-1c0d7d79cef6591a9faaa9dd0dd903a7bda671d4885952f472b40dd49d827465 => native.source-61c02136482500675de2c6c7be30a3fa2d2706e0259c17a65966f210e31068f4} (99%) rename assets/opal/{version.source-e3809d99ad3702cb6ef488218066728fb7f889c0ddad3e794785906cdcab4379 => version.source-9dd407e8e560e0f7578ccc6153eab2f4607a2ae0836db2d46e28cc5d7ada94af} (69%) rename assets/{try-be06c51740f19e9ba0c35fdc4c49457e10319b2d3c769911818d9866e87cd107.js => try-a51164b017a4255201e72222db4ea8cde71bef0a2e8c97a19d46d82dfad3c2db.js} (99%) rename assets/{try-be06c51740f19e9ba0c35fdc4c49457e10319b2d3c769911818d9866e87cd107.js.gz => try-a51164b017a4255201e72222db4ea8cde71bef0a2e8c97a19d46d82dfad3c2db.js.gz} (94%) rename assets/{try.debug-9406c8141040cc9dd32f9ad05ab21a0662a70305b1a22ee26e6bc0cf14572b7a.js => try.debug-fc5a97558dfaa14eedc387af7b1f8d60da375e8c5922a1d0278af8c5be4ecc52.js} (99%) rename assets/{try.debug-9406c8141040cc9dd32f9ad05ab21a0662a70305b1a22ee26e6bc0cf14572b7a.js.gz => try.debug-fc5a97558dfaa14eedc387af7b1f8d60da375e8c5922a1d0278af8c5be4ecc52.js.gz} (94%) create mode 100644 docs/api/v1.8.2/corelib/ArgumentError.html create mode 100644 docs/api/v1.8.2/corelib/Array.html create mode 100644 docs/api/v1.8.2/corelib/Array.self/SampleRandom.html create mode 100644 docs/api/v1.8.2/corelib/BasicObject.html create mode 100644 docs/api/v1.8.2/corelib/Binding.html create mode 100644 docs/api/v1.8.2/corelib/Boolean.html create mode 100644 docs/api/v1.8.2/corelib/Class.html create mode 100644 docs/api/v1.8.2/corelib/ClosedQueueError.html create mode 100644 docs/api/v1.8.2/corelib/Comparable.html create mode 100644 docs/api/v1.8.2/corelib/CompatibilityError.html create mode 100644 docs/api/v1.8.2/corelib/Complex.html create mode 100644 docs/api/v1.8.2/corelib/Dir.html create mode 100644 docs/api/v1.8.2/corelib/EOFError.html create mode 100644 docs/api/v1.8.2/corelib/Encoding.html create mode 100644 docs/api/v1.8.2/corelib/Encoding/UndefinedConversionError.html create mode 100644 docs/api/v1.8.2/corelib/EncodingError.html create mode 100644 docs/api/v1.8.2/corelib/Enumerable.html create mode 100644 docs/api/v1.8.2/corelib/Enumerator.html create mode 100644 docs/api/v1.8.2/corelib/Enumerator.self/ArithmeticSequence.html create mode 100644 docs/api/v1.8.2/corelib/Enumerator.self/Chain.html create mode 100644 docs/api/v1.8.2/corelib/Enumerator.self/Lazy.html create mode 100644 docs/api/v1.8.2/corelib/Enumerator.self/Lazy.self/StopLazyError.html create mode 100644 docs/api/v1.8.2/corelib/Enumerator/Generator.html create mode 100644 docs/api/v1.8.2/corelib/Enumerator/Yielder.html create mode 100644 docs/api/v1.8.2/corelib/Errno.html create mode 100644 docs/api/v1.8.2/corelib/Exception.html create mode 100644 docs/api/v1.8.2/corelib/FalseClass.html create mode 100644 docs/api/v1.8.2/corelib/FiberError.html create mode 100644 docs/api/v1.8.2/corelib/File.html create mode 100644 docs/api/v1.8.2/corelib/Float.html create mode 100644 docs/api/v1.8.2/corelib/FloatDomainError.html create mode 100644 docs/api/v1.8.2/corelib/FrozenError.html create mode 100644 docs/api/v1.8.2/corelib/GC.html create mode 100644 docs/api/v1.8.2/corelib/Hash.html create mode 100644 docs/api/v1.8.2/corelib/IO.html create mode 100644 docs/api/v1.8.2/corelib/IOError.html create mode 100644 docs/api/v1.8.2/corelib/IndexError.html create mode 100644 docs/api/v1.8.2/corelib/Integer.html create mode 100644 docs/api/v1.8.2/corelib/Interrupt.html create mode 100644 docs/api/v1.8.2/corelib/JS.html create mode 100644 docs/api/v1.8.2/corelib/Kernel.html create mode 100644 docs/api/v1.8.2/corelib/KeyError.html create mode 100644 docs/api/v1.8.2/corelib/LoadError.html create mode 100644 docs/api/v1.8.2/corelib/LocalJumpError.html create mode 100644 docs/api/v1.8.2/corelib/Marshal.html create mode 100644 docs/api/v1.8.2/corelib/Marshal.self/ReadBuffer.html create mode 100644 docs/api/v1.8.2/corelib/Marshal.self/WriteBuffer.html create mode 100644 docs/api/v1.8.2/corelib/MatchData.html create mode 100644 docs/api/v1.8.2/corelib/Math.html create mode 100644 docs/api/v1.8.2/corelib/Method.html create mode 100644 docs/api/v1.8.2/corelib/Module.html create mode 100644 docs/api/v1.8.2/corelib/NameError.html create mode 100644 docs/api/v1.8.2/corelib/NilClass.html create mode 100644 docs/api/v1.8.2/corelib/NoMatchingPatternError.html create mode 100644 docs/api/v1.8.2/corelib/NoMemoryError.html create mode 100644 docs/api/v1.8.2/corelib/NoMethodError.html create mode 100644 docs/api/v1.8.2/corelib/NotImplementedError.html create mode 100644 docs/api/v1.8.2/corelib/Number.html create mode 100644 docs/api/v1.8.2/corelib/Numeric.html create mode 100644 docs/api/v1.8.2/corelib/Object.html create mode 100644 docs/api/v1.8.2/corelib/ObjectSpace.html create mode 100644 docs/api/v1.8.2/corelib/ObjectSpace.self/WeakMap.html create mode 100644 docs/api/v1.8.2/corelib/Opal.html create mode 100644 docs/api/v1.8.2/corelib/Opal/IRB.html create mode 100644 docs/api/v1.8.2/corelib/Opal/IRB/Silencer.html create mode 100644 docs/api/v1.8.2/corelib/PackUnpack.html create mode 100644 docs/api/v1.8.2/corelib/PatternMatching.html create mode 100644 docs/api/v1.8.2/corelib/Proc.html create mode 100644 docs/api/v1.8.2/corelib/Process.html create mode 100644 docs/api/v1.8.2/corelib/Process/Status.html create mode 100644 docs/api/v1.8.2/corelib/Random.html create mode 100644 docs/api/v1.8.2/corelib/Random.self/Formatter.html create mode 100644 docs/api/v1.8.2/corelib/Range.html create mode 100644 docs/api/v1.8.2/corelib/RangeError.html create mode 100644 docs/api/v1.8.2/corelib/Rational.html create mode 100644 docs/api/v1.8.2/corelib/Refinement.html create mode 100644 docs/api/v1.8.2/corelib/Regexp.html create mode 100644 docs/api/v1.8.2/corelib/RegexpError.html create mode 100644 docs/api/v1.8.2/corelib/RuntimeError.html create mode 100644 docs/api/v1.8.2/corelib/ScriptError.html create mode 100644 docs/api/v1.8.2/corelib/SecurityError.html create mode 100644 docs/api/v1.8.2/corelib/Set.html create mode 100644 docs/api/v1.8.2/corelib/Signal.html create mode 100644 docs/api/v1.8.2/corelib/SignalException.html create mode 100644 docs/api/v1.8.2/corelib/StandardError.html create mode 100644 docs/api/v1.8.2/corelib/StopIteration.html create mode 100644 docs/api/v1.8.2/corelib/String.html create mode 100644 docs/api/v1.8.2/corelib/Struct.html create mode 100644 docs/api/v1.8.2/corelib/SyntaxError.html create mode 100644 docs/api/v1.8.2/corelib/SystemCallError.html create mode 100644 docs/api/v1.8.2/corelib/SystemExit.html create mode 100644 docs/api/v1.8.2/corelib/SystemStackError.html create mode 100644 docs/api/v1.8.2/corelib/ThreadError.html create mode 100644 docs/api/v1.8.2/corelib/Time.html create mode 100644 docs/api/v1.8.2/corelib/TracePoint.html create mode 100644 docs/api/v1.8.2/corelib/TrueClass.html create mode 100644 docs/api/v1.8.2/corelib/TypeError.html create mode 100644 docs/api/v1.8.2/corelib/UnboundMethod.html create mode 100644 docs/api/v1.8.2/corelib/UncaughtThrowError.html create mode 100644 docs/api/v1.8.2/corelib/ZeroDivisionError.html create mode 100644 docs/api/v1.8.2/corelib/_index.html create mode 100644 docs/api/v1.8.2/corelib/class_list.html create mode 100644 docs/api/v1.8.2/corelib/css/common.css create mode 100644 docs/api/v1.8.2/corelib/css/full_list.css create mode 100644 docs/api/v1.8.2/corelib/css/style.css create mode 100644 docs/api/v1.8.2/corelib/file.README.html create mode 100644 docs/api/v1.8.2/corelib/file.RUNTIME.html create mode 100644 docs/api/v1.8.2/corelib/file_list.html create mode 100644 docs/api/v1.8.2/corelib/frames.html create mode 100644 docs/api/v1.8.2/corelib/index.html create mode 100644 docs/api/v1.8.2/corelib/js/Error.html create mode 100644 docs/api/v1.8.2/corelib/js/app.js create mode 100644 docs/api/v1.8.2/corelib/js/full_list.js create mode 100644 docs/api/v1.8.2/corelib/js/jquery.js create mode 100644 docs/api/v1.8.2/corelib/method_list.html create mode 100644 docs/api/v1.8.2/corelib/top-level-namespace.html create mode 100644 docs/api/v1.8.2/index.html create mode 100644 docs/api/v1.8.2/lib/AST/Processor/Mixin.html create mode 100644 docs/api/v1.8.2/lib/Opal.html create mode 100644 docs/api/v1.8.2/lib/Opal/AST.html create mode 100644 docs/api/v1.8.2/lib/Opal/AST/Builder.html create mode 100644 docs/api/v1.8.2/lib/Opal/AST/Matcher.html create mode 100644 docs/api/v1.8.2/lib/Opal/AST/Matcher/Node.html create mode 100644 docs/api/v1.8.2/lib/Opal/AST/Node.html create mode 100644 docs/api/v1.8.2/lib/Opal/Builder.html create mode 100644 docs/api/v1.8.2/lib/Opal/Builder/MissingRequire.html create mode 100644 docs/api/v1.8.2/lib/Opal/Builder/ProcessorNotFound.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors/ERBProcessor.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor/ManualFragment.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors/OpalERBProcessor.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors/Processor.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyERBProcessor.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyProcessor.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderScheduler.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/Fork.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/ForkSet.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/OrderCorrector.html create mode 100644 docs/api/v1.8.2/lib/Opal/BuilderScheduler/Sequential.html create mode 100644 docs/api/v1.8.2/lib/Opal/CLI.html create mode 100644 docs/api/v1.8.2/lib/Opal/CLI/Evals.html create mode 100644 docs/api/v1.8.2/lib/Opal/CLIOptions.html create mode 100644 docs/api/v1.8.2/lib/Opal/Cache.html create mode 100644 docs/api/v1.8.2/lib/Opal/Cache/FileCache.html create mode 100644 docs/api/v1.8.2/lib/Opal/Cache/NullCache.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Applescript.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingAppleScript.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingJavaScriptSupport.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Chrome.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Compiler.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Deno.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Deno/MissingDeno.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Firefox.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Gjs.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Gjs/MissingGjs.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/MiniRacer.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn/MissingNashorn.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs/MissingNodeJS.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs/MissingQuickjs.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/RunnerError.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Safari.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Server.html create mode 100644 docs/api/v1.8.2/lib/Opal/CliRunners/Server/App.html create mode 100644 docs/api/v1.8.2/lib/Opal/CompilationError.html create mode 100644 docs/api/v1.8.2/lib/Opal/Compiler.html create mode 100644 docs/api/v1.8.2/lib/Opal/Config.html create mode 100644 docs/api/v1.8.2/lib/Opal/Deprecations.html create mode 100644 docs/api/v1.8.2/lib/Opal/ERB.html create mode 100644 docs/api/v1.8.2/lib/Opal/ERB/Compiler.html create mode 100644 docs/api/v1.8.2/lib/Opal/EofContent.html create mode 100644 docs/api/v1.8.2/lib/Opal/Error.html create mode 100644 docs/api/v1.8.2/lib/Opal/Fragment.html create mode 100644 docs/api/v1.8.2/lib/Opal/GemNotFound.html create mode 100644 docs/api/v1.8.2/lib/Opal/Hike.html create mode 100644 docs/api/v1.8.2/lib/Opal/Hike/Index.html create mode 100644 docs/api/v1.8.2/lib/Opal/Hike/Trail.html create mode 100644 docs/api/v1.8.2/lib/Opal/MagicComments.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/AliasNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ArglistNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ArgNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/EnsureKwargsAreKwargs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractBlockarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwargs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwoptarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwrestarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractOptargNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostArg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostOptarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractRestarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/FakeArgNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeIterarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeShadowarg.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/Parameters.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Args/PreparePostArgs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ArgsNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ArityCheckNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ArrayNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/BackRefNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Base.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/BaseFlipFlop.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/BaseSuperNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/BaseYieldNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/BeginNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/BlockPassNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/BreakNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/CallNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/CallNode/DependencyResolver.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/CbaseNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ClassNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ClassVarAssignNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ClassVariableNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Closure.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Closure/CompilerSupport.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Closure/NodeSupport.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ComplexNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ConstAssignNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ConstNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/DefNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/DefinedNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/DefinedSuperNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/DefsNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/DynamicStringNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/DynamicSymbolNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/EFlipFlop.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/EnsureNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ExclusiveRangeNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/GlobalAssignNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/GlobalVariableNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/HashNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Helpers.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/IFlipFlop.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/IfNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/InclusiveRangeNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/InstanceAssignNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/InstanceVariableNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/IterArityCheckNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/IterNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/JSReturnNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/JSTempNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/JsAttrAsgnNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/JsAttrNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/JsCallNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/KwBeginNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/KwSplatNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/LambdaNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/LocalAssignNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/LocalDeclareNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/LocalVariableNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/MassAssignNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/Match3Node.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/MatchCurrentLineNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ModuleNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/NextNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs/Shortcut.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/NthrefNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/NumericNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/RangeNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/RationalNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/RedoNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/RegexpNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ResBodyNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/RescueNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/RetryNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ReturnNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ReturnableYieldNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ScopeNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/SelfNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/SingletonClassNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/SplatNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/StringNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/SuperNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/SymbolNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/TopNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/UndefNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/UntilNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/UntilPostNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ValueNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/WhileNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/WhilePostNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/XStringNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/YieldNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/Nodes/ZsuperNode.html create mode 100644 docs/api/v1.8.2/lib/Opal/OS.html create mode 100644 docs/api/v1.8.2/lib/Opal/OpalBacktraceLocation.html create mode 100644 docs/api/v1.8.2/lib/Opal/Parser.html create mode 100644 docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig.html create mode 100644 docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig/ClassMethods.html create mode 100644 docs/api/v1.8.2/lib/Opal/Parser/SourceBuffer.html create mode 100644 docs/api/v1.8.2/lib/Opal/Parser/WithRubyLexer.html create mode 100644 docs/api/v1.8.2/lib/Opal/ParsingError.html create mode 100644 docs/api/v1.8.2/lib/Opal/PathReader.html create mode 100644 docs/api/v1.8.2/lib/Opal/REPL.html create mode 100644 docs/api/v1.8.2/lib/Opal/REPL/Silencer.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriter.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/Arguments.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/Base.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/Base/DummyLocation.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/ConditionalSendHandler.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/SendHandler.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/BlockToIter.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/DeduplicateArgName.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/DotJsSyntax.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/DumpArgs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter/LocalVariableAssigns.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/ForwardArgs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/Hashes.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter/UniqKeysSet.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs/Initializer.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/JsReservedWords.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/ConditionalSendHandler.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/SendHandler.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/Arguments.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/MlhsRewriter.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/Numblocks.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/OpalEngineCheck.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching/PatternConverter.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/ReturnableLogic.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/TargetedPatches.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rewriters/ThrowerFinder.html create mode 100644 docs/api/v1.8.2/lib/Opal/RewritingError.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rubyspec.html create mode 100644 docs/api/v1.8.2/lib/Opal/Rubyspec/FiltersRewriter.html create mode 100644 docs/api/v1.8.2/lib/Opal/SimpleServer.html create mode 100644 docs/api/v1.8.2/lib/Opal/SourceMap.html create mode 100644 docs/api/v1.8.2/lib/Opal/SourceMap/File.html create mode 100644 docs/api/v1.8.2/lib/Opal/SourceMap/Index.html create mode 100644 docs/api/v1.8.2/lib/Opal/SourceMap/Map.html create mode 100644 docs/api/v1.8.2/lib/Opal/SourceMap/VLQ.html create mode 100644 docs/api/v1.8.2/lib/Opal/SyntaxError.html create mode 100644 docs/api/v1.8.2/lib/Opal/TiltTemplate.html create mode 100644 docs/api/v1.8.2/lib/Opal/UseGem.html create mode 100644 docs/api/v1.8.2/lib/Opal/Util.html create mode 100644 docs/api/v1.8.2/lib/Parser/Builders/Default.html create mode 100644 docs/api/v1.8.2/lib/Parser/Lexer.html create mode 100644 docs/api/v1.8.2/lib/Parser/Lexer/Dedenter.html create mode 100644 docs/api/v1.8.2/lib/Parser/Lexer/Literal.html create mode 100644 docs/api/v1.8.2/lib/Parser/Source/Buffer.html create mode 100644 docs/api/v1.8.2/lib/_index.html create mode 100644 docs/api/v1.8.2/lib/class_list.html create mode 100644 docs/api/v1.8.2/lib/css/common.css create mode 100644 docs/api/v1.8.2/lib/css/full_list.css create mode 100644 docs/api/v1.8.2/lib/css/style.css create mode 100644 docs/api/v1.8.2/lib/file.History.html create mode 100644 docs/api/v1.8.2/lib/file.README.html create mode 100644 docs/api/v1.8.2/lib/file_list.html create mode 100644 docs/api/v1.8.2/lib/frames.html create mode 100644 docs/api/v1.8.2/lib/index.html create mode 100644 docs/api/v1.8.2/lib/js/app.js create mode 100644 docs/api/v1.8.2/lib/js/full_list.js create mode 100644 docs/api/v1.8.2/lib/js/jquery.js create mode 100644 docs/api/v1.8.2/lib/method_list.html create mode 100644 docs/api/v1.8.2/lib/top-level-namespace.html create mode 100644 docs/api/v1.8.2/stdlib/Array.html create mode 100644 docs/api/v1.8.2/stdlib/Base64.html create mode 100644 docs/api/v1.8.2/stdlib/BasicObject.html create mode 100644 docs/api/v1.8.2/stdlib/Benchmark.html create mode 100644 docs/api/v1.8.2/stdlib/Benchmark/Job.html create mode 100644 docs/api/v1.8.2/stdlib/Benchmark/Report.html create mode 100644 docs/api/v1.8.2/stdlib/Benchmark/Tms.html create mode 100644 docs/api/v1.8.2/stdlib/BigDecimal.html create mode 100644 docs/api/v1.8.2/stdlib/Boolean.html create mode 100644 docs/api/v1.8.2/stdlib/Buffer.html create mode 100644 docs/api/v1.8.2/stdlib/Buffer/Array.html create mode 100644 docs/api/v1.8.2/stdlib/Buffer/View.html create mode 100644 docs/api/v1.8.2/stdlib/CGI.html create mode 100644 docs/api/v1.8.2/stdlib/CGI/Util.html create mode 100644 docs/api/v1.8.2/stdlib/Class.html create mode 100644 docs/api/v1.8.2/stdlib/Console.html create mode 100644 docs/api/v1.8.2/stdlib/Date.html create mode 100644 docs/api/v1.8.2/stdlib/Date/Infinity.html create mode 100644 docs/api/v1.8.2/stdlib/DateTime.html create mode 100644 docs/api/v1.8.2/stdlib/Delegator.html create mode 100644 docs/api/v1.8.2/stdlib/Deno.html create mode 100644 docs/api/v1.8.2/stdlib/Dir.html create mode 100644 docs/api/v1.8.2/stdlib/ENV.html create mode 100644 docs/api/v1.8.2/stdlib/ERB.html create mode 100644 docs/api/v1.8.2/stdlib/ERB/Util.html create mode 100644 docs/api/v1.8.2/stdlib/Enumerable.html create mode 100644 docs/api/v1.8.2/stdlib/Exception2MessageMapper.html create mode 100644 docs/api/v1.8.2/stdlib/ExceptionForMatrix.html create mode 100644 docs/api/v1.8.2/stdlib/File.html create mode 100644 docs/api/v1.8.2/stdlib/File/Stat.html create mode 100644 docs/api/v1.8.2/stdlib/FileUtils.html create mode 100644 docs/api/v1.8.2/stdlib/Float.html create mode 100644 docs/api/v1.8.2/stdlib/Forwardable.html create mode 100644 docs/api/v1.8.2/stdlib/Hash.html create mode 100644 docs/api/v1.8.2/stdlib/IO.html create mode 100644 docs/api/v1.8.2/stdlib/Integer.html create mode 100644 docs/api/v1.8.2/stdlib/JS.html create mode 100644 docs/api/v1.8.2/stdlib/JSON.html create mode 100644 docs/api/v1.8.2/stdlib/JSON/JSONError.html create mode 100644 docs/api/v1.8.2/stdlib/JSON/ParserError.html create mode 100644 docs/api/v1.8.2/stdlib/Kernel.html create mode 100644 docs/api/v1.8.2/stdlib/Logger.html create mode 100644 docs/api/v1.8.2/stdlib/Logger/Formatter.html create mode 100644 docs/api/v1.8.2/stdlib/Logger/Severity.html create mode 100644 docs/api/v1.8.2/stdlib/MatchData.html create mode 100644 docs/api/v1.8.2/stdlib/Matrix.html create mode 100644 docs/api/v1.8.2/stdlib/Matrix/CoercionHelper.html create mode 100644 docs/api/v1.8.2/stdlib/Matrix/ConversionHelper.html create mode 100644 docs/api/v1.8.2/stdlib/Matrix/EigenvalueDecomposition.html create mode 100644 docs/api/v1.8.2/stdlib/Matrix/LUPDecomposition.html create mode 100644 docs/api/v1.8.2/stdlib/Matrix/Scalar.html create mode 100644 docs/api/v1.8.2/stdlib/Method.html create mode 100644 docs/api/v1.8.2/stdlib/Module.html create mode 100644 docs/api/v1.8.2/stdlib/Mutex.html create mode 100644 docs/api/v1.8.2/stdlib/Nashorn.html create mode 100644 docs/api/v1.8.2/stdlib/Native.html create mode 100644 docs/api/v1.8.2/stdlib/Native/Array.html create mode 100644 docs/api/v1.8.2/stdlib/Native/Helpers.html create mode 100644 docs/api/v1.8.2/stdlib/Native/Object.html create mode 100644 docs/api/v1.8.2/stdlib/Native/Wrapper.html create mode 100644 docs/api/v1.8.2/stdlib/NilClass.html create mode 100644 docs/api/v1.8.2/stdlib/NodeJS.html create mode 100644 docs/api/v1.8.2/stdlib/Numeric.html create mode 100644 docs/api/v1.8.2/stdlib/Object.html create mode 100644 docs/api/v1.8.2/stdlib/Observable.html create mode 100644 docs/api/v1.8.2/stdlib/OpenStruct.html create mode 100644 docs/api/v1.8.2/stdlib/OpenURI.html create mode 100644 docs/api/v1.8.2/stdlib/OpenURI/Buffer.html create mode 100644 docs/api/v1.8.2/stdlib/OpenURI/HTTPError.html create mode 100644 docs/api/v1.8.2/stdlib/OpenURI/Meta.html create mode 100644 docs/api/v1.8.2/stdlib/OpenURI/OpenRead.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/AC.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Acceptables.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/AmbiguousArgument.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/AmbiguousOption.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Arguable.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/CompletingHash.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Completion.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/InvalidArgument.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/InvalidOption.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/List.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/MissingArgument.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/NeedlessArgument.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/OptionMap.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/ParseError.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Switch.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Switch/NoArgument.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Switch/OptionalArgument.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Switch/PlacedArgument.html create mode 100644 docs/api/v1.8.2/stdlib/OptionParser/Switch/RequiredArgument.html create mode 100644 docs/api/v1.8.2/stdlib/PP.html create mode 100644 docs/api/v1.8.2/stdlib/PP/ObjectMixin.html create mode 100644 docs/api/v1.8.2/stdlib/PP/PPMethods.html create mode 100644 docs/api/v1.8.2/stdlib/PP/SingleLine.html create mode 100644 docs/api/v1.8.2/stdlib/Pathname.html create mode 100644 docs/api/v1.8.2/stdlib/PrettyPrint.html create mode 100644 docs/api/v1.8.2/stdlib/PrettyPrint/Breakable.html create mode 100644 docs/api/v1.8.2/stdlib/PrettyPrint/Group.html create mode 100644 docs/api/v1.8.2/stdlib/PrettyPrint/GroupQueue.html create mode 100644 docs/api/v1.8.2/stdlib/PrettyPrint/SingleLine.html create mode 100644 docs/api/v1.8.2/stdlib/PrettyPrint/Text.html create mode 100644 docs/api/v1.8.2/stdlib/Proc.html create mode 100644 docs/api/v1.8.2/stdlib/Promise.html create mode 100644 docs/api/v1.8.2/stdlib/Promise/Trace.html create mode 100644 docs/api/v1.8.2/stdlib/Promise/When.html create mode 100644 docs/api/v1.8.2/stdlib/PromiseV2.html create mode 100644 docs/api/v1.8.2/stdlib/REPLUtils.html create mode 100644 docs/api/v1.8.2/stdlib/REPLUtils/ColorPrinter.html create mode 100644 docs/api/v1.8.2/stdlib/Racc.html create mode 100644 docs/api/v1.8.2/stdlib/Racc/ParseError.html create mode 100644 docs/api/v1.8.2/stdlib/Racc/Parser.html create mode 100644 docs/api/v1.8.2/stdlib/Range.html create mode 100644 docs/api/v1.8.2/stdlib/Rational.html create mode 100644 docs/api/v1.8.2/stdlib/RbConfig.html create mode 100644 docs/api/v1.8.2/stdlib/Regexp.html create mode 100644 docs/api/v1.8.2/stdlib/SecureRandom.html create mode 100644 docs/api/v1.8.2/stdlib/Shellwords.html create mode 100644 docs/api/v1.8.2/stdlib/SimpleDelegator.html create mode 100644 docs/api/v1.8.2/stdlib/SingleForwardable.html create mode 100644 docs/api/v1.8.2/stdlib/Singleton.html create mode 100644 docs/api/v1.8.2/stdlib/Singleton/SingletonClassMethods.html create mode 100644 docs/api/v1.8.2/stdlib/String.html create mode 100644 docs/api/v1.8.2/stdlib/StringIO.html create mode 100644 docs/api/v1.8.2/stdlib/StringScanner.html create mode 100644 docs/api/v1.8.2/stdlib/Struct.html create mode 100644 docs/api/v1.8.2/stdlib/Template.html create mode 100644 docs/api/v1.8.2/stdlib/Template/OutputBuffer.html create mode 100644 docs/api/v1.8.2/stdlib/Thread.html create mode 100644 docs/api/v1.8.2/stdlib/Thread/Backtrace.html create mode 100644 docs/api/v1.8.2/stdlib/Thread/Backtrace/Location.html create mode 100644 docs/api/v1.8.2/stdlib/Thread/Queue.html create mode 100644 docs/api/v1.8.2/stdlib/ThreadError.html create mode 100644 docs/api/v1.8.2/stdlib/Time.html create mode 100644 docs/api/v1.8.2/stdlib/URI.html create mode 100644 docs/api/v1.8.2/stdlib/Vector.html create mode 100644 docs/api/v1.8.2/stdlib/Vector/ZeroVectorError.html create mode 100644 docs/api/v1.8.2/stdlib/YAML.html create mode 100644 docs/api/v1.8.2/stdlib/_index.html create mode 100644 docs/api/v1.8.2/stdlib/class_list.html create mode 100644 docs/api/v1.8.2/stdlib/css/common.css create mode 100644 docs/api/v1.8.2/stdlib/css/full_list.css create mode 100644 docs/api/v1.8.2/stdlib/css/style.css create mode 100644 docs/api/v1.8.2/stdlib/file.LICENSE.html create mode 100644 docs/api/v1.8.2/stdlib/file.README.html create mode 100644 docs/api/v1.8.2/stdlib/file.changelog.html create mode 100644 docs/api/v1.8.2/stdlib/file_list.html create mode 100644 docs/api/v1.8.2/stdlib/frames.html create mode 100644 docs/api/v1.8.2/stdlib/index.html create mode 100644 docs/api/v1.8.2/stdlib/js/app.js create mode 100644 docs/api/v1.8.2/stdlib/js/full_list.js create mode 100644 docs/api/v1.8.2/stdlib/js/jquery.js create mode 100644 docs/api/v1.8.2/stdlib/method_list.html create mode 100644 docs/api/v1.8.2/stdlib/top-level-namespace.html create mode 100644 docs/guides/v1.8.2/async.html create mode 100644 docs/guides/v1.8.2/bridging.html create mode 100644 docs/guides/v1.8.2/cdp_common.html create mode 100644 docs/guides/v1.8.2/compiled_ruby.html create mode 100644 docs/guides/v1.8.2/compiler.html create mode 100644 docs/guides/v1.8.2/compiler_directives.html create mode 100644 docs/guides/v1.8.2/configuring_gems.html create mode 100644 docs/guides/v1.8.2/encoding.html create mode 100644 docs/guides/v1.8.2/getting_started.html create mode 100644 docs/guides/v1.8.2/headless_browsers.html create mode 100644 docs/guides/v1.8.2/index.html create mode 100644 docs/guides/v1.8.2/jquery.html create mode 100644 docs/guides/v1.8.2/opal_parser.html create mode 100644 docs/guides/v1.8.2/promises.html create mode 100644 docs/guides/v1.8.2/rails.html create mode 100644 docs/guides/v1.8.2/releasing.html create mode 100644 docs/guides/v1.8.2/roda-sprockets.html create mode 100644 docs/guides/v1.8.2/rspec.html create mode 100644 docs/guides/v1.8.2/sinatra.html create mode 100644 docs/guides/v1.8.2/source_maps.html create mode 100644 docs/guides/v1.8.2/static_applications.html create mode 100644 docs/guides/v1.8.2/templates.html create mode 100644 docs/guides/v1.8.2/unsupported_features.html create mode 100644 docs/guides/v1.8.2/upgrading.html create mode 100644 docs/guides/v1.8.2/using_sprockets.html diff --git a/assets/.sprockets-manifest-9338579b1385a55d70dbc9410f867605.json b/assets/.sprockets-manifest-6d5a4569e28824ef587523e2f6987ca9.json similarity index 81% rename from assets/.sprockets-manifest-9338579b1385a55d70dbc9410f867605.json rename to assets/.sprockets-manifest-6d5a4569e28824ef587523e2f6987ca9.json index ad8ea3ee..4ec2d278 100644 --- a/assets/.sprockets-manifest-9338579b1385a55d70dbc9410f867605.json +++ b/assets/.sprockets-manifest-6d5a4569e28824ef587523e2f6987ca9.json @@ -1 +1 @@ -{"files":{"manifest-051b80c2b5fb204b550aba6cf928072bbb42036e37e7706f5459081c977c1c2c.js":{"logical_path":"manifest.js","mtime":"2023-11-09T11:34:39+00:00","size":90,"digest":"051b80c2b5fb204b550aba6cf928072bbb42036e37e7706f5459081c977c1c2c","integrity":"sha256-BRuAwrX7IEtVCrps+SgHK7tCA24353BvVFkIHJd8HCw="},"application.debug-5831b9572963d71dcb254b54bc0ec95f027323aed416e47cd8a208bed1efbbea.css":{"logical_path":"application.debug.css","mtime":"2023-11-09T11:34:39+00:00","size":116521,"digest":"5831b9572963d71dcb254b54bc0ec95f027323aed416e47cd8a208bed1efbbea","integrity":"sha256-WDG5Vylj1x3LJUtUvA7JXwJzI67UFuR82KIIvtHvu+o="},"application-915b7e3cafe6e192dee011fa09837b2af85b7e1de3dbb52fd1413d46dd2dca0e.css":{"logical_path":"application.css","mtime":"2023-11-09T11:34:39+00:00","size":116411,"digest":"915b7e3cafe6e192dee011fa09837b2af85b7e1de3dbb52fd1413d46dd2dca0e","integrity":"sha256-kVt+PK/m4ZLe4BH6CYN7Kvhbfh3j27Uv0UE9Rt0tyg4="},"application.css-6af110e86ced0e076fe5512b7eeef8d85edc3659719ed624f009ab14f21e029a.map":{"logical_path":"application.css.map","mtime":"2023-11-09T11:34:39+00:00","size":81254,"digest":"6af110e86ced0e076fe5512b7eeef8d85edc3659719ed624f009ab14f21e029a","integrity":"sha256-avEQ6GztDgdv5VErfu742F7cNllxntYk8AmrFPIeApo="},"application.source-01d3042c3bc7c1b2ded94479a37bda3e2a3b65f1957686eba6700502b4fe5082.scss":{"logical_path":"application.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4963,"digest":"01d3042c3bc7c1b2ded94479a37bda3e2a3b65f1957686eba6700502b4fe5082","integrity":"sha256-AdMELDvHwbLe2UR5o3vaPio7ZfGVdobrpnAFArT+UII="},"_vendor/_pygment_solarized_light.source-6794ffcdd63dcecc7c972f8c3b032fe28134bd8add2a0257df56c173174ccc30.scss":{"logical_path":"_vendor/_pygment_solarized_light.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":3696,"digest":"6794ffcdd63dcecc7c972f8c3b032fe28134bd8add2a0257df56c173174ccc30","integrity":"sha256-Z5T/zdY9zsx8ly+MOwMv4oE0vYrdKgJX31bBcxdMzDA="},"_vendor/_codemirror-solarized.source-c8817c4f8a3022d53d7ba1f7d53a0739efd87e1740d931cc1fff1ec30060bdcc.scss":{"logical_path":"_vendor/_codemirror-solarized.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":2073,"digest":"c8817c4f8a3022d53d7ba1f7d53a0739efd87e1740d931cc1fff1ec30060bdcc","integrity":"sha256-yIF8T4owItU9e6H31ToHOe/YfhdA2THMH/8ewwBgvcw="},"_blog.source-1468f1e056e48afbf297b9511e4cb8d72622100a4cbd79dcab0c313174ac0164.scss":{"logical_path":"_blog.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1308,"digest":"1468f1e056e48afbf297b9511e4cb8d72622100a4cbd79dcab0c313174ac0164","integrity":"sha256-FGjx4Fbkivvyl7lRHky41yYiEApMvXncqwwxMXSsAWQ="},"_index.source-8e5904704d64bea7a6d7cc2cbd3291762d8e14a5702873b2b8f372c0d4db2cd2.scss":{"logical_path":"_index.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1094,"digest":"8e5904704d64bea7a6d7cc2cbd3291762d8e14a5702873b2b8f372c0d4db2cd2","integrity":"sha256-jlkEcE1kvqem18wsvTKRdi2OFKVwKHOyuPNywNTbLNI="},"_codemirror.source-e40f23e95ff81277d0e9f4cb5b65d5df9ce160bfdc41d67cc224af3a6922488c.scss":{"logical_path":"_codemirror.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":6199,"digest":"e40f23e95ff81277d0e9f4cb5b65d5df9ce160bfdc41d67cc224af3a6922488c","integrity":"sha256-5A8j6V/4EnfQ6fTLW2XV35zhYL/cQdZ8wiSvOmkiSIw="},"_bootstrap-sprockets.source-617bd14f8f87a7d4f3104d96ada5ff1ef60ea8cd1b0c0244675ac792d4c4977c.scss":{"logical_path":"_bootstrap-sprockets.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":131,"digest":"617bd14f8f87a7d4f3104d96ada5ff1ef60ea8cd1b0c0244675ac792d4c4977c","integrity":"sha256-YXvRT4+Hp9TzEE2WraX/HvYOqM0bDAJEZ1rHktTEl3w="},"_bootstrap.source-17d7cd48409fa895ebcc007d74770c893e323925b0a1e4095aea7bcdb529c070.scss":{"logical_path":"_bootstrap.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1319,"digest":"17d7cd48409fa895ebcc007d74770c893e323925b0a1e4095aea7bcdb529c070","integrity":"sha256-F9fNSECfqJXrzAB9dHcMiT4yOSWwoeQJWup7zbUpwHA="},"bootstrap/_variables.source-482186f7e15fd47e0bdb00a85e8edf7a10a014aa59373f1fdf71585a5d6feadc.scss":{"logical_path":"bootstrap/_variables.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":30142,"digest":"482186f7e15fd47e0bdb00a85e8edf7a10a014aa59373f1fdf71585a5d6feadc","integrity":"sha256-SCGG9+Ff1H4L2wCoXo7fehCgFKpZNz8f33FYWl1v6tw="},"bootstrap/_mixins.source-f69f85085da6f31aeaf5a3f6e829609414b034f72d5f66c28b7e47565c31879d.scss":{"logical_path":"bootstrap/_mixins.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":957,"digest":"f69f85085da6f31aeaf5a3f6e829609414b034f72d5f66c28b7e47565c31879d","integrity":"sha256-9p+FCF2m8xrq9aP26ClglBSwNPctX2bCi35HVlwxh50="},"bootstrap/mixins/_hide-text.source-744d07b859e64a5054bb3a5a61c741da0802ccdf1c01c04cb58a99e7a3a64475.scss":{"logical_path":"bootstrap/mixins/_hide-text.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":599,"digest":"744d07b859e64a5054bb3a5a61c741da0802ccdf1c01c04cb58a99e7a3a64475","integrity":"sha256-dE0HuFnmSlBUuzpaYcdB2ggCzN8cAcBMtYqZ56OmRHU="},"bootstrap/mixins/_opacity.source-24a43bd4cccdf1523772ee49cb5d26e7bf8cd3f76202221ce2d417180f920e60.scss":{"logical_path":"bootstrap/mixins/_opacity.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":152,"digest":"24a43bd4cccdf1523772ee49cb5d26e7bf8cd3f76202221ce2d417180f920e60","integrity":"sha256-JKQ71MzN8VI3cu5Jy10m57+M0/diAiIc4tQXGA+SDmA="},"bootstrap/mixins/_image.source-11e4a737146939fe6c78e1634e2aaacaf6555340fceabfad6c0c90f0501386f4.scss":{"logical_path":"bootstrap/mixins/_image.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1279,"digest":"11e4a737146939fe6c78e1634e2aaacaf6555340fceabfad6c0c90f0501386f4","integrity":"sha256-EeSnNxRpOf5seOFjTiqqyvZVU0D86r+tbAyQ8FAThvQ="},"bootstrap/mixins/_labels.source-fc0e4380846766ac47c42d977f6a16c89788fabc88aa5d825aa2040c0397fd15.scss":{"logical_path":"bootstrap/mixins/_labels.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":169,"digest":"fc0e4380846766ac47c42d977f6a16c89788fabc88aa5d825aa2040c0397fd15","integrity":"sha256-/A5DgIRnZqxHxC2Xf2oWyJeI+ryIql2CWqIEDAOX/RU="},"bootstrap/mixins/_reset-filter.source-85a38f5886d4d9f3c3beee2d2a0762a336725b1b6ce8a900b35c0fef05eca90c.scss":{"logical_path":"bootstrap/mixins/_reset-filter.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":246,"digest":"85a38f5886d4d9f3c3beee2d2a0762a336725b1b6ce8a900b35c0fef05eca90c","integrity":"sha256-haOPWIbU2fPDvu4tKgdiozZyWxts6KkAs1wP7wXsqQw="},"bootstrap/mixins/_resize.source-f667a158b80786e0b6a02cbe8cc007879cd2f0111e7285f37ad76221fc53edd8.scss":{"logical_path":"bootstrap/mixins/_resize.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":202,"digest":"f667a158b80786e0b6a02cbe8cc007879cd2f0111e7285f37ad76221fc53edd8","integrity":"sha256-9mehWLgHhuC2oCy+jMAHh5zS8BEecoXzetdiIfxT7dg="},"bootstrap/mixins/_responsive-visibility.source-c5922fa5c03e4e5519c0d6b0fe55d74deb4df78c4b92030f167a7eb93e3cf5f4.scss":{"logical_path":"bootstrap/mixins/_responsive-visibility.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":503,"digest":"c5922fa5c03e4e5519c0d6b0fe55d74deb4df78c4b92030f167a7eb93e3cf5f4","integrity":"sha256-xZIvpcA+TlUZwNaw/lXXTetN94xLkgMPFnp+uT489fQ="},"bootstrap/mixins/_size.source-43ed70c482e6890da52c5cb98b33b651cb6e5535887deebc31145a9d2ae0e292.scss":{"logical_path":"bootstrap/mixins/_size.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":147,"digest":"43ed70c482e6890da52c5cb98b33b651cb6e5535887deebc31145a9d2ae0e292","integrity":"sha256-Q+1wxILmiQ2lLFy5izO2UctuVTWIfe68MRRanSrg4pI="},"bootstrap/mixins/_tab-focus.source-cc154891d4d781e6a012e90e57921c52b8b4be016c9a86c827546b7d117fb25b.scss":{"logical_path":"bootstrap/mixins/_tab-focus.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":165,"digest":"cc154891d4d781e6a012e90e57921c52b8b4be016c9a86c827546b7d117fb25b","integrity":"sha256-zBVIkdTXgeagEukOV5IcUri0vgFsmobIJ1RrfRF/sls="},"bootstrap/mixins/_text-emphasis.source-5122df1667a80e2f6e577fc257c5106b68d68b5ae490647c2c3ecc41651743a7.scss":{"logical_path":"bootstrap/mixins/_text-emphasis.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":189,"digest":"5122df1667a80e2f6e577fc257c5106b68d68b5ae490647c2c3ecc41651743a7","integrity":"sha256-USLfFmeoDi9uV3/CV8UQa2jWi1rkkGR8LD7MQWUXQ6c="},"bootstrap/mixins/_text-overflow.source-f2a9a690e1843c596df61998e0e78f40cd65a5b649c77a50b87dd2fdb980aa1b.scss":{"logical_path":"bootstrap/mixins/_text-overflow.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":168,"digest":"f2a9a690e1843c596df61998e0e78f40cd65a5b649c77a50b87dd2fdb980aa1b","integrity":"sha256-8qmmkOGEPFlt9hmY4OePQM1lpbZJx3pQuH3S/bmAqhs="},"bootstrap/mixins/_vendor-prefixes.source-f5f733f9a623615ab9101c9e32699cc92770fa57ac1d09196e099d1749cda303.scss":{"logical_path":"bootstrap/mixins/_vendor-prefixes.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":6638,"digest":"f5f733f9a623615ab9101c9e32699cc92770fa57ac1d09196e099d1749cda303","integrity":"sha256-9fcz+aYjYVq5EByeMmmcySdw+lesHQkZbgmdF0nNowM="},"bootstrap/mixins/_alerts.source-16f165cb79b8d222f79cfa2e9eb63d80afc00b73c5fc0720997734d389a29d6f.scss":{"logical_path":"bootstrap/mixins/_alerts.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":263,"digest":"16f165cb79b8d222f79cfa2e9eb63d80afc00b73c5fc0720997734d389a29d6f","integrity":"sha256-FvFly3m40iL3nPounrY9gK/AC3PF/AcgmXc004minW8="},"bootstrap/mixins/_buttons.source-1e01e239d869ca1db2c754944d3443f116fe8bf046ffcd937310ca42be615c39.scss":{"logical_path":"bootstrap/mixins/_buttons.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1068,"digest":"1e01e239d869ca1db2c754944d3443f116fe8bf046ffcd937310ca42be615c39","integrity":"sha256-HgHiOdhpyh2yx1SUTTRD8Rb+i/BG/82TcxDKQr5hXDk="},"bootstrap/mixins/_panels.source-d6fb2063735bf908241957257cfdb03d6410e22a29d2499c0536be2632abd592.scss":{"logical_path":"bootstrap/mixins/_panels.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":543,"digest":"d6fb2063735bf908241957257cfdb03d6410e22a29d2499c0536be2632abd592","integrity":"sha256-1vsgY3Nb+QgkGVclfP2wPWQQ4iop0kmcBTa+JjKr1ZI="},"bootstrap/mixins/_pagination.source-f06aaed2591ea5ca3e3bd48f62e25e471a69dddd8fc195f1d0cc6ccc4bf23b81.scss":{"logical_path":"bootstrap/mixins/_pagination.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":460,"digest":"f06aaed2591ea5ca3e3bd48f62e25e471a69dddd8fc195f1d0cc6ccc4bf23b81","integrity":"sha256-8Gqu0lkepco+O9SPYuJeRxpp3d2PwZXx0MxszEvyO4E="},"bootstrap/mixins/_list-group.source-294f6a9a302c9b2781e61ee063e53a79902f4b61827473630170da3f47714357.scss":{"logical_path":"bootstrap/mixins/_list-group.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":593,"digest":"294f6a9a302c9b2781e61ee063e53a79902f4b61827473630170da3f47714357","integrity":"sha256-KU9qmjAsmyeB5h7gY+U6eZAvS2GCdHNjAXDaP0dxQ1c="},"bootstrap/mixins/_nav-divider.source-4dfd32935ea1d043c0af570b80687bcf634ded8ba616336259d0dff8ab650191.scss":{"logical_path":"bootstrap/mixins/_nav-divider.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":238,"digest":"4dfd32935ea1d043c0af570b80687bcf634ded8ba616336259d0dff8ab650191","integrity":"sha256-Tf0yk16h0EPAr1cLgGh7z2NN7YumFjNiWdDf+KtlAZE="},"bootstrap/mixins/_forms.source-d58c71313533676457cddeb86fb2dbffa636e39ef86696c863a3054429a60642.scss":{"logical_path":"bootstrap/mixins/_forms.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":2683,"digest":"d58c71313533676457cddeb86fb2dbffa636e39ef86696c863a3054429a60642","integrity":"sha256-1YxxMTUzZ2RXzd64b7Lb/6Y24574ZpbIY6MFRCmmBkI="},"bootstrap/mixins/_progress-bar.source-75f3702c9f9f63ced3d3e848e8c5de1cc321256b864eb79d9b2534da2a782b82.scss":{"logical_path":"bootstrap/mixins/_progress-bar.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":202,"digest":"75f3702c9f9f63ced3d3e848e8c5de1cc321256b864eb79d9b2534da2a782b82","integrity":"sha256-dfNwLJ+fY87T0+hI6MXeHMMhJWuGTredmyU02ip4K4I="},"bootstrap/mixins/_table-row.source-5bc673689b0e533c050784b4aac716c12e08cae1bb8948f32cd0a9da752e6a6c.scss":{"logical_path":"bootstrap/mixins/_table-row.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":715,"digest":"5bc673689b0e533c050784b4aac716c12e08cae1bb8948f32cd0a9da752e6a6c","integrity":"sha256-W8ZzaJsOUzwFB4S0qscWwS4IyuG7iUjzLNCp2nUuamw="},"bootstrap/mixins/_background-variant.source-faea592ef84bb2f65cbc371028f8db9f6ce70a0169a32feed86dbe2fd45b243d.scss":{"logical_path":"bootstrap/mixins/_background-variant.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":212,"digest":"faea592ef84bb2f65cbc371028f8db9f6ce70a0169a32feed86dbe2fd45b243d","integrity":"sha256-+upZLvhLsvZcvDcQKPjbn2znCgFpoy/u2G2+L9RbJD0="},"bootstrap/mixins/_border-radius.source-c7385e8d18e49d52cdcef95f7a22a86c3c1a10cddc56f7071c6f988869d3ca62.scss":{"logical_path":"bootstrap/mixins/_border-radius.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":492,"digest":"c7385e8d18e49d52cdcef95f7a22a86c3c1a10cddc56f7071c6f988869d3ca62","integrity":"sha256-xzhejRjknVLNzvlfeiKobDwaEM3cVvcHHG+YiGnTymI="},"bootstrap/mixins/_gradients.source-8c74fe22ac06fa17249449c725c00f9f6cac2affa5eca1f09f28639bd01013ec.scss":{"logical_path":"bootstrap/mixins/_gradients.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4392,"digest":"8c74fe22ac06fa17249449c725c00f9f6cac2affa5eca1f09f28639bd01013ec","integrity":"sha256-jHT+IqwG+hcklEnHJcAPn2ysKv+l7KHwnyhjm9AQE+w="},"bootstrap/mixins/_clearfix.source-f3599294867438e1433ceb90d573d4f042e546e687e06b366219c67f3e08cacd.scss":{"logical_path":"bootstrap/mixins/_clearfix.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":611,"digest":"f3599294867438e1433ceb90d573d4f042e546e687e06b366219c67f3e08cacd","integrity":"sha256-81mSlIZ0OOFDPOuQ1XPU8ELlRuaH4Gs2YhnGfz4Iys0="},"bootstrap/mixins/_center-block.source-bfdc52231145f062b6ac0444096d5da0fdcfa24412f9f01def285882a761da14.scss":{"logical_path":"bootstrap/mixins/_center-block.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":126,"digest":"bfdc52231145f062b6ac0444096d5da0fdcfa24412f9f01def285882a761da14","integrity":"sha256-v9xSIxFF8GK2rARECW1doP3PokQS+fAd7yhYgqdh2hQ="},"bootstrap/mixins/_nav-vertical-align.source-5dd7d8297185f30e923b35bf60b7f4e6c3ea662561a1b588230c55297fc75168.scss":{"logical_path":"bootstrap/mixins/_nav-vertical-align.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":370,"digest":"5dd7d8297185f30e923b35bf60b7f4e6c3ea662561a1b588230c55297fc75168","integrity":"sha256-XdfYKXGF8w6SOzW/YLf05sPqZiVhobWIIwxVKX/HUWg="},"bootstrap/mixins/_grid-framework.source-d6de740850d367cde1814a930f5a89e68f1a4048ad2af57eba0c5850a9dd229e.scss":{"logical_path":"bootstrap/mixins/_grid-framework.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":2347,"digest":"d6de740850d367cde1814a930f5a89e68f1a4048ad2af57eba0c5850a9dd229e","integrity":"sha256-1t50CFDTZ83hgUqTD1qJ5o8aQEitKvV+ugxYUKndIp4="},"bootstrap/mixins/_grid.source-86a1bea9c80367c82818c8deee4b694f5d03db8b3baf0d3cd10f109bf9e0aaec.scss":{"logical_path":"bootstrap/mixins/_grid.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":3194,"digest":"86a1bea9c80367c82818c8deee4b694f5d03db8b3baf0d3cd10f109bf9e0aaec","integrity":"sha256-hqG+qcgDZ8goGMje7ktpT10D24s7rw080Q8Qm/ngquw="},"bootstrap/_normalize.source-9d4affd5f91924523e244e1c5b503aac4bb2fb76a4b009c0168d872788426626.scss":{"logical_path":"bootstrap/_normalize.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":7635,"digest":"9d4affd5f91924523e244e1c5b503aac4bb2fb76a4b009c0168d872788426626","integrity":"sha256-nUr/1fkZJFI+JE4cW1A6rEuy+3aksAnAFo2HJ4hCZiY="},"bootstrap/_print.source-4e1eac8f340c82d34b71b5fae32aff2a607a5b3279077d97e81836951660b6dc.scss":{"logical_path":"bootstrap/_print.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1613,"digest":"4e1eac8f340c82d34b71b5fae32aff2a607a5b3279077d97e81836951660b6dc","integrity":"sha256-Th6sjzQMgtNLcbX64yr/KmB6WzJ5B32X6Bg2lRZgttw="},"bootstrap/_scaffolding.source-a6ba8ce4bf75bd1f7f49bfd683557a5dd67844db73827639c207453e72c1d9a6.scss":{"logical_path":"bootstrap/_scaffolding.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":2691,"digest":"a6ba8ce4bf75bd1f7f49bfd683557a5dd67844db73827639c207453e72c1d9a6","integrity":"sha256-prqM5L91vR9/Sb/Wg1V6XdZ4RNtzgnY5wgdFPnLB2aY="},"bootstrap/_type.source-3734242e194571b02107f9d64d1676cab7f99eaf1c0a2741831bdb84e8b054de.scss":{"logical_path":"bootstrap/_type.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":6174,"digest":"3734242e194571b02107f9d64d1676cab7f99eaf1c0a2741831bdb84e8b054de","integrity":"sha256-NzQkLhlFcbAhB/nWTRZ2yrf5nq8cCidBgxvbhOiwVN4="},"bootstrap/_code.source-32c093107b854533c984a1d3d33977f99202a126c07a054001e4cd7fde0fac10.scss":{"logical_path":"bootstrap/_code.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1378,"digest":"32c093107b854533c984a1d3d33977f99202a126c07a054001e4cd7fde0fac10","integrity":"sha256-MsCTEHuFRTPJhKHT0zl3+ZICoSbAegVAAeTNf94PrBA="},"bootstrap/_grid.source-cca48675d371e0c0bf11dbf00e3736578eff464b978a25d1a4ade3bcbed80ecd.scss":{"logical_path":"bootstrap/_grid.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1451,"digest":"cca48675d371e0c0bf11dbf00e3736578eff464b978a25d1a4ade3bcbed80ecd","integrity":"sha256-zKSGddNx4MC/EdvwDjc2V47/RkuXiiXRpK3jvL7YDs0="},"bootstrap/_tables.source-5d66b5342353d126f0e20b2b4184143350f54f68022f36da658d5d1e3d91bed8.scss":{"logical_path":"bootstrap/_tables.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4529,"digest":"5d66b5342353d126f0e20b2b4184143350f54f68022f36da658d5d1e3d91bed8","integrity":"sha256-XWa1NCNT0Sbw4gsrQYQUM1D1T2gCLzbaZY1dHj2Rvtg="},"bootstrap/_forms.source-a9e925fca4a9805dc3b80b749d357b3afc1196d85a07f096c23862c37e51d426.scss":{"logical_path":"bootstrap/_forms.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":13884,"digest":"a9e925fca4a9805dc3b80b749d357b3afc1196d85a07f096c23862c37e51d426","integrity":"sha256-qekl/KSpgF3DuAt0nTV7OvwRlthaB/CWwjhiw35R1CY="},"bootstrap/_buttons.source-a3e623ca2a0490713d186de54ec6bac70a8612f986b6b39c63bda4f843adcf55.scss":{"logical_path":"bootstrap/_buttons.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":3628,"digest":"a3e623ca2a0490713d186de54ec6bac70a8612f986b6b39c63bda4f843adcf55","integrity":"sha256-o+YjyioEkHE9GG3lTsa6xwqGEvmGtrOcY72k+EOtz1U="},"bootstrap/_component-animations.source-153de427f07c04d747940bc5c360cc716fa00008dd2b8e5d1038bbd3e93bd8ed.scss":{"logical_path":"bootstrap/_component-animations.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":725,"digest":"153de427f07c04d747940bc5c360cc716fa00008dd2b8e5d1038bbd3e93bd8ed","integrity":"sha256-FT3kJ/B8BNdHlAvFw2DMcW+gAAjdK45dEDi70+k72O0="},"bootstrap/_dropdowns.source-0010fb4057ead72a145cc8e6ab3e4ea290e899d82b7f66177a29f90c2996b647.scss":{"logical_path":"bootstrap/_dropdowns.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4803,"digest":"0010fb4057ead72a145cc8e6ab3e4ea290e899d82b7f66177a29f90c2996b647","integrity":"sha256-ABD7QFfq1yoUXMjmqz5OopDomdgrf2YXein5DCmWtkc="},"bootstrap/_button-groups.source-21e18e2516879de3defda28c5d32f5e344bbc85421ad66b38186224f2455e8cc.scss":{"logical_path":"bootstrap/_button-groups.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":5558,"digest":"21e18e2516879de3defda28c5d32f5e344bbc85421ad66b38186224f2455e8cc","integrity":"sha256-IeGOJRaHnePe/aKMXTL140S7yFQhrWazgYYiTyRV6Mw="},"bootstrap/_input-groups.source-8fae3b159a0c69d4cc9af589bb073ca5b1da90973092bcc00276aa1a4fa164be.scss":{"logical_path":"bootstrap/_input-groups.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4243,"digest":"8fae3b159a0c69d4cc9af589bb073ca5b1da90973092bcc00276aa1a4fa164be","integrity":"sha256-j647FZoMadTMmvWJuwc8pbHakJcwkrzAAnaqGk+hZL4="},"bootstrap/_navs.source-8779db84fe76e19abe7b9d4d5014adb07e23e5a773a3d17b529c0e879df71540.scss":{"logical_path":"bootstrap/_navs.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4949,"digest":"8779db84fe76e19abe7b9d4d5014adb07e23e5a773a3d17b529c0e879df71540","integrity":"sha256-h3nbhP524Zq+e51NUBStsH4j5adzo9F7UpwOh533FUA="},"bootstrap/_navbar.source-6ea4c7c0aeabc2157f63ac00af971a113c9b5cf66736a8020ca4a18cca3817df.scss":{"logical_path":"bootstrap/_navbar.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":14803,"digest":"6ea4c7c0aeabc2157f63ac00af971a113c9b5cf66736a8020ca4a18cca3817df","integrity":"sha256-bqTHwK6rwhV/Y6wAr5caETybXPZnNqgCDKShjMo4F98="},"bootstrap/_breadcrumbs.source-33c2f0bae433c1d2bed93c81ce71176ba35ab03d15d8b7cc919251d6ff619f80.scss":{"logical_path":"bootstrap/_breadcrumbs.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":595,"digest":"33c2f0bae433c1d2bed93c81ce71176ba35ab03d15d8b7cc919251d6ff619f80","integrity":"sha256-M8LwuuQzwdK+2TyBznEXa6NasD0V2LfMkZJR1v9hn4A="},"bootstrap/_pagination.source-3f41713467dd921cc1ac350f1cc0b3bdb6c57687f36cbb0d680fc9d078d7fb46.scss":{"logical_path":"bootstrap/_pagination.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":2028,"digest":"3f41713467dd921cc1ac350f1cc0b3bdb6c57687f36cbb0d680fc9d078d7fb46","integrity":"sha256-P0FxNGfdkhzBrDUPHMCzvbbFdofzbLsNaA/J0HjX+0Y="},"bootstrap/_pager.source-59ef3d3b0c5e7ed35f392ce461edf06bfc829c535afd8630b2aac51a44e11892.scss":{"logical_path":"bootstrap/_pager.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":853,"digest":"59ef3d3b0c5e7ed35f392ce461edf06bfc829c535afd8630b2aac51a44e11892","integrity":"sha256-We89OwxeftNfOSzkYe3wa/yCnFNa/YYwsqrFGkThGJI="},"bootstrap/_labels.source-bf9bd4cdd0441acb70db89f7a33adf06e50b4a7ff92db8fece20832a697612a7.scss":{"logical_path":"bootstrap/_labels.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1156,"digest":"bf9bd4cdd0441acb70db89f7a33adf06e50b4a7ff92db8fece20832a697612a7","integrity":"sha256-v5vUzdBEGstw24n3ozrfBuULSn/5Lbj+ziCDKml2Eqc="},"bootstrap/_badges.source-f20d636c4d5f23c846448eb64155b594a319e62329f5f1001f680b35972a1ae4.scss":{"logical_path":"bootstrap/_badges.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1098,"digest":"f20d636c4d5f23c846448eb64155b594a319e62329f5f1001f680b35972a1ae4","integrity":"sha256-8g1jbE1fI8hGRI62QVW1lKMZ5iMp9fEAH2gLNZcqGuQ="},"bootstrap/_jumbotron.source-35d116542ab176f99d69611ba5b6ff30f03769f44ee364c2c1b224c89fcbcafb.scss":{"logical_path":"bootstrap/_jumbotron.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":965,"digest":"35d116542ab176f99d69611ba5b6ff30f03769f44ee364c2c1b224c89fcbcafb","integrity":"sha256-NdEWVCqxdvmdaWEbpbb/MPA3afRO42TCwbIkyJ/Lyvs="},"bootstrap/_thumbnails.source-9d6038f6ab70449bed07a3b40d4cbb304a9339c00e568b00fc9432168afec7de.scss":{"logical_path":"bootstrap/_thumbnails.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":891,"digest":"9d6038f6ab70449bed07a3b40d4cbb304a9339c00e568b00fc9432168afec7de","integrity":"sha256-nWA49qtwRJvtB6O0DUy7MEqTOcAOVosA/JQyFor+x94="},"bootstrap/_alerts.source-f175606a34f8d438e6dab1bb0522f0bfb97ca0df0166f81425bab8021d9b2c41.scss":{"logical_path":"bootstrap/_alerts.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":1545,"digest":"f175606a34f8d438e6dab1bb0522f0bfb97ca0df0166f81425bab8021d9b2c41","integrity":"sha256-8XVgajT41Djm2rG7BSLwv7l8oN8BZvgUJbq4Ah2bLEE="},"bootstrap/_progress-bars.source-4c2bf460b33d74d64db07fca213c92de552b7dc92cd24a950cbf38c064e7875b.scss":{"logical_path":"bootstrap/_progress-bars.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":2278,"digest":"4c2bf460b33d74d64db07fca213c92de552b7dc92cd24a950cbf38c064e7875b","integrity":"sha256-TCv0YLM9dNZNsH/KITyS3lUrfcks0kqVDL84wGTnh1s="},"bootstrap/_media.source-5eab757b15c103bf176c89387f77e660d7f618f08df68b8506362293eaf51769.scss":{"logical_path":"bootstrap/_media.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":848,"digest":"5eab757b15c103bf176c89387f77e660d7f618f08df68b8506362293eaf51769","integrity":"sha256-Xqt1exXBA78XbIk4f3fmYNf2GPCN9ouFBjYik+r1F2k="},"bootstrap/_list-group.source-3175916051c5d7f163fa79e5608cc06fd700dd923606c90efc35e4189157c8e3.scss":{"logical_path":"bootstrap/_list-group.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":3161,"digest":"3175916051c5d7f163fa79e5608cc06fd700dd923606c90efc35e4189157c8e3","integrity":"sha256-MXWRYFHF1/Fj+nnlYIzAb9cA3ZI2BskO/DXkGJFXyOM="},"bootstrap/_panels.source-7c21bb3c0c7c5c5b7275b089b930217a6d57c9279a0a76fe29165cb88f31a1aa.scss":{"logical_path":"bootstrap/_panels.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":5705,"digest":"7c21bb3c0c7c5c5b7275b089b930217a6d57c9279a0a76fe29165cb88f31a1aa","integrity":"sha256-fCG7PAx8XFtydbCJuTAhem1XySeaCnb+KRZcuI8xoao="},"bootstrap/_responsive-embed.source-ca767590895216af631f9623df26a5fd0ff84ab499ab04c85c48096583bc81d3.scss":{"logical_path":"bootstrap/_responsive-embed.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":555,"digest":"ca767590895216af631f9623df26a5fd0ff84ab499ab04c85c48096583bc81d3","integrity":"sha256-ynZ1kIlSFq9jH5Yj3yal/Q/4SrSZqwTIXEgJZYO8gdM="},"bootstrap/_wells.source-d6bf447416761835357cf9535db2932c8f4a8b7a3aa77716bdde90a4ecc5551c.scss":{"logical_path":"bootstrap/_wells.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":535,"digest":"d6bf447416761835357cf9535db2932c8f4a8b7a3aa77716bdde90a4ecc5551c","integrity":"sha256-1r9EdBZ2GDU1fPlTXbKTLI9Ki3o6p3cWvd6QpOzFVRw="},"bootstrap/_close.source-29f12a91774599a71d1b1fd0bdce91411d71c03bf06ad48f355fe2d5ba781ae9.scss":{"logical_path":"bootstrap/_close.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":736,"digest":"29f12a91774599a71d1b1fd0bdce91411d71c03bf06ad48f355fe2d5ba781ae9","integrity":"sha256-KfEqkXdFmacdGx/Qvc6RQR1xwDvwatSPNV/i1bp4Guk="},"bootstrap/_modals.source-cc9b2a29ca21d8d4e6445c9d6bf6e4a11855fffe398a2b0477342be55a56d8b0.scss":{"logical_path":"bootstrap/_modals.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":3624,"digest":"cc9b2a29ca21d8d4e6445c9d6bf6e4a11855fffe398a2b0477342be55a56d8b0","integrity":"sha256-zJsqKcoh2NTmRFyda/bkoRhV//45iisEdzQr5VpW2LA="},"bootstrap/_tooltip.source-fd70c95a50674c92f89bd27380a9768db21e997193cd2ec4b9a07b2f6dfe8622.scss":{"logical_path":"bootstrap/_tooltip.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":2606,"digest":"fd70c95a50674c92f89bd27380a9768db21e997193cd2ec4b9a07b2f6dfe8622","integrity":"sha256-/XDJWlBnTJL4m9JzgKl2jbIemXGTzS7EuaB7L23+hiI="},"bootstrap/_popovers.source-c80157dccd38cfcd3a256c5c97937c566d6260fbf63d981c923b040bf16cac04.scss":{"logical_path":"bootstrap/_popovers.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":3414,"digest":"c80157dccd38cfcd3a256c5c97937c566d6260fbf63d981c923b040bf16cac04","integrity":"sha256-yAFX3M04z806JWxcl5N8Vm1iYPv2PZgckjsEC/FsrAQ="},"bootstrap/_carousel.source-78e906253c103c0563db95faa9a9a17a4bd75ab619cfb27312555f4dc16d614f.scss":{"logical_path":"bootstrap/_carousel.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4793,"digest":"78e906253c103c0563db95faa9a9a17a4bd75ab619cfb27312555f4dc16d614f","integrity":"sha256-eOkGJTwQPAVj25X6qamhekvXWrYZz7JzElVfTcFtYU8="},"bootstrap/_utilities.source-f311f41d090eabc8f185d2371e3531389665eb552303a40302d319a7c7354e66.scss":{"logical_path":"bootstrap/_utilities.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":837,"digest":"f311f41d090eabc8f185d2371e3531389665eb552303a40302d319a7c7354e66","integrity":"sha256-8xH0HQkOq8jxhdI3HjUxOJZl61UjA6QDAtMZp8c1TmY="},"bootstrap/_responsive-utilities.source-1a88b9dade13b7c60cf7b99e315f371ac16f09334f34dd4da94068e2390f521d.scss":{"logical_path":"bootstrap/_responsive-utilities.source.scss","mtime":"2023-11-09T11:34:39+00:00","size":4282,"digest":"1a88b9dade13b7c60cf7b99e315f371ac16f09334f34dd4da94068e2390f521d","integrity":"sha256-Goi52t4Tt8YM97meMV83GsFvCTNPNN1NqUBo4jkPUh0="},"load-parser.debug-71c5d06adb7f7f182c8e6cad7dea2e00a26acbbf9d6ccbbed5bd8a86bd67c911.js":{"logical_path":"load-parser.debug.js","mtime":"2023-11-09T11:34:39+00:00","size":2267134,"digest":"71c5d06adb7f7f182c8e6cad7dea2e00a26acbbf9d6ccbbed5bd8a86bd67c911","integrity":"sha256-ccXQatt/fxgsjmytfeouAKJqy7+dbMu+1b2Khr1nyRE="},"load-parser-2f3ba30138edaf9916f78766b8388e4d31bf513da551ef96326e75a3e2a26dd3.js":{"logical_path":"load-parser.js","mtime":"2023-11-09T11:34:39+00:00","size":2267028,"digest":"2f3ba30138edaf9916f78766b8388e4d31bf513da551ef96326e75a3e2a26dd3","integrity":"sha256-LzujATjtr5kW94dmuDiOTTG/UT2lUe+WMm51o+KibdM="},"load-parser.js-37acfee094c1ed89c2e72e42274100fb700c853bad86d9cd45aa2275d427807e.map":{"logical_path":"load-parser.js.map","mtime":"2023-11-09T11:34:39+00:00","size":1154799,"digest":"37acfee094c1ed89c2e72e42274100fb700c853bad86d9cd45aa2275d427807e","integrity":"sha256-N6z+4JTB7YnC5y5CJ0EA+3AMhTuthtnNRaoiddQngH4="},"base64.source-ff1b709cbf57f3945ce5cfadb58c63d87c2f4ba36331c23b4b84d7a92a7741dd.rb":{"logical_path":"base64.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2859,"digest":"ff1b709cbf57f3945ce5cfadb58c63d87c2f4ba36331c23b4b84d7a92a7741dd","integrity":"sha256-/xtwnL9X85Rc5c+ttYxj2HwvS6NjMcI7S4TXqSp3Qd0="},"corelib/pack_unpack/format_string_parser.source-06ee75543d8f742e5323e0c28155d26a97a3fe323091f8ead67df96b40384e2a.rb":{"logical_path":"corelib/pack_unpack/format_string_parser.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2941,"digest":"06ee75543d8f742e5323e0c28155d26a97a3fe323091f8ead67df96b40384e2a","integrity":"sha256-Bu51VD2PdC5TI+DCgVXSapej/jIwkfjq1n35a0A4Tio="},"corelib/string/unpack.source-9292521cf2d03d9a3322b0201794affc5e4ff656a8e1907a352b43f0f04b0bc6.rb":{"logical_path":"corelib/string/unpack.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":19866,"digest":"9292521cf2d03d9a3322b0201794affc5e4ff656a8e1907a352b43f0f04b0bc6","integrity":"sha256-kpJSHPLQPZozIrAgF5Sv/F5P9lao4ZB6NStD8PBLC8Y="},"set.source-9ecbee038e5d23a6807530e28d805d1088e523a68a49ee4f66cb45c35e593659.rb":{"logical_path":"set.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":32,"digest":"9ecbee038e5d23a6807530e28d805d1088e523a68a49ee4f66cb45c35e593659","integrity":"sha256-nsvuA45dI6aAdTDijYBdEIjlI6aKSe5PZstFw15ZNlk="},"ast/node.source-e0346587af629df152c23042fcc16d10d929138f90e5fb7cadeedf92cb6c852d.rb":{"logical_path":"ast/node.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":8105,"digest":"e0346587af629df152c23042fcc16d10d929138f90e5fb7cadeedf92cb6c852d","integrity":"sha256-4DRlh69infFSwjBC/MFtENkpE4+Q5ft8re7fkstshS0="},"ast/processor/mixin.source-4f5d9beb4d8be76583b4fac388d91804538131387d7eab2a0f4e778ea88e72d4.rb":{"logical_path":"ast/processor/mixin.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":10280,"digest":"4f5d9beb4d8be76583b4fac388d91804538131387d7eab2a0f4e778ea88e72d4","integrity":"sha256-T12b602L52WDtPrDiNkYBFOBMTh9fqsqD053jqiOctQ="},"ast/processor.source-e4c2a8e995b1922b0a1848d81426e7057168a0851c75a9da99cf427242cbf646.rb":{"logical_path":"ast/processor.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":394,"digest":"e4c2a8e995b1922b0a1848d81426e7057168a0851c75a9da99cf427242cbf646","integrity":"sha256-5MKo6ZWxkisKGEjYFCbnBXFooIUcdanamc9CckLL9kY="},"ast/sexp.source-8dc78dac8f9465a5f6a62aa057ae97fbadd5b111efe8895ac824d46938dc3793.rb":{"logical_path":"ast/sexp.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":947,"digest":"8dc78dac8f9465a5f6a62aa057ae97fbadd5b111efe8895ac824d46938dc3793","integrity":"sha256-jceNrI+UZaX2piqgV66X+63VsRHv6IlayCTUaTjcN5M="},"ast.source-905da9f5b152658b445875a3f12b2fe9521683ac31fdc24e41a724cfdd09ac44.rb":{"logical_path":"ast.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":586,"digest":"905da9f5b152658b445875a3f12b2fe9521683ac31fdc24e41a724cfdd09ac44","integrity":"sha256-kF2p9bFSZYtEWHWj8Ssv6VIWg6wx/cJOQackz90JrEQ="},"parser/ast/node.source-3c183648686e0e02561eec8d8728167e77c9ed5304843adaf9ed80b45d7a258d.rb":{"logical_path":"parser/ast/node.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1036,"digest":"3c183648686e0e02561eec8d8728167e77c9ed5304843adaf9ed80b45d7a258d","integrity":"sha256-PBg2SGhuDgJWHuyNhygWfnfJ7VMEhDra+e2AtF16JY0="},"opal/ast/node.source-4a42cb5bf8e372a82c3bc3f2fe44beeeb0c89d3734e4a67016ba838418288fd5.rb":{"logical_path":"opal/ast/node.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":501,"digest":"4a42cb5bf8e372a82c3bc3f2fe44beeeb0c89d3734e4a67016ba838418288fd5","integrity":"sha256-SkLLW/jjcqgsO8Py/kS+7rDInTc05KZwFrqDhBgoj9U="},"racc/parser.source-47e481218146a1561e566a1f41766919cc6c8e2713bab6aed0384ed6ef55656b.rb":{"logical_path":"racc/parser.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":18414,"digest":"47e481218146a1561e566a1f41766919cc6c8e2713bab6aed0384ed6ef55656b","integrity":"sha256-R+SBIYFGoVYeVmofQXZpGcxsjicTurau0DhO1u9VZWs="},"parser/version.source-83844cf58343f542492c29bc0d4c6117b6d8b81731717151e20bc2cfab348cc7.rb":{"logical_path":"parser/version.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":71,"digest":"83844cf58343f542492c29bc0d4c6117b6d8b81731717151e20bc2cfab348cc7","integrity":"sha256-g4RM9YND9UJJLCm8DUxhF7bYuBcxcXFR4gvCz6s0jMc="},"parser/messages.source-feb872b0d062340525de564d7ec081e192666537d74b1f8c250d358d81bdc205.rb":{"logical_path":"parser/messages.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6850,"digest":"feb872b0d062340525de564d7ec081e192666537d74b1f8c250d358d81bdc205","integrity":"sha256-/rhysNBiNAUl3lZNfsCB4ZJmZTfXSx+MJQ01jYG9wgU="},"parser/deprecation.source-d0805a72096c6de3981bb7d3e447eb28d29fd9640f3b4c6d11fd5047377464f5.rb":{"logical_path":"parser/deprecation.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":250,"digest":"d0805a72096c6de3981bb7d3e447eb28d29fd9640f3b4c6d11fd5047377464f5","integrity":"sha256-0IBacglsbeOYG7fT5EfrKNKf2WQPO0xtEf1QRzd0ZPU="},"parser/ast/processor.source-75f876361c7a487d0cd403c1241ac618174f3d88b00d948424cb9722e1bf4dc2.rb":{"logical_path":"parser/ast/processor.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":8851,"digest":"75f876361c7a487d0cd403c1241ac618174f3d88b00d948424cb9722e1bf4dc2","integrity":"sha256-dfh2Nhx6SH0M1APBJBrGGBdPPYiwDZSEJMuXIuG/TcI="},"parser/meta.source-c35c18829a422c63e84b77dc5af59ca2b67441f92b871dd8c369a10ffac4d8d4.rb":{"logical_path":"parser/meta.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1609,"digest":"c35c18829a422c63e84b77dc5af59ca2b67441f92b871dd8c369a10ffac4d8d4","integrity":"sha256-w1wYgppCLGPoS3fcWvWcorZ0Qfkrhx3Yw2mhD/rE2NQ="},"parser/source/buffer.source-4580df88737728b7d1e96541f31c1e9ab09ab54e85851ee20c28a54f8c230400.rb":{"logical_path":"parser/source/buffer.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":10020,"digest":"4580df88737728b7d1e96541f31c1e9ab09ab54e85851ee20c28a54f8c230400","integrity":"sha256-RYDfiHN3KLfR6WVB8xwemrCatU6FhR7iDCilT4wjBAA="},"parser/source/range.source-0a568e9e163619617fa4faef2827852edba5bff9537d4650b6635156591124a4.rb":{"logical_path":"parser/source/range.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":8848,"digest":"0a568e9e163619617fa4faef2827852edba5bff9537d4650b6635156591124a4","integrity":"sha256-ClaOnhY2GWF/pPrvKCeFLtulv/lTfUZQtmNRVlkRJKQ="},"parser/source/comment.source-fc4b14d95ce20d37fbea4a1d3294a38ab0211f41579763e9b4a9ec6470441680.rb":{"logical_path":"parser/source/comment.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3298,"digest":"fc4b14d95ce20d37fbea4a1d3294a38ab0211f41579763e9b4a9ec6470441680","integrity":"sha256-/EsU2VziDTf76kodMpSjirAhH0FXl2PptKnsZHBEFoA="},"parser/source/comment/associator.source-6029f0f9ff2c3c29839e5d88b20f25d64f39797cea6d29702243c94b01f6af5e.rb":{"logical_path":"parser/source/comment/associator.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":7226,"digest":"6029f0f9ff2c3c29839e5d88b20f25d64f39797cea6d29702243c94b01f6af5e","integrity":"sha256-YCnw+f8sPCmDnl2Isg8l1k85eXzqbSlwIkPJSwH2r14="},"parser/source/rewriter.source-1647682808397f50876b8080c9386050769b75ca172d7606fd012194ea9f8c1e.rb":{"logical_path":"parser/source/rewriter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":16897,"digest":"1647682808397f50876b8080c9386050769b75ca172d7606fd012194ea9f8c1e","integrity":"sha256-FkdoKAg5f1CHa4CAyThgUHabdcoXLXYG/QEhlOqfjB4="},"parser/source/rewriter/action.source-89dc19a710955c30c730b6b3870cd03f9791a8846c55884bbe7c0ab4f2c4ed44.rb":{"logical_path":"parser/source/rewriter/action.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1105,"digest":"89dc19a710955c30c730b6b3870cd03f9791a8846c55884bbe7c0ab4f2c4ed44","integrity":"sha256-idwZpxCVXDDHMLazhwzQP5eRqIRsVYhLvnwKtPLE7UQ="},"parser/source/tree_rewriter.source-e47e361cd5b0adb1949b76743fd4d406fc7617f7e85b8a46d9f0af060244b772.rb":{"logical_path":"parser/source/tree_rewriter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":14154,"digest":"e47e361cd5b0adb1949b76743fd4d406fc7617f7e85b8a46d9f0af060244b772","integrity":"sha256-5H42HNWwrbGUm3Z0P9TUBvx2F/foW4pG2fCvBgJEt3I="},"parser/source/tree_rewriter/action.source-c0a18d5f314548c371a1b7175307289380ab70f4c9496a61b66b1f8f3bed4319.rb":{"logical_path":"parser/source/tree_rewriter/action.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":9460,"digest":"c0a18d5f314548c371a1b7175307289380ab70f4c9496a61b66b1f8f3bed4319","integrity":"sha256-wKGNXzFFSMNxobcXUwcok4CrcPTJSWphtmsfjzvtQxk="},"parser/source/map.source-1d9a13302f85e4756c695dbb55e13b0e04e01cdc23074a9e824fa38bdb3fb359.rb":{"logical_path":"parser/source/map.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5321,"digest":"1d9a13302f85e4756c695dbb55e13b0e04e01cdc23074a9e824fa38bdb3fb359","integrity":"sha256-HZoTMC+F5HVsaV27VeE7DgTgHNwjB0qegk+ji9s/s1k="},"parser/source/map/operator.source-f71b5afe77fd6fb7f431d08e8cd3bc82c9a3f6560e44d55a9a392778ea5adebd.rb":{"logical_path":"parser/source/map/operator.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":249,"digest":"f71b5afe77fd6fb7f431d08e8cd3bc82c9a3f6560e44d55a9a392778ea5adebd","integrity":"sha256-9xta/nf9b7f0MdCOjNO8gsmj9lYORNVamjkneOpa3r0="},"parser/source/map/collection.source-9a582ce032c03905dc9944e58a04bcbd24309c84332d2409598511745dfc578b.rb":{"logical_path":"parser/source/map/collection.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":290,"digest":"9a582ce032c03905dc9944e58a04bcbd24309c84332d2409598511745dfc578b","integrity":"sha256-mlgs4DLAOQXcmUTligS8vSQwnIQzLSQJWYURdF38V4s="},"parser/source/map/constant.source-8887161ce7754f19f1c24119e9c5b5d3409da683c2f3d76cd439c9b37edcfa88.rb":{"logical_path":"parser/source/map/constant.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":573,"digest":"8887161ce7754f19f1c24119e9c5b5d3409da683c2f3d76cd439c9b37edcfa88","integrity":"sha256-iIcWHOd1TxnxwkEZ6cW100CdpoPC89ds1DnJs37c+og="},"parser/source/map/variable.source-cd0246287786e8cef9e224b480da4b3e0589005cc5098c78a876332ec768416f.rb":{"logical_path":"parser/source/map/variable.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":513,"digest":"cd0246287786e8cef9e224b480da4b3e0589005cc5098c78a876332ec768416f","integrity":"sha256-zQJGKHeG6M754iS0gNpLPgWJAFzFCYx4qHYzLsdoQW8="},"parser/source/map/keyword.source-dedb99ced5eb88d041994d28deeb0870d45690a9215fadcb1deabd555b23b8e7.rb":{"logical_path":"parser/source/map/keyword.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":358,"digest":"dedb99ced5eb88d041994d28deeb0870d45690a9215fadcb1deabd555b23b8e7","integrity":"sha256-3tuZztXriNBBmU0o3usIcNRWkKkhX63LHeq9VVsjuOc="},"parser/source/map/definition.source-8e6840668ebc86a187050492c4ae0be800ab508ad349b6ce802e48802a8bda6c.rb":{"logical_path":"parser/source/map/definition.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":435,"digest":"8e6840668ebc86a187050492c4ae0be800ab508ad349b6ce802e48802a8bda6c","integrity":"sha256-jmhAZo68hqGHBQSSxK4L6ACrUIrTSbbOgC5IgCqL2mw="},"parser/source/map/method_definition.source-ab2e20cdf7f7ba09514bdb1fcbf9a6abd1a3adf1b0b52f133359ae07df39b44c.rb":{"logical_path":"parser/source/map/method_definition.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":539,"digest":"ab2e20cdf7f7ba09514bdb1fcbf9a6abd1a3adf1b0b52f133359ae07df39b44c","integrity":"sha256-qy4gzff3uglRS9sfy/mmq9GjrfGwtS8TM1muB985tEw="},"parser/source/map/send.source-3ac8ece7feb6d38674b20421e391fbff71530d479a11e576c845af23be52b4db.rb":{"logical_path":"parser/source/map/send.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":682,"digest":"3ac8ece7feb6d38674b20421e391fbff71530d479a11e576c845af23be52b4db","integrity":"sha256-Osjs5/6204Z0sgQh45H7/3FTDUeaEeV2yEWvI75StNs="},"parser/source/map/index.source-a72e5a3651da8f713a5c7a49be545f59af09719ebc1950a7e7da1dd39500d8e9.rb":{"logical_path":"parser/source/map/index.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":574,"digest":"a72e5a3651da8f713a5c7a49be545f59af09719ebc1950a7e7da1dd39500d8e9","integrity":"sha256-py5aNlHaj3E6XHpJvlRfWa8JcZ68GVCn59od05UA2Ok="},"parser/source/map/condition.source-d3c4f51b72943d60f8627dea4e2bc87378b1b609ed4599b8cfe74dbcd9120aa2.rb":{"logical_path":"parser/source/map/condition.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":403,"digest":"d3c4f51b72943d60f8627dea4e2bc87378b1b609ed4599b8cfe74dbcd9120aa2","integrity":"sha256-08T1G3KUPWD4Yn3qTivIc3ixtgntRZm4z+dNvNkSCqI="},"parser/source/map/ternary.source-8b1224840dc23807237c82b37d1457ddd9c68f76880ec836543fcd4a01e5156c.rb":{"logical_path":"parser/source/map/ternary.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":307,"digest":"8b1224840dc23807237c82b37d1457ddd9c68f76880ec836543fcd4a01e5156c","integrity":"sha256-ixIkhA3COAcjfIKzfRRX3dnGj3aIDsg2VD/NSgHlFWw="},"parser/source/map/for.source-187f83959e6aa4b80afc9eee422865711e75cdd760c4bb64da46f3efe0a8f7af.rb":{"logical_path":"parser/source/map/for.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":356,"digest":"187f83959e6aa4b80afc9eee422865711e75cdd760c4bb64da46f3efe0a8f7af","integrity":"sha256-GH+DlZ5qpLgK/J7uQihlcR51zddgxLtk2kbz7+Co968="},"parser/source/map/rescue_body.source-2135ac0caf455b360effe438be50ff12290ca172b6775396215d8bd4b6fdec38.rb":{"logical_path":"parser/source/map/rescue_body.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":377,"digest":"2135ac0caf455b360effe438be50ff12290ca172b6775396215d8bd4b6fdec38","integrity":"sha256-ITWsDK9FWzYO/+Q4vlD/EikMoXK2d1OWIV2L1Lb97Dg="},"parser/source/map/heredoc.source-802e3218a11a36e37d59f2699ba9ef027ba3f25a9ccaf5b67b9f51b9be711167.rb":{"logical_path":"parser/source/map/heredoc.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":314,"digest":"802e3218a11a36e37d59f2699ba9ef027ba3f25a9ccaf5b67b9f51b9be711167","integrity":"sha256-gC4yGKEaNuN9WfJpm6nvAnuj8lqcyvW2e59Rub5xEWc="},"parser/source/map/objc_kwarg.source-b8b54b4ff74d2589e8544a33d7d855ff85e655ac8dff96a276ee8108fe6c78f4.rb":{"logical_path":"parser/source/map/objc_kwarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":380,"digest":"b8b54b4ff74d2589e8544a33d7d855ff85e655ac8dff96a276ee8108fe6c78f4","integrity":"sha256-uLVLT/dNJYnoVEoz19hV/4XmVayN/5aidu6BCP5sePQ="},"parser/syntax_error.source-b35a7eb23f86478e8d1480728eb38b7138a00331e9741bc7f4fb37ea1a1f3d05.rb":{"logical_path":"parser/syntax_error.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":443,"digest":"b35a7eb23f86478e8d1480728eb38b7138a00331e9741bc7f4fb37ea1a1f3d05","integrity":"sha256-s1p+sj+GR46NFIByjrOLcTigAzHpdBvH9Ps36hofPQU="},"parser/clobbering_error.source-5f0b2aee4291455b71cfc41193a03c1eb39dececcf3a272fa1dd7f52d81619a7.rb":{"logical_path":"parser/clobbering_error.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":331,"digest":"5f0b2aee4291455b71cfc41193a03c1eb39dececcf3a272fa1dd7f52d81619a7","integrity":"sha256-Xwsq7kKRRVtxz8QRk6A8HrOd7OzPOicvod1/UtgWGac="},"parser/diagnostic.source-35218d12206180871dc0b4d00559238172c5f5a1c89391a28d2e9f27012c87af.rb":{"logical_path":"parser/diagnostic.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4339,"digest":"35218d12206180871dc0b4d00559238172c5f5a1c89391a28d2e9f27012c87af","integrity":"sha256-NSGNEiBhgIcdwLTQBVkjgXLF9aHIk5GijS6fJwEsh68="},"parser/diagnostic/engine.source-ace6754a27a82e312572f22e30a5741e9399d3ab30deabf7a866372ad3873a6d.rb":{"logical_path":"parser/diagnostic/engine.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2537,"digest":"ace6754a27a82e312572f22e30a5741e9399d3ab30deabf7a866372ad3873a6d","integrity":"sha256-rOZ1SieoLjElcvIuMKV0HpOZ06sw3qv3qGY3KtOHOm0="},"parser/static_environment.source-8cfc2f896c62d5270a35feb0bac71d2b10bb884f9d760fe7b16da78afba1901d.rb":{"logical_path":"parser/static_environment.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1444,"digest":"8cfc2f896c62d5270a35feb0bac71d2b10bb884f9d760fe7b16da78afba1901d","integrity":"sha256-jPwviWxi1ScKNf6wuscdKxC7iE+ddg/nsW2nivuhkB0="},"parser/lexer-F0.source-0bd700cff79f59a415d47d17a0accfe71752ac87c38a4d78d7a930b85eefa212.rb":{"logical_path":"parser/lexer-F0.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":419451,"digest":"0bd700cff79f59a415d47d17a0accfe71752ac87c38a4d78d7a930b85eefa212","integrity":"sha256-C9cAz/efWaQV1H0XoKzP5xdSrIfDik1416kwuF7vohI="},"parser/lexer-F1.source-1731830baa1a62e49155a5163b94ddbb89dda14edbdb1e6a643ed70abff46a1b.rb":{"logical_path":"parser/lexer-F1.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":451894,"digest":"1731830baa1a62e49155a5163b94ddbb89dda14edbdb1e6a643ed70abff46a1b","integrity":"sha256-FzGDC6oaYuSRVaUWO5Tdu4ndoU7b2x5qZD7XCr/0ahs="},"parser/lexer-strings.source-bcb54e3e3cf67073369bedac2181573768774bf1ece9d1fe352a35d7fe3e2517.rb":{"logical_path":"parser/lexer-strings.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":171286,"digest":"bcb54e3e3cf67073369bedac2181573768774bf1ece9d1fe352a35d7fe3e2517","integrity":"sha256-vLVOPjz2cHM2m+2sIYFXN2h3S/Hs6dH+NSo11/4+JRc="},"parser/lexer/literal.source-e27abea50742e2b60e1d49b9bbdb92c64fd696c41aeb17341f8a5f4c0b5d8ce8.rb":{"logical_path":"parser/lexer/literal.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6564,"digest":"e27abea50742e2b60e1d49b9bbdb92c64fd696c41aeb17341f8a5f4c0b5d8ce8","integrity":"sha256-4nq+pQdC4rYOHUm5u9uSxk/WlsQa6xc0H4pfTAtdjOg="},"parser/lexer/stack_state.source-6c4b455a2961afcfa57e2508d2d2f927d9f1b509c6bf3b6796a2de9b9bcdde59.rb":{"logical_path":"parser/lexer/stack_state.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":661,"digest":"6c4b455a2961afcfa57e2508d2d2f927d9f1b509c6bf3b6796a2de9b9bcdde59","integrity":"sha256-bEtFWilhr8+lfiUI0tL5J9nxtQnGvztnlqLem5vN3lk="},"parser/lexer/dedenter.source-65e1040b204edb68a3e352343ab77fa9811872bdb249f238e9728a2f99f1d43b.rb":{"logical_path":"parser/lexer/dedenter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2290,"digest":"65e1040b204edb68a3e352343ab77fa9811872bdb249f238e9728a2f99f1d43b","integrity":"sha256-ZeEECyBO22ij41I0Ord/qYEYcr2ySfI46XKKL5nx1Ds="},"parser/builders/default.source-ab69929f6740db5a107dd355834d0dcef7731be839ca06a26d6e21d0c9c9ab9f.rb":{"logical_path":"parser/builders/default.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":62724,"digest":"ab69929f6740db5a107dd355834d0dcef7731be839ca06a26d6e21d0c9c9ab9f","integrity":"sha256-q2mSn2dA21oQfdNVg00NzvdzG+g5ygaibW4h0MnJq58="},"parser/context.source-eada1358bea1056602975f4c6bd8ed3126a3e3c95a437fea35362b3ff9fbeb5e.rb":{"logical_path":"parser/context.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1225,"digest":"eada1358bea1056602975f4c6bd8ed3126a3e3c95a437fea35362b3ff9fbeb5e","integrity":"sha256-6toTWL6hBWYCl19Ma9jtMSaj48laQ3/qNTYrP/n7614="},"parser/max_numparam_stack.source-68c697d6a215860b957bd9c0d19256976b7ea3074606a0675b47851ab4591ffd.rb":{"logical_path":"parser/max_numparam_stack.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":781,"digest":"68c697d6a215860b957bd9c0d19256976b7ea3074606a0675b47851ab4591ffd","integrity":"sha256-aMaX1qIVhguVe9nA0ZJWl2t+owdGBqBnW0eFGrRZH/0="},"parser/current_arg_stack.source-7063f1f3627b3b3fa693afba3ad63ce5f4f9885677be08900b09819d9234ad8a.rb":{"logical_path":"parser/current_arg_stack.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":717,"digest":"7063f1f3627b3b3fa693afba3ad63ce5f4f9885677be08900b09819d9234ad8a","integrity":"sha256-cGPx82J7Oz+mk6+6OtY85fT5iFZ3vgiQCwmBnZI0rYo="},"parser/variables_stack.source-f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0.rb":{"logical_path":"parser/variables_stack.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":443,"digest":"f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0","integrity":"sha256-9VVIIj+F/Z7+/oMuaAWxn1FSdEShUCVadbKNfeidMNA="},"parser/base.source-5eb855a17557873f53b3255d6123879f6081ab3c9fa6ea1f6ec28d9d14a93b46.rb":{"logical_path":"parser/base.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":8156,"digest":"5eb855a17557873f53b3255d6123879f6081ab3c9fa6ea1f6ec28d9d14a93b46","integrity":"sha256-XrhVoXVXhz9TsyVdYSOHn2CBqzyfpuofbsKNnRSpO0Y="},"parser/rewriter.source-f95150be5d8e334e237f2b3cedac5393320c41a2d756f0e7c0713fd920996c16.rb":{"logical_path":"parser/rewriter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2570,"digest":"f95150be5d8e334e237f2b3cedac5393320c41a2d756f0e7c0713fd920996c16","integrity":"sha256-+VFQvl2OM04jfys87axTkzIMQaLXVvDnwHE/2SCZbBY="},"parser/tree_rewriter.source-9b9c711839d953a2008dfcea1a4c144d3cfbdde76b72fd89470792f2bb130637.rb":{"logical_path":"parser/tree_rewriter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3541,"digest":"9b9c711839d953a2008dfcea1a4c144d3cfbdde76b72fd89470792f2bb130637","integrity":"sha256-m5xxGDnZU6IAjfzqGkwUTTz73edrcv2JRweS8rsTBjc="},"parser.source-0c0f4bf7e342af741738456c3157ab798c8804e9d2b73e3492503950cb7b66d4.rb":{"logical_path":"parser.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2308,"digest":"0c0f4bf7e342af741738456c3157ab798c8804e9d2b73e3492503950cb7b66d4","integrity":"sha256-DA9L9+NCr3QXOEVsMVereYyIBOnStz40klA5UMt7ZtQ="},"parser/ruby32.source-35d2a9eec77c538180dd894beb0b108bbfd5d69a3a354051075fef69a967d7ef.rb":{"logical_path":"parser/ruby32.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":622273,"digest":"35d2a9eec77c538180dd894beb0b108bbfd5d69a3a354051075fef69a967d7ef","integrity":"sha256-NdKp7sd8U4GA3YlL6wsQi7/V1po6NUBRB1/vaaln1+8="},"opal/ast/builder.source-eaf6df550a58d52a79a62a41acabefee2259247678734a925b178509d3a4ec05.rb":{"logical_path":"opal/ast/builder.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":316,"digest":"eaf6df550a58d52a79a62a41acabefee2259247678734a925b178509d3a4ec05","integrity":"sha256-6vbfVQpY1Sp5pipBrKvv7iJZJHZ4c0qSWxeFCdOk7AU="},"opal/rewriters/base.source-aa1b6772df8024d3537caf4483dd31cd8d1ba7291d9fad606e9293da551f627e.rb":{"logical_path":"opal/rewriters/base.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3309,"digest":"aa1b6772df8024d3537caf4483dd31cd8d1ba7291d9fad606e9293da551f627e","integrity":"sha256-qhtnct+AJNNTfK9Eg90xzY0bpykdn61gbpKT2lUfYn4="},"opal/rewriters/opal_engine_check.source-79f1e0ad24150790cf1f9aad5dba3cf5b09aa5e041f31bf571e802da54d88d21.rb":{"logical_path":"opal/rewriters/opal_engine_check.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1097,"digest":"79f1e0ad24150790cf1f9aad5dba3cf5b09aa5e041f31bf571e802da54d88d21","integrity":"sha256-efHgrSQVB5DPH5qtXbo89bCapeBB8xv1cegC2lTYjSE="},"opal/rewriters/targeted_patches.source-d9d349d8078f2dd6d3ccb5fdc0328300ac6ec2230bc56e4adee3ed8cc0ef824a.rb":{"logical_path":"opal/rewriters/targeted_patches.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3269,"digest":"d9d349d8078f2dd6d3ccb5fdc0328300ac6ec2230bc56e4adee3ed8cc0ef824a","integrity":"sha256-2dNJ2AePLdbTzLX9wDKDAKxuwiMLxW5K3uPtjMDvgko="},"opal/rewriters/for_rewriter.source-753748c955ec1b63a21e2450b44694a654c06cd182dd5e59dc5e76ed674f5135.rb":{"logical_path":"opal/rewriters/for_rewriter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3503,"digest":"753748c955ec1b63a21e2450b44694a654c06cd182dd5e59dc5e76ed674f5135","integrity":"sha256-dTdIyVXsG2OiHiRQtEaUplTAbNGC3V5Z3F527WdPUTU="},"opal/regexp_anchors.source-9a82e2c2c1d73ae9606226301af73b2ef0112155f3fca52defa4be2b4cd75243.rb":{"logical_path":"opal/regexp_anchors.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1766,"digest":"9a82e2c2c1d73ae9606226301af73b2ef0112155f3fca52defa4be2b4cd75243","integrity":"sha256-moLiwsHXOulgYiYwGvc7LvARIVXz/KUt76S+K0zXUkM="},"opal/rewriters/js_reserved_words.source-11a079affae8c126b9bd182f9f090b45dcfbbeea31f4d913a616dd48523f16a1.rb":{"logical_path":"opal/rewriters/js_reserved_words.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3625,"digest":"11a079affae8c126b9bd182f9f090b45dcfbbeea31f4d913a616dd48523f16a1","integrity":"sha256-EaB5r/rowSa5vRgvnwkLRdz7vuox9NkTphbdSFI/FqE="},"opal/rewriters/block_to_iter.source-e9c300c643bdb416e53cbc6fda6d8130fba40388e3954f4ac3edb122df6bb079.rb":{"logical_path":"opal/rewriters/block_to_iter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":348,"digest":"e9c300c643bdb416e53cbc6fda6d8130fba40388e3954f4ac3edb122df6bb079","integrity":"sha256-6cMAxkO9tBblPLxv2m2BMPukA4jjlU9Kw+2xIt9rsHk="},"opal/rewriters/dot_js_syntax.source-50de46af4c9a2b0190947c51fae98997f6337b038f1641c1ef709834a2fe6922.rb":{"logical_path":"opal/rewriters/dot_js_syntax.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1846,"digest":"50de46af4c9a2b0190947c51fae98997f6337b038f1641c1ef709834a2fe6922","integrity":"sha256-UN5Gr0yaKwGQlHxR+umJl/YzewOPFkHB73CYNKL+aSI="},"opal/rewriters/pattern_matching.source-eb37306ac4421a8070a416101c89861786b403a6f46f2dd6ec8b40d45e36282c.rb":{"logical_path":"opal/rewriters/pattern_matching.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6416,"digest":"eb37306ac4421a8070a416101c89861786b403a6f46f2dd6ec8b40d45e36282c","integrity":"sha256-6zcwasRCGoBwpBYQHImGF4a0A6b0by3W7ItA1F42KCw="},"opal/rewriters/logical_operator_assignment.source-e422b06ca9e9b67cc1fd3e99b7e9af4a813b2bb9c50fb9e9df7b2f5f71efc2a8.rb":{"logical_path":"opal/rewriters/logical_operator_assignment.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5277,"digest":"e422b06ca9e9b67cc1fd3e99b7e9af4a813b2bb9c50fb9e9df7b2f5f71efc2a8","integrity":"sha256-5CKwbKnptnzB/T6Zt+mvSoE7K7nFD7np33svX3Hvwqg="},"opal/rewriters/binary_operator_assignment.source-6d9942e1ba135acc050bf3e1399693fff6049e1abb2a9e470021df972957da86.rb":{"logical_path":"opal/rewriters/binary_operator_assignment.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4532,"digest":"6d9942e1ba135acc050bf3e1399693fff6049e1abb2a9e470021df972957da86","integrity":"sha256-bZlC4boTWswFC/PhOZaT//YEnhq7Kp5HACHflylX2oY="},"opal/rewriters/hashes/key_duplicates_rewriter.source-b2210660c3d99f87f818f71fc7e3ac44cbcbdb17d94b32963c70c072f83360df.rb":{"logical_path":"opal/rewriters/hashes/key_duplicates_rewriter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1244,"digest":"b2210660c3d99f87f818f71fc7e3ac44cbcbdb17d94b32963c70c072f83360df","integrity":"sha256-siEGYMPZn4f4GPcfx+OsRMvL2xfZSzKWPHDAcvgzYN8="},"opal/rewriters/dump_args.source-b6268131cb1c7150e479c80269cfff65410301602508c1ad438d6f5b3ba98e77.rb":{"logical_path":"opal/rewriters/dump_args.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":611,"digest":"b6268131cb1c7150e479c80269cfff65410301602508c1ad438d6f5b3ba98e77","integrity":"sha256-tiaBMcsccVDkecgCac//ZUEDAWAlCMGtQ41vWzupjnc="},"opal/rewriters/deduplicate_arg_name.source-0e7d424fe13323e93e767c765aea0faa804b4ee5ac9c3cdcade2d5966094db57.rb":{"logical_path":"opal/rewriters/deduplicate_arg_name.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1409,"digest":"0e7d424fe13323e93e767c765aea0faa804b4ee5ac9c3cdcade2d5966094db57","integrity":"sha256-Dn1CT+EzI+k+dnx2WuoPqoBLTuWsnDzcreLVlmCU21c="},"opal/rewriters/mlhs_args.source-c491b4c2dad56a6adefdc5adfbb78f281fa2dcc9c0f45e35734bfb5a09cdea39.rb":{"logical_path":"opal/rewriters/mlhs_args.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3049,"digest":"c491b4c2dad56a6adefdc5adfbb78f281fa2dcc9c0f45e35734bfb5a09cdea39","integrity":"sha256-xJG0wtrVamre/cWt+7ePKB+i3MnA9F41c0v7WgnN6jk="},"opal/rewriters/arguments.source-d8f46b3f620b8700a99a5057ee440f0f2a9399be8c210332810e2e101aae0a77.rb":{"logical_path":"opal/rewriters/arguments.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1493,"digest":"d8f46b3f620b8700a99a5057ee440f0f2a9399be8c210332810e2e101aae0a77","integrity":"sha256-2PRrP2ILhwCpmlBX7kQPDyqTmb6MIQMygQ4uEBquCnc="},"opal/rewriters/inline_args.source-00d82368b44568f8c81e49a4d5a2ee2b0c0bf02aa47f55c730c5b8b363398056.rb":{"logical_path":"opal/rewriters/inline_args.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5777,"digest":"00d82368b44568f8c81e49a4d5a2ee2b0c0bf02aa47f55c730c5b8b363398056","integrity":"sha256-ANgjaLRFaPjIHkmk1aLuKwwL8Cqkf1XHMMW4s2M5gFY="},"opal/rewriters/numblocks.source-f75a33f2be591d99b79b1c5c748746c84240a7c921b0d183b71d1467067fbca2.rb":{"logical_path":"opal/rewriters/numblocks.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":585,"digest":"f75a33f2be591d99b79b1c5c748746c84240a7c921b0d183b71d1467067fbca2","integrity":"sha256-91oz8r5ZHZm3mxxcdIdGyEJAp8khsNGDtx0UZwZ/vKI="},"opal/rewriters/returnable_logic.source-1618e549c1ed81e4375aa63e5455e39b446c9695ad4dfdaaadbccb536c48f8f4.rb":{"logical_path":"opal/rewriters/returnable_logic.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4202,"digest":"1618e549c1ed81e4375aa63e5455e39b446c9695ad4dfdaaadbccb536c48f8f4","integrity":"sha256-FhjlScHtgeQ3WqY+VFXjm0RslpWtTf2qrbzLU2xI+PQ="},"opal/rewriters/forward_args.source-4fb90101cb11a0977b71212bf9ea00530cca00825d5d6c0591316f8d2a178e80.rb":{"logical_path":"opal/rewriters/forward_args.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2104,"digest":"4fb90101cb11a0977b71212bf9ea00530cca00825d5d6c0591316f8d2a178e80","integrity":"sha256-T7kBAcsRoJd7cSEr+eoAUwzKAIJdXWwFkTFvjSoXjoA="},"opal/rewriters/thrower_finder.source-c5219d32fc56bd7c8e82e5fe6b320ad91c6889938af14d40e90b0a3e274ee603.rb":{"logical_path":"opal/rewriters/thrower_finder.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2667,"digest":"c5219d32fc56bd7c8e82e5fe6b320ad91c6889938af14d40e90b0a3e274ee603","integrity":"sha256-xSGdMvxWvXyOguX+azIK2RxoiZOK8U1A6QsKPidO5gM="},"opal/rewriter.source-32fff58fe139f7244fa87f66adc46e4d235add89d752cd3f29ab97d4b7ccbe6e.rb":{"logical_path":"opal/rewriter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2357,"digest":"32fff58fe139f7244fa87f66adc46e4d235add89d752cd3f29ab97d4b7ccbe6e","integrity":"sha256-Mv/1j+E59yRPqH9mrcRuTSNa3YnXUs0/KauX1LfMvm4="},"opal/parser/source_buffer.source-61b789b0b2ebe0500121b8eebb10ce46c496357ccaabfa968c2e0934bc13116e.rb":{"logical_path":"opal/parser/source_buffer.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":212,"digest":"61b789b0b2ebe0500121b8eebb10ce46c496357ccaabfa968c2e0934bc13116e","integrity":"sha256-YbeJsLLr4FABIbjuuxDORsSWNXzKq/qWjC4JNLwTEW4="},"opal/parser/default_config.source-725b38eae1180c8614ff8024fdb50c5e02b3a6ae1149efd15c57e9bcf9c7ad2a.rb":{"logical_path":"opal/parser/default_config.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1192,"digest":"725b38eae1180c8614ff8024fdb50c5e02b3a6ae1149efd15c57e9bcf9c7ad2a","integrity":"sha256-cls46uEYDIYU/4Ak/bUMXgKzpq4RSe/RXFfpvPnHrSo="},"opal/parser/with_ruby_lexer.source-ac3acfedd2463df65e3ec54147b694a6947e2c95bfa0cdfd376988717c9b1f3a.rb":{"logical_path":"opal/parser/with_ruby_lexer.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":167,"digest":"ac3acfedd2463df65e3ec54147b694a6947e2c95bfa0cdfd376988717c9b1f3a","integrity":"sha256-rDrP7dJGPfZePsVBR7aUppR+LJW/oM39N2mIcXybHzo="},"opal/parser/patch.source-c09d163f1d90c4e656ab93d27ab1c730817f58b75507dbdb50d6a921e54b46fc.rb":{"logical_path":"opal/parser/patch.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4690,"digest":"c09d163f1d90c4e656ab93d27ab1c730817f58b75507dbdb50d6a921e54b46fc","integrity":"sha256-wJ0WPx2QxOZWq5PSerHHMIF/WLdVB9vbUNapIeVLRvw="},"opal/parser.source-eac055fcb3cccd920f474b295f83de67fc3a2d0fbddf2290d57a605c5693b324.rb":{"logical_path":"opal/parser.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":222,"digest":"eac055fcb3cccd920f474b295f83de67fc3a2d0fbddf2290d57a605c5693b324","integrity":"sha256-6sBV/LPMzZIPR0spX4PeZ/w6LQ+93yKQ1XpgXFaTsyQ="},"opal/fragment.source-9dfeb6c63014455b8fc06714d178b62715ed77c2e443b4ab60eb25466fd0b7c0.rb":{"logical_path":"opal/fragment.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3399,"digest":"9dfeb6c63014455b8fc06714d178b62715ed77c2e443b4ab60eb25466fd0b7c0","integrity":"sha256-nf62xjAURVuPwGcU0Xi2JxXtd8LkQ7SrYOslRm/Qt8A="},"opal/nodes/closure.source-61701fe2e741f0f8b7006beb475788bf3cb6431d23d523e2d8fcfaf611303d1b.rb":{"logical_path":"opal/nodes/closure.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":8528,"digest":"61701fe2e741f0f8b7006beb475788bf3cb6431d23d523e2d8fcfaf611303d1b","integrity":"sha256-YXAf4udB8Pi3AGvrR1eIvzy2Qx0j1SPi2Pz69hEwPRs="},"opal/nodes/helpers.source-4915c6fabe15697556648dd6dd615c2edecd1ef8949ddb73a863ba2ff71e237e.rb":{"logical_path":"opal/nodes/helpers.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3791,"digest":"4915c6fabe15697556648dd6dd615c2edecd1ef8949ddb73a863ba2ff71e237e","integrity":"sha256-SRXG+r4VaXVWZI3W3WFcLt7NHviUndtzqGO6L/ceI34="},"opal/nodes/base.source-7659dcba28b01c565569308cc375fe94831ef7ad46a157973c7d375fe1771840.rb":{"logical_path":"opal/nodes/base.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4584,"digest":"7659dcba28b01c565569308cc375fe94831ef7ad46a157973c7d375fe1771840","integrity":"sha256-dlncuiiwHFZVaTCMw3X+lIMe961GoVeXPH03X+F3GEA="},"opal/nodes/literal.source-e7c63d19f638a079cd0cb73592c0a63738bc83dc41e289d31e62aa911246d142.rb":{"logical_path":"opal/nodes/literal.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":9150,"digest":"e7c63d19f638a079cd0cb73592c0a63738bc83dc41e289d31e62aa911246d142","integrity":"sha256-58Y9GfY4oHnNDLc1ksCmNzi8g9xB4onTHmKqkRJG0UI="},"opal/nodes/variables.source-af1977a8b39bce0210f945ddfd203187038a4bb65a3ab5fadc7d750d4051ef08.rb":{"logical_path":"opal/nodes/variables.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4340,"digest":"af1977a8b39bce0210f945ddfd203187038a4bb65a3ab5fadc7d750d4051ef08","integrity":"sha256-rxl3qLObzgIQ+UXd/SAxhwOKS7ZaOrX63H11DUBR7wg="},"opal/nodes/constants.source-9dee2fcf8462ed165ee00335973717010f7473af2f6d111a6ab0a1c2efadc68c.rb":{"logical_path":"opal/nodes/constants.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2081,"digest":"9dee2fcf8462ed165ee00335973717010f7473af2f6d111a6ab0a1c2efadc68c","integrity":"sha256-ne4vz4Ri7RZe4AM1lzcXAQ90c68vbREaarChwu+txow="},"corelib/comparable.source-6ae740f39e41e4c73dbbd9609b3cfe5b06f6efcbeb1a6ad45e512220cc7dc2f1.rb":{"logical_path":"corelib/comparable.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2511,"digest":"6ae740f39e41e4c73dbbd9609b3cfe5b06f6efcbeb1a6ad45e512220cc7dc2f1","integrity":"sha256-audA855B5Mc9u9lgmzz+Wwb278vrGmrUXlEiIMx9wvE="},"pathname.source-4af5fbc18a6508347db78ac4925d3ec2cc25b66b8e64b5e22658f401d1c8bde7.rb":{"logical_path":"pathname.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5216,"digest":"4af5fbc18a6508347db78ac4925d3ec2cc25b66b8e64b5e22658f401d1c8bde7","integrity":"sha256-SvX7wYplCDR9t4rEkl0+wswltmuOZLXiJlj0AdHIvec="},"opal/nodes/call.source-c48dc207235fddcff1b0bcda050f5b0bd1309bbfa01d8186ce8e794787b10d95.rb":{"logical_path":"opal/nodes/call.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":16076,"digest":"c48dc207235fddcff1b0bcda050f5b0bd1309bbfa01d8186ce8e794787b10d95","integrity":"sha256-xI3CByNf3c/xsLzaBQ9bC9Ewm7+gHYGGzo55R4exDZU="},"opal/nodes/call_special.source-9ff7b96524a95b4062ca6ab4ced1a560d1fe8991db9d04f1b94d25a0bdb9172c.rb":{"logical_path":"opal/nodes/call_special.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3734,"digest":"9ff7b96524a95b4062ca6ab4ced1a560d1fe8991db9d04f1b94d25a0bdb9172c","integrity":"sha256-n/e5ZSSpW0Biymq0ztGlYNH+iZHbnQTxuU0loL25Fyw="},"opal/nodes/scope.source-364d5f744bd417d460fb47772495cccf9acecb94413df8658815cdb26aea84a6.rb":{"logical_path":"opal/nodes/scope.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":9392,"digest":"364d5f744bd417d460fb47772495cccf9acecb94413df8658815cdb26aea84a6","integrity":"sha256-Nk1fdEvUF9Rg+0d3JJXMz5rOy5RBPfhliBXNsmrqhKY="},"opal/nodes/module.source-1ce7c0c61c98853e523e079b76d8b3207a4bdfc93f7f12526959d0130b84ac1e.rb":{"logical_path":"opal/nodes/module.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1767,"digest":"1ce7c0c61c98853e523e079b76d8b3207a4bdfc93f7f12526959d0130b84ac1e","integrity":"sha256-HOfAxhyYhT5SPgebdtizIHpL38k/fxJSaVnQEwuErB4="},"opal/nodes/class.source-ca22f2475cb60ee24354a640f27179a3cbaded644124d0ffdcfe6ad5da8945e3.rb":{"logical_path":"opal/nodes/class.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1338,"digest":"ca22f2475cb60ee24354a640f27179a3cbaded644124d0ffdcfe6ad5da8945e3","integrity":"sha256-yiLyR1y2DuJDVKZA8nF5o8ut7WRBJND/3P5q1dqJReM="},"opal/nodes/singleton_class.source-0ea1443d8433a8d96b3d24e9ca318e88555986cf8fe2ee263489cc906c7f0a6f.rb":{"logical_path":"opal/nodes/singleton_class.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":652,"digest":"0ea1443d8433a8d96b3d24e9ca318e88555986cf8fe2ee263489cc906c7f0a6f","integrity":"sha256-DqFEPYQzqNlrPSTpyjGOiFVZhs+P4u4mNInMkGx/Cm8="},"opal/nodes/args/arg.source-8d5d2450446c50a6cf9061e8dbcb0266c43c4223b44400ccb5c4dcb04afac3ae.rb":{"logical_path":"opal/nodes/args/arg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":375,"digest":"8d5d2450446c50a6cf9061e8dbcb0266c43c4223b44400ccb5c4dcb04afac3ae","integrity":"sha256-jV0kUERsUKbPkGHo28sCZsQ8QiO0RADMtcTcsEr6w64="},"opal/nodes/args/arity_check.source-0b4f697fd70e5cd42e1501a8b60cc9b20d6ee580feead711ddbb53a7bc8d85c5.rb":{"logical_path":"opal/nodes/args/arity_check.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3846,"digest":"0b4f697fd70e5cd42e1501a8b60cc9b20d6ee580feead711ddbb53a7bc8d85c5","integrity":"sha256-C09pf9cOXNQuFQGotgzJsg1u5YD+6tcR3btTp7yNhcU="},"opal/nodes/args/ensure_kwargs_are_kwargs.source-980baec81aa4b014263336a90ec17417c1a682c9e04e3e1c509d8f7318ea8d12.rb":{"logical_path":"opal/nodes/args/ensure_kwargs_are_kwargs.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":492,"digest":"980baec81aa4b014263336a90ec17417c1a682c9e04e3e1c509d8f7318ea8d12","integrity":"sha256-mAuuyBqksBQmMzapDsF0F8GmgsngTj4cUJ2PcxjqjRI="},"opal/nodes/args/extract_block_arg.source-6a85d2bb6011fb580f3c05ef965ca281dfbf38a778c5c4878ae9b9b3d8809217.rb":{"logical_path":"opal/nodes/args/extract_block_arg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":569,"digest":"6a85d2bb6011fb580f3c05ef965ca281dfbf38a778c5c4878ae9b9b3d8809217","integrity":"sha256-aoXSu2AR+1gPPAXvllyigd+/OKd4xcSHium5s9iAkhc="},"opal/nodes/args/extract_kwarg.source-7ea9c9432b9fba0d27b3bbfdc935b97386d6ee9abe6138e98906d76464c76cc2.rb":{"logical_path":"opal/nodes/args/extract_kwarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":708,"digest":"7ea9c9432b9fba0d27b3bbfdc935b97386d6ee9abe6138e98906d76464c76cc2","integrity":"sha256-fqnJQyufug0ns7v9yTW5c4bW7pq+YTjpiQbXZGTHbMI="},"opal/nodes/args/extract_kwargs.source-57fd41af5899f069aa69688b30d0713c373d97c244a33c71f3bc7114031f1bf8.rb":{"logical_path":"opal/nodes/args/extract_kwargs.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":637,"digest":"57fd41af5899f069aa69688b30d0713c373d97c244a33c71f3bc7114031f1bf8","integrity":"sha256-V/1Br1iZ8GmqaWiLMNBxPDc9l8JEozxx87xxFAMfG/g="},"opal/nodes/args/extract_kwoptarg.source-1fb3f7119fa8fcf230e98e5599afd9a7cdf9bf559704892d74cbd4cde3d07feb.rb":{"logical_path":"opal/nodes/args/extract_kwoptarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":870,"digest":"1fb3f7119fa8fcf230e98e5599afd9a7cdf9bf559704892d74cbd4cde3d07feb","integrity":"sha256-H7P3EZ+o/PIw6Y5Vma/Zp835v1WXBIktdMvUzePQf+s="},"opal/nodes/args/extract_kwrestarg.source-2e32668aed5dec1f77dc615d9374748cb1bb0f063ec612e91d1ba76e6c4bd14c.rb":{"logical_path":"opal/nodes/args/extract_kwrestarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":912,"digest":"2e32668aed5dec1f77dc615d9374748cb1bb0f063ec612e91d1ba76e6c4bd14c","integrity":"sha256-LjJmiu1d7B933GFdk3R0jLG7DwY+xhLpHRunbmxL0Uw="},"opal/nodes/args/extract_optarg.source-4973e4bd89aebde7abf99d0713e23d304c519e51be77a8a91e697c02c12b1a1b.rb":{"logical_path":"opal/nodes/args/extract_optarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":896,"digest":"4973e4bd89aebde7abf99d0713e23d304c519e51be77a8a91e697c02c12b1a1b","integrity":"sha256-SXPkvYmuveer+Z0HE+I9MExRnlG+d6ipHml8AsErGhs="},"opal/nodes/args/extract_post_arg.source-2f45dcaf1dfcb2ceb236339492b5cb0f72e4bd44a214dfc1f7f8c644250cfbb6.rb":{"logical_path":"opal/nodes/args/extract_post_arg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":489,"digest":"2f45dcaf1dfcb2ceb236339492b5cb0f72e4bd44a214dfc1f7f8c644250cfbb6","integrity":"sha256-L0Xcrx38ss6yNjOUkrXLD3LkvUSiFN/B9/jGRCUM+7Y="},"opal/nodes/args/extract_post_optarg.source-87acad22bc6cf033ad56d23b9fc7257291af371e1272f88fe5454f2c66fc711c.rb":{"logical_path":"opal/nodes/args/extract_post_optarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":895,"digest":"87acad22bc6cf033ad56d23b9fc7257291af371e1272f88fe5454f2c66fc711c","integrity":"sha256-h6ytIrxs8DOtVtI7n8clcpGvNx4ScviP5UVPLGb8cRw="},"opal/nodes/args/extract_restarg.source-07348cbf0070549ee56e5f6dab3ea5f49875209f82248f77a9239f38801f5b4d.rb":{"logical_path":"opal/nodes/args/extract_restarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":974,"digest":"07348cbf0070549ee56e5f6dab3ea5f49875209f82248f77a9239f38801f5b4d","integrity":"sha256-BzSMvwBwVJ7lbl9tqz6l9Jh1IJ+CJI93qSOfOIAfW00="},"opal/nodes/args/fake_arg.source-0eedc329de139f44dc91961c2f04b9d58872e38219da177944baacf3162789fa.rb":{"logical_path":"opal/nodes/args/fake_arg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":560,"digest":"0eedc329de139f44dc91961c2f04b9d58872e38219da177944baacf3162789fa","integrity":"sha256-Du3DKd4Tn0TckZYcLwS51Yhy44IZ2hd5RLqs8xYnifo="},"opal/nodes/args/initialize_iterarg.source-1ce56fbb913210226852184a0af760aad726e2a70bef5a28ae3541d1f56e35e2.rb":{"logical_path":"opal/nodes/args/initialize_iterarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":541,"digest":"1ce56fbb913210226852184a0af760aad726e2a70bef5a28ae3541d1f56e35e2","integrity":"sha256-HOVvu5EyECJoUhhKCvdgqtcm4qcL71oorjVB0fVuNeI="},"opal/nodes/args/initialize_shadowarg.source-16bc5e6e66bc8601eed5a638c5ae19f52248642f18c4b3aa9d992cebfe1772b7.rb":{"logical_path":"opal/nodes/args/initialize_shadowarg.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":454,"digest":"16bc5e6e66bc8601eed5a638c5ae19f52248642f18c4b3aa9d992cebfe1772b7","integrity":"sha256-Frxebma8hgHu1aY4xa4Z9SJIZC8YxLOqnZks6/4Xcrc="},"opal/nodes/args/parameters.source-f0111f3975a6322fe945978d480dd0958fdf1166dfe3911d8fe8446a65ffaf19.rb":{"logical_path":"opal/nodes/args/parameters.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1669,"digest":"f0111f3975a6322fe945978d480dd0958fdf1166dfe3911d8fe8446a65ffaf19","integrity":"sha256-8BEfOXWmMi/pRZeNSA3QlY/fEWbf45Edj+hEamX/rxk="},"opal/nodes/args/prepare_post_args.source-4fc872ee92352be9cc57730c078ce43d8e455e9beabc4912546c3670cccd21ba.rb":{"logical_path":"opal/nodes/args/prepare_post_args.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":576,"digest":"4fc872ee92352be9cc57730c078ce43d8e455e9beabc4912546c3670cccd21ba","integrity":"sha256-T8hy7pI1K+nMV3MMB4zkPY5FXpvqvEkSVGw2cMzNIbo="},"opal/nodes/args.source-345dd14ece705f6a8d8c8184c0aa217df51744e35ecd71d102a2fa80c8918b11.rb":{"logical_path":"opal/nodes/args.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1008,"digest":"345dd14ece705f6a8d8c8184c0aa217df51744e35ecd71d102a2fa80c8918b11","integrity":"sha256-NF3RTs5wX2qNjIGEwKohffUXRONezXHRAqL6gMiRixE="},"opal/nodes/node_with_args/shortcuts.source-c2decc753ed2daf7beb6517deb8a83002c2ecd6f57eff7b0de621ccd98b5663a.rb":{"logical_path":"opal/nodes/node_with_args/shortcuts.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3037,"digest":"c2decc753ed2daf7beb6517deb8a83002c2ecd6f57eff7b0de621ccd98b5663a","integrity":"sha256-wt7MdT7S2ve+tlF964qDACwuzW9X7/ew3mIczZi1Zjo="},"opal/nodes/node_with_args.source-b9042d63c9378b2fa3089450122ee741d9a2c897b0b750150cae548ad40d42c5.rb":{"logical_path":"opal/nodes/node_with_args.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":886,"digest":"b9042d63c9378b2fa3089450122ee741d9a2c897b0b750150cae548ad40d42c5","integrity":"sha256-uQQtY8k3iy+jCJRQEi7nQdmiyJewt1AVDK5UitQNQsU="},"opal/nodes/iter.source-1002ee2fd151097bcf980ffacfdf9c23b6107728846005bd353fa89fa211926c.rb":{"logical_path":"opal/nodes/iter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3746,"digest":"1002ee2fd151097bcf980ffacfdf9c23b6107728846005bd353fa89fa211926c","integrity":"sha256-EALuL9FRCXvPmA/6z9+cI7YQdyiEYAW9NT+on6IRkmw="},"opal/nodes/def.source-14774520b7164f94594c10cef0eadbfddff59900e89850ccb1af67ffbae6ad4b.rb":{"logical_path":"opal/nodes/def.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2202,"digest":"14774520b7164f94594c10cef0eadbfddff59900e89850ccb1af67ffbae6ad4b","integrity":"sha256-FHdFILcWT5RZTBDO8Orb/d/1mQDomFDMsa9n/7rmrUs="},"opal/nodes/defs.source-17c910cf0f4da688af691125109e85fbda464a49b7e322d7d6e14fa74568bfd7.rb":{"logical_path":"opal/nodes/defs.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":335,"digest":"17c910cf0f4da688af691125109e85fbda464a49b7e322d7d6e14fa74568bfd7","integrity":"sha256-F8kQzw9NpoivaRElEJ6F+9pGSkm34yLX1uFPp0Vov9c="},"opal/ast/matcher.source-704b0a37637c831e85d7fb52b1b836077b0f918b3a0266dc292c1e81a717acba.rb":{"logical_path":"opal/ast/matcher.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1772,"digest":"704b0a37637c831e85d7fb52b1b836077b0f918b3a0266dc292c1e81a717acba","integrity":"sha256-cEsKN2N8gx6F1/tSsbg2B3sPkYs6AmbcKSwegacXrLo="},"opal/nodes/if.source-51f92ca049aa5101785d1b0e007b0be29328333c0e158aa9fb64352cc7441266.rb":{"logical_path":"opal/nodes/if.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":13093,"digest":"51f92ca049aa5101785d1b0e007b0be29328333c0e158aa9fb64352cc7441266","integrity":"sha256-UfksoEmqUQF4XRsOAHsL4pMoMzwOFYqp+2Q1LMdEEmY="},"opal/nodes/logic.source-2debb04deb82f64adedca33ad7e7c5908cc097bc6898374a210c996a73600239.rb":{"logical_path":"opal/nodes/logic.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2195,"digest":"2debb04deb82f64adedca33ad7e7c5908cc097bc6898374a210c996a73600239","integrity":"sha256-LeuwTeuC9kre3KM61+fFkIzAl7xomDdKIQyZanNgAjk="},"opal/nodes/definitions.source-b5b8ebc9901ca181ca2170c7b17308a3d1ea15ec5c4710df703ee42d412d4300.rb":{"logical_path":"opal/nodes/definitions.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2997,"digest":"b5b8ebc9901ca181ca2170c7b17308a3d1ea15ec5c4710df703ee42d412d4300","integrity":"sha256-tbjryZAcoYHKIXDHsXMIo9HqFexcRxDfcD7kLUEtQwA="},"opal/nodes/yield.source-9c3ffb95e0c2a999719ecce959649499ba79a57c181f6aee839fd4adf0de02e1.rb":{"logical_path":"opal/nodes/yield.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1537,"digest":"9c3ffb95e0c2a999719ecce959649499ba79a57c181f6aee839fd4adf0de02e1","integrity":"sha256-nD/7leDCqZlxnszpWWSUmbp5pXwYH2rug5/UrfDeAuE="},"opal/nodes/rescue.source-51619b81b4fc4e0bfefe024b98a520c0d3f6e53ffdee44b7b75c7ed719d201ff.rb":{"logical_path":"opal/nodes/rescue.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5943,"digest":"51619b81b4fc4e0bfefe024b98a520c0d3f6e53ffdee44b7b75c7ed719d201ff","integrity":"sha256-UWGbgbT8Tgv+/gJLmKUgwNP25T/97kS3t1x+1xnSAf8="},"opal/nodes/super.source-29e8f086d8a16a9d9be5259065a0c0af5c072ce62a1726b79ff876bfeb42dffd.rb":{"logical_path":"opal/nodes/super.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5292,"digest":"29e8f086d8a16a9d9be5259065a0c0af5c072ce62a1726b79ff876bfeb42dffd","integrity":"sha256-Kejwhtihap2b5SWQZaDAr1wHLOYqFya3n/h2v+tC3/0="},"json.source-b865f9c6664a1747fa62b4a9585dff5d367de647b7e8e3a08410116640579941.rb":{"logical_path":"json.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3627,"digest":"b865f9c6664a1747fa62b4a9585dff5d367de647b7e8e3a08410116640579941","integrity":"sha256-uGX5xmZKF0f6YrSpWF3/XTZ95ke36OOghBARZkBXmUE="},"opal/version.source-e3809d99ad3702cb6ef488218066728fb7f889c0ddad3e794785906cdcab4379.rb":{"logical_path":"opal/version.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":164,"digest":"e3809d99ad3702cb6ef488218066728fb7f889c0ddad3e794785906cdcab4379","integrity":"sha256-44Cdma03Astu9IghgGZyj7f4icDdrT55R4WQbNyrQ3k="},"opal/nodes/top.source-358838f769b2856651e5b09f35d4a09f85f8d72038e7d132e54026648a2f303a.rb":{"logical_path":"opal/nodes/top.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4287,"digest":"358838f769b2856651e5b09f35d4a09f85f8d72038e7d132e54026648a2f303a","integrity":"sha256-NYg492myhWZR5bCfNdSgn4X41yA459Ey5UAmZIovMDo="},"opal/nodes/while.source-21679024f6c30e20c60ebea952c6ed64a5d92b0f7a7e983ba22ae2da965bd61a.rb":{"logical_path":"opal/nodes/while.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2698,"digest":"21679024f6c30e20c60ebea952c6ed64a5d92b0f7a7e983ba22ae2da965bd61a","integrity":"sha256-IWeQJPbDDiDGDr6pUsbtZKXZKw96fpg7oiri2pZb1ho="},"opal/nodes/hash.source-bbc17f118949262dbb74e7375d56eeaf059dd4180ab294ff5ae932b13a393648.rb":{"logical_path":"opal/nodes/hash.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2525,"digest":"bbc17f118949262dbb74e7375d56eeaf059dd4180ab294ff5ae932b13a393648","integrity":"sha256-u8F/EYlJJi27dOc3XVburwWd1BgKspT/WukysTo5Nkg="},"opal/nodes/array.source-03c3f566655b4b61125e309e63f5cd06b7d8e986a2bbe8bd379c584791f6fb6c.rb":{"logical_path":"opal/nodes/array.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1315,"digest":"03c3f566655b4b61125e309e63f5cd06b7d8e986a2bbe8bd379c584791f6fb6c","integrity":"sha256-A8P1ZmVbS2ESXjCeY/XNBrfY6Yaiu+i9N5xYR5H2+2w="},"opal/nodes/defined.source-f29e732cf1c11cc81e3a19cf954f1f98c871596d2949079e46ad38d7b0388583.rb":{"logical_path":"opal/nodes/defined.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6422,"digest":"f29e732cf1c11cc81e3a19cf954f1f98c871596d2949079e46ad38d7b0388583","integrity":"sha256-8p5zLPHBHMgeOhnPlU8fmMhxWW0pSQeeRq0417A4hYM="},"opal/nodes/masgn.source-3323dcd78ccf976fef2b06d015ac4a3c3b685f047d73abb8f915d5190fd56cd8.rb":{"logical_path":"opal/nodes/masgn.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3404,"digest":"3323dcd78ccf976fef2b06d015ac4a3c3b685f047d73abb8f915d5190fd56cd8","integrity":"sha256-MyPc14zPl2/vKwbQFaxKPDtoXwR9c6u4+RXVGQ/VbNg="},"opal/nodes/arglist.source-5cc6bfac539eb067375d8c5a66f977ce76431afdcf0647da43d95d8aeea83af4.rb":{"logical_path":"opal/nodes/arglist.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1229,"digest":"5cc6bfac539eb067375d8c5a66f977ce76431afdcf0647da43d95d8aeea83af4","integrity":"sha256-XMa/rFOesGc3XYxaZvl3znZDGv3PBkfaQ9ldiu6oOvQ="},"opal/nodes/x_string.source-8d1e9b92363cc3880c2a31b91f7679c694d8f99c1ddf22338738d9859d4e6593.rb":{"logical_path":"opal/nodes/x_string.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4608,"digest":"8d1e9b92363cc3880c2a31b91f7679c694d8f99c1ddf22338738d9859d4e6593","integrity":"sha256-jR6bkjY8w4gMKjG5H3Z5xpTY+Zwd3yIzhzjZhZ1OZZM="},"opal/nodes/lambda.source-3ad0ff2fa933e061a26c44a5419b6b6e61848087abe6ad51379a78ad9c040949.rb":{"logical_path":"opal/nodes/lambda.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":313,"digest":"3ad0ff2fa933e061a26c44a5419b6b6e61848087abe6ad51379a78ad9c040949","integrity":"sha256-OtD/L6kz4GGibESlQZtrbmGEgIer5q1RN5p4rZwECUk="},"opal/nodes.source-a06e9fca039a76d955658c837683e297c1469a40397653dda6fecd5a3b44dcc3.rb":{"logical_path":"opal/nodes.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":884,"digest":"a06e9fca039a76d955658c837683e297c1469a40397653dda6fecd5a3b44dcc3","integrity":"sha256-oG6fygOadtlVZYyDdoPil8FGmkA5dlPdpv7NWjtE3MM="},"opal/eof_content.source-e3a9ba6ecfd5a7fb18b95aefd9c3a42aa3b15b0e8cec82d79ca0d52d3e7fb269.rb":{"logical_path":"opal/eof_content.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1029,"digest":"e3a9ba6ecfd5a7fb18b95aefd9c3a42aa3b15b0e8cec82d79ca0d52d3e7fb269","integrity":"sha256-46m6bs/Vp/sYuVrv2cOkKqOxWw6M7ILXnKDVLT5/smk="},"opal/errors.source-fb67e0c10d23fbcd654523c4b8a295a2dd106e0cd900f3fb9f1a582cc48d4166.rb":{"logical_path":"opal/errors.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1997,"digest":"fb67e0c10d23fbcd654523c4b8a295a2dd106e0cd900f3fb9f1a582cc48d4166","integrity":"sha256-+2fgwQ0j+81lRSPEuKKVot0QbgzZAPP7nxpYLMSNQWY="},"opal/magic_comments.source-a5059e1a7f2f33f7a4975316d31918090e9b02d9601a87da2672dda31f98053f.rb":{"logical_path":"opal/magic_comments.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":860,"digest":"a5059e1a7f2f33f7a4975316d31918090e9b02d9601a87da2672dda31f98053f","integrity":"sha256-pQWeGn8vM/ekl1MW0xkYCQ6bAtlgGofaJnLdox+YBT8="},"opal/source_map/map.source-efdd58648b9911055d0a91aa72e18e349ca37570013261708aa029a72a052bcb.rb":{"logical_path":"opal/source_map/map.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":771,"digest":"efdd58648b9911055d0a91aa72e18e349ca37570013261708aa029a72a052bcb","integrity":"sha256-791YZIuZEQVdCpGqcuGONJyjdXABMmFwiqAppyoFK8s="},"opal/source_map/file.source-11e0f7ecb939ecd146987e36b9f4b8a2b7f41f71f3735ea4ba0f677da856ed67.rb":{"logical_path":"opal/source_map/file.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":7807,"digest":"11e0f7ecb939ecd146987e36b9f4b8a2b7f41f71f3735ea4ba0f677da856ed67","integrity":"sha256-EeD37Lk57NFGmH42ufS4orf0H3Hzc16kug9nfahW7Wc="},"opal/source_map/index.source-1f72a1a208d444b4ac047cbbb06704bccec77896d9aac98dc3b792ba829da65b.rb":{"logical_path":"opal/source_map/index.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2687,"digest":"1f72a1a208d444b4ac047cbbb06704bccec77896d9aac98dc3b792ba829da65b","integrity":"sha256-H3KhogjURLSsBHy7sGcEvM7HeJbZqsmNw7eSuoKdpls="},"opal/source_map/vlq.source-1262a66cc794d867f086a703fe1cbdf94038125f5002eab3f961e8dfd57ce437.rb":{"logical_path":"opal/source_map/vlq.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2567,"digest":"1262a66cc794d867f086a703fe1cbdf94038125f5002eab3f961e8dfd57ce437","integrity":"sha256-EmKmbMeU2GfwhqcD/hy9+UA4El9QAuqz+WHo39V85Dc="},"opal/source_map.source-c31ead9775b0c66a9db73db136269b863bd688f923f6b03fb3dfbff1bf780489.rb":{"logical_path":"opal/source_map.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":396,"digest":"c31ead9775b0c66a9db73db136269b863bd688f923f6b03fb3dfbff1bf780489","integrity":"sha256-wx6tl3Wwxmqdtz2xNiabhjvWiPkj9rA/s9+/8b94BIk="},"opal/compiler.source-e403fe4c219cc7500c997c59a45775415cd7c8f4f323da8ce93e7ff937fa0df6.rb":{"logical_path":"opal/compiler.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":20113,"digest":"e403fe4c219cc7500c997c59a45775415cd7c8f4f323da8ce93e7ff937fa0df6","integrity":"sha256-5AP+TCGcx1AMmXxZpFd1QVzXyPTzI9qM6T5/+Tf6DfY="},"opal/erb.source-c28c99c3cbe2c1cea8baa86979fa4eaad4fc069750f27a86cb1cef306014d6e8.rb":{"logical_path":"opal/erb.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2431,"digest":"c28c99c3cbe2c1cea8baa86979fa4eaad4fc069750f27a86cb1cef306014d6e8","integrity":"sha256-woyZw8viwc6ouqhpefpOqtT8BpdQ8nqGyxzvMGAU1ug="},"opal-parser.source-5d6f2ad0f5161a55ca662eb7587ef300f719556d4f526b805ce9dae78c367b38.rb":{"logical_path":"opal-parser.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2154,"digest":"5d6f2ad0f5161a55ca662eb7587ef300f719556d4f526b805ce9dae78c367b38","integrity":"sha256-XW8q0PUWGlXKZi63WH7zAPcZVW1PUmuAXOna54w2ezg="},"load-parser.source.js-18a0a131bf97d1a19b0b875bcf7a57e061ad1d8822fbf5a5699707793de11cfb.rb":{"logical_path":"load-parser.source.js.rb","mtime":"2023-11-09T11:34:39+00:00","size":91,"digest":"18a0a131bf97d1a19b0b875bcf7a57e061ad1d8822fbf5a5699707793de11cfb","integrity":"sha256-GKChMb+X0aGbC4dbz3pX4GGtHYgi+/WlaZcHeT3hHPs="},"application.debug-f885af64520b10f24d2e46f68e925180dcf3dd5811d11be92629e51696a0389f.js":{"logical_path":"application.debug.js","mtime":"2023-11-09T11:34:39+00:00","size":784944,"digest":"f885af64520b10f24d2e46f68e925180dcf3dd5811d11be92629e51696a0389f","integrity":"sha256-+IWvZFILEPJNLkb2jpJRgNzz3VgR0RvpJinlFpagOJ8="},"application-74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80.js":{"logical_path":"application.js","mtime":"2023-11-09T11:34:39+00:00","size":784838,"digest":"74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80","integrity":"sha256-dJlKdBCBiUfClKX0S495FtXhx3PpOlosg9ucBtUW/YA="},"application.js-fefc1e2760e062a33b165fb45b0e0ef13e4bdc35d1f65975b492fe858c2136cf.map":{"logical_path":"application.js.map","mtime":"2023-11-09T11:34:39+00:00","size":438110,"digest":"fefc1e2760e062a33b165fb45b0e0ef13e4bdc35d1f65975b492fe858c2136cf","integrity":"sha256-/vweJ2DgYqM7Fl+0Ww4O8T5L3DXR9ll1tJL+hYwhNs8="},"corelib/runtime.source-6a5a2cf851d99ea1fb6eab3f4c324f66d8fc21426515c040dca3489a5a86eb70.js":{"logical_path":"corelib/runtime.source.js","mtime":"2023-11-09T11:34:39+00:00","size":95395,"digest":"6a5a2cf851d99ea1fb6eab3f4c324f66d8fc21426515c040dca3489a5a86eb70","integrity":"sha256-alos+FHZnqH7bqs/TDJPZtj8IUJlFcBA3KNImlqG63A="},"corelib/helpers.source-098704fe3cd4d2bb51daa51fc1ecb610bd5584fd3a02011d2d1c39daa19ec7b8.rb":{"logical_path":"corelib/helpers.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5283,"digest":"098704fe3cd4d2bb51daa51fc1ecb610bd5584fd3a02011d2d1c39daa19ec7b8","integrity":"sha256-CYcE/jzU0rtR2qUfwey2EL1VhP06AgEdLRw52qGex7g="},"corelib/module.source-74e15d4257ba5112a9b6922c3675bfb7064aeb1acd92f1f5bf40345a66f04a78.rb":{"logical_path":"corelib/module.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":20625,"digest":"74e15d4257ba5112a9b6922c3675bfb7064aeb1acd92f1f5bf40345a66f04a78","integrity":"sha256-dOFdQle6URKptpIsNnW/twZK6xrNkvH1v0A0WmbwSng="},"corelib/class.source-6ac4292f7e727b499f679a4be5e22ca77533509714c7d8c87c429250b05d38ae.rb":{"logical_path":"corelib/class.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2503,"digest":"6ac4292f7e727b499f679a4be5e22ca77533509714c7d8c87c429250b05d38ae","integrity":"sha256-asQpL35ye0mfZ5pL5eIsp3UzUJcUx9jIfEKSULBdOK4="},"corelib/basic_object.source-c9f2ae6f9828520598d297ff62bd1d72086dc6f271cd63f0da8daf654e00d7d0.rb":{"logical_path":"corelib/basic_object.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3329,"digest":"c9f2ae6f9828520598d297ff62bd1d72086dc6f271cd63f0da8daf654e00d7d0","integrity":"sha256-yfKub5goUgWY0pf/Yr0dcghtxvJxzWPw2o2vZU4A19A="},"corelib/kernel.source-4496dc29bcb0623813ec9c3cde538d2a3e6839593b93ec478cc3aa24a1a963fb.rb":{"logical_path":"corelib/kernel.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":19326,"digest":"4496dc29bcb0623813ec9c3cde538d2a3e6839593b93ec478cc3aa24a1a963fb","integrity":"sha256-RJbcKbywYjgT7Jw83lONKj5oOVk7k+xHjMOqJKGpY/s="},"corelib/main.source-117fdb7af0b8c1642859e35713a278f05fe11725c23d81f705018d1c605e0f53.rb":{"logical_path":"corelib/main.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":329,"digest":"117fdb7af0b8c1642859e35713a278f05fe11725c23d81f705018d1c605e0f53","integrity":"sha256-EX/bevC4wWQoWeNXE6J48F/hFyXCPYH3BQGNHGBeD1M="},"corelib/error/errno.source-ca296bcfdf36d407edbcb3fa71e8b7718c94dce141a8a87e37881aadf23b80cd.rb":{"logical_path":"corelib/error/errno.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1139,"digest":"ca296bcfdf36d407edbcb3fa71e8b7718c94dce141a8a87e37881aadf23b80cd","integrity":"sha256-yilrz9821AftvLP6cei3cYyU3OFBqKh+N4garfI7gM0="},"corelib/error.source-f23645cbb2065bfe2c1231e3851e9bfc9fd8a3b153bca37073a839997e98237c.rb":{"logical_path":"corelib/error.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":8918,"digest":"f23645cbb2065bfe2c1231e3851e9bfc9fd8a3b153bca37073a839997e98237c","integrity":"sha256-8jZFy7IGW/4sEjHjhR6b/J/Yo7FTvKNwc6g5mX6YI3w="},"corelib/constants.source-e79144fd86e6b20f2b49c62a5d37b60ffaf47f11db81d1363991639df141a01f.rb":{"logical_path":"corelib/constants.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":421,"digest":"e79144fd86e6b20f2b49c62a5d37b60ffaf47f11db81d1363991639df141a01f","integrity":"sha256-55FE/Ybmsg8rScYqXTe2D/r0fxHbgdE2OZFjnfFBoB8="},"opal/base.source-55abc823c216010fd952e74b44c669aa82652aced413b1d59af35133542353cf.rb":{"logical_path":"opal/base.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":314,"digest":"55abc823c216010fd952e74b44c669aa82652aced413b1d59af35133542353cf","integrity":"sha256-VavII8IWAQ/ZUudLRMZpqoJlKs7UE7HVmvNRM1QjU88="},"corelib/nil.source-d65ee9c3403849589db650b9ddbf0bafe912d5481bf5fcf3cf6c492a3ee04bf2.rb":{"logical_path":"corelib/nil.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":977,"digest":"d65ee9c3403849589db650b9ddbf0bafe912d5481bf5fcf3cf6c492a3ee04bf2","integrity":"sha256-1l7pw0A4SVidtlC53b8Lr+kS1Ugb9fzzz2xJKj7gS/I="},"corelib/boolean.source-5020f3d8692e3eeb1bc1d2daeb9fa0be955052788dbc702db146ced433569493.rb":{"logical_path":"corelib/boolean.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2851,"digest":"5020f3d8692e3eeb1bc1d2daeb9fa0be955052788dbc702db146ced433569493","integrity":"sha256-UCDz2GkuPusbwdLa65+gvpVQUniNvHAtsUbO1DNWlJM="},"corelib/regexp.source-c31394a97f067e5b5260844ade4b891f568b331638a038aaf7a240638a520a78.rb":{"logical_path":"corelib/regexp.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":12124,"digest":"c31394a97f067e5b5260844ade4b891f568b331638a038aaf7a240638a520a78","integrity":"sha256-wxOUqX8GfltSYIRK3kuJH1aLMxY4oDiq96JAY4pSCng="},"corelib/string.source-87d008e7c0faa9a99219a0288c20bbdf19ab4cfdebaab9121c3b1030b29e3b5a.rb":{"logical_path":"corelib/string.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":48541,"digest":"87d008e7c0faa9a99219a0288c20bbdf19ab4cfdebaab9121c3b1030b29e3b5a","integrity":"sha256-h9AI58D6qamSGaAojCC73xmrTP3rqrkSHDsQMLKeO1o="},"corelib/enumerable.source-aabe09b8461c48d5b4f9ac021caf5fb561d30ec76415f4bfffeecce0fa593269.rb":{"logical_path":"corelib/enumerable.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":26578,"digest":"aabe09b8461c48d5b4f9ac021caf5fb561d30ec76415f4bfffeecce0fa593269","integrity":"sha256-qr4JuEYcSNW0+awCHK9ftWHTDsdkFfS//+7M4PpZMmk="},"corelib/enumerator/arithmetic_sequence.source-37b39c4bf3514dda60c0c84cb5f279528063e7be16d55e04efa0dc608af6484e.rb":{"logical_path":"corelib/enumerator/arithmetic_sequence.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4174,"digest":"37b39c4bf3514dda60c0c84cb5f279528063e7be16d55e04efa0dc608af6484e","integrity":"sha256-N7OcS/NRTdpgwMhMtfJ5UoBj574W1V4E76DcYIr2SE4="},"corelib/enumerator/chain.source-d6e40c167f5f3479e4c9913e35ac1a4f8db519c39486c82858c555af3918d3eb.rb":{"logical_path":"corelib/enumerator/chain.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":896,"digest":"d6e40c167f5f3479e4c9913e35ac1a4f8db519c39486c82858c555af3918d3eb","integrity":"sha256-1uQMFn9fNHnkyZE+NawaT421GcOUhsgoWMVVrzkY0+s="},"corelib/enumerator/generator.source-9a9f9f4e152a0164a894fd263fc4d60605fcc184f6e8b898fb03117953f94b09.rb":{"logical_path":"corelib/enumerator/generator.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":664,"digest":"9a9f9f4e152a0164a894fd263fc4d60605fcc184f6e8b898fb03117953f94b09","integrity":"sha256-mp+fThUqAWSolP0mP8TWBgX8wYT26LiY+wMReVP5Swk="},"corelib/enumerator/lazy.source-0ff176e17644692a9ac0d9e2e8b015cbdb9cc8ebb450f3cc9fa0dee8dc908107.rb":{"logical_path":"corelib/enumerator/lazy.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5643,"digest":"0ff176e17644692a9ac0d9e2e8b015cbdb9cc8ebb450f3cc9fa0dee8dc908107","integrity":"sha256-D/F24XZEaSqawNni6LAVy9ucyOu0UPPMn6De6NyQgQc="},"corelib/enumerator/yielder.source-9dc42b00f789765de111f3a82e5ad90502fb39e830be9c2a7d09e17e70237034.rb":{"logical_path":"corelib/enumerator/yielder.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":570,"digest":"9dc42b00f789765de111f3a82e5ad90502fb39e830be9c2a7d09e17e70237034","integrity":"sha256-ncQrAPeJdl3hEfOoLlrZBQL7OegwvpwqfQnhfnAjcDQ="},"corelib/enumerator.source-230900b104b66f027879b18af04cf02b4b81d3d4dcc7f630eb49d526fbaca7ef.rb":{"logical_path":"corelib/enumerator.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2958,"digest":"230900b104b66f027879b18af04cf02b4b81d3d4dcc7f630eb49d526fbaca7ef","integrity":"sha256-IwkAsQS2bwJ4ebGK8EzwK0uB09Tcx/Yw60nVJvusp+8="},"corelib/numeric.source-16c3c8db76d183fa8775cce038960f6ef64a9a6b5df54bfa8169775c45a9ce8c.rb":{"logical_path":"corelib/numeric.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6572,"digest":"16c3c8db76d183fa8775cce038960f6ef64a9a6b5df54bfa8169775c45a9ce8c","integrity":"sha256-FsPI23bRg/qHdczgOJYPbvZKmmtd9Uv6gWl3XEWpzow="},"corelib/array.source-bfe4bfd38d29d22a2c59f723e4a83727a1c7f2aff0ef255042af4e68d0409ec6.rb":{"logical_path":"corelib/array.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":55893,"digest":"bfe4bfd38d29d22a2c59f723e4a83727a1c7f2aff0ef255042af4e68d0409ec6","integrity":"sha256-v+S/040p0iosWfcj5Kg3J6HH8q/w7yVQQq9OaNBAnsY="},"corelib/hash.source-43e0f7ea8b3c04d5a56613bdd11ab765756fcaa9c5fb6022d1421d6751b8e229.rb":{"logical_path":"corelib/hash.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":19360,"digest":"43e0f7ea8b3c04d5a56613bdd11ab765756fcaa9c5fb6022d1421d6751b8e229","integrity":"sha256-Q+D36os8BNWlZhO90Rq3ZXVvyqnF+2Ai0UIdZ1G44ik="},"corelib/number.source-cb83b5ca4647c2e1cc036178e34f6225a22e2d51a3fb7264cefb83de6e6e1939.rb":{"logical_path":"corelib/number.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":18632,"digest":"cb83b5ca4647c2e1cc036178e34f6225a22e2d51a3fb7264cefb83de6e6e1939","integrity":"sha256-y4O1ykZHwuHMA2F4409iJaIuLVGj+3JkzvuD3m5uGTk="},"corelib/range.source-d351f7482e46103eec38f4c207e096d7378e1932f96843ea03daec8b8ffff6f2.rb":{"logical_path":"corelib/range.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":8818,"digest":"d351f7482e46103eec38f4c207e096d7378e1932f96843ea03daec8b8ffff6f2","integrity":"sha256-01H3SC5GED7sOPTCB+CW1zeOGTL5aEPqA9rsi4//9vI="},"corelib/proc.source-2b521447daf405076d4bac222855ff36812379c0445dfed9bc3eac34a3b219a2.rb":{"logical_path":"corelib/proc.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4391,"digest":"2b521447daf405076d4bac222855ff36812379c0445dfed9bc3eac34a3b219a2","integrity":"sha256-K1IUR9r0BQdtS6wiKFX/NoEjecBEXf7ZvD6sNKOyGaI="},"corelib/method.source-5db9cae6ec1333ff90f7ef7739d45d3e8d7b9d8f238c367021ff7165dd6a6446.rb":{"logical_path":"corelib/method.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2292,"digest":"5db9cae6ec1333ff90f7ef7739d45d3e8d7b9d8f238c367021ff7165dd6a6446","integrity":"sha256-XbnK5uwTM/+Q9+93OdRdPo17nY8jjDZwIf9xZd1qZEY="},"corelib/variables.source-1a0df2dfa30886613488a97ea41fb3cd9dcc9fdeabcbe1e3e5a904647c90c4e6.rb":{"logical_path":"corelib/variables.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":325,"digest":"1a0df2dfa30886613488a97ea41fb3cd9dcc9fdeabcbe1e3e5a904647c90c4e6","integrity":"sha256-Gg3y36MIhmE0iKl+pB+zzZ3Mn96ry+Hj5akEZHyQxOY="},"corelib/io.source-403e8a47b15d3fe92b5d55e8a315e5f07371c55f1b6db056fc4d9b01408af5e9.rb":{"logical_path":"corelib/io.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6404,"digest":"403e8a47b15d3fe92b5d55e8a315e5f07371c55f1b6db056fc4d9b01408af5e9","integrity":"sha256-QD6KR7FdP+krXVXooxXl8HNxxV8bbbBW/E2bAUCK9ek="},"opal/mini.source-638e1531040665f9ec68e0c88df0b229ebe2ac89276b1e9c156f779b9f33029f.rb":{"logical_path":"opal/mini.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":582,"digest":"638e1531040665f9ec68e0c88df0b229ebe2ac89276b1e9c156f779b9f33029f","integrity":"sha256-Y44VMQQGZfnsaODIjfCyKevirIknax6cFW93m58zAp8="},"corelib/kernel/format.source-5dc6358fac4ee2a49f27470485163b821e0c9f61ba12db5a121e85985475ac7d.rb":{"logical_path":"corelib/kernel/format.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":19650,"digest":"5dc6358fac4ee2a49f27470485163b821e0c9f61ba12db5a121e85985475ac7d","integrity":"sha256-XcY1j6xO4qSfJ0cEhRY7gh4Mn2G6EttaEh6FmFR1rH0="},"corelib/string/encoding.source-e20bbd4db806af48823ff828bea06cca9c5573fe968e8db3e8ca77a99a45ea4b.rb":{"logical_path":"corelib/string/encoding.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":9772,"digest":"e20bbd4db806af48823ff828bea06cca9c5573fe968e8db3e8ca77a99a45ea4b","integrity":"sha256-4gu9TbgGr0iCP/govqBsypxVc/6Wjo2z6Mp3qZpF6ks="},"corelib/math.source-fa2631fcff5e4d9e11516986243d3b60098ba2262ad2ee05069193fbc0ad99d7.rb":{"logical_path":"corelib/math.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6185,"digest":"fa2631fcff5e4d9e11516986243d3b60098ba2262ad2ee05069193fbc0ad99d7","integrity":"sha256-+iYx/P9eTZ4RUWmGJD07YAmLoiYq0u4FBpGT+8Ctmdc="},"corelib/complex/base.source-e3d177911f1b14c79b0cc915d3f6acb16d23336997324f10689e0805766cb5f7.rb":{"logical_path":"corelib/complex/base.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":211,"digest":"e3d177911f1b14c79b0cc915d3f6acb16d23336997324f10689e0805766cb5f7","integrity":"sha256-49F3kR8bFMebDMkV0/assW0jM2mXMk8QaJ4IBXZstfc="},"corelib/complex.source-15d824f7f747b34ea4ec96b8fb20b039de8777db21ed673ffa89f09eefa6e312.rb":{"logical_path":"corelib/complex.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":7798,"digest":"15d824f7f747b34ea4ec96b8fb20b039de8777db21ed673ffa89f09eefa6e312","integrity":"sha256-Fdgk9/dHs06k7Ja4+yCwOd6Hd9sh7Wc/+onwnu+m4xI="},"corelib/rational/base.source-4783a9070f721a5eab480da1444557f592c4fa03694deda96cfe068dd5014a3c.rb":{"logical_path":"corelib/rational/base.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":186,"digest":"4783a9070f721a5eab480da1444557f592c4fa03694deda96cfe068dd5014a3c","integrity":"sha256-R4OpBw9yGl6rSA2hREVX9ZLE+gNpTe2pbP4GjdUBSjw="},"corelib/rational.source-fd79732f5b9233a5ad74fee8c2c1fb8cc5feba389dfef0076b6d0378d81d5b6f.rb":{"logical_path":"corelib/rational.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":7253,"digest":"fd79732f5b9233a5ad74fee8c2c1fb8cc5feba389dfef0076b6d0378d81d5b6f","integrity":"sha256-/XlzL1uSM6WtdP7owsH7jMX+ujid/vAHa20DeNgdW28="},"corelib/time.source-eb79092b11820cd9074f48da3c3c95471675bef7c150c443c008b4fbb915cfdb.rb":{"logical_path":"corelib/time.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":19119,"digest":"eb79092b11820cd9074f48da3c3c95471675bef7c150c443c008b4fbb915cfdb","integrity":"sha256-63kJKxGCDNkHT0jaPDyVRxZ1vvfBUMRDwAi0+7kVz9s="},"corelib/struct.source-be1ae7c9162154659ed197f2225c0a1b5fc455f72629c3b5f31482d4fcb09fa2.rb":{"logical_path":"corelib/struct.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":7988,"digest":"be1ae7c9162154659ed197f2225c0a1b5fc455f72629c3b5f31482d4fcb09fa2","integrity":"sha256-vhrnyRYhVGWe0ZfyIlwKG1/EVfcmKcO18xSC1Pywn6I="},"corelib/set.source-b044aca303702523db7cf30a05368d7dcf4b000fc6a688938dc4644d3eecc7ba.rb":{"logical_path":"corelib/set.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4524,"digest":"b044aca303702523db7cf30a05368d7dcf4b000fc6a688938dc4644d3eecc7ba","integrity":"sha256-sESsowNwJSPbfPMKBTaNfc9LAA/GpoiTjcRkTT7sx7o="},"corelib/dir.source-d67398b5f027e6bcf13aaa88c93a14c7b1d252ccce8189f63db8dff2347672a0.rb":{"logical_path":"corelib/dir.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":349,"digest":"d67398b5f027e6bcf13aaa88c93a14c7b1d252ccce8189f63db8dff2347672a0","integrity":"sha256-1nOYtfAn5rzxOqqIyToUx7HSUszOgYn2Pbjf8jR2cqA="},"corelib/file.source-db4d733e61452a07f91d541a74c11a413b88a2ae1ccb54090bc32177d141140d.rb":{"logical_path":"corelib/file.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":6578,"digest":"db4d733e61452a07f91d541a74c11a413b88a2ae1ccb54090bc32177d141140d","integrity":"sha256-201zPmFFKgf5HVQadMEaQTuIoq4cy1QJC8Mhd9FBFA0="},"corelib/process/base.source-ed219f24e478564e66ce8b54c742bde00c698b6e2f8e258551f4c5a754592378.rb":{"logical_path":"corelib/process/base.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":83,"digest":"ed219f24e478564e66ce8b54c742bde00c698b6e2f8e258551f4c5a754592378","integrity":"sha256-7SGfJOR4Vk5mzotUx0K94Axpi24vjiWFUfTFp1RZI3g="},"corelib/process.source-eae0d96ba98ca61234679790bfdd6b05adf36ed806a67d2c575505d96a580316.rb":{"logical_path":"corelib/process.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1987,"digest":"eae0d96ba98ca61234679790bfdd6b05adf36ed806a67d2c575505d96a580316","integrity":"sha256-6uDZa6mMphI0Z5eQv91rBa3zbtgGpn0sV1UF2WpYAxY="},"corelib/random/formatter.source-a5c67b3842448a9f38de7e59b1ef6cf0c1a4e9300c4ee9cf84d9102417f3a8f3.rb":{"logical_path":"corelib/random/formatter.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":3106,"digest":"a5c67b3842448a9f38de7e59b1ef6cf0c1a4e9300c4ee9cf84d9102417f3a8f3","integrity":"sha256-pcZ7OEJEip843n5Zse9s8MGk6TAMTunPhNkQJBfzqPM="},"corelib/random/mersenne_twister.source-96ab5e8c533f105c29c53801cfefff5c4a93daa242214f233d93d7e71989134e.rb":{"logical_path":"corelib/random/mersenne_twister.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":5483,"digest":"96ab5e8c533f105c29c53801cfefff5c4a93daa242214f233d93d7e71989134e","integrity":"sha256-lqtejFM/EFwpxTgBz+//XEqT2qJCIU8jPZPX5xmJE04="},"corelib/random.source-7a6ede92c9d8128add2371b37d8a03a47d3170656f40e20e56e532a1a63aba3e.rb":{"logical_path":"corelib/random.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1988,"digest":"7a6ede92c9d8128add2371b37d8a03a47d3170656f40e20e56e532a1a63aba3e","integrity":"sha256-em7eksnYEordI3GzfYoDpH0xcGVvQOIOVuUyoaY6uj4="},"corelib/unsupported.source-8e81720371807cc5396ff2eedff847682814b8e9c62ec9d95208d96584e09b4b.rb":{"logical_path":"corelib/unsupported.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":2626,"digest":"8e81720371807cc5396ff2eedff847682814b8e9c62ec9d95208d96584e09b4b","integrity":"sha256-joFyA3GAfMU5b/Lu3/hHaCgUuOnGLsnZUgjZZYTgm0s="},"corelib/binding.source-3b309deb9807f4940f2c9ed7679bfc40cc5eb11683ca41f594bf7f49453630a0.rb":{"logical_path":"corelib/binding.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1423,"digest":"3b309deb9807f4940f2c9ed7679bfc40cc5eb11683ca41f594bf7f49453630a0","integrity":"sha256-OzCd65gH9JQPLJ7XZ5v8QMxesRaDykH1lL9/SUU2MKA="},"corelib/irb.source-04c57c643e2c4ed9e9cda17758fd8929fb02554f1a8576a782d788eb37e563dd.rb":{"logical_path":"corelib/irb.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":4644,"digest":"04c57c643e2c4ed9e9cda17758fd8929fb02554f1a8576a782d788eb37e563dd","integrity":"sha256-BMV8ZD4sTtnpzaF3WP2JKfsCVU8ahXangteI6zflY90="},"opal.source-4034ad8e0a1fdcd74becb7ba30cb0eb19ba9ffbb4e7d511b79077250fcad421d.rb":{"logical_path":"opal.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":788,"digest":"4034ad8e0a1fdcd74becb7ba30cb0eb19ba9ffbb4e7d511b79077250fcad421d","integrity":"sha256-QDStjgof3NdL7Le6MMsOsZup/7tOfVEbeQdyUPytQh0="},"native.source-1c0d7d79cef6591a9faaa9dd0dd903a7bda671d4885952f472b40dd49d827465.rb":{"logical_path":"native.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":13521,"digest":"1c0d7d79cef6591a9faaa9dd0dd903a7bda671d4885952f472b40dd49d827465","integrity":"sha256-HA19ec72WRqfqqndDdkDp72mcdSIWVL0crQN1J2CdGU="},"console.source-d5d314ea6b559f8cfe86bf3f2809ff5602b4a492a206152a3f2dc568c79361af.rb":{"logical_path":"console.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1983,"digest":"d5d314ea6b559f8cfe86bf3f2809ff5602b4a492a206152a3f2dc568c79361af","integrity":"sha256-1dMU6mtVn4z+hr8/KAn/VgK0pJKiBhUqPy3FaMeTYa8="},"js.source-fc496a13dc2a906b4406a4a97ee81a610152e0a15d9b935e8bbf634f94e535fd.rb":{"logical_path":"js.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1842,"digest":"fc496a13dc2a906b4406a4a97ee81a610152e0a15d9b935e8bbf634f94e535fd","integrity":"sha256-/ElqE9wqkGtEBqSpfugaYQFS4KFdm5Nei79jT5TlNf0="},"application.source.js-1c44c3e7669e9ba07cc951b94fa5249c487df88ac70612b6a2a6d4b95ce60b02.rb":{"logical_path":"application.source.js.rb","mtime":"2023-11-09T11:34:39+00:00","size":381,"digest":"1c44c3e7669e9ba07cc951b94fa5249c487df88ac70612b6a2a6d4b95ce60b02","integrity":"sha256-HETD52aem6B8yVG5T6UknEh9+IrHBhK2oqbUuVzmCwI="},"try.debug-9406c8141040cc9dd32f9ad05ab21a0662a70305b1a22ee26e6bc0cf14572b7a.js":{"logical_path":"try.debug.js","mtime":"2023-11-09T11:34:39+00:00","size":268154,"digest":"9406c8141040cc9dd32f9ad05ab21a0662a70305b1a22ee26e6bc0cf14572b7a","integrity":"sha256-lAbIFBBAzJ3TL5rQWrIaBmKnAwWxoi7ibmvAzxRXK3o="},"try-be06c51740f19e9ba0c35fdc4c49457e10319b2d3c769911818d9866e87cd107.js":{"logical_path":"try.js","mtime":"2023-11-09T11:34:39+00:00","size":268056,"digest":"be06c51740f19e9ba0c35fdc4c49457e10319b2d3c769911818d9866e87cd107","integrity":"sha256-vgbFF0Dxnpugw1/cTElFfhAxmy08dpkRgY2YZuh80Qc="},"try.js-4a24a3170b9aaf4107e672a9772cbcf91222ba6a397247d800938ad58d95a4bc.map":{"logical_path":"try.js.map","mtime":"2023-11-09T11:34:39+00:00","size":42994,"digest":"4a24a3170b9aaf4107e672a9772cbcf91222ba6a397247d800938ad58d95a4bc","integrity":"sha256-SiSjFwuar0EH5nKpdyy8+RIiumo5ckfYAJOK1Y2VpLw="},"_vendor/codemirror.source-02e1e58bfe4c3b5acc3b5eac25dd452e75094d1f2ad66aa19d68997988c661de.js":{"logical_path":"_vendor/codemirror.source.js","mtime":"2023-11-09T11:34:39+00:00","size":233685,"digest":"02e1e58bfe4c3b5acc3b5eac25dd452e75094d1f2ad66aa19d68997988c661de","integrity":"sha256-AuHli/5MO1rMO16sJd1FLnUJTR8q1mqhnWiZeYjGYd4="},"_vendor/ruby.source-66aaca5ea56621bad19bff704c61709e12cb5e53d83aa65f098432d0fb599cac.js":{"logical_path":"_vendor/ruby.source.js","mtime":"2023-11-09T11:34:39+00:00","size":7296,"digest":"66aaca5ea56621bad19bff704c61709e12cb5e53d83aa65f098432d0fb599cac","integrity":"sha256-ZqrKXqVmIbrRm/9wTGFwnhLLXlPYOqZfCYQy0PtZnKw="},"_vendor/javascript.source-5462d687adc5dcbddfc7bf43cde9ad6ccc27cfdf78e7a96a86368d6af62f69b3.js":{"logical_path":"_vendor/javascript.source.js","mtime":"2023-11-09T11:34:39+00:00","size":12823,"digest":"5462d687adc5dcbddfc7bf43cde9ad6ccc27cfdf78e7a96a86368d6af62f69b3","integrity":"sha256-VGLWh63F3L3fx79DzemtbMwnz99456lqhjaNavYvabM="},"try/examples.source-ffd37a3924f0f5fd6e55eb1f75c25c78bb939e9eda723b4b039c51d07a7700f5.rb":{"logical_path":"try/examples.source.rb","mtime":"2023-11-09T11:34:39+00:00","size":1711,"digest":"ffd37a3924f0f5fd6e55eb1f75c25c78bb939e9eda723b4b039c51d07a7700f5","integrity":"sha256-/9N6OSTw9f1uVesfdcJceLuTnp7acjtLA5xR0Hp3APU="},"try.source.js-85bdbb21b84aa0121d3a4f891a3132fd51c363ea14e32837ab9b419eec7a6682.rb":{"logical_path":"try.source.js.rb","mtime":"2023-11-09T11:34:39+00:00","size":4389,"digest":"85bdbb21b84aa0121d3a4f891a3132fd51c363ea14e32837ab9b419eec7a6682","integrity":"sha256-hb27IbhKoBIdOk+JGjEy/VHDY+oU4yg3q5tBnux6ZoI="}},"assets":{"manifest.js":"manifest-051b80c2b5fb204b550aba6cf928072bbb42036e37e7706f5459081c977c1c2c.js","application.debug.css":"application.debug-5831b9572963d71dcb254b54bc0ec95f027323aed416e47cd8a208bed1efbbea.css","application.css":"application-915b7e3cafe6e192dee011fa09837b2af85b7e1de3dbb52fd1413d46dd2dca0e.css","application.css.map":"application.css-6af110e86ced0e076fe5512b7eeef8d85edc3659719ed624f009ab14f21e029a.map","application.source.scss":"application.source-01d3042c3bc7c1b2ded94479a37bda3e2a3b65f1957686eba6700502b4fe5082.scss","_vendor/_pygment_solarized_light.source.scss":"_vendor/_pygment_solarized_light.source-6794ffcdd63dcecc7c972f8c3b032fe28134bd8add2a0257df56c173174ccc30.scss","_vendor/_codemirror-solarized.source.scss":"_vendor/_codemirror-solarized.source-c8817c4f8a3022d53d7ba1f7d53a0739efd87e1740d931cc1fff1ec30060bdcc.scss","_blog.source.scss":"_blog.source-1468f1e056e48afbf297b9511e4cb8d72622100a4cbd79dcab0c313174ac0164.scss","_index.source.scss":"_index.source-8e5904704d64bea7a6d7cc2cbd3291762d8e14a5702873b2b8f372c0d4db2cd2.scss","_codemirror.source.scss":"_codemirror.source-e40f23e95ff81277d0e9f4cb5b65d5df9ce160bfdc41d67cc224af3a6922488c.scss","_bootstrap-sprockets.source.scss":"_bootstrap-sprockets.source-617bd14f8f87a7d4f3104d96ada5ff1ef60ea8cd1b0c0244675ac792d4c4977c.scss","_bootstrap.source.scss":"_bootstrap.source-17d7cd48409fa895ebcc007d74770c893e323925b0a1e4095aea7bcdb529c070.scss","bootstrap/_variables.source.scss":"bootstrap/_variables.source-482186f7e15fd47e0bdb00a85e8edf7a10a014aa59373f1fdf71585a5d6feadc.scss","bootstrap/_mixins.source.scss":"bootstrap/_mixins.source-f69f85085da6f31aeaf5a3f6e829609414b034f72d5f66c28b7e47565c31879d.scss","bootstrap/mixins/_hide-text.source.scss":"bootstrap/mixins/_hide-text.source-744d07b859e64a5054bb3a5a61c741da0802ccdf1c01c04cb58a99e7a3a64475.scss","bootstrap/mixins/_opacity.source.scss":"bootstrap/mixins/_opacity.source-24a43bd4cccdf1523772ee49cb5d26e7bf8cd3f76202221ce2d417180f920e60.scss","bootstrap/mixins/_image.source.scss":"bootstrap/mixins/_image.source-11e4a737146939fe6c78e1634e2aaacaf6555340fceabfad6c0c90f0501386f4.scss","bootstrap/mixins/_labels.source.scss":"bootstrap/mixins/_labels.source-fc0e4380846766ac47c42d977f6a16c89788fabc88aa5d825aa2040c0397fd15.scss","bootstrap/mixins/_reset-filter.source.scss":"bootstrap/mixins/_reset-filter.source-85a38f5886d4d9f3c3beee2d2a0762a336725b1b6ce8a900b35c0fef05eca90c.scss","bootstrap/mixins/_resize.source.scss":"bootstrap/mixins/_resize.source-f667a158b80786e0b6a02cbe8cc007879cd2f0111e7285f37ad76221fc53edd8.scss","bootstrap/mixins/_responsive-visibility.source.scss":"bootstrap/mixins/_responsive-visibility.source-c5922fa5c03e4e5519c0d6b0fe55d74deb4df78c4b92030f167a7eb93e3cf5f4.scss","bootstrap/mixins/_size.source.scss":"bootstrap/mixins/_size.source-43ed70c482e6890da52c5cb98b33b651cb6e5535887deebc31145a9d2ae0e292.scss","bootstrap/mixins/_tab-focus.source.scss":"bootstrap/mixins/_tab-focus.source-cc154891d4d781e6a012e90e57921c52b8b4be016c9a86c827546b7d117fb25b.scss","bootstrap/mixins/_text-emphasis.source.scss":"bootstrap/mixins/_text-emphasis.source-5122df1667a80e2f6e577fc257c5106b68d68b5ae490647c2c3ecc41651743a7.scss","bootstrap/mixins/_text-overflow.source.scss":"bootstrap/mixins/_text-overflow.source-f2a9a690e1843c596df61998e0e78f40cd65a5b649c77a50b87dd2fdb980aa1b.scss","bootstrap/mixins/_vendor-prefixes.source.scss":"bootstrap/mixins/_vendor-prefixes.source-f5f733f9a623615ab9101c9e32699cc92770fa57ac1d09196e099d1749cda303.scss","bootstrap/mixins/_alerts.source.scss":"bootstrap/mixins/_alerts.source-16f165cb79b8d222f79cfa2e9eb63d80afc00b73c5fc0720997734d389a29d6f.scss","bootstrap/mixins/_buttons.source.scss":"bootstrap/mixins/_buttons.source-1e01e239d869ca1db2c754944d3443f116fe8bf046ffcd937310ca42be615c39.scss","bootstrap/mixins/_panels.source.scss":"bootstrap/mixins/_panels.source-d6fb2063735bf908241957257cfdb03d6410e22a29d2499c0536be2632abd592.scss","bootstrap/mixins/_pagination.source.scss":"bootstrap/mixins/_pagination.source-f06aaed2591ea5ca3e3bd48f62e25e471a69dddd8fc195f1d0cc6ccc4bf23b81.scss","bootstrap/mixins/_list-group.source.scss":"bootstrap/mixins/_list-group.source-294f6a9a302c9b2781e61ee063e53a79902f4b61827473630170da3f47714357.scss","bootstrap/mixins/_nav-divider.source.scss":"bootstrap/mixins/_nav-divider.source-4dfd32935ea1d043c0af570b80687bcf634ded8ba616336259d0dff8ab650191.scss","bootstrap/mixins/_forms.source.scss":"bootstrap/mixins/_forms.source-d58c71313533676457cddeb86fb2dbffa636e39ef86696c863a3054429a60642.scss","bootstrap/mixins/_progress-bar.source.scss":"bootstrap/mixins/_progress-bar.source-75f3702c9f9f63ced3d3e848e8c5de1cc321256b864eb79d9b2534da2a782b82.scss","bootstrap/mixins/_table-row.source.scss":"bootstrap/mixins/_table-row.source-5bc673689b0e533c050784b4aac716c12e08cae1bb8948f32cd0a9da752e6a6c.scss","bootstrap/mixins/_background-variant.source.scss":"bootstrap/mixins/_background-variant.source-faea592ef84bb2f65cbc371028f8db9f6ce70a0169a32feed86dbe2fd45b243d.scss","bootstrap/mixins/_border-radius.source.scss":"bootstrap/mixins/_border-radius.source-c7385e8d18e49d52cdcef95f7a22a86c3c1a10cddc56f7071c6f988869d3ca62.scss","bootstrap/mixins/_gradients.source.scss":"bootstrap/mixins/_gradients.source-8c74fe22ac06fa17249449c725c00f9f6cac2affa5eca1f09f28639bd01013ec.scss","bootstrap/mixins/_clearfix.source.scss":"bootstrap/mixins/_clearfix.source-f3599294867438e1433ceb90d573d4f042e546e687e06b366219c67f3e08cacd.scss","bootstrap/mixins/_center-block.source.scss":"bootstrap/mixins/_center-block.source-bfdc52231145f062b6ac0444096d5da0fdcfa24412f9f01def285882a761da14.scss","bootstrap/mixins/_nav-vertical-align.source.scss":"bootstrap/mixins/_nav-vertical-align.source-5dd7d8297185f30e923b35bf60b7f4e6c3ea662561a1b588230c55297fc75168.scss","bootstrap/mixins/_grid-framework.source.scss":"bootstrap/mixins/_grid-framework.source-d6de740850d367cde1814a930f5a89e68f1a4048ad2af57eba0c5850a9dd229e.scss","bootstrap/mixins/_grid.source.scss":"bootstrap/mixins/_grid.source-86a1bea9c80367c82818c8deee4b694f5d03db8b3baf0d3cd10f109bf9e0aaec.scss","bootstrap/_normalize.source.scss":"bootstrap/_normalize.source-9d4affd5f91924523e244e1c5b503aac4bb2fb76a4b009c0168d872788426626.scss","bootstrap/_print.source.scss":"bootstrap/_print.source-4e1eac8f340c82d34b71b5fae32aff2a607a5b3279077d97e81836951660b6dc.scss","bootstrap/_scaffolding.source.scss":"bootstrap/_scaffolding.source-a6ba8ce4bf75bd1f7f49bfd683557a5dd67844db73827639c207453e72c1d9a6.scss","bootstrap/_type.source.scss":"bootstrap/_type.source-3734242e194571b02107f9d64d1676cab7f99eaf1c0a2741831bdb84e8b054de.scss","bootstrap/_code.source.scss":"bootstrap/_code.source-32c093107b854533c984a1d3d33977f99202a126c07a054001e4cd7fde0fac10.scss","bootstrap/_grid.source.scss":"bootstrap/_grid.source-cca48675d371e0c0bf11dbf00e3736578eff464b978a25d1a4ade3bcbed80ecd.scss","bootstrap/_tables.source.scss":"bootstrap/_tables.source-5d66b5342353d126f0e20b2b4184143350f54f68022f36da658d5d1e3d91bed8.scss","bootstrap/_forms.source.scss":"bootstrap/_forms.source-a9e925fca4a9805dc3b80b749d357b3afc1196d85a07f096c23862c37e51d426.scss","bootstrap/_buttons.source.scss":"bootstrap/_buttons.source-a3e623ca2a0490713d186de54ec6bac70a8612f986b6b39c63bda4f843adcf55.scss","bootstrap/_component-animations.source.scss":"bootstrap/_component-animations.source-153de427f07c04d747940bc5c360cc716fa00008dd2b8e5d1038bbd3e93bd8ed.scss","bootstrap/_dropdowns.source.scss":"bootstrap/_dropdowns.source-0010fb4057ead72a145cc8e6ab3e4ea290e899d82b7f66177a29f90c2996b647.scss","bootstrap/_button-groups.source.scss":"bootstrap/_button-groups.source-21e18e2516879de3defda28c5d32f5e344bbc85421ad66b38186224f2455e8cc.scss","bootstrap/_input-groups.source.scss":"bootstrap/_input-groups.source-8fae3b159a0c69d4cc9af589bb073ca5b1da90973092bcc00276aa1a4fa164be.scss","bootstrap/_navs.source.scss":"bootstrap/_navs.source-8779db84fe76e19abe7b9d4d5014adb07e23e5a773a3d17b529c0e879df71540.scss","bootstrap/_navbar.source.scss":"bootstrap/_navbar.source-6ea4c7c0aeabc2157f63ac00af971a113c9b5cf66736a8020ca4a18cca3817df.scss","bootstrap/_breadcrumbs.source.scss":"bootstrap/_breadcrumbs.source-33c2f0bae433c1d2bed93c81ce71176ba35ab03d15d8b7cc919251d6ff619f80.scss","bootstrap/_pagination.source.scss":"bootstrap/_pagination.source-3f41713467dd921cc1ac350f1cc0b3bdb6c57687f36cbb0d680fc9d078d7fb46.scss","bootstrap/_pager.source.scss":"bootstrap/_pager.source-59ef3d3b0c5e7ed35f392ce461edf06bfc829c535afd8630b2aac51a44e11892.scss","bootstrap/_labels.source.scss":"bootstrap/_labels.source-bf9bd4cdd0441acb70db89f7a33adf06e50b4a7ff92db8fece20832a697612a7.scss","bootstrap/_badges.source.scss":"bootstrap/_badges.source-f20d636c4d5f23c846448eb64155b594a319e62329f5f1001f680b35972a1ae4.scss","bootstrap/_jumbotron.source.scss":"bootstrap/_jumbotron.source-35d116542ab176f99d69611ba5b6ff30f03769f44ee364c2c1b224c89fcbcafb.scss","bootstrap/_thumbnails.source.scss":"bootstrap/_thumbnails.source-9d6038f6ab70449bed07a3b40d4cbb304a9339c00e568b00fc9432168afec7de.scss","bootstrap/_alerts.source.scss":"bootstrap/_alerts.source-f175606a34f8d438e6dab1bb0522f0bfb97ca0df0166f81425bab8021d9b2c41.scss","bootstrap/_progress-bars.source.scss":"bootstrap/_progress-bars.source-4c2bf460b33d74d64db07fca213c92de552b7dc92cd24a950cbf38c064e7875b.scss","bootstrap/_media.source.scss":"bootstrap/_media.source-5eab757b15c103bf176c89387f77e660d7f618f08df68b8506362293eaf51769.scss","bootstrap/_list-group.source.scss":"bootstrap/_list-group.source-3175916051c5d7f163fa79e5608cc06fd700dd923606c90efc35e4189157c8e3.scss","bootstrap/_panels.source.scss":"bootstrap/_panels.source-7c21bb3c0c7c5c5b7275b089b930217a6d57c9279a0a76fe29165cb88f31a1aa.scss","bootstrap/_responsive-embed.source.scss":"bootstrap/_responsive-embed.source-ca767590895216af631f9623df26a5fd0ff84ab499ab04c85c48096583bc81d3.scss","bootstrap/_wells.source.scss":"bootstrap/_wells.source-d6bf447416761835357cf9535db2932c8f4a8b7a3aa77716bdde90a4ecc5551c.scss","bootstrap/_close.source.scss":"bootstrap/_close.source-29f12a91774599a71d1b1fd0bdce91411d71c03bf06ad48f355fe2d5ba781ae9.scss","bootstrap/_modals.source.scss":"bootstrap/_modals.source-cc9b2a29ca21d8d4e6445c9d6bf6e4a11855fffe398a2b0477342be55a56d8b0.scss","bootstrap/_tooltip.source.scss":"bootstrap/_tooltip.source-fd70c95a50674c92f89bd27380a9768db21e997193cd2ec4b9a07b2f6dfe8622.scss","bootstrap/_popovers.source.scss":"bootstrap/_popovers.source-c80157dccd38cfcd3a256c5c97937c566d6260fbf63d981c923b040bf16cac04.scss","bootstrap/_carousel.source.scss":"bootstrap/_carousel.source-78e906253c103c0563db95faa9a9a17a4bd75ab619cfb27312555f4dc16d614f.scss","bootstrap/_utilities.source.scss":"bootstrap/_utilities.source-f311f41d090eabc8f185d2371e3531389665eb552303a40302d319a7c7354e66.scss","bootstrap/_responsive-utilities.source.scss":"bootstrap/_responsive-utilities.source-1a88b9dade13b7c60cf7b99e315f371ac16f09334f34dd4da94068e2390f521d.scss","load-parser.debug.js":"load-parser.debug-71c5d06adb7f7f182c8e6cad7dea2e00a26acbbf9d6ccbbed5bd8a86bd67c911.js","load-parser.js":"load-parser-2f3ba30138edaf9916f78766b8388e4d31bf513da551ef96326e75a3e2a26dd3.js","load-parser.js.map":"load-parser.js-37acfee094c1ed89c2e72e42274100fb700c853bad86d9cd45aa2275d427807e.map","base64.source.rb":"base64.source-ff1b709cbf57f3945ce5cfadb58c63d87c2f4ba36331c23b4b84d7a92a7741dd.rb","corelib/pack_unpack/format_string_parser.source.rb":"corelib/pack_unpack/format_string_parser.source-06ee75543d8f742e5323e0c28155d26a97a3fe323091f8ead67df96b40384e2a.rb","corelib/string/unpack.source.rb":"corelib/string/unpack.source-9292521cf2d03d9a3322b0201794affc5e4ff656a8e1907a352b43f0f04b0bc6.rb","set.source.rb":"set.source-9ecbee038e5d23a6807530e28d805d1088e523a68a49ee4f66cb45c35e593659.rb","ast/node.source.rb":"ast/node.source-e0346587af629df152c23042fcc16d10d929138f90e5fb7cadeedf92cb6c852d.rb","ast/processor/mixin.source.rb":"ast/processor/mixin.source-4f5d9beb4d8be76583b4fac388d91804538131387d7eab2a0f4e778ea88e72d4.rb","ast/processor.source.rb":"ast/processor.source-e4c2a8e995b1922b0a1848d81426e7057168a0851c75a9da99cf427242cbf646.rb","ast/sexp.source.rb":"ast/sexp.source-8dc78dac8f9465a5f6a62aa057ae97fbadd5b111efe8895ac824d46938dc3793.rb","ast.source.rb":"ast.source-905da9f5b152658b445875a3f12b2fe9521683ac31fdc24e41a724cfdd09ac44.rb","parser/ast/node.source.rb":"parser/ast/node.source-3c183648686e0e02561eec8d8728167e77c9ed5304843adaf9ed80b45d7a258d.rb","opal/ast/node.source.rb":"opal/ast/node.source-4a42cb5bf8e372a82c3bc3f2fe44beeeb0c89d3734e4a67016ba838418288fd5.rb","racc/parser.source.rb":"racc/parser.source-47e481218146a1561e566a1f41766919cc6c8e2713bab6aed0384ed6ef55656b.rb","parser/version.source.rb":"parser/version.source-83844cf58343f542492c29bc0d4c6117b6d8b81731717151e20bc2cfab348cc7.rb","parser/messages.source.rb":"parser/messages.source-feb872b0d062340525de564d7ec081e192666537d74b1f8c250d358d81bdc205.rb","parser/deprecation.source.rb":"parser/deprecation.source-d0805a72096c6de3981bb7d3e447eb28d29fd9640f3b4c6d11fd5047377464f5.rb","parser/ast/processor.source.rb":"parser/ast/processor.source-75f876361c7a487d0cd403c1241ac618174f3d88b00d948424cb9722e1bf4dc2.rb","parser/meta.source.rb":"parser/meta.source-c35c18829a422c63e84b77dc5af59ca2b67441f92b871dd8c369a10ffac4d8d4.rb","parser/source/buffer.source.rb":"parser/source/buffer.source-4580df88737728b7d1e96541f31c1e9ab09ab54e85851ee20c28a54f8c230400.rb","parser/source/range.source.rb":"parser/source/range.source-0a568e9e163619617fa4faef2827852edba5bff9537d4650b6635156591124a4.rb","parser/source/comment.source.rb":"parser/source/comment.source-fc4b14d95ce20d37fbea4a1d3294a38ab0211f41579763e9b4a9ec6470441680.rb","parser/source/comment/associator.source.rb":"parser/source/comment/associator.source-6029f0f9ff2c3c29839e5d88b20f25d64f39797cea6d29702243c94b01f6af5e.rb","parser/source/rewriter.source.rb":"parser/source/rewriter.source-1647682808397f50876b8080c9386050769b75ca172d7606fd012194ea9f8c1e.rb","parser/source/rewriter/action.source.rb":"parser/source/rewriter/action.source-89dc19a710955c30c730b6b3870cd03f9791a8846c55884bbe7c0ab4f2c4ed44.rb","parser/source/tree_rewriter.source.rb":"parser/source/tree_rewriter.source-e47e361cd5b0adb1949b76743fd4d406fc7617f7e85b8a46d9f0af060244b772.rb","parser/source/tree_rewriter/action.source.rb":"parser/source/tree_rewriter/action.source-c0a18d5f314548c371a1b7175307289380ab70f4c9496a61b66b1f8f3bed4319.rb","parser/source/map.source.rb":"parser/source/map.source-1d9a13302f85e4756c695dbb55e13b0e04e01cdc23074a9e824fa38bdb3fb359.rb","parser/source/map/operator.source.rb":"parser/source/map/operator.source-f71b5afe77fd6fb7f431d08e8cd3bc82c9a3f6560e44d55a9a392778ea5adebd.rb","parser/source/map/collection.source.rb":"parser/source/map/collection.source-9a582ce032c03905dc9944e58a04bcbd24309c84332d2409598511745dfc578b.rb","parser/source/map/constant.source.rb":"parser/source/map/constant.source-8887161ce7754f19f1c24119e9c5b5d3409da683c2f3d76cd439c9b37edcfa88.rb","parser/source/map/variable.source.rb":"parser/source/map/variable.source-cd0246287786e8cef9e224b480da4b3e0589005cc5098c78a876332ec768416f.rb","parser/source/map/keyword.source.rb":"parser/source/map/keyword.source-dedb99ced5eb88d041994d28deeb0870d45690a9215fadcb1deabd555b23b8e7.rb","parser/source/map/definition.source.rb":"parser/source/map/definition.source-8e6840668ebc86a187050492c4ae0be800ab508ad349b6ce802e48802a8bda6c.rb","parser/source/map/method_definition.source.rb":"parser/source/map/method_definition.source-ab2e20cdf7f7ba09514bdb1fcbf9a6abd1a3adf1b0b52f133359ae07df39b44c.rb","parser/source/map/send.source.rb":"parser/source/map/send.source-3ac8ece7feb6d38674b20421e391fbff71530d479a11e576c845af23be52b4db.rb","parser/source/map/index.source.rb":"parser/source/map/index.source-a72e5a3651da8f713a5c7a49be545f59af09719ebc1950a7e7da1dd39500d8e9.rb","parser/source/map/condition.source.rb":"parser/source/map/condition.source-d3c4f51b72943d60f8627dea4e2bc87378b1b609ed4599b8cfe74dbcd9120aa2.rb","parser/source/map/ternary.source.rb":"parser/source/map/ternary.source-8b1224840dc23807237c82b37d1457ddd9c68f76880ec836543fcd4a01e5156c.rb","parser/source/map/for.source.rb":"parser/source/map/for.source-187f83959e6aa4b80afc9eee422865711e75cdd760c4bb64da46f3efe0a8f7af.rb","parser/source/map/rescue_body.source.rb":"parser/source/map/rescue_body.source-2135ac0caf455b360effe438be50ff12290ca172b6775396215d8bd4b6fdec38.rb","parser/source/map/heredoc.source.rb":"parser/source/map/heredoc.source-802e3218a11a36e37d59f2699ba9ef027ba3f25a9ccaf5b67b9f51b9be711167.rb","parser/source/map/objc_kwarg.source.rb":"parser/source/map/objc_kwarg.source-b8b54b4ff74d2589e8544a33d7d855ff85e655ac8dff96a276ee8108fe6c78f4.rb","parser/syntax_error.source.rb":"parser/syntax_error.source-b35a7eb23f86478e8d1480728eb38b7138a00331e9741bc7f4fb37ea1a1f3d05.rb","parser/clobbering_error.source.rb":"parser/clobbering_error.source-5f0b2aee4291455b71cfc41193a03c1eb39dececcf3a272fa1dd7f52d81619a7.rb","parser/diagnostic.source.rb":"parser/diagnostic.source-35218d12206180871dc0b4d00559238172c5f5a1c89391a28d2e9f27012c87af.rb","parser/diagnostic/engine.source.rb":"parser/diagnostic/engine.source-ace6754a27a82e312572f22e30a5741e9399d3ab30deabf7a866372ad3873a6d.rb","parser/static_environment.source.rb":"parser/static_environment.source-8cfc2f896c62d5270a35feb0bac71d2b10bb884f9d760fe7b16da78afba1901d.rb","parser/lexer-F0.source.rb":"parser/lexer-F0.source-0bd700cff79f59a415d47d17a0accfe71752ac87c38a4d78d7a930b85eefa212.rb","parser/lexer-F1.source.rb":"parser/lexer-F1.source-1731830baa1a62e49155a5163b94ddbb89dda14edbdb1e6a643ed70abff46a1b.rb","parser/lexer-strings.source.rb":"parser/lexer-strings.source-bcb54e3e3cf67073369bedac2181573768774bf1ece9d1fe352a35d7fe3e2517.rb","parser/lexer/literal.source.rb":"parser/lexer/literal.source-e27abea50742e2b60e1d49b9bbdb92c64fd696c41aeb17341f8a5f4c0b5d8ce8.rb","parser/lexer/stack_state.source.rb":"parser/lexer/stack_state.source-6c4b455a2961afcfa57e2508d2d2f927d9f1b509c6bf3b6796a2de9b9bcdde59.rb","parser/lexer/dedenter.source.rb":"parser/lexer/dedenter.source-65e1040b204edb68a3e352343ab77fa9811872bdb249f238e9728a2f99f1d43b.rb","parser/builders/default.source.rb":"parser/builders/default.source-ab69929f6740db5a107dd355834d0dcef7731be839ca06a26d6e21d0c9c9ab9f.rb","parser/context.source.rb":"parser/context.source-eada1358bea1056602975f4c6bd8ed3126a3e3c95a437fea35362b3ff9fbeb5e.rb","parser/max_numparam_stack.source.rb":"parser/max_numparam_stack.source-68c697d6a215860b957bd9c0d19256976b7ea3074606a0675b47851ab4591ffd.rb","parser/current_arg_stack.source.rb":"parser/current_arg_stack.source-7063f1f3627b3b3fa693afba3ad63ce5f4f9885677be08900b09819d9234ad8a.rb","parser/variables_stack.source.rb":"parser/variables_stack.source-f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0.rb","parser/base.source.rb":"parser/base.source-5eb855a17557873f53b3255d6123879f6081ab3c9fa6ea1f6ec28d9d14a93b46.rb","parser/rewriter.source.rb":"parser/rewriter.source-f95150be5d8e334e237f2b3cedac5393320c41a2d756f0e7c0713fd920996c16.rb","parser/tree_rewriter.source.rb":"parser/tree_rewriter.source-9b9c711839d953a2008dfcea1a4c144d3cfbdde76b72fd89470792f2bb130637.rb","parser.source.rb":"parser.source-0c0f4bf7e342af741738456c3157ab798c8804e9d2b73e3492503950cb7b66d4.rb","parser/ruby32.source.rb":"parser/ruby32.source-35d2a9eec77c538180dd894beb0b108bbfd5d69a3a354051075fef69a967d7ef.rb","opal/ast/builder.source.rb":"opal/ast/builder.source-eaf6df550a58d52a79a62a41acabefee2259247678734a925b178509d3a4ec05.rb","opal/rewriters/base.source.rb":"opal/rewriters/base.source-aa1b6772df8024d3537caf4483dd31cd8d1ba7291d9fad606e9293da551f627e.rb","opal/rewriters/opal_engine_check.source.rb":"opal/rewriters/opal_engine_check.source-79f1e0ad24150790cf1f9aad5dba3cf5b09aa5e041f31bf571e802da54d88d21.rb","opal/rewriters/targeted_patches.source.rb":"opal/rewriters/targeted_patches.source-d9d349d8078f2dd6d3ccb5fdc0328300ac6ec2230bc56e4adee3ed8cc0ef824a.rb","opal/rewriters/for_rewriter.source.rb":"opal/rewriters/for_rewriter.source-753748c955ec1b63a21e2450b44694a654c06cd182dd5e59dc5e76ed674f5135.rb","opal/regexp_anchors.source.rb":"opal/regexp_anchors.source-9a82e2c2c1d73ae9606226301af73b2ef0112155f3fca52defa4be2b4cd75243.rb","opal/rewriters/js_reserved_words.source.rb":"opal/rewriters/js_reserved_words.source-11a079affae8c126b9bd182f9f090b45dcfbbeea31f4d913a616dd48523f16a1.rb","opal/rewriters/block_to_iter.source.rb":"opal/rewriters/block_to_iter.source-e9c300c643bdb416e53cbc6fda6d8130fba40388e3954f4ac3edb122df6bb079.rb","opal/rewriters/dot_js_syntax.source.rb":"opal/rewriters/dot_js_syntax.source-50de46af4c9a2b0190947c51fae98997f6337b038f1641c1ef709834a2fe6922.rb","opal/rewriters/pattern_matching.source.rb":"opal/rewriters/pattern_matching.source-eb37306ac4421a8070a416101c89861786b403a6f46f2dd6ec8b40d45e36282c.rb","opal/rewriters/logical_operator_assignment.source.rb":"opal/rewriters/logical_operator_assignment.source-e422b06ca9e9b67cc1fd3e99b7e9af4a813b2bb9c50fb9e9df7b2f5f71efc2a8.rb","opal/rewriters/binary_operator_assignment.source.rb":"opal/rewriters/binary_operator_assignment.source-6d9942e1ba135acc050bf3e1399693fff6049e1abb2a9e470021df972957da86.rb","opal/rewriters/hashes/key_duplicates_rewriter.source.rb":"opal/rewriters/hashes/key_duplicates_rewriter.source-b2210660c3d99f87f818f71fc7e3ac44cbcbdb17d94b32963c70c072f83360df.rb","opal/rewriters/dump_args.source.rb":"opal/rewriters/dump_args.source-b6268131cb1c7150e479c80269cfff65410301602508c1ad438d6f5b3ba98e77.rb","opal/rewriters/deduplicate_arg_name.source.rb":"opal/rewriters/deduplicate_arg_name.source-0e7d424fe13323e93e767c765aea0faa804b4ee5ac9c3cdcade2d5966094db57.rb","opal/rewriters/mlhs_args.source.rb":"opal/rewriters/mlhs_args.source-c491b4c2dad56a6adefdc5adfbb78f281fa2dcc9c0f45e35734bfb5a09cdea39.rb","opal/rewriters/arguments.source.rb":"opal/rewriters/arguments.source-d8f46b3f620b8700a99a5057ee440f0f2a9399be8c210332810e2e101aae0a77.rb","opal/rewriters/inline_args.source.rb":"opal/rewriters/inline_args.source-00d82368b44568f8c81e49a4d5a2ee2b0c0bf02aa47f55c730c5b8b363398056.rb","opal/rewriters/numblocks.source.rb":"opal/rewriters/numblocks.source-f75a33f2be591d99b79b1c5c748746c84240a7c921b0d183b71d1467067fbca2.rb","opal/rewriters/returnable_logic.source.rb":"opal/rewriters/returnable_logic.source-1618e549c1ed81e4375aa63e5455e39b446c9695ad4dfdaaadbccb536c48f8f4.rb","opal/rewriters/forward_args.source.rb":"opal/rewriters/forward_args.source-4fb90101cb11a0977b71212bf9ea00530cca00825d5d6c0591316f8d2a178e80.rb","opal/rewriters/thrower_finder.source.rb":"opal/rewriters/thrower_finder.source-c5219d32fc56bd7c8e82e5fe6b320ad91c6889938af14d40e90b0a3e274ee603.rb","opal/rewriter.source.rb":"opal/rewriter.source-32fff58fe139f7244fa87f66adc46e4d235add89d752cd3f29ab97d4b7ccbe6e.rb","opal/parser/source_buffer.source.rb":"opal/parser/source_buffer.source-61b789b0b2ebe0500121b8eebb10ce46c496357ccaabfa968c2e0934bc13116e.rb","opal/parser/default_config.source.rb":"opal/parser/default_config.source-725b38eae1180c8614ff8024fdb50c5e02b3a6ae1149efd15c57e9bcf9c7ad2a.rb","opal/parser/with_ruby_lexer.source.rb":"opal/parser/with_ruby_lexer.source-ac3acfedd2463df65e3ec54147b694a6947e2c95bfa0cdfd376988717c9b1f3a.rb","opal/parser/patch.source.rb":"opal/parser/patch.source-c09d163f1d90c4e656ab93d27ab1c730817f58b75507dbdb50d6a921e54b46fc.rb","opal/parser.source.rb":"opal/parser.source-eac055fcb3cccd920f474b295f83de67fc3a2d0fbddf2290d57a605c5693b324.rb","opal/fragment.source.rb":"opal/fragment.source-9dfeb6c63014455b8fc06714d178b62715ed77c2e443b4ab60eb25466fd0b7c0.rb","opal/nodes/closure.source.rb":"opal/nodes/closure.source-61701fe2e741f0f8b7006beb475788bf3cb6431d23d523e2d8fcfaf611303d1b.rb","opal/nodes/helpers.source.rb":"opal/nodes/helpers.source-4915c6fabe15697556648dd6dd615c2edecd1ef8949ddb73a863ba2ff71e237e.rb","opal/nodes/base.source.rb":"opal/nodes/base.source-7659dcba28b01c565569308cc375fe94831ef7ad46a157973c7d375fe1771840.rb","opal/nodes/literal.source.rb":"opal/nodes/literal.source-e7c63d19f638a079cd0cb73592c0a63738bc83dc41e289d31e62aa911246d142.rb","opal/nodes/variables.source.rb":"opal/nodes/variables.source-af1977a8b39bce0210f945ddfd203187038a4bb65a3ab5fadc7d750d4051ef08.rb","opal/nodes/constants.source.rb":"opal/nodes/constants.source-9dee2fcf8462ed165ee00335973717010f7473af2f6d111a6ab0a1c2efadc68c.rb","corelib/comparable.source.rb":"corelib/comparable.source-6ae740f39e41e4c73dbbd9609b3cfe5b06f6efcbeb1a6ad45e512220cc7dc2f1.rb","pathname.source.rb":"pathname.source-4af5fbc18a6508347db78ac4925d3ec2cc25b66b8e64b5e22658f401d1c8bde7.rb","opal/nodes/call.source.rb":"opal/nodes/call.source-c48dc207235fddcff1b0bcda050f5b0bd1309bbfa01d8186ce8e794787b10d95.rb","opal/nodes/call_special.source.rb":"opal/nodes/call_special.source-9ff7b96524a95b4062ca6ab4ced1a560d1fe8991db9d04f1b94d25a0bdb9172c.rb","opal/nodes/scope.source.rb":"opal/nodes/scope.source-364d5f744bd417d460fb47772495cccf9acecb94413df8658815cdb26aea84a6.rb","opal/nodes/module.source.rb":"opal/nodes/module.source-1ce7c0c61c98853e523e079b76d8b3207a4bdfc93f7f12526959d0130b84ac1e.rb","opal/nodes/class.source.rb":"opal/nodes/class.source-ca22f2475cb60ee24354a640f27179a3cbaded644124d0ffdcfe6ad5da8945e3.rb","opal/nodes/singleton_class.source.rb":"opal/nodes/singleton_class.source-0ea1443d8433a8d96b3d24e9ca318e88555986cf8fe2ee263489cc906c7f0a6f.rb","opal/nodes/args/arg.source.rb":"opal/nodes/args/arg.source-8d5d2450446c50a6cf9061e8dbcb0266c43c4223b44400ccb5c4dcb04afac3ae.rb","opal/nodes/args/arity_check.source.rb":"opal/nodes/args/arity_check.source-0b4f697fd70e5cd42e1501a8b60cc9b20d6ee580feead711ddbb53a7bc8d85c5.rb","opal/nodes/args/ensure_kwargs_are_kwargs.source.rb":"opal/nodes/args/ensure_kwargs_are_kwargs.source-980baec81aa4b014263336a90ec17417c1a682c9e04e3e1c509d8f7318ea8d12.rb","opal/nodes/args/extract_block_arg.source.rb":"opal/nodes/args/extract_block_arg.source-6a85d2bb6011fb580f3c05ef965ca281dfbf38a778c5c4878ae9b9b3d8809217.rb","opal/nodes/args/extract_kwarg.source.rb":"opal/nodes/args/extract_kwarg.source-7ea9c9432b9fba0d27b3bbfdc935b97386d6ee9abe6138e98906d76464c76cc2.rb","opal/nodes/args/extract_kwargs.source.rb":"opal/nodes/args/extract_kwargs.source-57fd41af5899f069aa69688b30d0713c373d97c244a33c71f3bc7114031f1bf8.rb","opal/nodes/args/extract_kwoptarg.source.rb":"opal/nodes/args/extract_kwoptarg.source-1fb3f7119fa8fcf230e98e5599afd9a7cdf9bf559704892d74cbd4cde3d07feb.rb","opal/nodes/args/extract_kwrestarg.source.rb":"opal/nodes/args/extract_kwrestarg.source-2e32668aed5dec1f77dc615d9374748cb1bb0f063ec612e91d1ba76e6c4bd14c.rb","opal/nodes/args/extract_optarg.source.rb":"opal/nodes/args/extract_optarg.source-4973e4bd89aebde7abf99d0713e23d304c519e51be77a8a91e697c02c12b1a1b.rb","opal/nodes/args/extract_post_arg.source.rb":"opal/nodes/args/extract_post_arg.source-2f45dcaf1dfcb2ceb236339492b5cb0f72e4bd44a214dfc1f7f8c644250cfbb6.rb","opal/nodes/args/extract_post_optarg.source.rb":"opal/nodes/args/extract_post_optarg.source-87acad22bc6cf033ad56d23b9fc7257291af371e1272f88fe5454f2c66fc711c.rb","opal/nodes/args/extract_restarg.source.rb":"opal/nodes/args/extract_restarg.source-07348cbf0070549ee56e5f6dab3ea5f49875209f82248f77a9239f38801f5b4d.rb","opal/nodes/args/fake_arg.source.rb":"opal/nodes/args/fake_arg.source-0eedc329de139f44dc91961c2f04b9d58872e38219da177944baacf3162789fa.rb","opal/nodes/args/initialize_iterarg.source.rb":"opal/nodes/args/initialize_iterarg.source-1ce56fbb913210226852184a0af760aad726e2a70bef5a28ae3541d1f56e35e2.rb","opal/nodes/args/initialize_shadowarg.source.rb":"opal/nodes/args/initialize_shadowarg.source-16bc5e6e66bc8601eed5a638c5ae19f52248642f18c4b3aa9d992cebfe1772b7.rb","opal/nodes/args/parameters.source.rb":"opal/nodes/args/parameters.source-f0111f3975a6322fe945978d480dd0958fdf1166dfe3911d8fe8446a65ffaf19.rb","opal/nodes/args/prepare_post_args.source.rb":"opal/nodes/args/prepare_post_args.source-4fc872ee92352be9cc57730c078ce43d8e455e9beabc4912546c3670cccd21ba.rb","opal/nodes/args.source.rb":"opal/nodes/args.source-345dd14ece705f6a8d8c8184c0aa217df51744e35ecd71d102a2fa80c8918b11.rb","opal/nodes/node_with_args/shortcuts.source.rb":"opal/nodes/node_with_args/shortcuts.source-c2decc753ed2daf7beb6517deb8a83002c2ecd6f57eff7b0de621ccd98b5663a.rb","opal/nodes/node_with_args.source.rb":"opal/nodes/node_with_args.source-b9042d63c9378b2fa3089450122ee741d9a2c897b0b750150cae548ad40d42c5.rb","opal/nodes/iter.source.rb":"opal/nodes/iter.source-1002ee2fd151097bcf980ffacfdf9c23b6107728846005bd353fa89fa211926c.rb","opal/nodes/def.source.rb":"opal/nodes/def.source-14774520b7164f94594c10cef0eadbfddff59900e89850ccb1af67ffbae6ad4b.rb","opal/nodes/defs.source.rb":"opal/nodes/defs.source-17c910cf0f4da688af691125109e85fbda464a49b7e322d7d6e14fa74568bfd7.rb","opal/ast/matcher.source.rb":"opal/ast/matcher.source-704b0a37637c831e85d7fb52b1b836077b0f918b3a0266dc292c1e81a717acba.rb","opal/nodes/if.source.rb":"opal/nodes/if.source-51f92ca049aa5101785d1b0e007b0be29328333c0e158aa9fb64352cc7441266.rb","opal/nodes/logic.source.rb":"opal/nodes/logic.source-2debb04deb82f64adedca33ad7e7c5908cc097bc6898374a210c996a73600239.rb","opal/nodes/definitions.source.rb":"opal/nodes/definitions.source-b5b8ebc9901ca181ca2170c7b17308a3d1ea15ec5c4710df703ee42d412d4300.rb","opal/nodes/yield.source.rb":"opal/nodes/yield.source-9c3ffb95e0c2a999719ecce959649499ba79a57c181f6aee839fd4adf0de02e1.rb","opal/nodes/rescue.source.rb":"opal/nodes/rescue.source-51619b81b4fc4e0bfefe024b98a520c0d3f6e53ffdee44b7b75c7ed719d201ff.rb","opal/nodes/super.source.rb":"opal/nodes/super.source-29e8f086d8a16a9d9be5259065a0c0af5c072ce62a1726b79ff876bfeb42dffd.rb","json.source.rb":"json.source-b865f9c6664a1747fa62b4a9585dff5d367de647b7e8e3a08410116640579941.rb","opal/version.source.rb":"opal/version.source-e3809d99ad3702cb6ef488218066728fb7f889c0ddad3e794785906cdcab4379.rb","opal/nodes/top.source.rb":"opal/nodes/top.source-358838f769b2856651e5b09f35d4a09f85f8d72038e7d132e54026648a2f303a.rb","opal/nodes/while.source.rb":"opal/nodes/while.source-21679024f6c30e20c60ebea952c6ed64a5d92b0f7a7e983ba22ae2da965bd61a.rb","opal/nodes/hash.source.rb":"opal/nodes/hash.source-bbc17f118949262dbb74e7375d56eeaf059dd4180ab294ff5ae932b13a393648.rb","opal/nodes/array.source.rb":"opal/nodes/array.source-03c3f566655b4b61125e309e63f5cd06b7d8e986a2bbe8bd379c584791f6fb6c.rb","opal/nodes/defined.source.rb":"opal/nodes/defined.source-f29e732cf1c11cc81e3a19cf954f1f98c871596d2949079e46ad38d7b0388583.rb","opal/nodes/masgn.source.rb":"opal/nodes/masgn.source-3323dcd78ccf976fef2b06d015ac4a3c3b685f047d73abb8f915d5190fd56cd8.rb","opal/nodes/arglist.source.rb":"opal/nodes/arglist.source-5cc6bfac539eb067375d8c5a66f977ce76431afdcf0647da43d95d8aeea83af4.rb","opal/nodes/x_string.source.rb":"opal/nodes/x_string.source-8d1e9b92363cc3880c2a31b91f7679c694d8f99c1ddf22338738d9859d4e6593.rb","opal/nodes/lambda.source.rb":"opal/nodes/lambda.source-3ad0ff2fa933e061a26c44a5419b6b6e61848087abe6ad51379a78ad9c040949.rb","opal/nodes.source.rb":"opal/nodes.source-a06e9fca039a76d955658c837683e297c1469a40397653dda6fecd5a3b44dcc3.rb","opal/eof_content.source.rb":"opal/eof_content.source-e3a9ba6ecfd5a7fb18b95aefd9c3a42aa3b15b0e8cec82d79ca0d52d3e7fb269.rb","opal/errors.source.rb":"opal/errors.source-fb67e0c10d23fbcd654523c4b8a295a2dd106e0cd900f3fb9f1a582cc48d4166.rb","opal/magic_comments.source.rb":"opal/magic_comments.source-a5059e1a7f2f33f7a4975316d31918090e9b02d9601a87da2672dda31f98053f.rb","opal/source_map/map.source.rb":"opal/source_map/map.source-efdd58648b9911055d0a91aa72e18e349ca37570013261708aa029a72a052bcb.rb","opal/source_map/file.source.rb":"opal/source_map/file.source-11e0f7ecb939ecd146987e36b9f4b8a2b7f41f71f3735ea4ba0f677da856ed67.rb","opal/source_map/index.source.rb":"opal/source_map/index.source-1f72a1a208d444b4ac047cbbb06704bccec77896d9aac98dc3b792ba829da65b.rb","opal/source_map/vlq.source.rb":"opal/source_map/vlq.source-1262a66cc794d867f086a703fe1cbdf94038125f5002eab3f961e8dfd57ce437.rb","opal/source_map.source.rb":"opal/source_map.source-c31ead9775b0c66a9db73db136269b863bd688f923f6b03fb3dfbff1bf780489.rb","opal/compiler.source.rb":"opal/compiler.source-e403fe4c219cc7500c997c59a45775415cd7c8f4f323da8ce93e7ff937fa0df6.rb","opal/erb.source.rb":"opal/erb.source-c28c99c3cbe2c1cea8baa86979fa4eaad4fc069750f27a86cb1cef306014d6e8.rb","opal-parser.source.rb":"opal-parser.source-5d6f2ad0f5161a55ca662eb7587ef300f719556d4f526b805ce9dae78c367b38.rb","load-parser.source.js.rb":"load-parser.source.js-18a0a131bf97d1a19b0b875bcf7a57e061ad1d8822fbf5a5699707793de11cfb.rb","application.debug.js":"application.debug-f885af64520b10f24d2e46f68e925180dcf3dd5811d11be92629e51696a0389f.js","application.js":"application-74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80.js","application.js.map":"application.js-fefc1e2760e062a33b165fb45b0e0ef13e4bdc35d1f65975b492fe858c2136cf.map","corelib/runtime.source.js":"corelib/runtime.source-6a5a2cf851d99ea1fb6eab3f4c324f66d8fc21426515c040dca3489a5a86eb70.js","corelib/helpers.source.rb":"corelib/helpers.source-098704fe3cd4d2bb51daa51fc1ecb610bd5584fd3a02011d2d1c39daa19ec7b8.rb","corelib/module.source.rb":"corelib/module.source-74e15d4257ba5112a9b6922c3675bfb7064aeb1acd92f1f5bf40345a66f04a78.rb","corelib/class.source.rb":"corelib/class.source-6ac4292f7e727b499f679a4be5e22ca77533509714c7d8c87c429250b05d38ae.rb","corelib/basic_object.source.rb":"corelib/basic_object.source-c9f2ae6f9828520598d297ff62bd1d72086dc6f271cd63f0da8daf654e00d7d0.rb","corelib/kernel.source.rb":"corelib/kernel.source-4496dc29bcb0623813ec9c3cde538d2a3e6839593b93ec478cc3aa24a1a963fb.rb","corelib/main.source.rb":"corelib/main.source-117fdb7af0b8c1642859e35713a278f05fe11725c23d81f705018d1c605e0f53.rb","corelib/error/errno.source.rb":"corelib/error/errno.source-ca296bcfdf36d407edbcb3fa71e8b7718c94dce141a8a87e37881aadf23b80cd.rb","corelib/error.source.rb":"corelib/error.source-f23645cbb2065bfe2c1231e3851e9bfc9fd8a3b153bca37073a839997e98237c.rb","corelib/constants.source.rb":"corelib/constants.source-e79144fd86e6b20f2b49c62a5d37b60ffaf47f11db81d1363991639df141a01f.rb","opal/base.source.rb":"opal/base.source-55abc823c216010fd952e74b44c669aa82652aced413b1d59af35133542353cf.rb","corelib/nil.source.rb":"corelib/nil.source-d65ee9c3403849589db650b9ddbf0bafe912d5481bf5fcf3cf6c492a3ee04bf2.rb","corelib/boolean.source.rb":"corelib/boolean.source-5020f3d8692e3eeb1bc1d2daeb9fa0be955052788dbc702db146ced433569493.rb","corelib/regexp.source.rb":"corelib/regexp.source-c31394a97f067e5b5260844ade4b891f568b331638a038aaf7a240638a520a78.rb","corelib/string.source.rb":"corelib/string.source-87d008e7c0faa9a99219a0288c20bbdf19ab4cfdebaab9121c3b1030b29e3b5a.rb","corelib/enumerable.source.rb":"corelib/enumerable.source-aabe09b8461c48d5b4f9ac021caf5fb561d30ec76415f4bfffeecce0fa593269.rb","corelib/enumerator/arithmetic_sequence.source.rb":"corelib/enumerator/arithmetic_sequence.source-37b39c4bf3514dda60c0c84cb5f279528063e7be16d55e04efa0dc608af6484e.rb","corelib/enumerator/chain.source.rb":"corelib/enumerator/chain.source-d6e40c167f5f3479e4c9913e35ac1a4f8db519c39486c82858c555af3918d3eb.rb","corelib/enumerator/generator.source.rb":"corelib/enumerator/generator.source-9a9f9f4e152a0164a894fd263fc4d60605fcc184f6e8b898fb03117953f94b09.rb","corelib/enumerator/lazy.source.rb":"corelib/enumerator/lazy.source-0ff176e17644692a9ac0d9e2e8b015cbdb9cc8ebb450f3cc9fa0dee8dc908107.rb","corelib/enumerator/yielder.source.rb":"corelib/enumerator/yielder.source-9dc42b00f789765de111f3a82e5ad90502fb39e830be9c2a7d09e17e70237034.rb","corelib/enumerator.source.rb":"corelib/enumerator.source-230900b104b66f027879b18af04cf02b4b81d3d4dcc7f630eb49d526fbaca7ef.rb","corelib/numeric.source.rb":"corelib/numeric.source-16c3c8db76d183fa8775cce038960f6ef64a9a6b5df54bfa8169775c45a9ce8c.rb","corelib/array.source.rb":"corelib/array.source-bfe4bfd38d29d22a2c59f723e4a83727a1c7f2aff0ef255042af4e68d0409ec6.rb","corelib/hash.source.rb":"corelib/hash.source-43e0f7ea8b3c04d5a56613bdd11ab765756fcaa9c5fb6022d1421d6751b8e229.rb","corelib/number.source.rb":"corelib/number.source-cb83b5ca4647c2e1cc036178e34f6225a22e2d51a3fb7264cefb83de6e6e1939.rb","corelib/range.source.rb":"corelib/range.source-d351f7482e46103eec38f4c207e096d7378e1932f96843ea03daec8b8ffff6f2.rb","corelib/proc.source.rb":"corelib/proc.source-2b521447daf405076d4bac222855ff36812379c0445dfed9bc3eac34a3b219a2.rb","corelib/method.source.rb":"corelib/method.source-5db9cae6ec1333ff90f7ef7739d45d3e8d7b9d8f238c367021ff7165dd6a6446.rb","corelib/variables.source.rb":"corelib/variables.source-1a0df2dfa30886613488a97ea41fb3cd9dcc9fdeabcbe1e3e5a904647c90c4e6.rb","corelib/io.source.rb":"corelib/io.source-403e8a47b15d3fe92b5d55e8a315e5f07371c55f1b6db056fc4d9b01408af5e9.rb","opal/mini.source.rb":"opal/mini.source-638e1531040665f9ec68e0c88df0b229ebe2ac89276b1e9c156f779b9f33029f.rb","corelib/kernel/format.source.rb":"corelib/kernel/format.source-5dc6358fac4ee2a49f27470485163b821e0c9f61ba12db5a121e85985475ac7d.rb","corelib/string/encoding.source.rb":"corelib/string/encoding.source-e20bbd4db806af48823ff828bea06cca9c5573fe968e8db3e8ca77a99a45ea4b.rb","corelib/math.source.rb":"corelib/math.source-fa2631fcff5e4d9e11516986243d3b60098ba2262ad2ee05069193fbc0ad99d7.rb","corelib/complex/base.source.rb":"corelib/complex/base.source-e3d177911f1b14c79b0cc915d3f6acb16d23336997324f10689e0805766cb5f7.rb","corelib/complex.source.rb":"corelib/complex.source-15d824f7f747b34ea4ec96b8fb20b039de8777db21ed673ffa89f09eefa6e312.rb","corelib/rational/base.source.rb":"corelib/rational/base.source-4783a9070f721a5eab480da1444557f592c4fa03694deda96cfe068dd5014a3c.rb","corelib/rational.source.rb":"corelib/rational.source-fd79732f5b9233a5ad74fee8c2c1fb8cc5feba389dfef0076b6d0378d81d5b6f.rb","corelib/time.source.rb":"corelib/time.source-eb79092b11820cd9074f48da3c3c95471675bef7c150c443c008b4fbb915cfdb.rb","corelib/struct.source.rb":"corelib/struct.source-be1ae7c9162154659ed197f2225c0a1b5fc455f72629c3b5f31482d4fcb09fa2.rb","corelib/set.source.rb":"corelib/set.source-b044aca303702523db7cf30a05368d7dcf4b000fc6a688938dc4644d3eecc7ba.rb","corelib/dir.source.rb":"corelib/dir.source-d67398b5f027e6bcf13aaa88c93a14c7b1d252ccce8189f63db8dff2347672a0.rb","corelib/file.source.rb":"corelib/file.source-db4d733e61452a07f91d541a74c11a413b88a2ae1ccb54090bc32177d141140d.rb","corelib/process/base.source.rb":"corelib/process/base.source-ed219f24e478564e66ce8b54c742bde00c698b6e2f8e258551f4c5a754592378.rb","corelib/process.source.rb":"corelib/process.source-eae0d96ba98ca61234679790bfdd6b05adf36ed806a67d2c575505d96a580316.rb","corelib/random/formatter.source.rb":"corelib/random/formatter.source-a5c67b3842448a9f38de7e59b1ef6cf0c1a4e9300c4ee9cf84d9102417f3a8f3.rb","corelib/random/mersenne_twister.source.rb":"corelib/random/mersenne_twister.source-96ab5e8c533f105c29c53801cfefff5c4a93daa242214f233d93d7e71989134e.rb","corelib/random.source.rb":"corelib/random.source-7a6ede92c9d8128add2371b37d8a03a47d3170656f40e20e56e532a1a63aba3e.rb","corelib/unsupported.source.rb":"corelib/unsupported.source-8e81720371807cc5396ff2eedff847682814b8e9c62ec9d95208d96584e09b4b.rb","corelib/binding.source.rb":"corelib/binding.source-3b309deb9807f4940f2c9ed7679bfc40cc5eb11683ca41f594bf7f49453630a0.rb","corelib/irb.source.rb":"corelib/irb.source-04c57c643e2c4ed9e9cda17758fd8929fb02554f1a8576a782d788eb37e563dd.rb","opal.source.rb":"opal.source-4034ad8e0a1fdcd74becb7ba30cb0eb19ba9ffbb4e7d511b79077250fcad421d.rb","native.source.rb":"native.source-1c0d7d79cef6591a9faaa9dd0dd903a7bda671d4885952f472b40dd49d827465.rb","console.source.rb":"console.source-d5d314ea6b559f8cfe86bf3f2809ff5602b4a492a206152a3f2dc568c79361af.rb","js.source.rb":"js.source-fc496a13dc2a906b4406a4a97ee81a610152e0a15d9b935e8bbf634f94e535fd.rb","application.source.js.rb":"application.source.js-1c44c3e7669e9ba07cc951b94fa5249c487df88ac70612b6a2a6d4b95ce60b02.rb","try.debug.js":"try.debug-9406c8141040cc9dd32f9ad05ab21a0662a70305b1a22ee26e6bc0cf14572b7a.js","try.js":"try-be06c51740f19e9ba0c35fdc4c49457e10319b2d3c769911818d9866e87cd107.js","try.js.map":"try.js-4a24a3170b9aaf4107e672a9772cbcf91222ba6a397247d800938ad58d95a4bc.map","_vendor/codemirror.source.js":"_vendor/codemirror.source-02e1e58bfe4c3b5acc3b5eac25dd452e75094d1f2ad66aa19d68997988c661de.js","_vendor/ruby.source.js":"_vendor/ruby.source-66aaca5ea56621bad19bff704c61709e12cb5e53d83aa65f098432d0fb599cac.js","_vendor/javascript.source.js":"_vendor/javascript.source-5462d687adc5dcbddfc7bf43cde9ad6ccc27cfdf78e7a96a86368d6af62f69b3.js","try/examples.source.rb":"try/examples.source-ffd37a3924f0f5fd6e55eb1f75c25c78bb939e9eda723b4b039c51d07a7700f5.rb","try.source.js.rb":"try.source.js-85bdbb21b84aa0121d3a4f891a3132fd51c363ea14e32837ab9b419eec7a6682.rb"}} \ No newline at end of file +{"files":{"manifest-051b80c2b5fb204b550aba6cf928072bbb42036e37e7706f5459081c977c1c2c.js":{"logical_path":"manifest.js","mtime":"2023-11-23T09:58:46+00:00","size":90,"digest":"051b80c2b5fb204b550aba6cf928072bbb42036e37e7706f5459081c977c1c2c","integrity":"sha256-BRuAwrX7IEtVCrps+SgHK7tCA24353BvVFkIHJd8HCw="},"application.debug-5831b9572963d71dcb254b54bc0ec95f027323aed416e47cd8a208bed1efbbea.css":{"logical_path":"application.debug.css","mtime":"2023-11-23T09:58:46+00:00","size":116521,"digest":"5831b9572963d71dcb254b54bc0ec95f027323aed416e47cd8a208bed1efbbea","integrity":"sha256-WDG5Vylj1x3LJUtUvA7JXwJzI67UFuR82KIIvtHvu+o="},"application-915b7e3cafe6e192dee011fa09837b2af85b7e1de3dbb52fd1413d46dd2dca0e.css":{"logical_path":"application.css","mtime":"2023-11-23T09:58:46+00:00","size":116411,"digest":"915b7e3cafe6e192dee011fa09837b2af85b7e1de3dbb52fd1413d46dd2dca0e","integrity":"sha256-kVt+PK/m4ZLe4BH6CYN7Kvhbfh3j27Uv0UE9Rt0tyg4="},"application.css-6af110e86ced0e076fe5512b7eeef8d85edc3659719ed624f009ab14f21e029a.map":{"logical_path":"application.css.map","mtime":"2023-11-23T09:58:46+00:00","size":81254,"digest":"6af110e86ced0e076fe5512b7eeef8d85edc3659719ed624f009ab14f21e029a","integrity":"sha256-avEQ6GztDgdv5VErfu742F7cNllxntYk8AmrFPIeApo="},"application.source-01d3042c3bc7c1b2ded94479a37bda3e2a3b65f1957686eba6700502b4fe5082.scss":{"logical_path":"application.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":4963,"digest":"01d3042c3bc7c1b2ded94479a37bda3e2a3b65f1957686eba6700502b4fe5082","integrity":"sha256-AdMELDvHwbLe2UR5o3vaPio7ZfGVdobrpnAFArT+UII="},"_vendor/_pygment_solarized_light.source-6794ffcdd63dcecc7c972f8c3b032fe28134bd8add2a0257df56c173174ccc30.scss":{"logical_path":"_vendor/_pygment_solarized_light.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":3696,"digest":"6794ffcdd63dcecc7c972f8c3b032fe28134bd8add2a0257df56c173174ccc30","integrity":"sha256-Z5T/zdY9zsx8ly+MOwMv4oE0vYrdKgJX31bBcxdMzDA="},"_vendor/_codemirror-solarized.source-c8817c4f8a3022d53d7ba1f7d53a0739efd87e1740d931cc1fff1ec30060bdcc.scss":{"logical_path":"_vendor/_codemirror-solarized.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":2073,"digest":"c8817c4f8a3022d53d7ba1f7d53a0739efd87e1740d931cc1fff1ec30060bdcc","integrity":"sha256-yIF8T4owItU9e6H31ToHOe/YfhdA2THMH/8ewwBgvcw="},"_blog.source-1468f1e056e48afbf297b9511e4cb8d72622100a4cbd79dcab0c313174ac0164.scss":{"logical_path":"_blog.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1308,"digest":"1468f1e056e48afbf297b9511e4cb8d72622100a4cbd79dcab0c313174ac0164","integrity":"sha256-FGjx4Fbkivvyl7lRHky41yYiEApMvXncqwwxMXSsAWQ="},"_index.source-8e5904704d64bea7a6d7cc2cbd3291762d8e14a5702873b2b8f372c0d4db2cd2.scss":{"logical_path":"_index.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1094,"digest":"8e5904704d64bea7a6d7cc2cbd3291762d8e14a5702873b2b8f372c0d4db2cd2","integrity":"sha256-jlkEcE1kvqem18wsvTKRdi2OFKVwKHOyuPNywNTbLNI="},"_codemirror.source-e40f23e95ff81277d0e9f4cb5b65d5df9ce160bfdc41d67cc224af3a6922488c.scss":{"logical_path":"_codemirror.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":6199,"digest":"e40f23e95ff81277d0e9f4cb5b65d5df9ce160bfdc41d67cc224af3a6922488c","integrity":"sha256-5A8j6V/4EnfQ6fTLW2XV35zhYL/cQdZ8wiSvOmkiSIw="},"_bootstrap-sprockets.source-617bd14f8f87a7d4f3104d96ada5ff1ef60ea8cd1b0c0244675ac792d4c4977c.scss":{"logical_path":"_bootstrap-sprockets.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":131,"digest":"617bd14f8f87a7d4f3104d96ada5ff1ef60ea8cd1b0c0244675ac792d4c4977c","integrity":"sha256-YXvRT4+Hp9TzEE2WraX/HvYOqM0bDAJEZ1rHktTEl3w="},"_bootstrap.source-17d7cd48409fa895ebcc007d74770c893e323925b0a1e4095aea7bcdb529c070.scss":{"logical_path":"_bootstrap.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1319,"digest":"17d7cd48409fa895ebcc007d74770c893e323925b0a1e4095aea7bcdb529c070","integrity":"sha256-F9fNSECfqJXrzAB9dHcMiT4yOSWwoeQJWup7zbUpwHA="},"bootstrap/_variables.source-482186f7e15fd47e0bdb00a85e8edf7a10a014aa59373f1fdf71585a5d6feadc.scss":{"logical_path":"bootstrap/_variables.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":30142,"digest":"482186f7e15fd47e0bdb00a85e8edf7a10a014aa59373f1fdf71585a5d6feadc","integrity":"sha256-SCGG9+Ff1H4L2wCoXo7fehCgFKpZNz8f33FYWl1v6tw="},"bootstrap/_mixins.source-f69f85085da6f31aeaf5a3f6e829609414b034f72d5f66c28b7e47565c31879d.scss":{"logical_path":"bootstrap/_mixins.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":957,"digest":"f69f85085da6f31aeaf5a3f6e829609414b034f72d5f66c28b7e47565c31879d","integrity":"sha256-9p+FCF2m8xrq9aP26ClglBSwNPctX2bCi35HVlwxh50="},"bootstrap/mixins/_hide-text.source-744d07b859e64a5054bb3a5a61c741da0802ccdf1c01c04cb58a99e7a3a64475.scss":{"logical_path":"bootstrap/mixins/_hide-text.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":599,"digest":"744d07b859e64a5054bb3a5a61c741da0802ccdf1c01c04cb58a99e7a3a64475","integrity":"sha256-dE0HuFnmSlBUuzpaYcdB2ggCzN8cAcBMtYqZ56OmRHU="},"bootstrap/mixins/_opacity.source-24a43bd4cccdf1523772ee49cb5d26e7bf8cd3f76202221ce2d417180f920e60.scss":{"logical_path":"bootstrap/mixins/_opacity.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":152,"digest":"24a43bd4cccdf1523772ee49cb5d26e7bf8cd3f76202221ce2d417180f920e60","integrity":"sha256-JKQ71MzN8VI3cu5Jy10m57+M0/diAiIc4tQXGA+SDmA="},"bootstrap/mixins/_image.source-11e4a737146939fe6c78e1634e2aaacaf6555340fceabfad6c0c90f0501386f4.scss":{"logical_path":"bootstrap/mixins/_image.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1279,"digest":"11e4a737146939fe6c78e1634e2aaacaf6555340fceabfad6c0c90f0501386f4","integrity":"sha256-EeSnNxRpOf5seOFjTiqqyvZVU0D86r+tbAyQ8FAThvQ="},"bootstrap/mixins/_labels.source-fc0e4380846766ac47c42d977f6a16c89788fabc88aa5d825aa2040c0397fd15.scss":{"logical_path":"bootstrap/mixins/_labels.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":169,"digest":"fc0e4380846766ac47c42d977f6a16c89788fabc88aa5d825aa2040c0397fd15","integrity":"sha256-/A5DgIRnZqxHxC2Xf2oWyJeI+ryIql2CWqIEDAOX/RU="},"bootstrap/mixins/_reset-filter.source-85a38f5886d4d9f3c3beee2d2a0762a336725b1b6ce8a900b35c0fef05eca90c.scss":{"logical_path":"bootstrap/mixins/_reset-filter.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":246,"digest":"85a38f5886d4d9f3c3beee2d2a0762a336725b1b6ce8a900b35c0fef05eca90c","integrity":"sha256-haOPWIbU2fPDvu4tKgdiozZyWxts6KkAs1wP7wXsqQw="},"bootstrap/mixins/_resize.source-f667a158b80786e0b6a02cbe8cc007879cd2f0111e7285f37ad76221fc53edd8.scss":{"logical_path":"bootstrap/mixins/_resize.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":202,"digest":"f667a158b80786e0b6a02cbe8cc007879cd2f0111e7285f37ad76221fc53edd8","integrity":"sha256-9mehWLgHhuC2oCy+jMAHh5zS8BEecoXzetdiIfxT7dg="},"bootstrap/mixins/_responsive-visibility.source-c5922fa5c03e4e5519c0d6b0fe55d74deb4df78c4b92030f167a7eb93e3cf5f4.scss":{"logical_path":"bootstrap/mixins/_responsive-visibility.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":503,"digest":"c5922fa5c03e4e5519c0d6b0fe55d74deb4df78c4b92030f167a7eb93e3cf5f4","integrity":"sha256-xZIvpcA+TlUZwNaw/lXXTetN94xLkgMPFnp+uT489fQ="},"bootstrap/mixins/_size.source-43ed70c482e6890da52c5cb98b33b651cb6e5535887deebc31145a9d2ae0e292.scss":{"logical_path":"bootstrap/mixins/_size.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":147,"digest":"43ed70c482e6890da52c5cb98b33b651cb6e5535887deebc31145a9d2ae0e292","integrity":"sha256-Q+1wxILmiQ2lLFy5izO2UctuVTWIfe68MRRanSrg4pI="},"bootstrap/mixins/_tab-focus.source-cc154891d4d781e6a012e90e57921c52b8b4be016c9a86c827546b7d117fb25b.scss":{"logical_path":"bootstrap/mixins/_tab-focus.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":165,"digest":"cc154891d4d781e6a012e90e57921c52b8b4be016c9a86c827546b7d117fb25b","integrity":"sha256-zBVIkdTXgeagEukOV5IcUri0vgFsmobIJ1RrfRF/sls="},"bootstrap/mixins/_text-emphasis.source-5122df1667a80e2f6e577fc257c5106b68d68b5ae490647c2c3ecc41651743a7.scss":{"logical_path":"bootstrap/mixins/_text-emphasis.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":189,"digest":"5122df1667a80e2f6e577fc257c5106b68d68b5ae490647c2c3ecc41651743a7","integrity":"sha256-USLfFmeoDi9uV3/CV8UQa2jWi1rkkGR8LD7MQWUXQ6c="},"bootstrap/mixins/_text-overflow.source-f2a9a690e1843c596df61998e0e78f40cd65a5b649c77a50b87dd2fdb980aa1b.scss":{"logical_path":"bootstrap/mixins/_text-overflow.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":168,"digest":"f2a9a690e1843c596df61998e0e78f40cd65a5b649c77a50b87dd2fdb980aa1b","integrity":"sha256-8qmmkOGEPFlt9hmY4OePQM1lpbZJx3pQuH3S/bmAqhs="},"bootstrap/mixins/_vendor-prefixes.source-f5f733f9a623615ab9101c9e32699cc92770fa57ac1d09196e099d1749cda303.scss":{"logical_path":"bootstrap/mixins/_vendor-prefixes.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":6638,"digest":"f5f733f9a623615ab9101c9e32699cc92770fa57ac1d09196e099d1749cda303","integrity":"sha256-9fcz+aYjYVq5EByeMmmcySdw+lesHQkZbgmdF0nNowM="},"bootstrap/mixins/_alerts.source-16f165cb79b8d222f79cfa2e9eb63d80afc00b73c5fc0720997734d389a29d6f.scss":{"logical_path":"bootstrap/mixins/_alerts.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":263,"digest":"16f165cb79b8d222f79cfa2e9eb63d80afc00b73c5fc0720997734d389a29d6f","integrity":"sha256-FvFly3m40iL3nPounrY9gK/AC3PF/AcgmXc004minW8="},"bootstrap/mixins/_buttons.source-1e01e239d869ca1db2c754944d3443f116fe8bf046ffcd937310ca42be615c39.scss":{"logical_path":"bootstrap/mixins/_buttons.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1068,"digest":"1e01e239d869ca1db2c754944d3443f116fe8bf046ffcd937310ca42be615c39","integrity":"sha256-HgHiOdhpyh2yx1SUTTRD8Rb+i/BG/82TcxDKQr5hXDk="},"bootstrap/mixins/_panels.source-d6fb2063735bf908241957257cfdb03d6410e22a29d2499c0536be2632abd592.scss":{"logical_path":"bootstrap/mixins/_panels.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":543,"digest":"d6fb2063735bf908241957257cfdb03d6410e22a29d2499c0536be2632abd592","integrity":"sha256-1vsgY3Nb+QgkGVclfP2wPWQQ4iop0kmcBTa+JjKr1ZI="},"bootstrap/mixins/_pagination.source-f06aaed2591ea5ca3e3bd48f62e25e471a69dddd8fc195f1d0cc6ccc4bf23b81.scss":{"logical_path":"bootstrap/mixins/_pagination.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":460,"digest":"f06aaed2591ea5ca3e3bd48f62e25e471a69dddd8fc195f1d0cc6ccc4bf23b81","integrity":"sha256-8Gqu0lkepco+O9SPYuJeRxpp3d2PwZXx0MxszEvyO4E="},"bootstrap/mixins/_list-group.source-294f6a9a302c9b2781e61ee063e53a79902f4b61827473630170da3f47714357.scss":{"logical_path":"bootstrap/mixins/_list-group.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":593,"digest":"294f6a9a302c9b2781e61ee063e53a79902f4b61827473630170da3f47714357","integrity":"sha256-KU9qmjAsmyeB5h7gY+U6eZAvS2GCdHNjAXDaP0dxQ1c="},"bootstrap/mixins/_nav-divider.source-4dfd32935ea1d043c0af570b80687bcf634ded8ba616336259d0dff8ab650191.scss":{"logical_path":"bootstrap/mixins/_nav-divider.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":238,"digest":"4dfd32935ea1d043c0af570b80687bcf634ded8ba616336259d0dff8ab650191","integrity":"sha256-Tf0yk16h0EPAr1cLgGh7z2NN7YumFjNiWdDf+KtlAZE="},"bootstrap/mixins/_forms.source-d58c71313533676457cddeb86fb2dbffa636e39ef86696c863a3054429a60642.scss":{"logical_path":"bootstrap/mixins/_forms.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":2683,"digest":"d58c71313533676457cddeb86fb2dbffa636e39ef86696c863a3054429a60642","integrity":"sha256-1YxxMTUzZ2RXzd64b7Lb/6Y24574ZpbIY6MFRCmmBkI="},"bootstrap/mixins/_progress-bar.source-75f3702c9f9f63ced3d3e848e8c5de1cc321256b864eb79d9b2534da2a782b82.scss":{"logical_path":"bootstrap/mixins/_progress-bar.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":202,"digest":"75f3702c9f9f63ced3d3e848e8c5de1cc321256b864eb79d9b2534da2a782b82","integrity":"sha256-dfNwLJ+fY87T0+hI6MXeHMMhJWuGTredmyU02ip4K4I="},"bootstrap/mixins/_table-row.source-5bc673689b0e533c050784b4aac716c12e08cae1bb8948f32cd0a9da752e6a6c.scss":{"logical_path":"bootstrap/mixins/_table-row.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":715,"digest":"5bc673689b0e533c050784b4aac716c12e08cae1bb8948f32cd0a9da752e6a6c","integrity":"sha256-W8ZzaJsOUzwFB4S0qscWwS4IyuG7iUjzLNCp2nUuamw="},"bootstrap/mixins/_background-variant.source-faea592ef84bb2f65cbc371028f8db9f6ce70a0169a32feed86dbe2fd45b243d.scss":{"logical_path":"bootstrap/mixins/_background-variant.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":212,"digest":"faea592ef84bb2f65cbc371028f8db9f6ce70a0169a32feed86dbe2fd45b243d","integrity":"sha256-+upZLvhLsvZcvDcQKPjbn2znCgFpoy/u2G2+L9RbJD0="},"bootstrap/mixins/_border-radius.source-c7385e8d18e49d52cdcef95f7a22a86c3c1a10cddc56f7071c6f988869d3ca62.scss":{"logical_path":"bootstrap/mixins/_border-radius.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":492,"digest":"c7385e8d18e49d52cdcef95f7a22a86c3c1a10cddc56f7071c6f988869d3ca62","integrity":"sha256-xzhejRjknVLNzvlfeiKobDwaEM3cVvcHHG+YiGnTymI="},"bootstrap/mixins/_gradients.source-8c74fe22ac06fa17249449c725c00f9f6cac2affa5eca1f09f28639bd01013ec.scss":{"logical_path":"bootstrap/mixins/_gradients.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":4392,"digest":"8c74fe22ac06fa17249449c725c00f9f6cac2affa5eca1f09f28639bd01013ec","integrity":"sha256-jHT+IqwG+hcklEnHJcAPn2ysKv+l7KHwnyhjm9AQE+w="},"bootstrap/mixins/_clearfix.source-f3599294867438e1433ceb90d573d4f042e546e687e06b366219c67f3e08cacd.scss":{"logical_path":"bootstrap/mixins/_clearfix.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":611,"digest":"f3599294867438e1433ceb90d573d4f042e546e687e06b366219c67f3e08cacd","integrity":"sha256-81mSlIZ0OOFDPOuQ1XPU8ELlRuaH4Gs2YhnGfz4Iys0="},"bootstrap/mixins/_center-block.source-bfdc52231145f062b6ac0444096d5da0fdcfa24412f9f01def285882a761da14.scss":{"logical_path":"bootstrap/mixins/_center-block.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":126,"digest":"bfdc52231145f062b6ac0444096d5da0fdcfa24412f9f01def285882a761da14","integrity":"sha256-v9xSIxFF8GK2rARECW1doP3PokQS+fAd7yhYgqdh2hQ="},"bootstrap/mixins/_nav-vertical-align.source-5dd7d8297185f30e923b35bf60b7f4e6c3ea662561a1b588230c55297fc75168.scss":{"logical_path":"bootstrap/mixins/_nav-vertical-align.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":370,"digest":"5dd7d8297185f30e923b35bf60b7f4e6c3ea662561a1b588230c55297fc75168","integrity":"sha256-XdfYKXGF8w6SOzW/YLf05sPqZiVhobWIIwxVKX/HUWg="},"bootstrap/mixins/_grid-framework.source-d6de740850d367cde1814a930f5a89e68f1a4048ad2af57eba0c5850a9dd229e.scss":{"logical_path":"bootstrap/mixins/_grid-framework.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":2347,"digest":"d6de740850d367cde1814a930f5a89e68f1a4048ad2af57eba0c5850a9dd229e","integrity":"sha256-1t50CFDTZ83hgUqTD1qJ5o8aQEitKvV+ugxYUKndIp4="},"bootstrap/mixins/_grid.source-86a1bea9c80367c82818c8deee4b694f5d03db8b3baf0d3cd10f109bf9e0aaec.scss":{"logical_path":"bootstrap/mixins/_grid.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":3194,"digest":"86a1bea9c80367c82818c8deee4b694f5d03db8b3baf0d3cd10f109bf9e0aaec","integrity":"sha256-hqG+qcgDZ8goGMje7ktpT10D24s7rw080Q8Qm/ngquw="},"bootstrap/_normalize.source-9d4affd5f91924523e244e1c5b503aac4bb2fb76a4b009c0168d872788426626.scss":{"logical_path":"bootstrap/_normalize.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":7635,"digest":"9d4affd5f91924523e244e1c5b503aac4bb2fb76a4b009c0168d872788426626","integrity":"sha256-nUr/1fkZJFI+JE4cW1A6rEuy+3aksAnAFo2HJ4hCZiY="},"bootstrap/_print.source-4e1eac8f340c82d34b71b5fae32aff2a607a5b3279077d97e81836951660b6dc.scss":{"logical_path":"bootstrap/_print.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1613,"digest":"4e1eac8f340c82d34b71b5fae32aff2a607a5b3279077d97e81836951660b6dc","integrity":"sha256-Th6sjzQMgtNLcbX64yr/KmB6WzJ5B32X6Bg2lRZgttw="},"bootstrap/_scaffolding.source-a6ba8ce4bf75bd1f7f49bfd683557a5dd67844db73827639c207453e72c1d9a6.scss":{"logical_path":"bootstrap/_scaffolding.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":2691,"digest":"a6ba8ce4bf75bd1f7f49bfd683557a5dd67844db73827639c207453e72c1d9a6","integrity":"sha256-prqM5L91vR9/Sb/Wg1V6XdZ4RNtzgnY5wgdFPnLB2aY="},"bootstrap/_type.source-3734242e194571b02107f9d64d1676cab7f99eaf1c0a2741831bdb84e8b054de.scss":{"logical_path":"bootstrap/_type.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":6174,"digest":"3734242e194571b02107f9d64d1676cab7f99eaf1c0a2741831bdb84e8b054de","integrity":"sha256-NzQkLhlFcbAhB/nWTRZ2yrf5nq8cCidBgxvbhOiwVN4="},"bootstrap/_code.source-32c093107b854533c984a1d3d33977f99202a126c07a054001e4cd7fde0fac10.scss":{"logical_path":"bootstrap/_code.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1378,"digest":"32c093107b854533c984a1d3d33977f99202a126c07a054001e4cd7fde0fac10","integrity":"sha256-MsCTEHuFRTPJhKHT0zl3+ZICoSbAegVAAeTNf94PrBA="},"bootstrap/_grid.source-cca48675d371e0c0bf11dbf00e3736578eff464b978a25d1a4ade3bcbed80ecd.scss":{"logical_path":"bootstrap/_grid.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1451,"digest":"cca48675d371e0c0bf11dbf00e3736578eff464b978a25d1a4ade3bcbed80ecd","integrity":"sha256-zKSGddNx4MC/EdvwDjc2V47/RkuXiiXRpK3jvL7YDs0="},"bootstrap/_tables.source-5d66b5342353d126f0e20b2b4184143350f54f68022f36da658d5d1e3d91bed8.scss":{"logical_path":"bootstrap/_tables.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":4529,"digest":"5d66b5342353d126f0e20b2b4184143350f54f68022f36da658d5d1e3d91bed8","integrity":"sha256-XWa1NCNT0Sbw4gsrQYQUM1D1T2gCLzbaZY1dHj2Rvtg="},"bootstrap/_forms.source-a9e925fca4a9805dc3b80b749d357b3afc1196d85a07f096c23862c37e51d426.scss":{"logical_path":"bootstrap/_forms.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":13884,"digest":"a9e925fca4a9805dc3b80b749d357b3afc1196d85a07f096c23862c37e51d426","integrity":"sha256-qekl/KSpgF3DuAt0nTV7OvwRlthaB/CWwjhiw35R1CY="},"bootstrap/_buttons.source-a3e623ca2a0490713d186de54ec6bac70a8612f986b6b39c63bda4f843adcf55.scss":{"logical_path":"bootstrap/_buttons.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":3628,"digest":"a3e623ca2a0490713d186de54ec6bac70a8612f986b6b39c63bda4f843adcf55","integrity":"sha256-o+YjyioEkHE9GG3lTsa6xwqGEvmGtrOcY72k+EOtz1U="},"bootstrap/_component-animations.source-153de427f07c04d747940bc5c360cc716fa00008dd2b8e5d1038bbd3e93bd8ed.scss":{"logical_path":"bootstrap/_component-animations.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":725,"digest":"153de427f07c04d747940bc5c360cc716fa00008dd2b8e5d1038bbd3e93bd8ed","integrity":"sha256-FT3kJ/B8BNdHlAvFw2DMcW+gAAjdK45dEDi70+k72O0="},"bootstrap/_dropdowns.source-0010fb4057ead72a145cc8e6ab3e4ea290e899d82b7f66177a29f90c2996b647.scss":{"logical_path":"bootstrap/_dropdowns.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":4803,"digest":"0010fb4057ead72a145cc8e6ab3e4ea290e899d82b7f66177a29f90c2996b647","integrity":"sha256-ABD7QFfq1yoUXMjmqz5OopDomdgrf2YXein5DCmWtkc="},"bootstrap/_button-groups.source-21e18e2516879de3defda28c5d32f5e344bbc85421ad66b38186224f2455e8cc.scss":{"logical_path":"bootstrap/_button-groups.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":5558,"digest":"21e18e2516879de3defda28c5d32f5e344bbc85421ad66b38186224f2455e8cc","integrity":"sha256-IeGOJRaHnePe/aKMXTL140S7yFQhrWazgYYiTyRV6Mw="},"bootstrap/_input-groups.source-8fae3b159a0c69d4cc9af589bb073ca5b1da90973092bcc00276aa1a4fa164be.scss":{"logical_path":"bootstrap/_input-groups.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":4243,"digest":"8fae3b159a0c69d4cc9af589bb073ca5b1da90973092bcc00276aa1a4fa164be","integrity":"sha256-j647FZoMadTMmvWJuwc8pbHakJcwkrzAAnaqGk+hZL4="},"bootstrap/_navs.source-8779db84fe76e19abe7b9d4d5014adb07e23e5a773a3d17b529c0e879df71540.scss":{"logical_path":"bootstrap/_navs.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":4949,"digest":"8779db84fe76e19abe7b9d4d5014adb07e23e5a773a3d17b529c0e879df71540","integrity":"sha256-h3nbhP524Zq+e51NUBStsH4j5adzo9F7UpwOh533FUA="},"bootstrap/_navbar.source-6ea4c7c0aeabc2157f63ac00af971a113c9b5cf66736a8020ca4a18cca3817df.scss":{"logical_path":"bootstrap/_navbar.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":14803,"digest":"6ea4c7c0aeabc2157f63ac00af971a113c9b5cf66736a8020ca4a18cca3817df","integrity":"sha256-bqTHwK6rwhV/Y6wAr5caETybXPZnNqgCDKShjMo4F98="},"bootstrap/_breadcrumbs.source-33c2f0bae433c1d2bed93c81ce71176ba35ab03d15d8b7cc919251d6ff619f80.scss":{"logical_path":"bootstrap/_breadcrumbs.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":595,"digest":"33c2f0bae433c1d2bed93c81ce71176ba35ab03d15d8b7cc919251d6ff619f80","integrity":"sha256-M8LwuuQzwdK+2TyBznEXa6NasD0V2LfMkZJR1v9hn4A="},"bootstrap/_pagination.source-3f41713467dd921cc1ac350f1cc0b3bdb6c57687f36cbb0d680fc9d078d7fb46.scss":{"logical_path":"bootstrap/_pagination.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":2028,"digest":"3f41713467dd921cc1ac350f1cc0b3bdb6c57687f36cbb0d680fc9d078d7fb46","integrity":"sha256-P0FxNGfdkhzBrDUPHMCzvbbFdofzbLsNaA/J0HjX+0Y="},"bootstrap/_pager.source-59ef3d3b0c5e7ed35f392ce461edf06bfc829c535afd8630b2aac51a44e11892.scss":{"logical_path":"bootstrap/_pager.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":853,"digest":"59ef3d3b0c5e7ed35f392ce461edf06bfc829c535afd8630b2aac51a44e11892","integrity":"sha256-We89OwxeftNfOSzkYe3wa/yCnFNa/YYwsqrFGkThGJI="},"bootstrap/_labels.source-bf9bd4cdd0441acb70db89f7a33adf06e50b4a7ff92db8fece20832a697612a7.scss":{"logical_path":"bootstrap/_labels.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1156,"digest":"bf9bd4cdd0441acb70db89f7a33adf06e50b4a7ff92db8fece20832a697612a7","integrity":"sha256-v5vUzdBEGstw24n3ozrfBuULSn/5Lbj+ziCDKml2Eqc="},"bootstrap/_badges.source-f20d636c4d5f23c846448eb64155b594a319e62329f5f1001f680b35972a1ae4.scss":{"logical_path":"bootstrap/_badges.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":1098,"digest":"f20d636c4d5f23c846448eb64155b594a319e62329f5f1001f680b35972a1ae4","integrity":"sha256-8g1jbE1fI8hGRI62QVW1lKMZ5iMp9fEAH2gLNZcqGuQ="},"bootstrap/_jumbotron.source-35d116542ab176f99d69611ba5b6ff30f03769f44ee364c2c1b224c89fcbcafb.scss":{"logical_path":"bootstrap/_jumbotron.source.scss","mtime":"2023-11-23T09:58:46+00:00","size":965,"digest":"35d116542ab176f99d69611ba5b6ff30f03769f44ee364c2c1b224c89fcbcafb","integrity":"sha256-NdEWVCqxdvmdaWEbpbb/MPA3afRO42TCwbIkyJ/Lyvs="},"bootstrap/_thumbnails.source-9d6038f6ab70449bed07a3b40d4cbb304a9339c00e568b00fc9432168afec7de.scss":{"logical_path":"bootstrap/_thumbnails.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":891,"digest":"9d6038f6ab70449bed07a3b40d4cbb304a9339c00e568b00fc9432168afec7de","integrity":"sha256-nWA49qtwRJvtB6O0DUy7MEqTOcAOVosA/JQyFor+x94="},"bootstrap/_alerts.source-f175606a34f8d438e6dab1bb0522f0bfb97ca0df0166f81425bab8021d9b2c41.scss":{"logical_path":"bootstrap/_alerts.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":1545,"digest":"f175606a34f8d438e6dab1bb0522f0bfb97ca0df0166f81425bab8021d9b2c41","integrity":"sha256-8XVgajT41Djm2rG7BSLwv7l8oN8BZvgUJbq4Ah2bLEE="},"bootstrap/_progress-bars.source-4c2bf460b33d74d64db07fca213c92de552b7dc92cd24a950cbf38c064e7875b.scss":{"logical_path":"bootstrap/_progress-bars.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":2278,"digest":"4c2bf460b33d74d64db07fca213c92de552b7dc92cd24a950cbf38c064e7875b","integrity":"sha256-TCv0YLM9dNZNsH/KITyS3lUrfcks0kqVDL84wGTnh1s="},"bootstrap/_media.source-5eab757b15c103bf176c89387f77e660d7f618f08df68b8506362293eaf51769.scss":{"logical_path":"bootstrap/_media.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":848,"digest":"5eab757b15c103bf176c89387f77e660d7f618f08df68b8506362293eaf51769","integrity":"sha256-Xqt1exXBA78XbIk4f3fmYNf2GPCN9ouFBjYik+r1F2k="},"bootstrap/_list-group.source-3175916051c5d7f163fa79e5608cc06fd700dd923606c90efc35e4189157c8e3.scss":{"logical_path":"bootstrap/_list-group.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":3161,"digest":"3175916051c5d7f163fa79e5608cc06fd700dd923606c90efc35e4189157c8e3","integrity":"sha256-MXWRYFHF1/Fj+nnlYIzAb9cA3ZI2BskO/DXkGJFXyOM="},"bootstrap/_panels.source-7c21bb3c0c7c5c5b7275b089b930217a6d57c9279a0a76fe29165cb88f31a1aa.scss":{"logical_path":"bootstrap/_panels.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":5705,"digest":"7c21bb3c0c7c5c5b7275b089b930217a6d57c9279a0a76fe29165cb88f31a1aa","integrity":"sha256-fCG7PAx8XFtydbCJuTAhem1XySeaCnb+KRZcuI8xoao="},"bootstrap/_responsive-embed.source-ca767590895216af631f9623df26a5fd0ff84ab499ab04c85c48096583bc81d3.scss":{"logical_path":"bootstrap/_responsive-embed.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":555,"digest":"ca767590895216af631f9623df26a5fd0ff84ab499ab04c85c48096583bc81d3","integrity":"sha256-ynZ1kIlSFq9jH5Yj3yal/Q/4SrSZqwTIXEgJZYO8gdM="},"bootstrap/_wells.source-d6bf447416761835357cf9535db2932c8f4a8b7a3aa77716bdde90a4ecc5551c.scss":{"logical_path":"bootstrap/_wells.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":535,"digest":"d6bf447416761835357cf9535db2932c8f4a8b7a3aa77716bdde90a4ecc5551c","integrity":"sha256-1r9EdBZ2GDU1fPlTXbKTLI9Ki3o6p3cWvd6QpOzFVRw="},"bootstrap/_close.source-29f12a91774599a71d1b1fd0bdce91411d71c03bf06ad48f355fe2d5ba781ae9.scss":{"logical_path":"bootstrap/_close.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":736,"digest":"29f12a91774599a71d1b1fd0bdce91411d71c03bf06ad48f355fe2d5ba781ae9","integrity":"sha256-KfEqkXdFmacdGx/Qvc6RQR1xwDvwatSPNV/i1bp4Guk="},"bootstrap/_modals.source-cc9b2a29ca21d8d4e6445c9d6bf6e4a11855fffe398a2b0477342be55a56d8b0.scss":{"logical_path":"bootstrap/_modals.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":3624,"digest":"cc9b2a29ca21d8d4e6445c9d6bf6e4a11855fffe398a2b0477342be55a56d8b0","integrity":"sha256-zJsqKcoh2NTmRFyda/bkoRhV//45iisEdzQr5VpW2LA="},"bootstrap/_tooltip.source-fd70c95a50674c92f89bd27380a9768db21e997193cd2ec4b9a07b2f6dfe8622.scss":{"logical_path":"bootstrap/_tooltip.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":2606,"digest":"fd70c95a50674c92f89bd27380a9768db21e997193cd2ec4b9a07b2f6dfe8622","integrity":"sha256-/XDJWlBnTJL4m9JzgKl2jbIemXGTzS7EuaB7L23+hiI="},"bootstrap/_popovers.source-c80157dccd38cfcd3a256c5c97937c566d6260fbf63d981c923b040bf16cac04.scss":{"logical_path":"bootstrap/_popovers.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":3414,"digest":"c80157dccd38cfcd3a256c5c97937c566d6260fbf63d981c923b040bf16cac04","integrity":"sha256-yAFX3M04z806JWxcl5N8Vm1iYPv2PZgckjsEC/FsrAQ="},"bootstrap/_carousel.source-78e906253c103c0563db95faa9a9a17a4bd75ab619cfb27312555f4dc16d614f.scss":{"logical_path":"bootstrap/_carousel.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":4793,"digest":"78e906253c103c0563db95faa9a9a17a4bd75ab619cfb27312555f4dc16d614f","integrity":"sha256-eOkGJTwQPAVj25X6qamhekvXWrYZz7JzElVfTcFtYU8="},"bootstrap/_utilities.source-f311f41d090eabc8f185d2371e3531389665eb552303a40302d319a7c7354e66.scss":{"logical_path":"bootstrap/_utilities.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":837,"digest":"f311f41d090eabc8f185d2371e3531389665eb552303a40302d319a7c7354e66","integrity":"sha256-8xH0HQkOq8jxhdI3HjUxOJZl61UjA6QDAtMZp8c1TmY="},"bootstrap/_responsive-utilities.source-1a88b9dade13b7c60cf7b99e315f371ac16f09334f34dd4da94068e2390f521d.scss":{"logical_path":"bootstrap/_responsive-utilities.source.scss","mtime":"2023-11-23T09:58:47+00:00","size":4282,"digest":"1a88b9dade13b7c60cf7b99e315f371ac16f09334f34dd4da94068e2390f521d","integrity":"sha256-Goi52t4Tt8YM97meMV83GsFvCTNPNN1NqUBo4jkPUh0="},"load-parser.debug-523d03515edac74f207e7254be80fad20f14a6a0baf27e5b8dfd5dfd064a91d5.js":{"logical_path":"load-parser.debug.js","mtime":"2023-11-23T09:58:47+00:00","size":2267134,"digest":"523d03515edac74f207e7254be80fad20f14a6a0baf27e5b8dfd5dfd064a91d5","integrity":"sha256-Uj0DUV7ax08gfnJUvoD60g8UpqC68n5bjf1d/QZKkdU="},"load-parser-4fb81d2f4beef3f223f340d12a7b25c574a2dd8c3ec18b94d46806c5cc833234.js":{"logical_path":"load-parser.js","mtime":"2023-11-23T09:58:47+00:00","size":2267028,"digest":"4fb81d2f4beef3f223f340d12a7b25c574a2dd8c3ec18b94d46806c5cc833234","integrity":"sha256-T7gdL0vu8/Ij80DRKnslxXSi3Yw+wYuU1GgGxcyDMjQ="},"load-parser.js-37acfee094c1ed89c2e72e42274100fb700c853bad86d9cd45aa2275d427807e.map":{"logical_path":"load-parser.js.map","mtime":"2023-11-23T09:58:47+00:00","size":1154799,"digest":"37acfee094c1ed89c2e72e42274100fb700c853bad86d9cd45aa2275d427807e","integrity":"sha256-N6z+4JTB7YnC5y5CJ0EA+3AMhTuthtnNRaoiddQngH4="},"base64.source-ff1b709cbf57f3945ce5cfadb58c63d87c2f4ba36331c23b4b84d7a92a7741dd.rb":{"logical_path":"base64.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2859,"digest":"ff1b709cbf57f3945ce5cfadb58c63d87c2f4ba36331c23b4b84d7a92a7741dd","integrity":"sha256-/xtwnL9X85Rc5c+ttYxj2HwvS6NjMcI7S4TXqSp3Qd0="},"corelib/pack_unpack/format_string_parser.source-06ee75543d8f742e5323e0c28155d26a97a3fe323091f8ead67df96b40384e2a.rb":{"logical_path":"corelib/pack_unpack/format_string_parser.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2941,"digest":"06ee75543d8f742e5323e0c28155d26a97a3fe323091f8ead67df96b40384e2a","integrity":"sha256-Bu51VD2PdC5TI+DCgVXSapej/jIwkfjq1n35a0A4Tio="},"corelib/string/unpack.source-9292521cf2d03d9a3322b0201794affc5e4ff656a8e1907a352b43f0f04b0bc6.rb":{"logical_path":"corelib/string/unpack.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":19866,"digest":"9292521cf2d03d9a3322b0201794affc5e4ff656a8e1907a352b43f0f04b0bc6","integrity":"sha256-kpJSHPLQPZozIrAgF5Sv/F5P9lao4ZB6NStD8PBLC8Y="},"set.source-9ecbee038e5d23a6807530e28d805d1088e523a68a49ee4f66cb45c35e593659.rb":{"logical_path":"set.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":32,"digest":"9ecbee038e5d23a6807530e28d805d1088e523a68a49ee4f66cb45c35e593659","integrity":"sha256-nsvuA45dI6aAdTDijYBdEIjlI6aKSe5PZstFw15ZNlk="},"ast/node.source-e0346587af629df152c23042fcc16d10d929138f90e5fb7cadeedf92cb6c852d.rb":{"logical_path":"ast/node.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":8105,"digest":"e0346587af629df152c23042fcc16d10d929138f90e5fb7cadeedf92cb6c852d","integrity":"sha256-4DRlh69infFSwjBC/MFtENkpE4+Q5ft8re7fkstshS0="},"ast/processor/mixin.source-4f5d9beb4d8be76583b4fac388d91804538131387d7eab2a0f4e778ea88e72d4.rb":{"logical_path":"ast/processor/mixin.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":10280,"digest":"4f5d9beb4d8be76583b4fac388d91804538131387d7eab2a0f4e778ea88e72d4","integrity":"sha256-T12b602L52WDtPrDiNkYBFOBMTh9fqsqD053jqiOctQ="},"ast/processor.source-e4c2a8e995b1922b0a1848d81426e7057168a0851c75a9da99cf427242cbf646.rb":{"logical_path":"ast/processor.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":394,"digest":"e4c2a8e995b1922b0a1848d81426e7057168a0851c75a9da99cf427242cbf646","integrity":"sha256-5MKo6ZWxkisKGEjYFCbnBXFooIUcdanamc9CckLL9kY="},"ast/sexp.source-8dc78dac8f9465a5f6a62aa057ae97fbadd5b111efe8895ac824d46938dc3793.rb":{"logical_path":"ast/sexp.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":947,"digest":"8dc78dac8f9465a5f6a62aa057ae97fbadd5b111efe8895ac824d46938dc3793","integrity":"sha256-jceNrI+UZaX2piqgV66X+63VsRHv6IlayCTUaTjcN5M="},"ast.source-905da9f5b152658b445875a3f12b2fe9521683ac31fdc24e41a724cfdd09ac44.rb":{"logical_path":"ast.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":586,"digest":"905da9f5b152658b445875a3f12b2fe9521683ac31fdc24e41a724cfdd09ac44","integrity":"sha256-kF2p9bFSZYtEWHWj8Ssv6VIWg6wx/cJOQackz90JrEQ="},"parser/ast/node.source-3c183648686e0e02561eec8d8728167e77c9ed5304843adaf9ed80b45d7a258d.rb":{"logical_path":"parser/ast/node.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1036,"digest":"3c183648686e0e02561eec8d8728167e77c9ed5304843adaf9ed80b45d7a258d","integrity":"sha256-PBg2SGhuDgJWHuyNhygWfnfJ7VMEhDra+e2AtF16JY0="},"opal/ast/node.source-4a42cb5bf8e372a82c3bc3f2fe44beeeb0c89d3734e4a67016ba838418288fd5.rb":{"logical_path":"opal/ast/node.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":501,"digest":"4a42cb5bf8e372a82c3bc3f2fe44beeeb0c89d3734e4a67016ba838418288fd5","integrity":"sha256-SkLLW/jjcqgsO8Py/kS+7rDInTc05KZwFrqDhBgoj9U="},"racc/parser.source-47e481218146a1561e566a1f41766919cc6c8e2713bab6aed0384ed6ef55656b.rb":{"logical_path":"racc/parser.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":18414,"digest":"47e481218146a1561e566a1f41766919cc6c8e2713bab6aed0384ed6ef55656b","integrity":"sha256-R+SBIYFGoVYeVmofQXZpGcxsjicTurau0DhO1u9VZWs="},"parser/version.source-83844cf58343f542492c29bc0d4c6117b6d8b81731717151e20bc2cfab348cc7.rb":{"logical_path":"parser/version.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":71,"digest":"83844cf58343f542492c29bc0d4c6117b6d8b81731717151e20bc2cfab348cc7","integrity":"sha256-g4RM9YND9UJJLCm8DUxhF7bYuBcxcXFR4gvCz6s0jMc="},"parser/messages.source-feb872b0d062340525de564d7ec081e192666537d74b1f8c250d358d81bdc205.rb":{"logical_path":"parser/messages.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6850,"digest":"feb872b0d062340525de564d7ec081e192666537d74b1f8c250d358d81bdc205","integrity":"sha256-/rhysNBiNAUl3lZNfsCB4ZJmZTfXSx+MJQ01jYG9wgU="},"parser/deprecation.source-d0805a72096c6de3981bb7d3e447eb28d29fd9640f3b4c6d11fd5047377464f5.rb":{"logical_path":"parser/deprecation.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":250,"digest":"d0805a72096c6de3981bb7d3e447eb28d29fd9640f3b4c6d11fd5047377464f5","integrity":"sha256-0IBacglsbeOYG7fT5EfrKNKf2WQPO0xtEf1QRzd0ZPU="},"parser/ast/processor.source-75f876361c7a487d0cd403c1241ac618174f3d88b00d948424cb9722e1bf4dc2.rb":{"logical_path":"parser/ast/processor.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":8851,"digest":"75f876361c7a487d0cd403c1241ac618174f3d88b00d948424cb9722e1bf4dc2","integrity":"sha256-dfh2Nhx6SH0M1APBJBrGGBdPPYiwDZSEJMuXIuG/TcI="},"parser/meta.source-c35c18829a422c63e84b77dc5af59ca2b67441f92b871dd8c369a10ffac4d8d4.rb":{"logical_path":"parser/meta.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1609,"digest":"c35c18829a422c63e84b77dc5af59ca2b67441f92b871dd8c369a10ffac4d8d4","integrity":"sha256-w1wYgppCLGPoS3fcWvWcorZ0Qfkrhx3Yw2mhD/rE2NQ="},"parser/source/buffer.source-4580df88737728b7d1e96541f31c1e9ab09ab54e85851ee20c28a54f8c230400.rb":{"logical_path":"parser/source/buffer.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":10020,"digest":"4580df88737728b7d1e96541f31c1e9ab09ab54e85851ee20c28a54f8c230400","integrity":"sha256-RYDfiHN3KLfR6WVB8xwemrCatU6FhR7iDCilT4wjBAA="},"parser/source/range.source-0a568e9e163619617fa4faef2827852edba5bff9537d4650b6635156591124a4.rb":{"logical_path":"parser/source/range.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":8848,"digest":"0a568e9e163619617fa4faef2827852edba5bff9537d4650b6635156591124a4","integrity":"sha256-ClaOnhY2GWF/pPrvKCeFLtulv/lTfUZQtmNRVlkRJKQ="},"parser/source/comment.source-fc4b14d95ce20d37fbea4a1d3294a38ab0211f41579763e9b4a9ec6470441680.rb":{"logical_path":"parser/source/comment.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3298,"digest":"fc4b14d95ce20d37fbea4a1d3294a38ab0211f41579763e9b4a9ec6470441680","integrity":"sha256-/EsU2VziDTf76kodMpSjirAhH0FXl2PptKnsZHBEFoA="},"parser/source/comment/associator.source-6029f0f9ff2c3c29839e5d88b20f25d64f39797cea6d29702243c94b01f6af5e.rb":{"logical_path":"parser/source/comment/associator.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":7226,"digest":"6029f0f9ff2c3c29839e5d88b20f25d64f39797cea6d29702243c94b01f6af5e","integrity":"sha256-YCnw+f8sPCmDnl2Isg8l1k85eXzqbSlwIkPJSwH2r14="},"parser/source/rewriter.source-1647682808397f50876b8080c9386050769b75ca172d7606fd012194ea9f8c1e.rb":{"logical_path":"parser/source/rewriter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":16897,"digest":"1647682808397f50876b8080c9386050769b75ca172d7606fd012194ea9f8c1e","integrity":"sha256-FkdoKAg5f1CHa4CAyThgUHabdcoXLXYG/QEhlOqfjB4="},"parser/source/rewriter/action.source-89dc19a710955c30c730b6b3870cd03f9791a8846c55884bbe7c0ab4f2c4ed44.rb":{"logical_path":"parser/source/rewriter/action.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1105,"digest":"89dc19a710955c30c730b6b3870cd03f9791a8846c55884bbe7c0ab4f2c4ed44","integrity":"sha256-idwZpxCVXDDHMLazhwzQP5eRqIRsVYhLvnwKtPLE7UQ="},"parser/source/tree_rewriter.source-e47e361cd5b0adb1949b76743fd4d406fc7617f7e85b8a46d9f0af060244b772.rb":{"logical_path":"parser/source/tree_rewriter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":14154,"digest":"e47e361cd5b0adb1949b76743fd4d406fc7617f7e85b8a46d9f0af060244b772","integrity":"sha256-5H42HNWwrbGUm3Z0P9TUBvx2F/foW4pG2fCvBgJEt3I="},"parser/source/tree_rewriter/action.source-c0a18d5f314548c371a1b7175307289380ab70f4c9496a61b66b1f8f3bed4319.rb":{"logical_path":"parser/source/tree_rewriter/action.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":9460,"digest":"c0a18d5f314548c371a1b7175307289380ab70f4c9496a61b66b1f8f3bed4319","integrity":"sha256-wKGNXzFFSMNxobcXUwcok4CrcPTJSWphtmsfjzvtQxk="},"parser/source/map.source-1d9a13302f85e4756c695dbb55e13b0e04e01cdc23074a9e824fa38bdb3fb359.rb":{"logical_path":"parser/source/map.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5321,"digest":"1d9a13302f85e4756c695dbb55e13b0e04e01cdc23074a9e824fa38bdb3fb359","integrity":"sha256-HZoTMC+F5HVsaV27VeE7DgTgHNwjB0qegk+ji9s/s1k="},"parser/source/map/operator.source-f71b5afe77fd6fb7f431d08e8cd3bc82c9a3f6560e44d55a9a392778ea5adebd.rb":{"logical_path":"parser/source/map/operator.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":249,"digest":"f71b5afe77fd6fb7f431d08e8cd3bc82c9a3f6560e44d55a9a392778ea5adebd","integrity":"sha256-9xta/nf9b7f0MdCOjNO8gsmj9lYORNVamjkneOpa3r0="},"parser/source/map/collection.source-9a582ce032c03905dc9944e58a04bcbd24309c84332d2409598511745dfc578b.rb":{"logical_path":"parser/source/map/collection.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":290,"digest":"9a582ce032c03905dc9944e58a04bcbd24309c84332d2409598511745dfc578b","integrity":"sha256-mlgs4DLAOQXcmUTligS8vSQwnIQzLSQJWYURdF38V4s="},"parser/source/map/constant.source-8887161ce7754f19f1c24119e9c5b5d3409da683c2f3d76cd439c9b37edcfa88.rb":{"logical_path":"parser/source/map/constant.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":573,"digest":"8887161ce7754f19f1c24119e9c5b5d3409da683c2f3d76cd439c9b37edcfa88","integrity":"sha256-iIcWHOd1TxnxwkEZ6cW100CdpoPC89ds1DnJs37c+og="},"parser/source/map/variable.source-cd0246287786e8cef9e224b480da4b3e0589005cc5098c78a876332ec768416f.rb":{"logical_path":"parser/source/map/variable.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":513,"digest":"cd0246287786e8cef9e224b480da4b3e0589005cc5098c78a876332ec768416f","integrity":"sha256-zQJGKHeG6M754iS0gNpLPgWJAFzFCYx4qHYzLsdoQW8="},"parser/source/map/keyword.source-dedb99ced5eb88d041994d28deeb0870d45690a9215fadcb1deabd555b23b8e7.rb":{"logical_path":"parser/source/map/keyword.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":358,"digest":"dedb99ced5eb88d041994d28deeb0870d45690a9215fadcb1deabd555b23b8e7","integrity":"sha256-3tuZztXriNBBmU0o3usIcNRWkKkhX63LHeq9VVsjuOc="},"parser/source/map/definition.source-8e6840668ebc86a187050492c4ae0be800ab508ad349b6ce802e48802a8bda6c.rb":{"logical_path":"parser/source/map/definition.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":435,"digest":"8e6840668ebc86a187050492c4ae0be800ab508ad349b6ce802e48802a8bda6c","integrity":"sha256-jmhAZo68hqGHBQSSxK4L6ACrUIrTSbbOgC5IgCqL2mw="},"parser/source/map/method_definition.source-ab2e20cdf7f7ba09514bdb1fcbf9a6abd1a3adf1b0b52f133359ae07df39b44c.rb":{"logical_path":"parser/source/map/method_definition.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":539,"digest":"ab2e20cdf7f7ba09514bdb1fcbf9a6abd1a3adf1b0b52f133359ae07df39b44c","integrity":"sha256-qy4gzff3uglRS9sfy/mmq9GjrfGwtS8TM1muB985tEw="},"parser/source/map/send.source-3ac8ece7feb6d38674b20421e391fbff71530d479a11e576c845af23be52b4db.rb":{"logical_path":"parser/source/map/send.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":682,"digest":"3ac8ece7feb6d38674b20421e391fbff71530d479a11e576c845af23be52b4db","integrity":"sha256-Osjs5/6204Z0sgQh45H7/3FTDUeaEeV2yEWvI75StNs="},"parser/source/map/index.source-a72e5a3651da8f713a5c7a49be545f59af09719ebc1950a7e7da1dd39500d8e9.rb":{"logical_path":"parser/source/map/index.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":574,"digest":"a72e5a3651da8f713a5c7a49be545f59af09719ebc1950a7e7da1dd39500d8e9","integrity":"sha256-py5aNlHaj3E6XHpJvlRfWa8JcZ68GVCn59od05UA2Ok="},"parser/source/map/condition.source-d3c4f51b72943d60f8627dea4e2bc87378b1b609ed4599b8cfe74dbcd9120aa2.rb":{"logical_path":"parser/source/map/condition.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":403,"digest":"d3c4f51b72943d60f8627dea4e2bc87378b1b609ed4599b8cfe74dbcd9120aa2","integrity":"sha256-08T1G3KUPWD4Yn3qTivIc3ixtgntRZm4z+dNvNkSCqI="},"parser/source/map/ternary.source-8b1224840dc23807237c82b37d1457ddd9c68f76880ec836543fcd4a01e5156c.rb":{"logical_path":"parser/source/map/ternary.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":307,"digest":"8b1224840dc23807237c82b37d1457ddd9c68f76880ec836543fcd4a01e5156c","integrity":"sha256-ixIkhA3COAcjfIKzfRRX3dnGj3aIDsg2VD/NSgHlFWw="},"parser/source/map/for.source-187f83959e6aa4b80afc9eee422865711e75cdd760c4bb64da46f3efe0a8f7af.rb":{"logical_path":"parser/source/map/for.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":356,"digest":"187f83959e6aa4b80afc9eee422865711e75cdd760c4bb64da46f3efe0a8f7af","integrity":"sha256-GH+DlZ5qpLgK/J7uQihlcR51zddgxLtk2kbz7+Co968="},"parser/source/map/rescue_body.source-2135ac0caf455b360effe438be50ff12290ca172b6775396215d8bd4b6fdec38.rb":{"logical_path":"parser/source/map/rescue_body.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":377,"digest":"2135ac0caf455b360effe438be50ff12290ca172b6775396215d8bd4b6fdec38","integrity":"sha256-ITWsDK9FWzYO/+Q4vlD/EikMoXK2d1OWIV2L1Lb97Dg="},"parser/source/map/heredoc.source-802e3218a11a36e37d59f2699ba9ef027ba3f25a9ccaf5b67b9f51b9be711167.rb":{"logical_path":"parser/source/map/heredoc.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":314,"digest":"802e3218a11a36e37d59f2699ba9ef027ba3f25a9ccaf5b67b9f51b9be711167","integrity":"sha256-gC4yGKEaNuN9WfJpm6nvAnuj8lqcyvW2e59Rub5xEWc="},"parser/source/map/objc_kwarg.source-b8b54b4ff74d2589e8544a33d7d855ff85e655ac8dff96a276ee8108fe6c78f4.rb":{"logical_path":"parser/source/map/objc_kwarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":380,"digest":"b8b54b4ff74d2589e8544a33d7d855ff85e655ac8dff96a276ee8108fe6c78f4","integrity":"sha256-uLVLT/dNJYnoVEoz19hV/4XmVayN/5aidu6BCP5sePQ="},"parser/syntax_error.source-b35a7eb23f86478e8d1480728eb38b7138a00331e9741bc7f4fb37ea1a1f3d05.rb":{"logical_path":"parser/syntax_error.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":443,"digest":"b35a7eb23f86478e8d1480728eb38b7138a00331e9741bc7f4fb37ea1a1f3d05","integrity":"sha256-s1p+sj+GR46NFIByjrOLcTigAzHpdBvH9Ps36hofPQU="},"parser/clobbering_error.source-5f0b2aee4291455b71cfc41193a03c1eb39dececcf3a272fa1dd7f52d81619a7.rb":{"logical_path":"parser/clobbering_error.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":331,"digest":"5f0b2aee4291455b71cfc41193a03c1eb39dececcf3a272fa1dd7f52d81619a7","integrity":"sha256-Xwsq7kKRRVtxz8QRk6A8HrOd7OzPOicvod1/UtgWGac="},"parser/diagnostic.source-35218d12206180871dc0b4d00559238172c5f5a1c89391a28d2e9f27012c87af.rb":{"logical_path":"parser/diagnostic.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4339,"digest":"35218d12206180871dc0b4d00559238172c5f5a1c89391a28d2e9f27012c87af","integrity":"sha256-NSGNEiBhgIcdwLTQBVkjgXLF9aHIk5GijS6fJwEsh68="},"parser/diagnostic/engine.source-ace6754a27a82e312572f22e30a5741e9399d3ab30deabf7a866372ad3873a6d.rb":{"logical_path":"parser/diagnostic/engine.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2537,"digest":"ace6754a27a82e312572f22e30a5741e9399d3ab30deabf7a866372ad3873a6d","integrity":"sha256-rOZ1SieoLjElcvIuMKV0HpOZ06sw3qv3qGY3KtOHOm0="},"parser/static_environment.source-8cfc2f896c62d5270a35feb0bac71d2b10bb884f9d760fe7b16da78afba1901d.rb":{"logical_path":"parser/static_environment.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1444,"digest":"8cfc2f896c62d5270a35feb0bac71d2b10bb884f9d760fe7b16da78afba1901d","integrity":"sha256-jPwviWxi1ScKNf6wuscdKxC7iE+ddg/nsW2nivuhkB0="},"parser/lexer-F0.source-0bd700cff79f59a415d47d17a0accfe71752ac87c38a4d78d7a930b85eefa212.rb":{"logical_path":"parser/lexer-F0.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":419451,"digest":"0bd700cff79f59a415d47d17a0accfe71752ac87c38a4d78d7a930b85eefa212","integrity":"sha256-C9cAz/efWaQV1H0XoKzP5xdSrIfDik1416kwuF7vohI="},"parser/lexer-F1.source-1731830baa1a62e49155a5163b94ddbb89dda14edbdb1e6a643ed70abff46a1b.rb":{"logical_path":"parser/lexer-F1.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":451894,"digest":"1731830baa1a62e49155a5163b94ddbb89dda14edbdb1e6a643ed70abff46a1b","integrity":"sha256-FzGDC6oaYuSRVaUWO5Tdu4ndoU7b2x5qZD7XCr/0ahs="},"parser/lexer-strings.source-bcb54e3e3cf67073369bedac2181573768774bf1ece9d1fe352a35d7fe3e2517.rb":{"logical_path":"parser/lexer-strings.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":171286,"digest":"bcb54e3e3cf67073369bedac2181573768774bf1ece9d1fe352a35d7fe3e2517","integrity":"sha256-vLVOPjz2cHM2m+2sIYFXN2h3S/Hs6dH+NSo11/4+JRc="},"parser/lexer/literal.source-e27abea50742e2b60e1d49b9bbdb92c64fd696c41aeb17341f8a5f4c0b5d8ce8.rb":{"logical_path":"parser/lexer/literal.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6564,"digest":"e27abea50742e2b60e1d49b9bbdb92c64fd696c41aeb17341f8a5f4c0b5d8ce8","integrity":"sha256-4nq+pQdC4rYOHUm5u9uSxk/WlsQa6xc0H4pfTAtdjOg="},"parser/lexer/stack_state.source-6c4b455a2961afcfa57e2508d2d2f927d9f1b509c6bf3b6796a2de9b9bcdde59.rb":{"logical_path":"parser/lexer/stack_state.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":661,"digest":"6c4b455a2961afcfa57e2508d2d2f927d9f1b509c6bf3b6796a2de9b9bcdde59","integrity":"sha256-bEtFWilhr8+lfiUI0tL5J9nxtQnGvztnlqLem5vN3lk="},"parser/lexer/dedenter.source-65e1040b204edb68a3e352343ab77fa9811872bdb249f238e9728a2f99f1d43b.rb":{"logical_path":"parser/lexer/dedenter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2290,"digest":"65e1040b204edb68a3e352343ab77fa9811872bdb249f238e9728a2f99f1d43b","integrity":"sha256-ZeEECyBO22ij41I0Ord/qYEYcr2ySfI46XKKL5nx1Ds="},"parser/builders/default.source-ab69929f6740db5a107dd355834d0dcef7731be839ca06a26d6e21d0c9c9ab9f.rb":{"logical_path":"parser/builders/default.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":62724,"digest":"ab69929f6740db5a107dd355834d0dcef7731be839ca06a26d6e21d0c9c9ab9f","integrity":"sha256-q2mSn2dA21oQfdNVg00NzvdzG+g5ygaibW4h0MnJq58="},"parser/context.source-eada1358bea1056602975f4c6bd8ed3126a3e3c95a437fea35362b3ff9fbeb5e.rb":{"logical_path":"parser/context.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1225,"digest":"eada1358bea1056602975f4c6bd8ed3126a3e3c95a437fea35362b3ff9fbeb5e","integrity":"sha256-6toTWL6hBWYCl19Ma9jtMSaj48laQ3/qNTYrP/n7614="},"parser/max_numparam_stack.source-68c697d6a215860b957bd9c0d19256976b7ea3074606a0675b47851ab4591ffd.rb":{"logical_path":"parser/max_numparam_stack.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":781,"digest":"68c697d6a215860b957bd9c0d19256976b7ea3074606a0675b47851ab4591ffd","integrity":"sha256-aMaX1qIVhguVe9nA0ZJWl2t+owdGBqBnW0eFGrRZH/0="},"parser/current_arg_stack.source-7063f1f3627b3b3fa693afba3ad63ce5f4f9885677be08900b09819d9234ad8a.rb":{"logical_path":"parser/current_arg_stack.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":717,"digest":"7063f1f3627b3b3fa693afba3ad63ce5f4f9885677be08900b09819d9234ad8a","integrity":"sha256-cGPx82J7Oz+mk6+6OtY85fT5iFZ3vgiQCwmBnZI0rYo="},"parser/variables_stack.source-f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0.rb":{"logical_path":"parser/variables_stack.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":443,"digest":"f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0","integrity":"sha256-9VVIIj+F/Z7+/oMuaAWxn1FSdEShUCVadbKNfeidMNA="},"parser/base.source-5eb855a17557873f53b3255d6123879f6081ab3c9fa6ea1f6ec28d9d14a93b46.rb":{"logical_path":"parser/base.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":8156,"digest":"5eb855a17557873f53b3255d6123879f6081ab3c9fa6ea1f6ec28d9d14a93b46","integrity":"sha256-XrhVoXVXhz9TsyVdYSOHn2CBqzyfpuofbsKNnRSpO0Y="},"parser/rewriter.source-f95150be5d8e334e237f2b3cedac5393320c41a2d756f0e7c0713fd920996c16.rb":{"logical_path":"parser/rewriter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2570,"digest":"f95150be5d8e334e237f2b3cedac5393320c41a2d756f0e7c0713fd920996c16","integrity":"sha256-+VFQvl2OM04jfys87axTkzIMQaLXVvDnwHE/2SCZbBY="},"parser/tree_rewriter.source-9b9c711839d953a2008dfcea1a4c144d3cfbdde76b72fd89470792f2bb130637.rb":{"logical_path":"parser/tree_rewriter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3541,"digest":"9b9c711839d953a2008dfcea1a4c144d3cfbdde76b72fd89470792f2bb130637","integrity":"sha256-m5xxGDnZU6IAjfzqGkwUTTz73edrcv2JRweS8rsTBjc="},"parser.source-0c0f4bf7e342af741738456c3157ab798c8804e9d2b73e3492503950cb7b66d4.rb":{"logical_path":"parser.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2308,"digest":"0c0f4bf7e342af741738456c3157ab798c8804e9d2b73e3492503950cb7b66d4","integrity":"sha256-DA9L9+NCr3QXOEVsMVereYyIBOnStz40klA5UMt7ZtQ="},"parser/ruby32.source-35d2a9eec77c538180dd894beb0b108bbfd5d69a3a354051075fef69a967d7ef.rb":{"logical_path":"parser/ruby32.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":622273,"digest":"35d2a9eec77c538180dd894beb0b108bbfd5d69a3a354051075fef69a967d7ef","integrity":"sha256-NdKp7sd8U4GA3YlL6wsQi7/V1po6NUBRB1/vaaln1+8="},"opal/ast/builder.source-eaf6df550a58d52a79a62a41acabefee2259247678734a925b178509d3a4ec05.rb":{"logical_path":"opal/ast/builder.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":316,"digest":"eaf6df550a58d52a79a62a41acabefee2259247678734a925b178509d3a4ec05","integrity":"sha256-6vbfVQpY1Sp5pipBrKvv7iJZJHZ4c0qSWxeFCdOk7AU="},"opal/rewriters/base.source-aa1b6772df8024d3537caf4483dd31cd8d1ba7291d9fad606e9293da551f627e.rb":{"logical_path":"opal/rewriters/base.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3309,"digest":"aa1b6772df8024d3537caf4483dd31cd8d1ba7291d9fad606e9293da551f627e","integrity":"sha256-qhtnct+AJNNTfK9Eg90xzY0bpykdn61gbpKT2lUfYn4="},"opal/rewriters/opal_engine_check.source-79f1e0ad24150790cf1f9aad5dba3cf5b09aa5e041f31bf571e802da54d88d21.rb":{"logical_path":"opal/rewriters/opal_engine_check.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1097,"digest":"79f1e0ad24150790cf1f9aad5dba3cf5b09aa5e041f31bf571e802da54d88d21","integrity":"sha256-efHgrSQVB5DPH5qtXbo89bCapeBB8xv1cegC2lTYjSE="},"opal/rewriters/targeted_patches.source-d9d349d8078f2dd6d3ccb5fdc0328300ac6ec2230bc56e4adee3ed8cc0ef824a.rb":{"logical_path":"opal/rewriters/targeted_patches.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3269,"digest":"d9d349d8078f2dd6d3ccb5fdc0328300ac6ec2230bc56e4adee3ed8cc0ef824a","integrity":"sha256-2dNJ2AePLdbTzLX9wDKDAKxuwiMLxW5K3uPtjMDvgko="},"opal/rewriters/for_rewriter.source-753748c955ec1b63a21e2450b44694a654c06cd182dd5e59dc5e76ed674f5135.rb":{"logical_path":"opal/rewriters/for_rewriter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3503,"digest":"753748c955ec1b63a21e2450b44694a654c06cd182dd5e59dc5e76ed674f5135","integrity":"sha256-dTdIyVXsG2OiHiRQtEaUplTAbNGC3V5Z3F527WdPUTU="},"opal/regexp_anchors.source-9a82e2c2c1d73ae9606226301af73b2ef0112155f3fca52defa4be2b4cd75243.rb":{"logical_path":"opal/regexp_anchors.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1766,"digest":"9a82e2c2c1d73ae9606226301af73b2ef0112155f3fca52defa4be2b4cd75243","integrity":"sha256-moLiwsHXOulgYiYwGvc7LvARIVXz/KUt76S+K0zXUkM="},"opal/rewriters/js_reserved_words.source-11a079affae8c126b9bd182f9f090b45dcfbbeea31f4d913a616dd48523f16a1.rb":{"logical_path":"opal/rewriters/js_reserved_words.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3625,"digest":"11a079affae8c126b9bd182f9f090b45dcfbbeea31f4d913a616dd48523f16a1","integrity":"sha256-EaB5r/rowSa5vRgvnwkLRdz7vuox9NkTphbdSFI/FqE="},"opal/rewriters/block_to_iter.source-e9c300c643bdb416e53cbc6fda6d8130fba40388e3954f4ac3edb122df6bb079.rb":{"logical_path":"opal/rewriters/block_to_iter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":348,"digest":"e9c300c643bdb416e53cbc6fda6d8130fba40388e3954f4ac3edb122df6bb079","integrity":"sha256-6cMAxkO9tBblPLxv2m2BMPukA4jjlU9Kw+2xIt9rsHk="},"opal/rewriters/dot_js_syntax.source-50de46af4c9a2b0190947c51fae98997f6337b038f1641c1ef709834a2fe6922.rb":{"logical_path":"opal/rewriters/dot_js_syntax.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1846,"digest":"50de46af4c9a2b0190947c51fae98997f6337b038f1641c1ef709834a2fe6922","integrity":"sha256-UN5Gr0yaKwGQlHxR+umJl/YzewOPFkHB73CYNKL+aSI="},"opal/rewriters/pattern_matching.source-eb37306ac4421a8070a416101c89861786b403a6f46f2dd6ec8b40d45e36282c.rb":{"logical_path":"opal/rewriters/pattern_matching.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6416,"digest":"eb37306ac4421a8070a416101c89861786b403a6f46f2dd6ec8b40d45e36282c","integrity":"sha256-6zcwasRCGoBwpBYQHImGF4a0A6b0by3W7ItA1F42KCw="},"opal/rewriters/logical_operator_assignment.source-e422b06ca9e9b67cc1fd3e99b7e9af4a813b2bb9c50fb9e9df7b2f5f71efc2a8.rb":{"logical_path":"opal/rewriters/logical_operator_assignment.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5277,"digest":"e422b06ca9e9b67cc1fd3e99b7e9af4a813b2bb9c50fb9e9df7b2f5f71efc2a8","integrity":"sha256-5CKwbKnptnzB/T6Zt+mvSoE7K7nFD7np33svX3Hvwqg="},"opal/rewriters/binary_operator_assignment.source-6d9942e1ba135acc050bf3e1399693fff6049e1abb2a9e470021df972957da86.rb":{"logical_path":"opal/rewriters/binary_operator_assignment.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4532,"digest":"6d9942e1ba135acc050bf3e1399693fff6049e1abb2a9e470021df972957da86","integrity":"sha256-bZlC4boTWswFC/PhOZaT//YEnhq7Kp5HACHflylX2oY="},"opal/rewriters/hashes/key_duplicates_rewriter.source-b2210660c3d99f87f818f71fc7e3ac44cbcbdb17d94b32963c70c072f83360df.rb":{"logical_path":"opal/rewriters/hashes/key_duplicates_rewriter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1244,"digest":"b2210660c3d99f87f818f71fc7e3ac44cbcbdb17d94b32963c70c072f83360df","integrity":"sha256-siEGYMPZn4f4GPcfx+OsRMvL2xfZSzKWPHDAcvgzYN8="},"opal/rewriters/dump_args.source-b6268131cb1c7150e479c80269cfff65410301602508c1ad438d6f5b3ba98e77.rb":{"logical_path":"opal/rewriters/dump_args.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":611,"digest":"b6268131cb1c7150e479c80269cfff65410301602508c1ad438d6f5b3ba98e77","integrity":"sha256-tiaBMcsccVDkecgCac//ZUEDAWAlCMGtQ41vWzupjnc="},"opal/rewriters/deduplicate_arg_name.source-0e7d424fe13323e93e767c765aea0faa804b4ee5ac9c3cdcade2d5966094db57.rb":{"logical_path":"opal/rewriters/deduplicate_arg_name.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1409,"digest":"0e7d424fe13323e93e767c765aea0faa804b4ee5ac9c3cdcade2d5966094db57","integrity":"sha256-Dn1CT+EzI+k+dnx2WuoPqoBLTuWsnDzcreLVlmCU21c="},"opal/rewriters/mlhs_args.source-c491b4c2dad56a6adefdc5adfbb78f281fa2dcc9c0f45e35734bfb5a09cdea39.rb":{"logical_path":"opal/rewriters/mlhs_args.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3049,"digest":"c491b4c2dad56a6adefdc5adfbb78f281fa2dcc9c0f45e35734bfb5a09cdea39","integrity":"sha256-xJG0wtrVamre/cWt+7ePKB+i3MnA9F41c0v7WgnN6jk="},"opal/rewriters/arguments.source-d8f46b3f620b8700a99a5057ee440f0f2a9399be8c210332810e2e101aae0a77.rb":{"logical_path":"opal/rewriters/arguments.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1493,"digest":"d8f46b3f620b8700a99a5057ee440f0f2a9399be8c210332810e2e101aae0a77","integrity":"sha256-2PRrP2ILhwCpmlBX7kQPDyqTmb6MIQMygQ4uEBquCnc="},"opal/rewriters/inline_args.source-00d82368b44568f8c81e49a4d5a2ee2b0c0bf02aa47f55c730c5b8b363398056.rb":{"logical_path":"opal/rewriters/inline_args.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5777,"digest":"00d82368b44568f8c81e49a4d5a2ee2b0c0bf02aa47f55c730c5b8b363398056","integrity":"sha256-ANgjaLRFaPjIHkmk1aLuKwwL8Cqkf1XHMMW4s2M5gFY="},"opal/rewriters/numblocks.source-f75a33f2be591d99b79b1c5c748746c84240a7c921b0d183b71d1467067fbca2.rb":{"logical_path":"opal/rewriters/numblocks.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":585,"digest":"f75a33f2be591d99b79b1c5c748746c84240a7c921b0d183b71d1467067fbca2","integrity":"sha256-91oz8r5ZHZm3mxxcdIdGyEJAp8khsNGDtx0UZwZ/vKI="},"opal/rewriters/returnable_logic.source-1618e549c1ed81e4375aa63e5455e39b446c9695ad4dfdaaadbccb536c48f8f4.rb":{"logical_path":"opal/rewriters/returnable_logic.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4202,"digest":"1618e549c1ed81e4375aa63e5455e39b446c9695ad4dfdaaadbccb536c48f8f4","integrity":"sha256-FhjlScHtgeQ3WqY+VFXjm0RslpWtTf2qrbzLU2xI+PQ="},"opal/rewriters/forward_args.source-4fb90101cb11a0977b71212bf9ea00530cca00825d5d6c0591316f8d2a178e80.rb":{"logical_path":"opal/rewriters/forward_args.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2104,"digest":"4fb90101cb11a0977b71212bf9ea00530cca00825d5d6c0591316f8d2a178e80","integrity":"sha256-T7kBAcsRoJd7cSEr+eoAUwzKAIJdXWwFkTFvjSoXjoA="},"opal/rewriters/thrower_finder.source-c5219d32fc56bd7c8e82e5fe6b320ad91c6889938af14d40e90b0a3e274ee603.rb":{"logical_path":"opal/rewriters/thrower_finder.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2667,"digest":"c5219d32fc56bd7c8e82e5fe6b320ad91c6889938af14d40e90b0a3e274ee603","integrity":"sha256-xSGdMvxWvXyOguX+azIK2RxoiZOK8U1A6QsKPidO5gM="},"opal/rewriter.source-32fff58fe139f7244fa87f66adc46e4d235add89d752cd3f29ab97d4b7ccbe6e.rb":{"logical_path":"opal/rewriter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2357,"digest":"32fff58fe139f7244fa87f66adc46e4d235add89d752cd3f29ab97d4b7ccbe6e","integrity":"sha256-Mv/1j+E59yRPqH9mrcRuTSNa3YnXUs0/KauX1LfMvm4="},"opal/parser/source_buffer.source-61b789b0b2ebe0500121b8eebb10ce46c496357ccaabfa968c2e0934bc13116e.rb":{"logical_path":"opal/parser/source_buffer.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":212,"digest":"61b789b0b2ebe0500121b8eebb10ce46c496357ccaabfa968c2e0934bc13116e","integrity":"sha256-YbeJsLLr4FABIbjuuxDORsSWNXzKq/qWjC4JNLwTEW4="},"opal/parser/default_config.source-725b38eae1180c8614ff8024fdb50c5e02b3a6ae1149efd15c57e9bcf9c7ad2a.rb":{"logical_path":"opal/parser/default_config.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1192,"digest":"725b38eae1180c8614ff8024fdb50c5e02b3a6ae1149efd15c57e9bcf9c7ad2a","integrity":"sha256-cls46uEYDIYU/4Ak/bUMXgKzpq4RSe/RXFfpvPnHrSo="},"opal/parser/with_ruby_lexer.source-ac3acfedd2463df65e3ec54147b694a6947e2c95bfa0cdfd376988717c9b1f3a.rb":{"logical_path":"opal/parser/with_ruby_lexer.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":167,"digest":"ac3acfedd2463df65e3ec54147b694a6947e2c95bfa0cdfd376988717c9b1f3a","integrity":"sha256-rDrP7dJGPfZePsVBR7aUppR+LJW/oM39N2mIcXybHzo="},"opal/parser/patch.source-c09d163f1d90c4e656ab93d27ab1c730817f58b75507dbdb50d6a921e54b46fc.rb":{"logical_path":"opal/parser/patch.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4690,"digest":"c09d163f1d90c4e656ab93d27ab1c730817f58b75507dbdb50d6a921e54b46fc","integrity":"sha256-wJ0WPx2QxOZWq5PSerHHMIF/WLdVB9vbUNapIeVLRvw="},"opal/parser.source-eac055fcb3cccd920f474b295f83de67fc3a2d0fbddf2290d57a605c5693b324.rb":{"logical_path":"opal/parser.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":222,"digest":"eac055fcb3cccd920f474b295f83de67fc3a2d0fbddf2290d57a605c5693b324","integrity":"sha256-6sBV/LPMzZIPR0spX4PeZ/w6LQ+93yKQ1XpgXFaTsyQ="},"opal/fragment.source-9dfeb6c63014455b8fc06714d178b62715ed77c2e443b4ab60eb25466fd0b7c0.rb":{"logical_path":"opal/fragment.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3399,"digest":"9dfeb6c63014455b8fc06714d178b62715ed77c2e443b4ab60eb25466fd0b7c0","integrity":"sha256-nf62xjAURVuPwGcU0Xi2JxXtd8LkQ7SrYOslRm/Qt8A="},"opal/nodes/closure.source-61701fe2e741f0f8b7006beb475788bf3cb6431d23d523e2d8fcfaf611303d1b.rb":{"logical_path":"opal/nodes/closure.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":8528,"digest":"61701fe2e741f0f8b7006beb475788bf3cb6431d23d523e2d8fcfaf611303d1b","integrity":"sha256-YXAf4udB8Pi3AGvrR1eIvzy2Qx0j1SPi2Pz69hEwPRs="},"opal/nodes/helpers.source-4915c6fabe15697556648dd6dd615c2edecd1ef8949ddb73a863ba2ff71e237e.rb":{"logical_path":"opal/nodes/helpers.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3791,"digest":"4915c6fabe15697556648dd6dd615c2edecd1ef8949ddb73a863ba2ff71e237e","integrity":"sha256-SRXG+r4VaXVWZI3W3WFcLt7NHviUndtzqGO6L/ceI34="},"opal/nodes/base.source-7659dcba28b01c565569308cc375fe94831ef7ad46a157973c7d375fe1771840.rb":{"logical_path":"opal/nodes/base.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4584,"digest":"7659dcba28b01c565569308cc375fe94831ef7ad46a157973c7d375fe1771840","integrity":"sha256-dlncuiiwHFZVaTCMw3X+lIMe961GoVeXPH03X+F3GEA="},"opal/nodes/literal.source-e7c63d19f638a079cd0cb73592c0a63738bc83dc41e289d31e62aa911246d142.rb":{"logical_path":"opal/nodes/literal.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":9150,"digest":"e7c63d19f638a079cd0cb73592c0a63738bc83dc41e289d31e62aa911246d142","integrity":"sha256-58Y9GfY4oHnNDLc1ksCmNzi8g9xB4onTHmKqkRJG0UI="},"opal/nodes/variables.source-af1977a8b39bce0210f945ddfd203187038a4bb65a3ab5fadc7d750d4051ef08.rb":{"logical_path":"opal/nodes/variables.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4340,"digest":"af1977a8b39bce0210f945ddfd203187038a4bb65a3ab5fadc7d750d4051ef08","integrity":"sha256-rxl3qLObzgIQ+UXd/SAxhwOKS7ZaOrX63H11DUBR7wg="},"opal/nodes/constants.source-9dee2fcf8462ed165ee00335973717010f7473af2f6d111a6ab0a1c2efadc68c.rb":{"logical_path":"opal/nodes/constants.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2081,"digest":"9dee2fcf8462ed165ee00335973717010f7473af2f6d111a6ab0a1c2efadc68c","integrity":"sha256-ne4vz4Ri7RZe4AM1lzcXAQ90c68vbREaarChwu+txow="},"corelib/comparable.source-6ae740f39e41e4c73dbbd9609b3cfe5b06f6efcbeb1a6ad45e512220cc7dc2f1.rb":{"logical_path":"corelib/comparable.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2511,"digest":"6ae740f39e41e4c73dbbd9609b3cfe5b06f6efcbeb1a6ad45e512220cc7dc2f1","integrity":"sha256-audA855B5Mc9u9lgmzz+Wwb278vrGmrUXlEiIMx9wvE="},"pathname.source-4af5fbc18a6508347db78ac4925d3ec2cc25b66b8e64b5e22658f401d1c8bde7.rb":{"logical_path":"pathname.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5216,"digest":"4af5fbc18a6508347db78ac4925d3ec2cc25b66b8e64b5e22658f401d1c8bde7","integrity":"sha256-SvX7wYplCDR9t4rEkl0+wswltmuOZLXiJlj0AdHIvec="},"opal/nodes/call.source-c48dc207235fddcff1b0bcda050f5b0bd1309bbfa01d8186ce8e794787b10d95.rb":{"logical_path":"opal/nodes/call.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":16076,"digest":"c48dc207235fddcff1b0bcda050f5b0bd1309bbfa01d8186ce8e794787b10d95","integrity":"sha256-xI3CByNf3c/xsLzaBQ9bC9Ewm7+gHYGGzo55R4exDZU="},"opal/nodes/call_special.source-9ff7b96524a95b4062ca6ab4ced1a560d1fe8991db9d04f1b94d25a0bdb9172c.rb":{"logical_path":"opal/nodes/call_special.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3734,"digest":"9ff7b96524a95b4062ca6ab4ced1a560d1fe8991db9d04f1b94d25a0bdb9172c","integrity":"sha256-n/e5ZSSpW0Biymq0ztGlYNH+iZHbnQTxuU0loL25Fyw="},"opal/nodes/scope.source-364d5f744bd417d460fb47772495cccf9acecb94413df8658815cdb26aea84a6.rb":{"logical_path":"opal/nodes/scope.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":9392,"digest":"364d5f744bd417d460fb47772495cccf9acecb94413df8658815cdb26aea84a6","integrity":"sha256-Nk1fdEvUF9Rg+0d3JJXMz5rOy5RBPfhliBXNsmrqhKY="},"opal/nodes/module.source-1ce7c0c61c98853e523e079b76d8b3207a4bdfc93f7f12526959d0130b84ac1e.rb":{"logical_path":"opal/nodes/module.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1767,"digest":"1ce7c0c61c98853e523e079b76d8b3207a4bdfc93f7f12526959d0130b84ac1e","integrity":"sha256-HOfAxhyYhT5SPgebdtizIHpL38k/fxJSaVnQEwuErB4="},"opal/nodes/class.source-ca22f2475cb60ee24354a640f27179a3cbaded644124d0ffdcfe6ad5da8945e3.rb":{"logical_path":"opal/nodes/class.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1338,"digest":"ca22f2475cb60ee24354a640f27179a3cbaded644124d0ffdcfe6ad5da8945e3","integrity":"sha256-yiLyR1y2DuJDVKZA8nF5o8ut7WRBJND/3P5q1dqJReM="},"opal/nodes/singleton_class.source-0ea1443d8433a8d96b3d24e9ca318e88555986cf8fe2ee263489cc906c7f0a6f.rb":{"logical_path":"opal/nodes/singleton_class.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":652,"digest":"0ea1443d8433a8d96b3d24e9ca318e88555986cf8fe2ee263489cc906c7f0a6f","integrity":"sha256-DqFEPYQzqNlrPSTpyjGOiFVZhs+P4u4mNInMkGx/Cm8="},"opal/nodes/args/arg.source-8d5d2450446c50a6cf9061e8dbcb0266c43c4223b44400ccb5c4dcb04afac3ae.rb":{"logical_path":"opal/nodes/args/arg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":375,"digest":"8d5d2450446c50a6cf9061e8dbcb0266c43c4223b44400ccb5c4dcb04afac3ae","integrity":"sha256-jV0kUERsUKbPkGHo28sCZsQ8QiO0RADMtcTcsEr6w64="},"opal/nodes/args/arity_check.source-0b4f697fd70e5cd42e1501a8b60cc9b20d6ee580feead711ddbb53a7bc8d85c5.rb":{"logical_path":"opal/nodes/args/arity_check.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3846,"digest":"0b4f697fd70e5cd42e1501a8b60cc9b20d6ee580feead711ddbb53a7bc8d85c5","integrity":"sha256-C09pf9cOXNQuFQGotgzJsg1u5YD+6tcR3btTp7yNhcU="},"opal/nodes/args/ensure_kwargs_are_kwargs.source-980baec81aa4b014263336a90ec17417c1a682c9e04e3e1c509d8f7318ea8d12.rb":{"logical_path":"opal/nodes/args/ensure_kwargs_are_kwargs.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":492,"digest":"980baec81aa4b014263336a90ec17417c1a682c9e04e3e1c509d8f7318ea8d12","integrity":"sha256-mAuuyBqksBQmMzapDsF0F8GmgsngTj4cUJ2PcxjqjRI="},"opal/nodes/args/extract_block_arg.source-6a85d2bb6011fb580f3c05ef965ca281dfbf38a778c5c4878ae9b9b3d8809217.rb":{"logical_path":"opal/nodes/args/extract_block_arg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":569,"digest":"6a85d2bb6011fb580f3c05ef965ca281dfbf38a778c5c4878ae9b9b3d8809217","integrity":"sha256-aoXSu2AR+1gPPAXvllyigd+/OKd4xcSHium5s9iAkhc="},"opal/nodes/args/extract_kwarg.source-7ea9c9432b9fba0d27b3bbfdc935b97386d6ee9abe6138e98906d76464c76cc2.rb":{"logical_path":"opal/nodes/args/extract_kwarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":708,"digest":"7ea9c9432b9fba0d27b3bbfdc935b97386d6ee9abe6138e98906d76464c76cc2","integrity":"sha256-fqnJQyufug0ns7v9yTW5c4bW7pq+YTjpiQbXZGTHbMI="},"opal/nodes/args/extract_kwargs.source-57fd41af5899f069aa69688b30d0713c373d97c244a33c71f3bc7114031f1bf8.rb":{"logical_path":"opal/nodes/args/extract_kwargs.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":637,"digest":"57fd41af5899f069aa69688b30d0713c373d97c244a33c71f3bc7114031f1bf8","integrity":"sha256-V/1Br1iZ8GmqaWiLMNBxPDc9l8JEozxx87xxFAMfG/g="},"opal/nodes/args/extract_kwoptarg.source-1fb3f7119fa8fcf230e98e5599afd9a7cdf9bf559704892d74cbd4cde3d07feb.rb":{"logical_path":"opal/nodes/args/extract_kwoptarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":870,"digest":"1fb3f7119fa8fcf230e98e5599afd9a7cdf9bf559704892d74cbd4cde3d07feb","integrity":"sha256-H7P3EZ+o/PIw6Y5Vma/Zp835v1WXBIktdMvUzePQf+s="},"opal/nodes/args/extract_kwrestarg.source-2e32668aed5dec1f77dc615d9374748cb1bb0f063ec612e91d1ba76e6c4bd14c.rb":{"logical_path":"opal/nodes/args/extract_kwrestarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":912,"digest":"2e32668aed5dec1f77dc615d9374748cb1bb0f063ec612e91d1ba76e6c4bd14c","integrity":"sha256-LjJmiu1d7B933GFdk3R0jLG7DwY+xhLpHRunbmxL0Uw="},"opal/nodes/args/extract_optarg.source-4973e4bd89aebde7abf99d0713e23d304c519e51be77a8a91e697c02c12b1a1b.rb":{"logical_path":"opal/nodes/args/extract_optarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":896,"digest":"4973e4bd89aebde7abf99d0713e23d304c519e51be77a8a91e697c02c12b1a1b","integrity":"sha256-SXPkvYmuveer+Z0HE+I9MExRnlG+d6ipHml8AsErGhs="},"opal/nodes/args/extract_post_arg.source-2f45dcaf1dfcb2ceb236339492b5cb0f72e4bd44a214dfc1f7f8c644250cfbb6.rb":{"logical_path":"opal/nodes/args/extract_post_arg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":489,"digest":"2f45dcaf1dfcb2ceb236339492b5cb0f72e4bd44a214dfc1f7f8c644250cfbb6","integrity":"sha256-L0Xcrx38ss6yNjOUkrXLD3LkvUSiFN/B9/jGRCUM+7Y="},"opal/nodes/args/extract_post_optarg.source-87acad22bc6cf033ad56d23b9fc7257291af371e1272f88fe5454f2c66fc711c.rb":{"logical_path":"opal/nodes/args/extract_post_optarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":895,"digest":"87acad22bc6cf033ad56d23b9fc7257291af371e1272f88fe5454f2c66fc711c","integrity":"sha256-h6ytIrxs8DOtVtI7n8clcpGvNx4ScviP5UVPLGb8cRw="},"opal/nodes/args/extract_restarg.source-07348cbf0070549ee56e5f6dab3ea5f49875209f82248f77a9239f38801f5b4d.rb":{"logical_path":"opal/nodes/args/extract_restarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":974,"digest":"07348cbf0070549ee56e5f6dab3ea5f49875209f82248f77a9239f38801f5b4d","integrity":"sha256-BzSMvwBwVJ7lbl9tqz6l9Jh1IJ+CJI93qSOfOIAfW00="},"opal/nodes/args/fake_arg.source-0eedc329de139f44dc91961c2f04b9d58872e38219da177944baacf3162789fa.rb":{"logical_path":"opal/nodes/args/fake_arg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":560,"digest":"0eedc329de139f44dc91961c2f04b9d58872e38219da177944baacf3162789fa","integrity":"sha256-Du3DKd4Tn0TckZYcLwS51Yhy44IZ2hd5RLqs8xYnifo="},"opal/nodes/args/initialize_iterarg.source-1ce56fbb913210226852184a0af760aad726e2a70bef5a28ae3541d1f56e35e2.rb":{"logical_path":"opal/nodes/args/initialize_iterarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":541,"digest":"1ce56fbb913210226852184a0af760aad726e2a70bef5a28ae3541d1f56e35e2","integrity":"sha256-HOVvu5EyECJoUhhKCvdgqtcm4qcL71oorjVB0fVuNeI="},"opal/nodes/args/initialize_shadowarg.source-16bc5e6e66bc8601eed5a638c5ae19f52248642f18c4b3aa9d992cebfe1772b7.rb":{"logical_path":"opal/nodes/args/initialize_shadowarg.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":454,"digest":"16bc5e6e66bc8601eed5a638c5ae19f52248642f18c4b3aa9d992cebfe1772b7","integrity":"sha256-Frxebma8hgHu1aY4xa4Z9SJIZC8YxLOqnZks6/4Xcrc="},"opal/nodes/args/parameters.source-f0111f3975a6322fe945978d480dd0958fdf1166dfe3911d8fe8446a65ffaf19.rb":{"logical_path":"opal/nodes/args/parameters.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1669,"digest":"f0111f3975a6322fe945978d480dd0958fdf1166dfe3911d8fe8446a65ffaf19","integrity":"sha256-8BEfOXWmMi/pRZeNSA3QlY/fEWbf45Edj+hEamX/rxk="},"opal/nodes/args/prepare_post_args.source-4fc872ee92352be9cc57730c078ce43d8e455e9beabc4912546c3670cccd21ba.rb":{"logical_path":"opal/nodes/args/prepare_post_args.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":576,"digest":"4fc872ee92352be9cc57730c078ce43d8e455e9beabc4912546c3670cccd21ba","integrity":"sha256-T8hy7pI1K+nMV3MMB4zkPY5FXpvqvEkSVGw2cMzNIbo="},"opal/nodes/args.source-345dd14ece705f6a8d8c8184c0aa217df51744e35ecd71d102a2fa80c8918b11.rb":{"logical_path":"opal/nodes/args.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1008,"digest":"345dd14ece705f6a8d8c8184c0aa217df51744e35ecd71d102a2fa80c8918b11","integrity":"sha256-NF3RTs5wX2qNjIGEwKohffUXRONezXHRAqL6gMiRixE="},"opal/nodes/node_with_args/shortcuts.source-c2decc753ed2daf7beb6517deb8a83002c2ecd6f57eff7b0de621ccd98b5663a.rb":{"logical_path":"opal/nodes/node_with_args/shortcuts.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3037,"digest":"c2decc753ed2daf7beb6517deb8a83002c2ecd6f57eff7b0de621ccd98b5663a","integrity":"sha256-wt7MdT7S2ve+tlF964qDACwuzW9X7/ew3mIczZi1Zjo="},"opal/nodes/node_with_args.source-b9042d63c9378b2fa3089450122ee741d9a2c897b0b750150cae548ad40d42c5.rb":{"logical_path":"opal/nodes/node_with_args.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":886,"digest":"b9042d63c9378b2fa3089450122ee741d9a2c897b0b750150cae548ad40d42c5","integrity":"sha256-uQQtY8k3iy+jCJRQEi7nQdmiyJewt1AVDK5UitQNQsU="},"opal/nodes/iter.source-1002ee2fd151097bcf980ffacfdf9c23b6107728846005bd353fa89fa211926c.rb":{"logical_path":"opal/nodes/iter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3746,"digest":"1002ee2fd151097bcf980ffacfdf9c23b6107728846005bd353fa89fa211926c","integrity":"sha256-EALuL9FRCXvPmA/6z9+cI7YQdyiEYAW9NT+on6IRkmw="},"opal/nodes/def.source-14774520b7164f94594c10cef0eadbfddff59900e89850ccb1af67ffbae6ad4b.rb":{"logical_path":"opal/nodes/def.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2202,"digest":"14774520b7164f94594c10cef0eadbfddff59900e89850ccb1af67ffbae6ad4b","integrity":"sha256-FHdFILcWT5RZTBDO8Orb/d/1mQDomFDMsa9n/7rmrUs="},"opal/nodes/defs.source-17c910cf0f4da688af691125109e85fbda464a49b7e322d7d6e14fa74568bfd7.rb":{"logical_path":"opal/nodes/defs.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":335,"digest":"17c910cf0f4da688af691125109e85fbda464a49b7e322d7d6e14fa74568bfd7","integrity":"sha256-F8kQzw9NpoivaRElEJ6F+9pGSkm34yLX1uFPp0Vov9c="},"opal/ast/matcher.source-704b0a37637c831e85d7fb52b1b836077b0f918b3a0266dc292c1e81a717acba.rb":{"logical_path":"opal/ast/matcher.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1772,"digest":"704b0a37637c831e85d7fb52b1b836077b0f918b3a0266dc292c1e81a717acba","integrity":"sha256-cEsKN2N8gx6F1/tSsbg2B3sPkYs6AmbcKSwegacXrLo="},"opal/nodes/if.source-51f92ca049aa5101785d1b0e007b0be29328333c0e158aa9fb64352cc7441266.rb":{"logical_path":"opal/nodes/if.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":13093,"digest":"51f92ca049aa5101785d1b0e007b0be29328333c0e158aa9fb64352cc7441266","integrity":"sha256-UfksoEmqUQF4XRsOAHsL4pMoMzwOFYqp+2Q1LMdEEmY="},"opal/nodes/logic.source-2debb04deb82f64adedca33ad7e7c5908cc097bc6898374a210c996a73600239.rb":{"logical_path":"opal/nodes/logic.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2195,"digest":"2debb04deb82f64adedca33ad7e7c5908cc097bc6898374a210c996a73600239","integrity":"sha256-LeuwTeuC9kre3KM61+fFkIzAl7xomDdKIQyZanNgAjk="},"opal/nodes/definitions.source-b5b8ebc9901ca181ca2170c7b17308a3d1ea15ec5c4710df703ee42d412d4300.rb":{"logical_path":"opal/nodes/definitions.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2997,"digest":"b5b8ebc9901ca181ca2170c7b17308a3d1ea15ec5c4710df703ee42d412d4300","integrity":"sha256-tbjryZAcoYHKIXDHsXMIo9HqFexcRxDfcD7kLUEtQwA="},"opal/nodes/yield.source-9c3ffb95e0c2a999719ecce959649499ba79a57c181f6aee839fd4adf0de02e1.rb":{"logical_path":"opal/nodes/yield.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1537,"digest":"9c3ffb95e0c2a999719ecce959649499ba79a57c181f6aee839fd4adf0de02e1","integrity":"sha256-nD/7leDCqZlxnszpWWSUmbp5pXwYH2rug5/UrfDeAuE="},"opal/nodes/rescue.source-51619b81b4fc4e0bfefe024b98a520c0d3f6e53ffdee44b7b75c7ed719d201ff.rb":{"logical_path":"opal/nodes/rescue.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5943,"digest":"51619b81b4fc4e0bfefe024b98a520c0d3f6e53ffdee44b7b75c7ed719d201ff","integrity":"sha256-UWGbgbT8Tgv+/gJLmKUgwNP25T/97kS3t1x+1xnSAf8="},"opal/nodes/super.source-29e8f086d8a16a9d9be5259065a0c0af5c072ce62a1726b79ff876bfeb42dffd.rb":{"logical_path":"opal/nodes/super.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5292,"digest":"29e8f086d8a16a9d9be5259065a0c0af5c072ce62a1726b79ff876bfeb42dffd","integrity":"sha256-Kejwhtihap2b5SWQZaDAr1wHLOYqFya3n/h2v+tC3/0="},"json.source-b865f9c6664a1747fa62b4a9585dff5d367de647b7e8e3a08410116640579941.rb":{"logical_path":"json.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3627,"digest":"b865f9c6664a1747fa62b4a9585dff5d367de647b7e8e3a08410116640579941","integrity":"sha256-uGX5xmZKF0f6YrSpWF3/XTZ95ke36OOghBARZkBXmUE="},"opal/version.source-9dd407e8e560e0f7578ccc6153eab2f4607a2ae0836db2d46e28cc5d7ada94af.rb":{"logical_path":"opal/version.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":164,"digest":"9dd407e8e560e0f7578ccc6153eab2f4607a2ae0836db2d46e28cc5d7ada94af","integrity":"sha256-ndQH6OVg4PdXjMxhU+qy9GB6KuCDbbLUbijMXXralK8="},"opal/nodes/top.source-358838f769b2856651e5b09f35d4a09f85f8d72038e7d132e54026648a2f303a.rb":{"logical_path":"opal/nodes/top.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4287,"digest":"358838f769b2856651e5b09f35d4a09f85f8d72038e7d132e54026648a2f303a","integrity":"sha256-NYg492myhWZR5bCfNdSgn4X41yA459Ey5UAmZIovMDo="},"opal/nodes/while.source-21679024f6c30e20c60ebea952c6ed64a5d92b0f7a7e983ba22ae2da965bd61a.rb":{"logical_path":"opal/nodes/while.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2698,"digest":"21679024f6c30e20c60ebea952c6ed64a5d92b0f7a7e983ba22ae2da965bd61a","integrity":"sha256-IWeQJPbDDiDGDr6pUsbtZKXZKw96fpg7oiri2pZb1ho="},"opal/nodes/hash.source-bbc17f118949262dbb74e7375d56eeaf059dd4180ab294ff5ae932b13a393648.rb":{"logical_path":"opal/nodes/hash.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2525,"digest":"bbc17f118949262dbb74e7375d56eeaf059dd4180ab294ff5ae932b13a393648","integrity":"sha256-u8F/EYlJJi27dOc3XVburwWd1BgKspT/WukysTo5Nkg="},"opal/nodes/array.source-03c3f566655b4b61125e309e63f5cd06b7d8e986a2bbe8bd379c584791f6fb6c.rb":{"logical_path":"opal/nodes/array.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1315,"digest":"03c3f566655b4b61125e309e63f5cd06b7d8e986a2bbe8bd379c584791f6fb6c","integrity":"sha256-A8P1ZmVbS2ESXjCeY/XNBrfY6Yaiu+i9N5xYR5H2+2w="},"opal/nodes/defined.source-f29e732cf1c11cc81e3a19cf954f1f98c871596d2949079e46ad38d7b0388583.rb":{"logical_path":"opal/nodes/defined.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6422,"digest":"f29e732cf1c11cc81e3a19cf954f1f98c871596d2949079e46ad38d7b0388583","integrity":"sha256-8p5zLPHBHMgeOhnPlU8fmMhxWW0pSQeeRq0417A4hYM="},"opal/nodes/masgn.source-3323dcd78ccf976fef2b06d015ac4a3c3b685f047d73abb8f915d5190fd56cd8.rb":{"logical_path":"opal/nodes/masgn.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3404,"digest":"3323dcd78ccf976fef2b06d015ac4a3c3b685f047d73abb8f915d5190fd56cd8","integrity":"sha256-MyPc14zPl2/vKwbQFaxKPDtoXwR9c6u4+RXVGQ/VbNg="},"opal/nodes/arglist.source-5cc6bfac539eb067375d8c5a66f977ce76431afdcf0647da43d95d8aeea83af4.rb":{"logical_path":"opal/nodes/arglist.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1229,"digest":"5cc6bfac539eb067375d8c5a66f977ce76431afdcf0647da43d95d8aeea83af4","integrity":"sha256-XMa/rFOesGc3XYxaZvl3znZDGv3PBkfaQ9ldiu6oOvQ="},"opal/nodes/x_string.source-8d1e9b92363cc3880c2a31b91f7679c694d8f99c1ddf22338738d9859d4e6593.rb":{"logical_path":"opal/nodes/x_string.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4608,"digest":"8d1e9b92363cc3880c2a31b91f7679c694d8f99c1ddf22338738d9859d4e6593","integrity":"sha256-jR6bkjY8w4gMKjG5H3Z5xpTY+Zwd3yIzhzjZhZ1OZZM="},"opal/nodes/lambda.source-3ad0ff2fa933e061a26c44a5419b6b6e61848087abe6ad51379a78ad9c040949.rb":{"logical_path":"opal/nodes/lambda.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":313,"digest":"3ad0ff2fa933e061a26c44a5419b6b6e61848087abe6ad51379a78ad9c040949","integrity":"sha256-OtD/L6kz4GGibESlQZtrbmGEgIer5q1RN5p4rZwECUk="},"opal/nodes.source-a06e9fca039a76d955658c837683e297c1469a40397653dda6fecd5a3b44dcc3.rb":{"logical_path":"opal/nodes.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":884,"digest":"a06e9fca039a76d955658c837683e297c1469a40397653dda6fecd5a3b44dcc3","integrity":"sha256-oG6fygOadtlVZYyDdoPil8FGmkA5dlPdpv7NWjtE3MM="},"opal/eof_content.source-e3a9ba6ecfd5a7fb18b95aefd9c3a42aa3b15b0e8cec82d79ca0d52d3e7fb269.rb":{"logical_path":"opal/eof_content.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1029,"digest":"e3a9ba6ecfd5a7fb18b95aefd9c3a42aa3b15b0e8cec82d79ca0d52d3e7fb269","integrity":"sha256-46m6bs/Vp/sYuVrv2cOkKqOxWw6M7ILXnKDVLT5/smk="},"opal/errors.source-fb67e0c10d23fbcd654523c4b8a295a2dd106e0cd900f3fb9f1a582cc48d4166.rb":{"logical_path":"opal/errors.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1997,"digest":"fb67e0c10d23fbcd654523c4b8a295a2dd106e0cd900f3fb9f1a582cc48d4166","integrity":"sha256-+2fgwQ0j+81lRSPEuKKVot0QbgzZAPP7nxpYLMSNQWY="},"opal/magic_comments.source-a5059e1a7f2f33f7a4975316d31918090e9b02d9601a87da2672dda31f98053f.rb":{"logical_path":"opal/magic_comments.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":860,"digest":"a5059e1a7f2f33f7a4975316d31918090e9b02d9601a87da2672dda31f98053f","integrity":"sha256-pQWeGn8vM/ekl1MW0xkYCQ6bAtlgGofaJnLdox+YBT8="},"opal/source_map/map.source-efdd58648b9911055d0a91aa72e18e349ca37570013261708aa029a72a052bcb.rb":{"logical_path":"opal/source_map/map.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":771,"digest":"efdd58648b9911055d0a91aa72e18e349ca37570013261708aa029a72a052bcb","integrity":"sha256-791YZIuZEQVdCpGqcuGONJyjdXABMmFwiqAppyoFK8s="},"opal/source_map/file.source-11e0f7ecb939ecd146987e36b9f4b8a2b7f41f71f3735ea4ba0f677da856ed67.rb":{"logical_path":"opal/source_map/file.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":7807,"digest":"11e0f7ecb939ecd146987e36b9f4b8a2b7f41f71f3735ea4ba0f677da856ed67","integrity":"sha256-EeD37Lk57NFGmH42ufS4orf0H3Hzc16kug9nfahW7Wc="},"opal/source_map/index.source-1f72a1a208d444b4ac047cbbb06704bccec77896d9aac98dc3b792ba829da65b.rb":{"logical_path":"opal/source_map/index.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2687,"digest":"1f72a1a208d444b4ac047cbbb06704bccec77896d9aac98dc3b792ba829da65b","integrity":"sha256-H3KhogjURLSsBHy7sGcEvM7HeJbZqsmNw7eSuoKdpls="},"opal/source_map/vlq.source-1262a66cc794d867f086a703fe1cbdf94038125f5002eab3f961e8dfd57ce437.rb":{"logical_path":"opal/source_map/vlq.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2567,"digest":"1262a66cc794d867f086a703fe1cbdf94038125f5002eab3f961e8dfd57ce437","integrity":"sha256-EmKmbMeU2GfwhqcD/hy9+UA4El9QAuqz+WHo39V85Dc="},"opal/source_map.source-c31ead9775b0c66a9db73db136269b863bd688f923f6b03fb3dfbff1bf780489.rb":{"logical_path":"opal/source_map.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":396,"digest":"c31ead9775b0c66a9db73db136269b863bd688f923f6b03fb3dfbff1bf780489","integrity":"sha256-wx6tl3Wwxmqdtz2xNiabhjvWiPkj9rA/s9+/8b94BIk="},"opal/compiler.source-e403fe4c219cc7500c997c59a45775415cd7c8f4f323da8ce93e7ff937fa0df6.rb":{"logical_path":"opal/compiler.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":20113,"digest":"e403fe4c219cc7500c997c59a45775415cd7c8f4f323da8ce93e7ff937fa0df6","integrity":"sha256-5AP+TCGcx1AMmXxZpFd1QVzXyPTzI9qM6T5/+Tf6DfY="},"opal/erb.source-c28c99c3cbe2c1cea8baa86979fa4eaad4fc069750f27a86cb1cef306014d6e8.rb":{"logical_path":"opal/erb.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2431,"digest":"c28c99c3cbe2c1cea8baa86979fa4eaad4fc069750f27a86cb1cef306014d6e8","integrity":"sha256-woyZw8viwc6ouqhpefpOqtT8BpdQ8nqGyxzvMGAU1ug="},"opal-parser.source-5d6f2ad0f5161a55ca662eb7587ef300f719556d4f526b805ce9dae78c367b38.rb":{"logical_path":"opal-parser.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2154,"digest":"5d6f2ad0f5161a55ca662eb7587ef300f719556d4f526b805ce9dae78c367b38","integrity":"sha256-XW8q0PUWGlXKZi63WH7zAPcZVW1PUmuAXOna54w2ezg="},"load-parser.source.js-18a0a131bf97d1a19b0b875bcf7a57e061ad1d8822fbf5a5699707793de11cfb.rb":{"logical_path":"load-parser.source.js.rb","mtime":"2023-11-23T09:58:47+00:00","size":91,"digest":"18a0a131bf97d1a19b0b875bcf7a57e061ad1d8822fbf5a5699707793de11cfb","integrity":"sha256-GKChMb+X0aGbC4dbz3pX4GGtHYgi+/WlaZcHeT3hHPs="},"application.debug-ff09e1eb149c682e225d3a75b7afa4fcb29136cb9ef2e003a34a1adca26f52bd.js":{"logical_path":"application.debug.js","mtime":"2023-11-23T09:58:47+00:00","size":785020,"digest":"ff09e1eb149c682e225d3a75b7afa4fcb29136cb9ef2e003a34a1adca26f52bd","integrity":"sha256-/wnh6xScaC4iXTp1t6+k/LKRNsue8uADo0oa3KJvUr0="},"application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js":{"logical_path":"application.js","mtime":"2023-11-23T09:58:47+00:00","size":784914,"digest":"596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f","integrity":"sha256-WW9SO0HNDBt1uAZlEsTJtZLoXOaZQooF201qxCXCsJ8="},"application.js-3ec4335d7b8f069f914b0d1e2db474163e862fa7b16e3d8d13ad3c1a23b4d0ce.map":{"logical_path":"application.js.map","mtime":"2023-11-23T09:58:47+00:00","size":438110,"digest":"3ec4335d7b8f069f914b0d1e2db474163e862fa7b16e3d8d13ad3c1a23b4d0ce","integrity":"sha256-PsQzXXuPBp+RSw0eLbR0Fj6GL6exbj2NE608GiO00M4="},"corelib/runtime.source-99051139d415b2cc01e77e875b95f2d0ee867e43b1c0366563d61db7834af76f.js":{"logical_path":"corelib/runtime.source.js","mtime":"2023-11-23T09:58:47+00:00","size":95430,"digest":"99051139d415b2cc01e77e875b95f2d0ee867e43b1c0366563d61db7834af76f","integrity":"sha256-mQUROdQVsswB536HW5Xy0O6GfkOxwDZlY9Ydt4NK928="},"corelib/helpers.source-098704fe3cd4d2bb51daa51fc1ecb610bd5584fd3a02011d2d1c39daa19ec7b8.rb":{"logical_path":"corelib/helpers.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5283,"digest":"098704fe3cd4d2bb51daa51fc1ecb610bd5584fd3a02011d2d1c39daa19ec7b8","integrity":"sha256-CYcE/jzU0rtR2qUfwey2EL1VhP06AgEdLRw52qGex7g="},"corelib/module.source-74e15d4257ba5112a9b6922c3675bfb7064aeb1acd92f1f5bf40345a66f04a78.rb":{"logical_path":"corelib/module.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":20625,"digest":"74e15d4257ba5112a9b6922c3675bfb7064aeb1acd92f1f5bf40345a66f04a78","integrity":"sha256-dOFdQle6URKptpIsNnW/twZK6xrNkvH1v0A0WmbwSng="},"corelib/class.source-6ac4292f7e727b499f679a4be5e22ca77533509714c7d8c87c429250b05d38ae.rb":{"logical_path":"corelib/class.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2503,"digest":"6ac4292f7e727b499f679a4be5e22ca77533509714c7d8c87c429250b05d38ae","integrity":"sha256-asQpL35ye0mfZ5pL5eIsp3UzUJcUx9jIfEKSULBdOK4="},"corelib/basic_object.source-c9f2ae6f9828520598d297ff62bd1d72086dc6f271cd63f0da8daf654e00d7d0.rb":{"logical_path":"corelib/basic_object.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3329,"digest":"c9f2ae6f9828520598d297ff62bd1d72086dc6f271cd63f0da8daf654e00d7d0","integrity":"sha256-yfKub5goUgWY0pf/Yr0dcghtxvJxzWPw2o2vZU4A19A="},"corelib/kernel.source-4496dc29bcb0623813ec9c3cde538d2a3e6839593b93ec478cc3aa24a1a963fb.rb":{"logical_path":"corelib/kernel.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":19326,"digest":"4496dc29bcb0623813ec9c3cde538d2a3e6839593b93ec478cc3aa24a1a963fb","integrity":"sha256-RJbcKbywYjgT7Jw83lONKj5oOVk7k+xHjMOqJKGpY/s="},"corelib/main.source-117fdb7af0b8c1642859e35713a278f05fe11725c23d81f705018d1c605e0f53.rb":{"logical_path":"corelib/main.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":329,"digest":"117fdb7af0b8c1642859e35713a278f05fe11725c23d81f705018d1c605e0f53","integrity":"sha256-EX/bevC4wWQoWeNXE6J48F/hFyXCPYH3BQGNHGBeD1M="},"corelib/error/errno.source-ca296bcfdf36d407edbcb3fa71e8b7718c94dce141a8a87e37881aadf23b80cd.rb":{"logical_path":"corelib/error/errno.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1139,"digest":"ca296bcfdf36d407edbcb3fa71e8b7718c94dce141a8a87e37881aadf23b80cd","integrity":"sha256-yilrz9821AftvLP6cei3cYyU3OFBqKh+N4garfI7gM0="},"corelib/error.source-f23645cbb2065bfe2c1231e3851e9bfc9fd8a3b153bca37073a839997e98237c.rb":{"logical_path":"corelib/error.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":8918,"digest":"f23645cbb2065bfe2c1231e3851e9bfc9fd8a3b153bca37073a839997e98237c","integrity":"sha256-8jZFy7IGW/4sEjHjhR6b/J/Yo7FTvKNwc6g5mX6YI3w="},"corelib/constants.source-650eaa201f9284b01b7d872a9d6a80f653c0bf3fd585ad080caade29b9bc17a0.rb":{"logical_path":"corelib/constants.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":421,"digest":"650eaa201f9284b01b7d872a9d6a80f653c0bf3fd585ad080caade29b9bc17a0","integrity":"sha256-ZQ6qIB+ShLAbfYcqnWqA9lPAvz/Vha0IDKreKbm8F6A="},"opal/base.source-55abc823c216010fd952e74b44c669aa82652aced413b1d59af35133542353cf.rb":{"logical_path":"opal/base.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":314,"digest":"55abc823c216010fd952e74b44c669aa82652aced413b1d59af35133542353cf","integrity":"sha256-VavII8IWAQ/ZUudLRMZpqoJlKs7UE7HVmvNRM1QjU88="},"corelib/nil.source-d65ee9c3403849589db650b9ddbf0bafe912d5481bf5fcf3cf6c492a3ee04bf2.rb":{"logical_path":"corelib/nil.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":977,"digest":"d65ee9c3403849589db650b9ddbf0bafe912d5481bf5fcf3cf6c492a3ee04bf2","integrity":"sha256-1l7pw0A4SVidtlC53b8Lr+kS1Ugb9fzzz2xJKj7gS/I="},"corelib/boolean.source-5020f3d8692e3eeb1bc1d2daeb9fa0be955052788dbc702db146ced433569493.rb":{"logical_path":"corelib/boolean.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2851,"digest":"5020f3d8692e3eeb1bc1d2daeb9fa0be955052788dbc702db146ced433569493","integrity":"sha256-UCDz2GkuPusbwdLa65+gvpVQUniNvHAtsUbO1DNWlJM="},"corelib/regexp.source-c31394a97f067e5b5260844ade4b891f568b331638a038aaf7a240638a520a78.rb":{"logical_path":"corelib/regexp.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":12124,"digest":"c31394a97f067e5b5260844ade4b891f568b331638a038aaf7a240638a520a78","integrity":"sha256-wxOUqX8GfltSYIRK3kuJH1aLMxY4oDiq96JAY4pSCng="},"corelib/string.source-8b4f7e8c13a7b97806d142617f8351ed4c4bf30edd2e258ce446c74091d5737a.rb":{"logical_path":"corelib/string.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":48593,"digest":"8b4f7e8c13a7b97806d142617f8351ed4c4bf30edd2e258ce446c74091d5737a","integrity":"sha256-i09+jBOnuXgG0UJhf4NR7UxL8w7dLiWM5EbHQJHVc3o="},"corelib/enumerable.source-aabe09b8461c48d5b4f9ac021caf5fb561d30ec76415f4bfffeecce0fa593269.rb":{"logical_path":"corelib/enumerable.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":26578,"digest":"aabe09b8461c48d5b4f9ac021caf5fb561d30ec76415f4bfffeecce0fa593269","integrity":"sha256-qr4JuEYcSNW0+awCHK9ftWHTDsdkFfS//+7M4PpZMmk="},"corelib/enumerator/arithmetic_sequence.source-37b39c4bf3514dda60c0c84cb5f279528063e7be16d55e04efa0dc608af6484e.rb":{"logical_path":"corelib/enumerator/arithmetic_sequence.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4174,"digest":"37b39c4bf3514dda60c0c84cb5f279528063e7be16d55e04efa0dc608af6484e","integrity":"sha256-N7OcS/NRTdpgwMhMtfJ5UoBj574W1V4E76DcYIr2SE4="},"corelib/enumerator/chain.source-d6e40c167f5f3479e4c9913e35ac1a4f8db519c39486c82858c555af3918d3eb.rb":{"logical_path":"corelib/enumerator/chain.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":896,"digest":"d6e40c167f5f3479e4c9913e35ac1a4f8db519c39486c82858c555af3918d3eb","integrity":"sha256-1uQMFn9fNHnkyZE+NawaT421GcOUhsgoWMVVrzkY0+s="},"corelib/enumerator/generator.source-9a9f9f4e152a0164a894fd263fc4d60605fcc184f6e8b898fb03117953f94b09.rb":{"logical_path":"corelib/enumerator/generator.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":664,"digest":"9a9f9f4e152a0164a894fd263fc4d60605fcc184f6e8b898fb03117953f94b09","integrity":"sha256-mp+fThUqAWSolP0mP8TWBgX8wYT26LiY+wMReVP5Swk="},"corelib/enumerator/lazy.source-0ff176e17644692a9ac0d9e2e8b015cbdb9cc8ebb450f3cc9fa0dee8dc908107.rb":{"logical_path":"corelib/enumerator/lazy.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5643,"digest":"0ff176e17644692a9ac0d9e2e8b015cbdb9cc8ebb450f3cc9fa0dee8dc908107","integrity":"sha256-D/F24XZEaSqawNni6LAVy9ucyOu0UPPMn6De6NyQgQc="},"corelib/enumerator/yielder.source-9dc42b00f789765de111f3a82e5ad90502fb39e830be9c2a7d09e17e70237034.rb":{"logical_path":"corelib/enumerator/yielder.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":570,"digest":"9dc42b00f789765de111f3a82e5ad90502fb39e830be9c2a7d09e17e70237034","integrity":"sha256-ncQrAPeJdl3hEfOoLlrZBQL7OegwvpwqfQnhfnAjcDQ="},"corelib/enumerator.source-230900b104b66f027879b18af04cf02b4b81d3d4dcc7f630eb49d526fbaca7ef.rb":{"logical_path":"corelib/enumerator.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2958,"digest":"230900b104b66f027879b18af04cf02b4b81d3d4dcc7f630eb49d526fbaca7ef","integrity":"sha256-IwkAsQS2bwJ4ebGK8EzwK0uB09Tcx/Yw60nVJvusp+8="},"corelib/numeric.source-16c3c8db76d183fa8775cce038960f6ef64a9a6b5df54bfa8169775c45a9ce8c.rb":{"logical_path":"corelib/numeric.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6572,"digest":"16c3c8db76d183fa8775cce038960f6ef64a9a6b5df54bfa8169775c45a9ce8c","integrity":"sha256-FsPI23bRg/qHdczgOJYPbvZKmmtd9Uv6gWl3XEWpzow="},"corelib/array.source-bfe4bfd38d29d22a2c59f723e4a83727a1c7f2aff0ef255042af4e68d0409ec6.rb":{"logical_path":"corelib/array.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":55893,"digest":"bfe4bfd38d29d22a2c59f723e4a83727a1c7f2aff0ef255042af4e68d0409ec6","integrity":"sha256-v+S/040p0iosWfcj5Kg3J6HH8q/w7yVQQq9OaNBAnsY="},"corelib/hash.source-43e0f7ea8b3c04d5a56613bdd11ab765756fcaa9c5fb6022d1421d6751b8e229.rb":{"logical_path":"corelib/hash.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":19360,"digest":"43e0f7ea8b3c04d5a56613bdd11ab765756fcaa9c5fb6022d1421d6751b8e229","integrity":"sha256-Q+D36os8BNWlZhO90Rq3ZXVvyqnF+2Ai0UIdZ1G44ik="},"corelib/number.source-cb83b5ca4647c2e1cc036178e34f6225a22e2d51a3fb7264cefb83de6e6e1939.rb":{"logical_path":"corelib/number.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":18632,"digest":"cb83b5ca4647c2e1cc036178e34f6225a22e2d51a3fb7264cefb83de6e6e1939","integrity":"sha256-y4O1ykZHwuHMA2F4409iJaIuLVGj+3JkzvuD3m5uGTk="},"corelib/range.source-d351f7482e46103eec38f4c207e096d7378e1932f96843ea03daec8b8ffff6f2.rb":{"logical_path":"corelib/range.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":8818,"digest":"d351f7482e46103eec38f4c207e096d7378e1932f96843ea03daec8b8ffff6f2","integrity":"sha256-01H3SC5GED7sOPTCB+CW1zeOGTL5aEPqA9rsi4//9vI="},"corelib/proc.source-2b521447daf405076d4bac222855ff36812379c0445dfed9bc3eac34a3b219a2.rb":{"logical_path":"corelib/proc.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4391,"digest":"2b521447daf405076d4bac222855ff36812379c0445dfed9bc3eac34a3b219a2","integrity":"sha256-K1IUR9r0BQdtS6wiKFX/NoEjecBEXf7ZvD6sNKOyGaI="},"corelib/method.source-5db9cae6ec1333ff90f7ef7739d45d3e8d7b9d8f238c367021ff7165dd6a6446.rb":{"logical_path":"corelib/method.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2292,"digest":"5db9cae6ec1333ff90f7ef7739d45d3e8d7b9d8f238c367021ff7165dd6a6446","integrity":"sha256-XbnK5uwTM/+Q9+93OdRdPo17nY8jjDZwIf9xZd1qZEY="},"corelib/variables.source-1a0df2dfa30886613488a97ea41fb3cd9dcc9fdeabcbe1e3e5a904647c90c4e6.rb":{"logical_path":"corelib/variables.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":325,"digest":"1a0df2dfa30886613488a97ea41fb3cd9dcc9fdeabcbe1e3e5a904647c90c4e6","integrity":"sha256-Gg3y36MIhmE0iKl+pB+zzZ3Mn96ry+Hj5akEZHyQxOY="},"corelib/io.source-403e8a47b15d3fe92b5d55e8a315e5f07371c55f1b6db056fc4d9b01408af5e9.rb":{"logical_path":"corelib/io.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6404,"digest":"403e8a47b15d3fe92b5d55e8a315e5f07371c55f1b6db056fc4d9b01408af5e9","integrity":"sha256-QD6KR7FdP+krXVXooxXl8HNxxV8bbbBW/E2bAUCK9ek="},"opal/mini.source-638e1531040665f9ec68e0c88df0b229ebe2ac89276b1e9c156f779b9f33029f.rb":{"logical_path":"opal/mini.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":582,"digest":"638e1531040665f9ec68e0c88df0b229ebe2ac89276b1e9c156f779b9f33029f","integrity":"sha256-Y44VMQQGZfnsaODIjfCyKevirIknax6cFW93m58zAp8="},"corelib/kernel/format.source-5dc6358fac4ee2a49f27470485163b821e0c9f61ba12db5a121e85985475ac7d.rb":{"logical_path":"corelib/kernel/format.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":19650,"digest":"5dc6358fac4ee2a49f27470485163b821e0c9f61ba12db5a121e85985475ac7d","integrity":"sha256-XcY1j6xO4qSfJ0cEhRY7gh4Mn2G6EttaEh6FmFR1rH0="},"corelib/string/encoding.source-e20bbd4db806af48823ff828bea06cca9c5573fe968e8db3e8ca77a99a45ea4b.rb":{"logical_path":"corelib/string/encoding.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":9772,"digest":"e20bbd4db806af48823ff828bea06cca9c5573fe968e8db3e8ca77a99a45ea4b","integrity":"sha256-4gu9TbgGr0iCP/govqBsypxVc/6Wjo2z6Mp3qZpF6ks="},"corelib/math.source-fa2631fcff5e4d9e11516986243d3b60098ba2262ad2ee05069193fbc0ad99d7.rb":{"logical_path":"corelib/math.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6185,"digest":"fa2631fcff5e4d9e11516986243d3b60098ba2262ad2ee05069193fbc0ad99d7","integrity":"sha256-+iYx/P9eTZ4RUWmGJD07YAmLoiYq0u4FBpGT+8Ctmdc="},"corelib/complex/base.source-e3d177911f1b14c79b0cc915d3f6acb16d23336997324f10689e0805766cb5f7.rb":{"logical_path":"corelib/complex/base.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":211,"digest":"e3d177911f1b14c79b0cc915d3f6acb16d23336997324f10689e0805766cb5f7","integrity":"sha256-49F3kR8bFMebDMkV0/assW0jM2mXMk8QaJ4IBXZstfc="},"corelib/complex.source-15d824f7f747b34ea4ec96b8fb20b039de8777db21ed673ffa89f09eefa6e312.rb":{"logical_path":"corelib/complex.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":7798,"digest":"15d824f7f747b34ea4ec96b8fb20b039de8777db21ed673ffa89f09eefa6e312","integrity":"sha256-Fdgk9/dHs06k7Ja4+yCwOd6Hd9sh7Wc/+onwnu+m4xI="},"corelib/rational/base.source-4783a9070f721a5eab480da1444557f592c4fa03694deda96cfe068dd5014a3c.rb":{"logical_path":"corelib/rational/base.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":186,"digest":"4783a9070f721a5eab480da1444557f592c4fa03694deda96cfe068dd5014a3c","integrity":"sha256-R4OpBw9yGl6rSA2hREVX9ZLE+gNpTe2pbP4GjdUBSjw="},"corelib/rational.source-fd79732f5b9233a5ad74fee8c2c1fb8cc5feba389dfef0076b6d0378d81d5b6f.rb":{"logical_path":"corelib/rational.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":7253,"digest":"fd79732f5b9233a5ad74fee8c2c1fb8cc5feba389dfef0076b6d0378d81d5b6f","integrity":"sha256-/XlzL1uSM6WtdP7owsH7jMX+ujid/vAHa20DeNgdW28="},"corelib/time.source-eb79092b11820cd9074f48da3c3c95471675bef7c150c443c008b4fbb915cfdb.rb":{"logical_path":"corelib/time.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":19119,"digest":"eb79092b11820cd9074f48da3c3c95471675bef7c150c443c008b4fbb915cfdb","integrity":"sha256-63kJKxGCDNkHT0jaPDyVRxZ1vvfBUMRDwAi0+7kVz9s="},"corelib/struct.source-be1ae7c9162154659ed197f2225c0a1b5fc455f72629c3b5f31482d4fcb09fa2.rb":{"logical_path":"corelib/struct.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":7988,"digest":"be1ae7c9162154659ed197f2225c0a1b5fc455f72629c3b5f31482d4fcb09fa2","integrity":"sha256-vhrnyRYhVGWe0ZfyIlwKG1/EVfcmKcO18xSC1Pywn6I="},"corelib/set.source-b044aca303702523db7cf30a05368d7dcf4b000fc6a688938dc4644d3eecc7ba.rb":{"logical_path":"corelib/set.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4524,"digest":"b044aca303702523db7cf30a05368d7dcf4b000fc6a688938dc4644d3eecc7ba","integrity":"sha256-sESsowNwJSPbfPMKBTaNfc9LAA/GpoiTjcRkTT7sx7o="},"corelib/dir.source-d67398b5f027e6bcf13aaa88c93a14c7b1d252ccce8189f63db8dff2347672a0.rb":{"logical_path":"corelib/dir.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":349,"digest":"d67398b5f027e6bcf13aaa88c93a14c7b1d252ccce8189f63db8dff2347672a0","integrity":"sha256-1nOYtfAn5rzxOqqIyToUx7HSUszOgYn2Pbjf8jR2cqA="},"corelib/file.source-db4d733e61452a07f91d541a74c11a413b88a2ae1ccb54090bc32177d141140d.rb":{"logical_path":"corelib/file.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":6578,"digest":"db4d733e61452a07f91d541a74c11a413b88a2ae1ccb54090bc32177d141140d","integrity":"sha256-201zPmFFKgf5HVQadMEaQTuIoq4cy1QJC8Mhd9FBFA0="},"corelib/process/base.source-ed219f24e478564e66ce8b54c742bde00c698b6e2f8e258551f4c5a754592378.rb":{"logical_path":"corelib/process/base.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":83,"digest":"ed219f24e478564e66ce8b54c742bde00c698b6e2f8e258551f4c5a754592378","integrity":"sha256-7SGfJOR4Vk5mzotUx0K94Axpi24vjiWFUfTFp1RZI3g="},"corelib/process.source-eae0d96ba98ca61234679790bfdd6b05adf36ed806a67d2c575505d96a580316.rb":{"logical_path":"corelib/process.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1987,"digest":"eae0d96ba98ca61234679790bfdd6b05adf36ed806a67d2c575505d96a580316","integrity":"sha256-6uDZa6mMphI0Z5eQv91rBa3zbtgGpn0sV1UF2WpYAxY="},"corelib/random/formatter.source-a5c67b3842448a9f38de7e59b1ef6cf0c1a4e9300c4ee9cf84d9102417f3a8f3.rb":{"logical_path":"corelib/random/formatter.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":3106,"digest":"a5c67b3842448a9f38de7e59b1ef6cf0c1a4e9300c4ee9cf84d9102417f3a8f3","integrity":"sha256-pcZ7OEJEip843n5Zse9s8MGk6TAMTunPhNkQJBfzqPM="},"corelib/random/mersenne_twister.source-96ab5e8c533f105c29c53801cfefff5c4a93daa242214f233d93d7e71989134e.rb":{"logical_path":"corelib/random/mersenne_twister.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":5483,"digest":"96ab5e8c533f105c29c53801cfefff5c4a93daa242214f233d93d7e71989134e","integrity":"sha256-lqtejFM/EFwpxTgBz+//XEqT2qJCIU8jPZPX5xmJE04="},"corelib/random.source-7a6ede92c9d8128add2371b37d8a03a47d3170656f40e20e56e532a1a63aba3e.rb":{"logical_path":"corelib/random.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1988,"digest":"7a6ede92c9d8128add2371b37d8a03a47d3170656f40e20e56e532a1a63aba3e","integrity":"sha256-em7eksnYEordI3GzfYoDpH0xcGVvQOIOVuUyoaY6uj4="},"corelib/unsupported.source-8e81720371807cc5396ff2eedff847682814b8e9c62ec9d95208d96584e09b4b.rb":{"logical_path":"corelib/unsupported.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":2626,"digest":"8e81720371807cc5396ff2eedff847682814b8e9c62ec9d95208d96584e09b4b","integrity":"sha256-joFyA3GAfMU5b/Lu3/hHaCgUuOnGLsnZUgjZZYTgm0s="},"corelib/binding.source-3b309deb9807f4940f2c9ed7679bfc40cc5eb11683ca41f594bf7f49453630a0.rb":{"logical_path":"corelib/binding.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1423,"digest":"3b309deb9807f4940f2c9ed7679bfc40cc5eb11683ca41f594bf7f49453630a0","integrity":"sha256-OzCd65gH9JQPLJ7XZ5v8QMxesRaDykH1lL9/SUU2MKA="},"corelib/irb.source-04c57c643e2c4ed9e9cda17758fd8929fb02554f1a8576a782d788eb37e563dd.rb":{"logical_path":"corelib/irb.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":4644,"digest":"04c57c643e2c4ed9e9cda17758fd8929fb02554f1a8576a782d788eb37e563dd","integrity":"sha256-BMV8ZD4sTtnpzaF3WP2JKfsCVU8ahXangteI6zflY90="},"opal.source-4034ad8e0a1fdcd74becb7ba30cb0eb19ba9ffbb4e7d511b79077250fcad421d.rb":{"logical_path":"opal.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":788,"digest":"4034ad8e0a1fdcd74becb7ba30cb0eb19ba9ffbb4e7d511b79077250fcad421d","integrity":"sha256-QDStjgof3NdL7Le6MMsOsZup/7tOfVEbeQdyUPytQh0="},"native.source-61c02136482500675de2c6c7be30a3fa2d2706e0259c17a65966f210e31068f4.rb":{"logical_path":"native.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":13523,"digest":"61c02136482500675de2c6c7be30a3fa2d2706e0259c17a65966f210e31068f4","integrity":"sha256-YcAhNkglAGdd4sbHvjCj+i0nBuAlnBemWWbyEOMQaPQ="},"console.source-d5d314ea6b559f8cfe86bf3f2809ff5602b4a492a206152a3f2dc568c79361af.rb":{"logical_path":"console.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1983,"digest":"d5d314ea6b559f8cfe86bf3f2809ff5602b4a492a206152a3f2dc568c79361af","integrity":"sha256-1dMU6mtVn4z+hr8/KAn/VgK0pJKiBhUqPy3FaMeTYa8="},"js.source-fc496a13dc2a906b4406a4a97ee81a610152e0a15d9b935e8bbf634f94e535fd.rb":{"logical_path":"js.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1842,"digest":"fc496a13dc2a906b4406a4a97ee81a610152e0a15d9b935e8bbf634f94e535fd","integrity":"sha256-/ElqE9wqkGtEBqSpfugaYQFS4KFdm5Nei79jT5TlNf0="},"application.source.js-1c44c3e7669e9ba07cc951b94fa5249c487df88ac70612b6a2a6d4b95ce60b02.rb":{"logical_path":"application.source.js.rb","mtime":"2023-11-23T09:58:47+00:00","size":381,"digest":"1c44c3e7669e9ba07cc951b94fa5249c487df88ac70612b6a2a6d4b95ce60b02","integrity":"sha256-HETD52aem6B8yVG5T6UknEh9+IrHBhK2oqbUuVzmCwI="},"try.debug-fc5a97558dfaa14eedc387af7b1f8d60da375e8c5922a1d0278af8c5be4ecc52.js":{"logical_path":"try.debug.js","mtime":"2023-11-23T09:58:47+00:00","size":268154,"digest":"fc5a97558dfaa14eedc387af7b1f8d60da375e8c5922a1d0278af8c5be4ecc52","integrity":"sha256-/FqXVY36oU7tw4evex+NYNo3XoxZIqHQJ4r4xb5OzFI="},"try-a51164b017a4255201e72222db4ea8cde71bef0a2e8c97a19d46d82dfad3c2db.js":{"logical_path":"try.js","mtime":"2023-11-23T09:58:47+00:00","size":268056,"digest":"a51164b017a4255201e72222db4ea8cde71bef0a2e8c97a19d46d82dfad3c2db","integrity":"sha256-pRFksBekJVIB5yIi206ozecb7woujJehnUbYLfrTwts="},"try.js-4a24a3170b9aaf4107e672a9772cbcf91222ba6a397247d800938ad58d95a4bc.map":{"logical_path":"try.js.map","mtime":"2023-11-23T09:58:47+00:00","size":42994,"digest":"4a24a3170b9aaf4107e672a9772cbcf91222ba6a397247d800938ad58d95a4bc","integrity":"sha256-SiSjFwuar0EH5nKpdyy8+RIiumo5ckfYAJOK1Y2VpLw="},"_vendor/codemirror.source-02e1e58bfe4c3b5acc3b5eac25dd452e75094d1f2ad66aa19d68997988c661de.js":{"logical_path":"_vendor/codemirror.source.js","mtime":"2023-11-23T09:58:47+00:00","size":233685,"digest":"02e1e58bfe4c3b5acc3b5eac25dd452e75094d1f2ad66aa19d68997988c661de","integrity":"sha256-AuHli/5MO1rMO16sJd1FLnUJTR8q1mqhnWiZeYjGYd4="},"_vendor/ruby.source-66aaca5ea56621bad19bff704c61709e12cb5e53d83aa65f098432d0fb599cac.js":{"logical_path":"_vendor/ruby.source.js","mtime":"2023-11-23T09:58:47+00:00","size":7296,"digest":"66aaca5ea56621bad19bff704c61709e12cb5e53d83aa65f098432d0fb599cac","integrity":"sha256-ZqrKXqVmIbrRm/9wTGFwnhLLXlPYOqZfCYQy0PtZnKw="},"_vendor/javascript.source-5462d687adc5dcbddfc7bf43cde9ad6ccc27cfdf78e7a96a86368d6af62f69b3.js":{"logical_path":"_vendor/javascript.source.js","mtime":"2023-11-23T09:58:47+00:00","size":12823,"digest":"5462d687adc5dcbddfc7bf43cde9ad6ccc27cfdf78e7a96a86368d6af62f69b3","integrity":"sha256-VGLWh63F3L3fx79DzemtbMwnz99456lqhjaNavYvabM="},"try/examples.source-ffd37a3924f0f5fd6e55eb1f75c25c78bb939e9eda723b4b039c51d07a7700f5.rb":{"logical_path":"try/examples.source.rb","mtime":"2023-11-23T09:58:47+00:00","size":1711,"digest":"ffd37a3924f0f5fd6e55eb1f75c25c78bb939e9eda723b4b039c51d07a7700f5","integrity":"sha256-/9N6OSTw9f1uVesfdcJceLuTnp7acjtLA5xR0Hp3APU="},"try.source.js-85bdbb21b84aa0121d3a4f891a3132fd51c363ea14e32837ab9b419eec7a6682.rb":{"logical_path":"try.source.js.rb","mtime":"2023-11-23T09:58:47+00:00","size":4389,"digest":"85bdbb21b84aa0121d3a4f891a3132fd51c363ea14e32837ab9b419eec7a6682","integrity":"sha256-hb27IbhKoBIdOk+JGjEy/VHDY+oU4yg3q5tBnux6ZoI="}},"assets":{"manifest.js":"manifest-051b80c2b5fb204b550aba6cf928072bbb42036e37e7706f5459081c977c1c2c.js","application.debug.css":"application.debug-5831b9572963d71dcb254b54bc0ec95f027323aed416e47cd8a208bed1efbbea.css","application.css":"application-915b7e3cafe6e192dee011fa09837b2af85b7e1de3dbb52fd1413d46dd2dca0e.css","application.css.map":"application.css-6af110e86ced0e076fe5512b7eeef8d85edc3659719ed624f009ab14f21e029a.map","application.source.scss":"application.source-01d3042c3bc7c1b2ded94479a37bda3e2a3b65f1957686eba6700502b4fe5082.scss","_vendor/_pygment_solarized_light.source.scss":"_vendor/_pygment_solarized_light.source-6794ffcdd63dcecc7c972f8c3b032fe28134bd8add2a0257df56c173174ccc30.scss","_vendor/_codemirror-solarized.source.scss":"_vendor/_codemirror-solarized.source-c8817c4f8a3022d53d7ba1f7d53a0739efd87e1740d931cc1fff1ec30060bdcc.scss","_blog.source.scss":"_blog.source-1468f1e056e48afbf297b9511e4cb8d72622100a4cbd79dcab0c313174ac0164.scss","_index.source.scss":"_index.source-8e5904704d64bea7a6d7cc2cbd3291762d8e14a5702873b2b8f372c0d4db2cd2.scss","_codemirror.source.scss":"_codemirror.source-e40f23e95ff81277d0e9f4cb5b65d5df9ce160bfdc41d67cc224af3a6922488c.scss","_bootstrap-sprockets.source.scss":"_bootstrap-sprockets.source-617bd14f8f87a7d4f3104d96ada5ff1ef60ea8cd1b0c0244675ac792d4c4977c.scss","_bootstrap.source.scss":"_bootstrap.source-17d7cd48409fa895ebcc007d74770c893e323925b0a1e4095aea7bcdb529c070.scss","bootstrap/_variables.source.scss":"bootstrap/_variables.source-482186f7e15fd47e0bdb00a85e8edf7a10a014aa59373f1fdf71585a5d6feadc.scss","bootstrap/_mixins.source.scss":"bootstrap/_mixins.source-f69f85085da6f31aeaf5a3f6e829609414b034f72d5f66c28b7e47565c31879d.scss","bootstrap/mixins/_hide-text.source.scss":"bootstrap/mixins/_hide-text.source-744d07b859e64a5054bb3a5a61c741da0802ccdf1c01c04cb58a99e7a3a64475.scss","bootstrap/mixins/_opacity.source.scss":"bootstrap/mixins/_opacity.source-24a43bd4cccdf1523772ee49cb5d26e7bf8cd3f76202221ce2d417180f920e60.scss","bootstrap/mixins/_image.source.scss":"bootstrap/mixins/_image.source-11e4a737146939fe6c78e1634e2aaacaf6555340fceabfad6c0c90f0501386f4.scss","bootstrap/mixins/_labels.source.scss":"bootstrap/mixins/_labels.source-fc0e4380846766ac47c42d977f6a16c89788fabc88aa5d825aa2040c0397fd15.scss","bootstrap/mixins/_reset-filter.source.scss":"bootstrap/mixins/_reset-filter.source-85a38f5886d4d9f3c3beee2d2a0762a336725b1b6ce8a900b35c0fef05eca90c.scss","bootstrap/mixins/_resize.source.scss":"bootstrap/mixins/_resize.source-f667a158b80786e0b6a02cbe8cc007879cd2f0111e7285f37ad76221fc53edd8.scss","bootstrap/mixins/_responsive-visibility.source.scss":"bootstrap/mixins/_responsive-visibility.source-c5922fa5c03e4e5519c0d6b0fe55d74deb4df78c4b92030f167a7eb93e3cf5f4.scss","bootstrap/mixins/_size.source.scss":"bootstrap/mixins/_size.source-43ed70c482e6890da52c5cb98b33b651cb6e5535887deebc31145a9d2ae0e292.scss","bootstrap/mixins/_tab-focus.source.scss":"bootstrap/mixins/_tab-focus.source-cc154891d4d781e6a012e90e57921c52b8b4be016c9a86c827546b7d117fb25b.scss","bootstrap/mixins/_text-emphasis.source.scss":"bootstrap/mixins/_text-emphasis.source-5122df1667a80e2f6e577fc257c5106b68d68b5ae490647c2c3ecc41651743a7.scss","bootstrap/mixins/_text-overflow.source.scss":"bootstrap/mixins/_text-overflow.source-f2a9a690e1843c596df61998e0e78f40cd65a5b649c77a50b87dd2fdb980aa1b.scss","bootstrap/mixins/_vendor-prefixes.source.scss":"bootstrap/mixins/_vendor-prefixes.source-f5f733f9a623615ab9101c9e32699cc92770fa57ac1d09196e099d1749cda303.scss","bootstrap/mixins/_alerts.source.scss":"bootstrap/mixins/_alerts.source-16f165cb79b8d222f79cfa2e9eb63d80afc00b73c5fc0720997734d389a29d6f.scss","bootstrap/mixins/_buttons.source.scss":"bootstrap/mixins/_buttons.source-1e01e239d869ca1db2c754944d3443f116fe8bf046ffcd937310ca42be615c39.scss","bootstrap/mixins/_panels.source.scss":"bootstrap/mixins/_panels.source-d6fb2063735bf908241957257cfdb03d6410e22a29d2499c0536be2632abd592.scss","bootstrap/mixins/_pagination.source.scss":"bootstrap/mixins/_pagination.source-f06aaed2591ea5ca3e3bd48f62e25e471a69dddd8fc195f1d0cc6ccc4bf23b81.scss","bootstrap/mixins/_list-group.source.scss":"bootstrap/mixins/_list-group.source-294f6a9a302c9b2781e61ee063e53a79902f4b61827473630170da3f47714357.scss","bootstrap/mixins/_nav-divider.source.scss":"bootstrap/mixins/_nav-divider.source-4dfd32935ea1d043c0af570b80687bcf634ded8ba616336259d0dff8ab650191.scss","bootstrap/mixins/_forms.source.scss":"bootstrap/mixins/_forms.source-d58c71313533676457cddeb86fb2dbffa636e39ef86696c863a3054429a60642.scss","bootstrap/mixins/_progress-bar.source.scss":"bootstrap/mixins/_progress-bar.source-75f3702c9f9f63ced3d3e848e8c5de1cc321256b864eb79d9b2534da2a782b82.scss","bootstrap/mixins/_table-row.source.scss":"bootstrap/mixins/_table-row.source-5bc673689b0e533c050784b4aac716c12e08cae1bb8948f32cd0a9da752e6a6c.scss","bootstrap/mixins/_background-variant.source.scss":"bootstrap/mixins/_background-variant.source-faea592ef84bb2f65cbc371028f8db9f6ce70a0169a32feed86dbe2fd45b243d.scss","bootstrap/mixins/_border-radius.source.scss":"bootstrap/mixins/_border-radius.source-c7385e8d18e49d52cdcef95f7a22a86c3c1a10cddc56f7071c6f988869d3ca62.scss","bootstrap/mixins/_gradients.source.scss":"bootstrap/mixins/_gradients.source-8c74fe22ac06fa17249449c725c00f9f6cac2affa5eca1f09f28639bd01013ec.scss","bootstrap/mixins/_clearfix.source.scss":"bootstrap/mixins/_clearfix.source-f3599294867438e1433ceb90d573d4f042e546e687e06b366219c67f3e08cacd.scss","bootstrap/mixins/_center-block.source.scss":"bootstrap/mixins/_center-block.source-bfdc52231145f062b6ac0444096d5da0fdcfa24412f9f01def285882a761da14.scss","bootstrap/mixins/_nav-vertical-align.source.scss":"bootstrap/mixins/_nav-vertical-align.source-5dd7d8297185f30e923b35bf60b7f4e6c3ea662561a1b588230c55297fc75168.scss","bootstrap/mixins/_grid-framework.source.scss":"bootstrap/mixins/_grid-framework.source-d6de740850d367cde1814a930f5a89e68f1a4048ad2af57eba0c5850a9dd229e.scss","bootstrap/mixins/_grid.source.scss":"bootstrap/mixins/_grid.source-86a1bea9c80367c82818c8deee4b694f5d03db8b3baf0d3cd10f109bf9e0aaec.scss","bootstrap/_normalize.source.scss":"bootstrap/_normalize.source-9d4affd5f91924523e244e1c5b503aac4bb2fb76a4b009c0168d872788426626.scss","bootstrap/_print.source.scss":"bootstrap/_print.source-4e1eac8f340c82d34b71b5fae32aff2a607a5b3279077d97e81836951660b6dc.scss","bootstrap/_scaffolding.source.scss":"bootstrap/_scaffolding.source-a6ba8ce4bf75bd1f7f49bfd683557a5dd67844db73827639c207453e72c1d9a6.scss","bootstrap/_type.source.scss":"bootstrap/_type.source-3734242e194571b02107f9d64d1676cab7f99eaf1c0a2741831bdb84e8b054de.scss","bootstrap/_code.source.scss":"bootstrap/_code.source-32c093107b854533c984a1d3d33977f99202a126c07a054001e4cd7fde0fac10.scss","bootstrap/_grid.source.scss":"bootstrap/_grid.source-cca48675d371e0c0bf11dbf00e3736578eff464b978a25d1a4ade3bcbed80ecd.scss","bootstrap/_tables.source.scss":"bootstrap/_tables.source-5d66b5342353d126f0e20b2b4184143350f54f68022f36da658d5d1e3d91bed8.scss","bootstrap/_forms.source.scss":"bootstrap/_forms.source-a9e925fca4a9805dc3b80b749d357b3afc1196d85a07f096c23862c37e51d426.scss","bootstrap/_buttons.source.scss":"bootstrap/_buttons.source-a3e623ca2a0490713d186de54ec6bac70a8612f986b6b39c63bda4f843adcf55.scss","bootstrap/_component-animations.source.scss":"bootstrap/_component-animations.source-153de427f07c04d747940bc5c360cc716fa00008dd2b8e5d1038bbd3e93bd8ed.scss","bootstrap/_dropdowns.source.scss":"bootstrap/_dropdowns.source-0010fb4057ead72a145cc8e6ab3e4ea290e899d82b7f66177a29f90c2996b647.scss","bootstrap/_button-groups.source.scss":"bootstrap/_button-groups.source-21e18e2516879de3defda28c5d32f5e344bbc85421ad66b38186224f2455e8cc.scss","bootstrap/_input-groups.source.scss":"bootstrap/_input-groups.source-8fae3b159a0c69d4cc9af589bb073ca5b1da90973092bcc00276aa1a4fa164be.scss","bootstrap/_navs.source.scss":"bootstrap/_navs.source-8779db84fe76e19abe7b9d4d5014adb07e23e5a773a3d17b529c0e879df71540.scss","bootstrap/_navbar.source.scss":"bootstrap/_navbar.source-6ea4c7c0aeabc2157f63ac00af971a113c9b5cf66736a8020ca4a18cca3817df.scss","bootstrap/_breadcrumbs.source.scss":"bootstrap/_breadcrumbs.source-33c2f0bae433c1d2bed93c81ce71176ba35ab03d15d8b7cc919251d6ff619f80.scss","bootstrap/_pagination.source.scss":"bootstrap/_pagination.source-3f41713467dd921cc1ac350f1cc0b3bdb6c57687f36cbb0d680fc9d078d7fb46.scss","bootstrap/_pager.source.scss":"bootstrap/_pager.source-59ef3d3b0c5e7ed35f392ce461edf06bfc829c535afd8630b2aac51a44e11892.scss","bootstrap/_labels.source.scss":"bootstrap/_labels.source-bf9bd4cdd0441acb70db89f7a33adf06e50b4a7ff92db8fece20832a697612a7.scss","bootstrap/_badges.source.scss":"bootstrap/_badges.source-f20d636c4d5f23c846448eb64155b594a319e62329f5f1001f680b35972a1ae4.scss","bootstrap/_jumbotron.source.scss":"bootstrap/_jumbotron.source-35d116542ab176f99d69611ba5b6ff30f03769f44ee364c2c1b224c89fcbcafb.scss","bootstrap/_thumbnails.source.scss":"bootstrap/_thumbnails.source-9d6038f6ab70449bed07a3b40d4cbb304a9339c00e568b00fc9432168afec7de.scss","bootstrap/_alerts.source.scss":"bootstrap/_alerts.source-f175606a34f8d438e6dab1bb0522f0bfb97ca0df0166f81425bab8021d9b2c41.scss","bootstrap/_progress-bars.source.scss":"bootstrap/_progress-bars.source-4c2bf460b33d74d64db07fca213c92de552b7dc92cd24a950cbf38c064e7875b.scss","bootstrap/_media.source.scss":"bootstrap/_media.source-5eab757b15c103bf176c89387f77e660d7f618f08df68b8506362293eaf51769.scss","bootstrap/_list-group.source.scss":"bootstrap/_list-group.source-3175916051c5d7f163fa79e5608cc06fd700dd923606c90efc35e4189157c8e3.scss","bootstrap/_panels.source.scss":"bootstrap/_panels.source-7c21bb3c0c7c5c5b7275b089b930217a6d57c9279a0a76fe29165cb88f31a1aa.scss","bootstrap/_responsive-embed.source.scss":"bootstrap/_responsive-embed.source-ca767590895216af631f9623df26a5fd0ff84ab499ab04c85c48096583bc81d3.scss","bootstrap/_wells.source.scss":"bootstrap/_wells.source-d6bf447416761835357cf9535db2932c8f4a8b7a3aa77716bdde90a4ecc5551c.scss","bootstrap/_close.source.scss":"bootstrap/_close.source-29f12a91774599a71d1b1fd0bdce91411d71c03bf06ad48f355fe2d5ba781ae9.scss","bootstrap/_modals.source.scss":"bootstrap/_modals.source-cc9b2a29ca21d8d4e6445c9d6bf6e4a11855fffe398a2b0477342be55a56d8b0.scss","bootstrap/_tooltip.source.scss":"bootstrap/_tooltip.source-fd70c95a50674c92f89bd27380a9768db21e997193cd2ec4b9a07b2f6dfe8622.scss","bootstrap/_popovers.source.scss":"bootstrap/_popovers.source-c80157dccd38cfcd3a256c5c97937c566d6260fbf63d981c923b040bf16cac04.scss","bootstrap/_carousel.source.scss":"bootstrap/_carousel.source-78e906253c103c0563db95faa9a9a17a4bd75ab619cfb27312555f4dc16d614f.scss","bootstrap/_utilities.source.scss":"bootstrap/_utilities.source-f311f41d090eabc8f185d2371e3531389665eb552303a40302d319a7c7354e66.scss","bootstrap/_responsive-utilities.source.scss":"bootstrap/_responsive-utilities.source-1a88b9dade13b7c60cf7b99e315f371ac16f09334f34dd4da94068e2390f521d.scss","load-parser.debug.js":"load-parser.debug-523d03515edac74f207e7254be80fad20f14a6a0baf27e5b8dfd5dfd064a91d5.js","load-parser.js":"load-parser-4fb81d2f4beef3f223f340d12a7b25c574a2dd8c3ec18b94d46806c5cc833234.js","load-parser.js.map":"load-parser.js-37acfee094c1ed89c2e72e42274100fb700c853bad86d9cd45aa2275d427807e.map","base64.source.rb":"base64.source-ff1b709cbf57f3945ce5cfadb58c63d87c2f4ba36331c23b4b84d7a92a7741dd.rb","corelib/pack_unpack/format_string_parser.source.rb":"corelib/pack_unpack/format_string_parser.source-06ee75543d8f742e5323e0c28155d26a97a3fe323091f8ead67df96b40384e2a.rb","corelib/string/unpack.source.rb":"corelib/string/unpack.source-9292521cf2d03d9a3322b0201794affc5e4ff656a8e1907a352b43f0f04b0bc6.rb","set.source.rb":"set.source-9ecbee038e5d23a6807530e28d805d1088e523a68a49ee4f66cb45c35e593659.rb","ast/node.source.rb":"ast/node.source-e0346587af629df152c23042fcc16d10d929138f90e5fb7cadeedf92cb6c852d.rb","ast/processor/mixin.source.rb":"ast/processor/mixin.source-4f5d9beb4d8be76583b4fac388d91804538131387d7eab2a0f4e778ea88e72d4.rb","ast/processor.source.rb":"ast/processor.source-e4c2a8e995b1922b0a1848d81426e7057168a0851c75a9da99cf427242cbf646.rb","ast/sexp.source.rb":"ast/sexp.source-8dc78dac8f9465a5f6a62aa057ae97fbadd5b111efe8895ac824d46938dc3793.rb","ast.source.rb":"ast.source-905da9f5b152658b445875a3f12b2fe9521683ac31fdc24e41a724cfdd09ac44.rb","parser/ast/node.source.rb":"parser/ast/node.source-3c183648686e0e02561eec8d8728167e77c9ed5304843adaf9ed80b45d7a258d.rb","opal/ast/node.source.rb":"opal/ast/node.source-4a42cb5bf8e372a82c3bc3f2fe44beeeb0c89d3734e4a67016ba838418288fd5.rb","racc/parser.source.rb":"racc/parser.source-47e481218146a1561e566a1f41766919cc6c8e2713bab6aed0384ed6ef55656b.rb","parser/version.source.rb":"parser/version.source-83844cf58343f542492c29bc0d4c6117b6d8b81731717151e20bc2cfab348cc7.rb","parser/messages.source.rb":"parser/messages.source-feb872b0d062340525de564d7ec081e192666537d74b1f8c250d358d81bdc205.rb","parser/deprecation.source.rb":"parser/deprecation.source-d0805a72096c6de3981bb7d3e447eb28d29fd9640f3b4c6d11fd5047377464f5.rb","parser/ast/processor.source.rb":"parser/ast/processor.source-75f876361c7a487d0cd403c1241ac618174f3d88b00d948424cb9722e1bf4dc2.rb","parser/meta.source.rb":"parser/meta.source-c35c18829a422c63e84b77dc5af59ca2b67441f92b871dd8c369a10ffac4d8d4.rb","parser/source/buffer.source.rb":"parser/source/buffer.source-4580df88737728b7d1e96541f31c1e9ab09ab54e85851ee20c28a54f8c230400.rb","parser/source/range.source.rb":"parser/source/range.source-0a568e9e163619617fa4faef2827852edba5bff9537d4650b6635156591124a4.rb","parser/source/comment.source.rb":"parser/source/comment.source-fc4b14d95ce20d37fbea4a1d3294a38ab0211f41579763e9b4a9ec6470441680.rb","parser/source/comment/associator.source.rb":"parser/source/comment/associator.source-6029f0f9ff2c3c29839e5d88b20f25d64f39797cea6d29702243c94b01f6af5e.rb","parser/source/rewriter.source.rb":"parser/source/rewriter.source-1647682808397f50876b8080c9386050769b75ca172d7606fd012194ea9f8c1e.rb","parser/source/rewriter/action.source.rb":"parser/source/rewriter/action.source-89dc19a710955c30c730b6b3870cd03f9791a8846c55884bbe7c0ab4f2c4ed44.rb","parser/source/tree_rewriter.source.rb":"parser/source/tree_rewriter.source-e47e361cd5b0adb1949b76743fd4d406fc7617f7e85b8a46d9f0af060244b772.rb","parser/source/tree_rewriter/action.source.rb":"parser/source/tree_rewriter/action.source-c0a18d5f314548c371a1b7175307289380ab70f4c9496a61b66b1f8f3bed4319.rb","parser/source/map.source.rb":"parser/source/map.source-1d9a13302f85e4756c695dbb55e13b0e04e01cdc23074a9e824fa38bdb3fb359.rb","parser/source/map/operator.source.rb":"parser/source/map/operator.source-f71b5afe77fd6fb7f431d08e8cd3bc82c9a3f6560e44d55a9a392778ea5adebd.rb","parser/source/map/collection.source.rb":"parser/source/map/collection.source-9a582ce032c03905dc9944e58a04bcbd24309c84332d2409598511745dfc578b.rb","parser/source/map/constant.source.rb":"parser/source/map/constant.source-8887161ce7754f19f1c24119e9c5b5d3409da683c2f3d76cd439c9b37edcfa88.rb","parser/source/map/variable.source.rb":"parser/source/map/variable.source-cd0246287786e8cef9e224b480da4b3e0589005cc5098c78a876332ec768416f.rb","parser/source/map/keyword.source.rb":"parser/source/map/keyword.source-dedb99ced5eb88d041994d28deeb0870d45690a9215fadcb1deabd555b23b8e7.rb","parser/source/map/definition.source.rb":"parser/source/map/definition.source-8e6840668ebc86a187050492c4ae0be800ab508ad349b6ce802e48802a8bda6c.rb","parser/source/map/method_definition.source.rb":"parser/source/map/method_definition.source-ab2e20cdf7f7ba09514bdb1fcbf9a6abd1a3adf1b0b52f133359ae07df39b44c.rb","parser/source/map/send.source.rb":"parser/source/map/send.source-3ac8ece7feb6d38674b20421e391fbff71530d479a11e576c845af23be52b4db.rb","parser/source/map/index.source.rb":"parser/source/map/index.source-a72e5a3651da8f713a5c7a49be545f59af09719ebc1950a7e7da1dd39500d8e9.rb","parser/source/map/condition.source.rb":"parser/source/map/condition.source-d3c4f51b72943d60f8627dea4e2bc87378b1b609ed4599b8cfe74dbcd9120aa2.rb","parser/source/map/ternary.source.rb":"parser/source/map/ternary.source-8b1224840dc23807237c82b37d1457ddd9c68f76880ec836543fcd4a01e5156c.rb","parser/source/map/for.source.rb":"parser/source/map/for.source-187f83959e6aa4b80afc9eee422865711e75cdd760c4bb64da46f3efe0a8f7af.rb","parser/source/map/rescue_body.source.rb":"parser/source/map/rescue_body.source-2135ac0caf455b360effe438be50ff12290ca172b6775396215d8bd4b6fdec38.rb","parser/source/map/heredoc.source.rb":"parser/source/map/heredoc.source-802e3218a11a36e37d59f2699ba9ef027ba3f25a9ccaf5b67b9f51b9be711167.rb","parser/source/map/objc_kwarg.source.rb":"parser/source/map/objc_kwarg.source-b8b54b4ff74d2589e8544a33d7d855ff85e655ac8dff96a276ee8108fe6c78f4.rb","parser/syntax_error.source.rb":"parser/syntax_error.source-b35a7eb23f86478e8d1480728eb38b7138a00331e9741bc7f4fb37ea1a1f3d05.rb","parser/clobbering_error.source.rb":"parser/clobbering_error.source-5f0b2aee4291455b71cfc41193a03c1eb39dececcf3a272fa1dd7f52d81619a7.rb","parser/diagnostic.source.rb":"parser/diagnostic.source-35218d12206180871dc0b4d00559238172c5f5a1c89391a28d2e9f27012c87af.rb","parser/diagnostic/engine.source.rb":"parser/diagnostic/engine.source-ace6754a27a82e312572f22e30a5741e9399d3ab30deabf7a866372ad3873a6d.rb","parser/static_environment.source.rb":"parser/static_environment.source-8cfc2f896c62d5270a35feb0bac71d2b10bb884f9d760fe7b16da78afba1901d.rb","parser/lexer-F0.source.rb":"parser/lexer-F0.source-0bd700cff79f59a415d47d17a0accfe71752ac87c38a4d78d7a930b85eefa212.rb","parser/lexer-F1.source.rb":"parser/lexer-F1.source-1731830baa1a62e49155a5163b94ddbb89dda14edbdb1e6a643ed70abff46a1b.rb","parser/lexer-strings.source.rb":"parser/lexer-strings.source-bcb54e3e3cf67073369bedac2181573768774bf1ece9d1fe352a35d7fe3e2517.rb","parser/lexer/literal.source.rb":"parser/lexer/literal.source-e27abea50742e2b60e1d49b9bbdb92c64fd696c41aeb17341f8a5f4c0b5d8ce8.rb","parser/lexer/stack_state.source.rb":"parser/lexer/stack_state.source-6c4b455a2961afcfa57e2508d2d2f927d9f1b509c6bf3b6796a2de9b9bcdde59.rb","parser/lexer/dedenter.source.rb":"parser/lexer/dedenter.source-65e1040b204edb68a3e352343ab77fa9811872bdb249f238e9728a2f99f1d43b.rb","parser/builders/default.source.rb":"parser/builders/default.source-ab69929f6740db5a107dd355834d0dcef7731be839ca06a26d6e21d0c9c9ab9f.rb","parser/context.source.rb":"parser/context.source-eada1358bea1056602975f4c6bd8ed3126a3e3c95a437fea35362b3ff9fbeb5e.rb","parser/max_numparam_stack.source.rb":"parser/max_numparam_stack.source-68c697d6a215860b957bd9c0d19256976b7ea3074606a0675b47851ab4591ffd.rb","parser/current_arg_stack.source.rb":"parser/current_arg_stack.source-7063f1f3627b3b3fa693afba3ad63ce5f4f9885677be08900b09819d9234ad8a.rb","parser/variables_stack.source.rb":"parser/variables_stack.source-f55548223f85fd9efefe832e6805b19f51527444a150255a75b28d7de89d30d0.rb","parser/base.source.rb":"parser/base.source-5eb855a17557873f53b3255d6123879f6081ab3c9fa6ea1f6ec28d9d14a93b46.rb","parser/rewriter.source.rb":"parser/rewriter.source-f95150be5d8e334e237f2b3cedac5393320c41a2d756f0e7c0713fd920996c16.rb","parser/tree_rewriter.source.rb":"parser/tree_rewriter.source-9b9c711839d953a2008dfcea1a4c144d3cfbdde76b72fd89470792f2bb130637.rb","parser.source.rb":"parser.source-0c0f4bf7e342af741738456c3157ab798c8804e9d2b73e3492503950cb7b66d4.rb","parser/ruby32.source.rb":"parser/ruby32.source-35d2a9eec77c538180dd894beb0b108bbfd5d69a3a354051075fef69a967d7ef.rb","opal/ast/builder.source.rb":"opal/ast/builder.source-eaf6df550a58d52a79a62a41acabefee2259247678734a925b178509d3a4ec05.rb","opal/rewriters/base.source.rb":"opal/rewriters/base.source-aa1b6772df8024d3537caf4483dd31cd8d1ba7291d9fad606e9293da551f627e.rb","opal/rewriters/opal_engine_check.source.rb":"opal/rewriters/opal_engine_check.source-79f1e0ad24150790cf1f9aad5dba3cf5b09aa5e041f31bf571e802da54d88d21.rb","opal/rewriters/targeted_patches.source.rb":"opal/rewriters/targeted_patches.source-d9d349d8078f2dd6d3ccb5fdc0328300ac6ec2230bc56e4adee3ed8cc0ef824a.rb","opal/rewriters/for_rewriter.source.rb":"opal/rewriters/for_rewriter.source-753748c955ec1b63a21e2450b44694a654c06cd182dd5e59dc5e76ed674f5135.rb","opal/regexp_anchors.source.rb":"opal/regexp_anchors.source-9a82e2c2c1d73ae9606226301af73b2ef0112155f3fca52defa4be2b4cd75243.rb","opal/rewriters/js_reserved_words.source.rb":"opal/rewriters/js_reserved_words.source-11a079affae8c126b9bd182f9f090b45dcfbbeea31f4d913a616dd48523f16a1.rb","opal/rewriters/block_to_iter.source.rb":"opal/rewriters/block_to_iter.source-e9c300c643bdb416e53cbc6fda6d8130fba40388e3954f4ac3edb122df6bb079.rb","opal/rewriters/dot_js_syntax.source.rb":"opal/rewriters/dot_js_syntax.source-50de46af4c9a2b0190947c51fae98997f6337b038f1641c1ef709834a2fe6922.rb","opal/rewriters/pattern_matching.source.rb":"opal/rewriters/pattern_matching.source-eb37306ac4421a8070a416101c89861786b403a6f46f2dd6ec8b40d45e36282c.rb","opal/rewriters/logical_operator_assignment.source.rb":"opal/rewriters/logical_operator_assignment.source-e422b06ca9e9b67cc1fd3e99b7e9af4a813b2bb9c50fb9e9df7b2f5f71efc2a8.rb","opal/rewriters/binary_operator_assignment.source.rb":"opal/rewriters/binary_operator_assignment.source-6d9942e1ba135acc050bf3e1399693fff6049e1abb2a9e470021df972957da86.rb","opal/rewriters/hashes/key_duplicates_rewriter.source.rb":"opal/rewriters/hashes/key_duplicates_rewriter.source-b2210660c3d99f87f818f71fc7e3ac44cbcbdb17d94b32963c70c072f83360df.rb","opal/rewriters/dump_args.source.rb":"opal/rewriters/dump_args.source-b6268131cb1c7150e479c80269cfff65410301602508c1ad438d6f5b3ba98e77.rb","opal/rewriters/deduplicate_arg_name.source.rb":"opal/rewriters/deduplicate_arg_name.source-0e7d424fe13323e93e767c765aea0faa804b4ee5ac9c3cdcade2d5966094db57.rb","opal/rewriters/mlhs_args.source.rb":"opal/rewriters/mlhs_args.source-c491b4c2dad56a6adefdc5adfbb78f281fa2dcc9c0f45e35734bfb5a09cdea39.rb","opal/rewriters/arguments.source.rb":"opal/rewriters/arguments.source-d8f46b3f620b8700a99a5057ee440f0f2a9399be8c210332810e2e101aae0a77.rb","opal/rewriters/inline_args.source.rb":"opal/rewriters/inline_args.source-00d82368b44568f8c81e49a4d5a2ee2b0c0bf02aa47f55c730c5b8b363398056.rb","opal/rewriters/numblocks.source.rb":"opal/rewriters/numblocks.source-f75a33f2be591d99b79b1c5c748746c84240a7c921b0d183b71d1467067fbca2.rb","opal/rewriters/returnable_logic.source.rb":"opal/rewriters/returnable_logic.source-1618e549c1ed81e4375aa63e5455e39b446c9695ad4dfdaaadbccb536c48f8f4.rb","opal/rewriters/forward_args.source.rb":"opal/rewriters/forward_args.source-4fb90101cb11a0977b71212bf9ea00530cca00825d5d6c0591316f8d2a178e80.rb","opal/rewriters/thrower_finder.source.rb":"opal/rewriters/thrower_finder.source-c5219d32fc56bd7c8e82e5fe6b320ad91c6889938af14d40e90b0a3e274ee603.rb","opal/rewriter.source.rb":"opal/rewriter.source-32fff58fe139f7244fa87f66adc46e4d235add89d752cd3f29ab97d4b7ccbe6e.rb","opal/parser/source_buffer.source.rb":"opal/parser/source_buffer.source-61b789b0b2ebe0500121b8eebb10ce46c496357ccaabfa968c2e0934bc13116e.rb","opal/parser/default_config.source.rb":"opal/parser/default_config.source-725b38eae1180c8614ff8024fdb50c5e02b3a6ae1149efd15c57e9bcf9c7ad2a.rb","opal/parser/with_ruby_lexer.source.rb":"opal/parser/with_ruby_lexer.source-ac3acfedd2463df65e3ec54147b694a6947e2c95bfa0cdfd376988717c9b1f3a.rb","opal/parser/patch.source.rb":"opal/parser/patch.source-c09d163f1d90c4e656ab93d27ab1c730817f58b75507dbdb50d6a921e54b46fc.rb","opal/parser.source.rb":"opal/parser.source-eac055fcb3cccd920f474b295f83de67fc3a2d0fbddf2290d57a605c5693b324.rb","opal/fragment.source.rb":"opal/fragment.source-9dfeb6c63014455b8fc06714d178b62715ed77c2e443b4ab60eb25466fd0b7c0.rb","opal/nodes/closure.source.rb":"opal/nodes/closure.source-61701fe2e741f0f8b7006beb475788bf3cb6431d23d523e2d8fcfaf611303d1b.rb","opal/nodes/helpers.source.rb":"opal/nodes/helpers.source-4915c6fabe15697556648dd6dd615c2edecd1ef8949ddb73a863ba2ff71e237e.rb","opal/nodes/base.source.rb":"opal/nodes/base.source-7659dcba28b01c565569308cc375fe94831ef7ad46a157973c7d375fe1771840.rb","opal/nodes/literal.source.rb":"opal/nodes/literal.source-e7c63d19f638a079cd0cb73592c0a63738bc83dc41e289d31e62aa911246d142.rb","opal/nodes/variables.source.rb":"opal/nodes/variables.source-af1977a8b39bce0210f945ddfd203187038a4bb65a3ab5fadc7d750d4051ef08.rb","opal/nodes/constants.source.rb":"opal/nodes/constants.source-9dee2fcf8462ed165ee00335973717010f7473af2f6d111a6ab0a1c2efadc68c.rb","corelib/comparable.source.rb":"corelib/comparable.source-6ae740f39e41e4c73dbbd9609b3cfe5b06f6efcbeb1a6ad45e512220cc7dc2f1.rb","pathname.source.rb":"pathname.source-4af5fbc18a6508347db78ac4925d3ec2cc25b66b8e64b5e22658f401d1c8bde7.rb","opal/nodes/call.source.rb":"opal/nodes/call.source-c48dc207235fddcff1b0bcda050f5b0bd1309bbfa01d8186ce8e794787b10d95.rb","opal/nodes/call_special.source.rb":"opal/nodes/call_special.source-9ff7b96524a95b4062ca6ab4ced1a560d1fe8991db9d04f1b94d25a0bdb9172c.rb","opal/nodes/scope.source.rb":"opal/nodes/scope.source-364d5f744bd417d460fb47772495cccf9acecb94413df8658815cdb26aea84a6.rb","opal/nodes/module.source.rb":"opal/nodes/module.source-1ce7c0c61c98853e523e079b76d8b3207a4bdfc93f7f12526959d0130b84ac1e.rb","opal/nodes/class.source.rb":"opal/nodes/class.source-ca22f2475cb60ee24354a640f27179a3cbaded644124d0ffdcfe6ad5da8945e3.rb","opal/nodes/singleton_class.source.rb":"opal/nodes/singleton_class.source-0ea1443d8433a8d96b3d24e9ca318e88555986cf8fe2ee263489cc906c7f0a6f.rb","opal/nodes/args/arg.source.rb":"opal/nodes/args/arg.source-8d5d2450446c50a6cf9061e8dbcb0266c43c4223b44400ccb5c4dcb04afac3ae.rb","opal/nodes/args/arity_check.source.rb":"opal/nodes/args/arity_check.source-0b4f697fd70e5cd42e1501a8b60cc9b20d6ee580feead711ddbb53a7bc8d85c5.rb","opal/nodes/args/ensure_kwargs_are_kwargs.source.rb":"opal/nodes/args/ensure_kwargs_are_kwargs.source-980baec81aa4b014263336a90ec17417c1a682c9e04e3e1c509d8f7318ea8d12.rb","opal/nodes/args/extract_block_arg.source.rb":"opal/nodes/args/extract_block_arg.source-6a85d2bb6011fb580f3c05ef965ca281dfbf38a778c5c4878ae9b9b3d8809217.rb","opal/nodes/args/extract_kwarg.source.rb":"opal/nodes/args/extract_kwarg.source-7ea9c9432b9fba0d27b3bbfdc935b97386d6ee9abe6138e98906d76464c76cc2.rb","opal/nodes/args/extract_kwargs.source.rb":"opal/nodes/args/extract_kwargs.source-57fd41af5899f069aa69688b30d0713c373d97c244a33c71f3bc7114031f1bf8.rb","opal/nodes/args/extract_kwoptarg.source.rb":"opal/nodes/args/extract_kwoptarg.source-1fb3f7119fa8fcf230e98e5599afd9a7cdf9bf559704892d74cbd4cde3d07feb.rb","opal/nodes/args/extract_kwrestarg.source.rb":"opal/nodes/args/extract_kwrestarg.source-2e32668aed5dec1f77dc615d9374748cb1bb0f063ec612e91d1ba76e6c4bd14c.rb","opal/nodes/args/extract_optarg.source.rb":"opal/nodes/args/extract_optarg.source-4973e4bd89aebde7abf99d0713e23d304c519e51be77a8a91e697c02c12b1a1b.rb","opal/nodes/args/extract_post_arg.source.rb":"opal/nodes/args/extract_post_arg.source-2f45dcaf1dfcb2ceb236339492b5cb0f72e4bd44a214dfc1f7f8c644250cfbb6.rb","opal/nodes/args/extract_post_optarg.source.rb":"opal/nodes/args/extract_post_optarg.source-87acad22bc6cf033ad56d23b9fc7257291af371e1272f88fe5454f2c66fc711c.rb","opal/nodes/args/extract_restarg.source.rb":"opal/nodes/args/extract_restarg.source-07348cbf0070549ee56e5f6dab3ea5f49875209f82248f77a9239f38801f5b4d.rb","opal/nodes/args/fake_arg.source.rb":"opal/nodes/args/fake_arg.source-0eedc329de139f44dc91961c2f04b9d58872e38219da177944baacf3162789fa.rb","opal/nodes/args/initialize_iterarg.source.rb":"opal/nodes/args/initialize_iterarg.source-1ce56fbb913210226852184a0af760aad726e2a70bef5a28ae3541d1f56e35e2.rb","opal/nodes/args/initialize_shadowarg.source.rb":"opal/nodes/args/initialize_shadowarg.source-16bc5e6e66bc8601eed5a638c5ae19f52248642f18c4b3aa9d992cebfe1772b7.rb","opal/nodes/args/parameters.source.rb":"opal/nodes/args/parameters.source-f0111f3975a6322fe945978d480dd0958fdf1166dfe3911d8fe8446a65ffaf19.rb","opal/nodes/args/prepare_post_args.source.rb":"opal/nodes/args/prepare_post_args.source-4fc872ee92352be9cc57730c078ce43d8e455e9beabc4912546c3670cccd21ba.rb","opal/nodes/args.source.rb":"opal/nodes/args.source-345dd14ece705f6a8d8c8184c0aa217df51744e35ecd71d102a2fa80c8918b11.rb","opal/nodes/node_with_args/shortcuts.source.rb":"opal/nodes/node_with_args/shortcuts.source-c2decc753ed2daf7beb6517deb8a83002c2ecd6f57eff7b0de621ccd98b5663a.rb","opal/nodes/node_with_args.source.rb":"opal/nodes/node_with_args.source-b9042d63c9378b2fa3089450122ee741d9a2c897b0b750150cae548ad40d42c5.rb","opal/nodes/iter.source.rb":"opal/nodes/iter.source-1002ee2fd151097bcf980ffacfdf9c23b6107728846005bd353fa89fa211926c.rb","opal/nodes/def.source.rb":"opal/nodes/def.source-14774520b7164f94594c10cef0eadbfddff59900e89850ccb1af67ffbae6ad4b.rb","opal/nodes/defs.source.rb":"opal/nodes/defs.source-17c910cf0f4da688af691125109e85fbda464a49b7e322d7d6e14fa74568bfd7.rb","opal/ast/matcher.source.rb":"opal/ast/matcher.source-704b0a37637c831e85d7fb52b1b836077b0f918b3a0266dc292c1e81a717acba.rb","opal/nodes/if.source.rb":"opal/nodes/if.source-51f92ca049aa5101785d1b0e007b0be29328333c0e158aa9fb64352cc7441266.rb","opal/nodes/logic.source.rb":"opal/nodes/logic.source-2debb04deb82f64adedca33ad7e7c5908cc097bc6898374a210c996a73600239.rb","opal/nodes/definitions.source.rb":"opal/nodes/definitions.source-b5b8ebc9901ca181ca2170c7b17308a3d1ea15ec5c4710df703ee42d412d4300.rb","opal/nodes/yield.source.rb":"opal/nodes/yield.source-9c3ffb95e0c2a999719ecce959649499ba79a57c181f6aee839fd4adf0de02e1.rb","opal/nodes/rescue.source.rb":"opal/nodes/rescue.source-51619b81b4fc4e0bfefe024b98a520c0d3f6e53ffdee44b7b75c7ed719d201ff.rb","opal/nodes/super.source.rb":"opal/nodes/super.source-29e8f086d8a16a9d9be5259065a0c0af5c072ce62a1726b79ff876bfeb42dffd.rb","json.source.rb":"json.source-b865f9c6664a1747fa62b4a9585dff5d367de647b7e8e3a08410116640579941.rb","opal/version.source.rb":"opal/version.source-9dd407e8e560e0f7578ccc6153eab2f4607a2ae0836db2d46e28cc5d7ada94af.rb","opal/nodes/top.source.rb":"opal/nodes/top.source-358838f769b2856651e5b09f35d4a09f85f8d72038e7d132e54026648a2f303a.rb","opal/nodes/while.source.rb":"opal/nodes/while.source-21679024f6c30e20c60ebea952c6ed64a5d92b0f7a7e983ba22ae2da965bd61a.rb","opal/nodes/hash.source.rb":"opal/nodes/hash.source-bbc17f118949262dbb74e7375d56eeaf059dd4180ab294ff5ae932b13a393648.rb","opal/nodes/array.source.rb":"opal/nodes/array.source-03c3f566655b4b61125e309e63f5cd06b7d8e986a2bbe8bd379c584791f6fb6c.rb","opal/nodes/defined.source.rb":"opal/nodes/defined.source-f29e732cf1c11cc81e3a19cf954f1f98c871596d2949079e46ad38d7b0388583.rb","opal/nodes/masgn.source.rb":"opal/nodes/masgn.source-3323dcd78ccf976fef2b06d015ac4a3c3b685f047d73abb8f915d5190fd56cd8.rb","opal/nodes/arglist.source.rb":"opal/nodes/arglist.source-5cc6bfac539eb067375d8c5a66f977ce76431afdcf0647da43d95d8aeea83af4.rb","opal/nodes/x_string.source.rb":"opal/nodes/x_string.source-8d1e9b92363cc3880c2a31b91f7679c694d8f99c1ddf22338738d9859d4e6593.rb","opal/nodes/lambda.source.rb":"opal/nodes/lambda.source-3ad0ff2fa933e061a26c44a5419b6b6e61848087abe6ad51379a78ad9c040949.rb","opal/nodes.source.rb":"opal/nodes.source-a06e9fca039a76d955658c837683e297c1469a40397653dda6fecd5a3b44dcc3.rb","opal/eof_content.source.rb":"opal/eof_content.source-e3a9ba6ecfd5a7fb18b95aefd9c3a42aa3b15b0e8cec82d79ca0d52d3e7fb269.rb","opal/errors.source.rb":"opal/errors.source-fb67e0c10d23fbcd654523c4b8a295a2dd106e0cd900f3fb9f1a582cc48d4166.rb","opal/magic_comments.source.rb":"opal/magic_comments.source-a5059e1a7f2f33f7a4975316d31918090e9b02d9601a87da2672dda31f98053f.rb","opal/source_map/map.source.rb":"opal/source_map/map.source-efdd58648b9911055d0a91aa72e18e349ca37570013261708aa029a72a052bcb.rb","opal/source_map/file.source.rb":"opal/source_map/file.source-11e0f7ecb939ecd146987e36b9f4b8a2b7f41f71f3735ea4ba0f677da856ed67.rb","opal/source_map/index.source.rb":"opal/source_map/index.source-1f72a1a208d444b4ac047cbbb06704bccec77896d9aac98dc3b792ba829da65b.rb","opal/source_map/vlq.source.rb":"opal/source_map/vlq.source-1262a66cc794d867f086a703fe1cbdf94038125f5002eab3f961e8dfd57ce437.rb","opal/source_map.source.rb":"opal/source_map.source-c31ead9775b0c66a9db73db136269b863bd688f923f6b03fb3dfbff1bf780489.rb","opal/compiler.source.rb":"opal/compiler.source-e403fe4c219cc7500c997c59a45775415cd7c8f4f323da8ce93e7ff937fa0df6.rb","opal/erb.source.rb":"opal/erb.source-c28c99c3cbe2c1cea8baa86979fa4eaad4fc069750f27a86cb1cef306014d6e8.rb","opal-parser.source.rb":"opal-parser.source-5d6f2ad0f5161a55ca662eb7587ef300f719556d4f526b805ce9dae78c367b38.rb","load-parser.source.js.rb":"load-parser.source.js-18a0a131bf97d1a19b0b875bcf7a57e061ad1d8822fbf5a5699707793de11cfb.rb","application.debug.js":"application.debug-ff09e1eb149c682e225d3a75b7afa4fcb29136cb9ef2e003a34a1adca26f52bd.js","application.js":"application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js","application.js.map":"application.js-3ec4335d7b8f069f914b0d1e2db474163e862fa7b16e3d8d13ad3c1a23b4d0ce.map","corelib/runtime.source.js":"corelib/runtime.source-99051139d415b2cc01e77e875b95f2d0ee867e43b1c0366563d61db7834af76f.js","corelib/helpers.source.rb":"corelib/helpers.source-098704fe3cd4d2bb51daa51fc1ecb610bd5584fd3a02011d2d1c39daa19ec7b8.rb","corelib/module.source.rb":"corelib/module.source-74e15d4257ba5112a9b6922c3675bfb7064aeb1acd92f1f5bf40345a66f04a78.rb","corelib/class.source.rb":"corelib/class.source-6ac4292f7e727b499f679a4be5e22ca77533509714c7d8c87c429250b05d38ae.rb","corelib/basic_object.source.rb":"corelib/basic_object.source-c9f2ae6f9828520598d297ff62bd1d72086dc6f271cd63f0da8daf654e00d7d0.rb","corelib/kernel.source.rb":"corelib/kernel.source-4496dc29bcb0623813ec9c3cde538d2a3e6839593b93ec478cc3aa24a1a963fb.rb","corelib/main.source.rb":"corelib/main.source-117fdb7af0b8c1642859e35713a278f05fe11725c23d81f705018d1c605e0f53.rb","corelib/error/errno.source.rb":"corelib/error/errno.source-ca296bcfdf36d407edbcb3fa71e8b7718c94dce141a8a87e37881aadf23b80cd.rb","corelib/error.source.rb":"corelib/error.source-f23645cbb2065bfe2c1231e3851e9bfc9fd8a3b153bca37073a839997e98237c.rb","corelib/constants.source.rb":"corelib/constants.source-650eaa201f9284b01b7d872a9d6a80f653c0bf3fd585ad080caade29b9bc17a0.rb","opal/base.source.rb":"opal/base.source-55abc823c216010fd952e74b44c669aa82652aced413b1d59af35133542353cf.rb","corelib/nil.source.rb":"corelib/nil.source-d65ee9c3403849589db650b9ddbf0bafe912d5481bf5fcf3cf6c492a3ee04bf2.rb","corelib/boolean.source.rb":"corelib/boolean.source-5020f3d8692e3eeb1bc1d2daeb9fa0be955052788dbc702db146ced433569493.rb","corelib/regexp.source.rb":"corelib/regexp.source-c31394a97f067e5b5260844ade4b891f568b331638a038aaf7a240638a520a78.rb","corelib/string.source.rb":"corelib/string.source-8b4f7e8c13a7b97806d142617f8351ed4c4bf30edd2e258ce446c74091d5737a.rb","corelib/enumerable.source.rb":"corelib/enumerable.source-aabe09b8461c48d5b4f9ac021caf5fb561d30ec76415f4bfffeecce0fa593269.rb","corelib/enumerator/arithmetic_sequence.source.rb":"corelib/enumerator/arithmetic_sequence.source-37b39c4bf3514dda60c0c84cb5f279528063e7be16d55e04efa0dc608af6484e.rb","corelib/enumerator/chain.source.rb":"corelib/enumerator/chain.source-d6e40c167f5f3479e4c9913e35ac1a4f8db519c39486c82858c555af3918d3eb.rb","corelib/enumerator/generator.source.rb":"corelib/enumerator/generator.source-9a9f9f4e152a0164a894fd263fc4d60605fcc184f6e8b898fb03117953f94b09.rb","corelib/enumerator/lazy.source.rb":"corelib/enumerator/lazy.source-0ff176e17644692a9ac0d9e2e8b015cbdb9cc8ebb450f3cc9fa0dee8dc908107.rb","corelib/enumerator/yielder.source.rb":"corelib/enumerator/yielder.source-9dc42b00f789765de111f3a82e5ad90502fb39e830be9c2a7d09e17e70237034.rb","corelib/enumerator.source.rb":"corelib/enumerator.source-230900b104b66f027879b18af04cf02b4b81d3d4dcc7f630eb49d526fbaca7ef.rb","corelib/numeric.source.rb":"corelib/numeric.source-16c3c8db76d183fa8775cce038960f6ef64a9a6b5df54bfa8169775c45a9ce8c.rb","corelib/array.source.rb":"corelib/array.source-bfe4bfd38d29d22a2c59f723e4a83727a1c7f2aff0ef255042af4e68d0409ec6.rb","corelib/hash.source.rb":"corelib/hash.source-43e0f7ea8b3c04d5a56613bdd11ab765756fcaa9c5fb6022d1421d6751b8e229.rb","corelib/number.source.rb":"corelib/number.source-cb83b5ca4647c2e1cc036178e34f6225a22e2d51a3fb7264cefb83de6e6e1939.rb","corelib/range.source.rb":"corelib/range.source-d351f7482e46103eec38f4c207e096d7378e1932f96843ea03daec8b8ffff6f2.rb","corelib/proc.source.rb":"corelib/proc.source-2b521447daf405076d4bac222855ff36812379c0445dfed9bc3eac34a3b219a2.rb","corelib/method.source.rb":"corelib/method.source-5db9cae6ec1333ff90f7ef7739d45d3e8d7b9d8f238c367021ff7165dd6a6446.rb","corelib/variables.source.rb":"corelib/variables.source-1a0df2dfa30886613488a97ea41fb3cd9dcc9fdeabcbe1e3e5a904647c90c4e6.rb","corelib/io.source.rb":"corelib/io.source-403e8a47b15d3fe92b5d55e8a315e5f07371c55f1b6db056fc4d9b01408af5e9.rb","opal/mini.source.rb":"opal/mini.source-638e1531040665f9ec68e0c88df0b229ebe2ac89276b1e9c156f779b9f33029f.rb","corelib/kernel/format.source.rb":"corelib/kernel/format.source-5dc6358fac4ee2a49f27470485163b821e0c9f61ba12db5a121e85985475ac7d.rb","corelib/string/encoding.source.rb":"corelib/string/encoding.source-e20bbd4db806af48823ff828bea06cca9c5573fe968e8db3e8ca77a99a45ea4b.rb","corelib/math.source.rb":"corelib/math.source-fa2631fcff5e4d9e11516986243d3b60098ba2262ad2ee05069193fbc0ad99d7.rb","corelib/complex/base.source.rb":"corelib/complex/base.source-e3d177911f1b14c79b0cc915d3f6acb16d23336997324f10689e0805766cb5f7.rb","corelib/complex.source.rb":"corelib/complex.source-15d824f7f747b34ea4ec96b8fb20b039de8777db21ed673ffa89f09eefa6e312.rb","corelib/rational/base.source.rb":"corelib/rational/base.source-4783a9070f721a5eab480da1444557f592c4fa03694deda96cfe068dd5014a3c.rb","corelib/rational.source.rb":"corelib/rational.source-fd79732f5b9233a5ad74fee8c2c1fb8cc5feba389dfef0076b6d0378d81d5b6f.rb","corelib/time.source.rb":"corelib/time.source-eb79092b11820cd9074f48da3c3c95471675bef7c150c443c008b4fbb915cfdb.rb","corelib/struct.source.rb":"corelib/struct.source-be1ae7c9162154659ed197f2225c0a1b5fc455f72629c3b5f31482d4fcb09fa2.rb","corelib/set.source.rb":"corelib/set.source-b044aca303702523db7cf30a05368d7dcf4b000fc6a688938dc4644d3eecc7ba.rb","corelib/dir.source.rb":"corelib/dir.source-d67398b5f027e6bcf13aaa88c93a14c7b1d252ccce8189f63db8dff2347672a0.rb","corelib/file.source.rb":"corelib/file.source-db4d733e61452a07f91d541a74c11a413b88a2ae1ccb54090bc32177d141140d.rb","corelib/process/base.source.rb":"corelib/process/base.source-ed219f24e478564e66ce8b54c742bde00c698b6e2f8e258551f4c5a754592378.rb","corelib/process.source.rb":"corelib/process.source-eae0d96ba98ca61234679790bfdd6b05adf36ed806a67d2c575505d96a580316.rb","corelib/random/formatter.source.rb":"corelib/random/formatter.source-a5c67b3842448a9f38de7e59b1ef6cf0c1a4e9300c4ee9cf84d9102417f3a8f3.rb","corelib/random/mersenne_twister.source.rb":"corelib/random/mersenne_twister.source-96ab5e8c533f105c29c53801cfefff5c4a93daa242214f233d93d7e71989134e.rb","corelib/random.source.rb":"corelib/random.source-7a6ede92c9d8128add2371b37d8a03a47d3170656f40e20e56e532a1a63aba3e.rb","corelib/unsupported.source.rb":"corelib/unsupported.source-8e81720371807cc5396ff2eedff847682814b8e9c62ec9d95208d96584e09b4b.rb","corelib/binding.source.rb":"corelib/binding.source-3b309deb9807f4940f2c9ed7679bfc40cc5eb11683ca41f594bf7f49453630a0.rb","corelib/irb.source.rb":"corelib/irb.source-04c57c643e2c4ed9e9cda17758fd8929fb02554f1a8576a782d788eb37e563dd.rb","opal.source.rb":"opal.source-4034ad8e0a1fdcd74becb7ba30cb0eb19ba9ffbb4e7d511b79077250fcad421d.rb","native.source.rb":"native.source-61c02136482500675de2c6c7be30a3fa2d2706e0259c17a65966f210e31068f4.rb","console.source.rb":"console.source-d5d314ea6b559f8cfe86bf3f2809ff5602b4a492a206152a3f2dc568c79361af.rb","js.source.rb":"js.source-fc496a13dc2a906b4406a4a97ee81a610152e0a15d9b935e8bbf634f94e535fd.rb","application.source.js.rb":"application.source.js-1c44c3e7669e9ba07cc951b94fa5249c487df88ac70612b6a2a6d4b95ce60b02.rb","try.debug.js":"try.debug-fc5a97558dfaa14eedc387af7b1f8d60da375e8c5922a1d0278af8c5be4ecc52.js","try.js":"try-a51164b017a4255201e72222db4ea8cde71bef0a2e8c97a19d46d82dfad3c2db.js","try.js.map":"try.js-4a24a3170b9aaf4107e672a9772cbcf91222ba6a397247d800938ad58d95a4bc.map","_vendor/codemirror.source.js":"_vendor/codemirror.source-02e1e58bfe4c3b5acc3b5eac25dd452e75094d1f2ad66aa19d68997988c661de.js","_vendor/ruby.source.js":"_vendor/ruby.source-66aaca5ea56621bad19bff704c61709e12cb5e53d83aa65f098432d0fb599cac.js","_vendor/javascript.source.js":"_vendor/javascript.source-5462d687adc5dcbddfc7bf43cde9ad6ccc27cfdf78e7a96a86368d6af62f69b3.js","try/examples.source.rb":"try/examples.source-ffd37a3924f0f5fd6e55eb1f75c25c78bb939e9eda723b4b039c51d07a7700f5.rb","try.source.js.rb":"try.source.js-85bdbb21b84aa0121d3a4f891a3132fd51c363ea14e32837ab9b419eec7a6682.rb"}} \ No newline at end of file diff --git a/assets/application-74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80.js b/assets/application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js similarity index 99% rename from assets/application-74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80.js rename to assets/application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js index 966c0d76..e2a5d07e 100644 --- a/assets/application-74994a7410818947c294a5f44b8f7916d5e1c773e93a5a2c83db9c06d516fd80.js +++ b/assets/application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js @@ -2403,7 +2403,7 @@ } var objects = keys.get(key_hash), - objects_copy = $slice(objects), + objects_copy = (objects.length === 1) ? objects : $slice(objects), object; for (var i=0; i,class,coerce_to!,new,to_s,__id__'); @@ -3310,7 +3310,7 @@ }, -1); })('::') }; -Opal.modules["corelib/module"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/module"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $truthy = Opal.truthy, $coerce_to = Opal.coerce_to, $const_set = Opal.const_set, $Object = Opal.Object, $return_ivar = Opal.return_ivar, $assign_ivar = Opal.assign_ivar, $ivar = Opal.ivar, $deny_frozen_access = Opal.deny_frozen_access, $freeze = Opal.freeze, $prop = Opal.prop, $jsid = Opal.jsid, $each_ivar = Opal.each_ivar, $klass = Opal.klass, $Opal = Opal.Opal, $Kernel = Opal.Kernel, $defs = Opal.defs, $send = Opal.send, $def = Opal.def, $eqeqeq = Opal.eqeqeq, $Module = Opal.Module, $rb_lt = Opal.rb_lt, $rb_gt = Opal.rb_gt, $slice = Opal.slice, $to_a = Opal.to_a, $return_val = Opal.return_val, $eqeq = Opal.eqeq, $not = Opal.not, $rb_le = Opal.rb_le, $range = Opal.range, $send2 = Opal.send2, $find_super = Opal.find_super, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('try_convert,raise,class,module_eval,to_proc,===,equal?,<,>,nil?,attr_reader,attr_writer,warn,attr_accessor,const_name?,class_variable_name!,pristine,const_name!,=~,new,inject,split,const_get,==,start_with?,!~,owner,!,<=,frozen?,append_features,included,name,cover?,size,merge,compile,proc,any?,prepend_features,prepended,to_s,__id__,constants,include?,copy_class_variables,copy_constants,copy_singleton_methods,class_exec,module_exec,inspect'); @@ -4376,7 +4376,7 @@ Opal.modules["corelib/module"] = function(Opal) {/* Generated by Opal 1.8.1 */ }); })('::', $Module); }; -Opal.modules["corelib/class"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/class"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $send = Opal.send, $defs = Opal.defs, $def = Opal.def, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $eqeq = Opal.eqeq, $truthy = Opal.truthy, $rb_plus = Opal.rb_plus, $return_val = Opal.return_val, $slice = Opal.slice, $send2 = Opal.send2, $find_super = Opal.find_super, $Kernel = Opal.Kernel, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,class_eval,to_proc,==,nil?,raise,class,copy_instance_variables,copy_singleton_methods,initialize_clone,frozen?,freeze,initialize_dup,+,subclasses,flatten,map,allocate,name,to_s'); @@ -4530,7 +4530,7 @@ Opal.modules["corelib/class"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "inspect", "to_s"); })('::', null, $nesting); }; -Opal.modules["corelib/basic_object"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/basic_object"] = function(Opal) {/* Generated by Opal 1.8.2 */ "use strict"; var $klass = Opal.klass, $slice = Opal.slice, $def = Opal.def, $alias = Opal.alias, $return_val = Opal.return_val, $Opal = Opal.Opal, $truthy = Opal.truthy, $range = Opal.range, $Kernel = Opal.Kernel, $to_a = Opal.to_a, $send = Opal.send, $eqeq = Opal.eqeq, $rb_ge = Opal.rb_ge, nil = Opal.nil, $$$ = Opal.$$$; @@ -4751,7 +4751,7 @@ Opal.modules["corelib/basic_object"] = function(Opal) {/* Generated by Opal 1.8. }, -2); })('::', null) }; -Opal.modules["corelib/kernel"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/kernel"] = function(Opal) {/* Generated by Opal 1.8.2 */ "use strict"; var $truthy = Opal.truthy, $coerce_to = Opal.coerce_to, $respond_to = Opal.respond_to, $Opal = Opal.Opal, $deny_frozen_access = Opal.deny_frozen_access, $freeze = Opal.freeze, $freeze_props = Opal.freeze_props, $jsid = Opal.jsid, $each_ivar = Opal.each_ivar, $module = Opal.module, $return_val = Opal.return_val, $def = Opal.def, $Kernel = Opal.Kernel, $gvars = Opal.gvars, $slice = Opal.slice, $send = Opal.send, $to_a = Opal.to_a, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $eqeq = Opal.eqeq, $rb_plus = Opal.rb_plus, $extract_kwargs = Opal.extract_kwargs, $eqeqeq = Opal.eqeqeq, $return_self = Opal.return_self, $rb_le = Opal.rb_le, $rb_lt = Opal.rb_lt, $Object = Opal.Object, $alias = Opal.alias, $klass = Opal.klass, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; @@ -5902,7 +5902,7 @@ Opal.modules["corelib/kernel"] = function(Opal) {/* Generated by Opal 1.8.1 */ return self.$include($Kernel); })('::', null); }; -Opal.modules["corelib/main"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/main"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $return_val = Opal.return_val, $def = Opal.def, $Object = Opal.Object, $slice = Opal.slice, $Kernel = Opal.Kernel, self = Opal.top, $nesting = [], nil = Opal.nil; Opal.add_stubs('include,raise'); @@ -5931,7 +5931,7 @@ Opal.modules["corelib/main"] = function(Opal) {/* Generated by Opal 1.8.1 */ }); })(Opal.get_singleton_class(self), $nesting) }; -Opal.modules["corelib/error/errno"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/error/errno"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $module = Opal.module, $truthy = Opal.truthy, $rb_plus = Opal.rb_plus, $send2 = Opal.send2, $find_super = Opal.find_super, $def = Opal.def, $klass = Opal.klass, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('+,errno,class,attr_reader'); @@ -5992,7 +5992,7 @@ Opal.modules["corelib/error/errno"] = function(Opal) {/* Generated by Opal 1.8.1 })(Opal.get_singleton_class(self), $nesting); })('::', $$$('StandardError'), $nesting); }; -Opal.modules["corelib/error"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/error"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $slice = Opal.slice, $gvars = Opal.gvars, $defs = Opal.defs, $send = Opal.send, $to_a = Opal.to_a, $def = Opal.def, $send2 = Opal.send2, $find_super = Opal.find_super, $truthy = Opal.truthy, $Kernel = Opal.Kernel, $not = Opal.not, $rb_plus = Opal.rb_plus, $eqeq = Opal.eqeq, $Object = Opal.Object, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $module = Opal.module, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('new,map,backtrace,clone,to_s,merge,tty?,[],include?,raise,dup,empty?,!,caller,shift,+,class,join,cause,full_message,==,reverse,split,autoload,attr_reader,inspect'); @@ -6447,21 +6447,21 @@ Opal.modules["corelib/error"] = function(Opal) {/* Generated by Opal 1.8.1 */ return ($klass($nesting[0], null, 'Error'), nil) })('::', $nesting); }; -Opal.modules["corelib/constants"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/constants"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $const_set = Opal.const_set, nil = Opal.nil, $$$ = Opal.$$$; $const_set('::', 'RUBY_PLATFORM', "opal"); $const_set('::', 'RUBY_ENGINE', "opal"); $const_set('::', 'RUBY_VERSION', "3.2.0"); - $const_set('::', 'RUBY_ENGINE_VERSION', "1.8.1"); - $const_set('::', 'RUBY_RELEASE_DATE', "2023-11-09"); + $const_set('::', 'RUBY_ENGINE_VERSION', "1.8.2"); + $const_set('::', 'RUBY_RELEASE_DATE', "2023-11-23"); $const_set('::', 'RUBY_PATCHLEVEL', 0); $const_set('::', 'RUBY_REVISION', "0"); $const_set('::', 'RUBY_COPYRIGHT', "opal - Copyright (C) 2011-2023 Adam Beynon and the Opal contributors"); return $const_set('::', 'RUBY_DESCRIPTION', "opal " + ($$$('RUBY_ENGINE_VERSION')) + " (" + ($$$('RUBY_RELEASE_DATE')) + " revision " + ($$$('RUBY_REVISION')) + ")"); }; -Opal.modules["opal/base"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["opal/base"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $Object = Opal.Object, nil = Opal.nil; Opal.add_stubs('require'); @@ -6476,7 +6476,7 @@ Opal.modules["opal/base"] = function(Opal) {/* Generated by Opal 1.8.1 */ $Object.$require("corelib/error"); return $Object.$require("corelib/constants"); }; -Opal.modules["corelib/nil"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/nil"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $Kernel = Opal.Kernel, $def = Opal.def, $return_val = Opal.return_val, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $NilClass = Opal.NilClass, $slice = Opal.slice, $truthy = Opal.truthy, $rb_gt = Opal.rb_gt, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('raise,name,new,>,length,Rational,to_i'); @@ -6585,7 +6585,7 @@ Opal.modules["corelib/nil"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "to_f", "to_i"); })('::', null, $nesting) }; -Opal.modules["corelib/boolean"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/boolean"] = function(Opal) {/* Generated by Opal 1.8.2 */ "use strict"; var $klass = Opal.klass, $Kernel = Opal.Kernel, $def = Opal.def, $return_self = Opal.return_self, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $slice = Opal.slice, $truthy = Opal.truthy, $send2 = Opal.send2, $find_super = Opal.find_super, $to_a = Opal.to_a, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; @@ -6729,7 +6729,7 @@ Opal.modules["corelib/boolean"] = function(Opal) {/* Generated by Opal 1.8.1 */ $klass('::', $$$('Boolean'), 'TrueClass'); return ($klass('::', $$$('Boolean'), 'FalseClass'), nil); }; -Opal.modules["corelib/comparable"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/comparable"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $truthy = Opal.truthy, $module = Opal.module, $rb_gt = Opal.rb_gt, $rb_lt = Opal.rb_lt, $eqeqeq = Opal.eqeqeq, $Kernel = Opal.Kernel, $def = Opal.def, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('>,<,===,raise,class,<=>,equal?'); @@ -6868,7 +6868,7 @@ Opal.modules["corelib/comparable"] = function(Opal) {/* Generated by Opal 1.8.1 }, -2); })('::') }; -Opal.modules["corelib/regexp"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/regexp"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $coerce_to = Opal.coerce_to, $prop = Opal.prop, $freeze = Opal.freeze, $klass = Opal.klass, $const_set = Opal.const_set, $send2 = Opal.send2, $find_super = Opal.find_super, $def = Opal.def, $truthy = Opal.truthy, $gvars = Opal.gvars, $slice = Opal.slice, $Kernel = Opal.Kernel, $Opal = Opal.Opal, $alias = Opal.alias, $send = Opal.send, $regexp = Opal.regexp, $rb_plus = Opal.rb_plus, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $rb_ge = Opal.rb_ge, $to_a = Opal.to_a, $eqeqeq = Opal.eqeqeq, $rb_minus = Opal.rb_minus, $return_ivar = Opal.return_ivar, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('nil?,[],raise,escape,options,to_str,new,join,coerce_to!,!,match,coerce_to?,begin,frozen?,uniq,map,scan,source,to_proc,transform_values,group_by,each_with_index,+,last,=~,==,attr_reader,>=,length,is_a?,include?,names,regexp,named_captures,===,captures,-,inspect,empty?,each,to_a'); @@ -7457,7 +7457,7 @@ Opal.modules["corelib/regexp"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "size", "length"); })($nesting[0], null, $nesting); }; -Opal.modules["corelib/string"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/string"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $coerce_to = Opal.coerce_to, $respond_to = Opal.respond_to, $global_multiline_regexp = Opal.global_multiline_regexp, $prop = Opal.prop, $opal32_init = Opal.opal32_init, $opal32_add = Opal.opal32_add, $klass = Opal.klass, $send2 = Opal.send2, $find_super = Opal.find_super, $def = Opal.def, $Opal = Opal.Opal, $defs = Opal.defs, $slice = Opal.slice, $send = Opal.send, $to_a = Opal.to_a, $extract_kwargs = Opal.extract_kwargs, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $eqeqeq = Opal.eqeqeq, $Kernel = Opal.Kernel, $truthy = Opal.truthy, $gvars = Opal.gvars, $rb_divide = Opal.rb_divide, $rb_plus = Opal.rb_plus, $eqeq = Opal.eqeq, $alias = Opal.alias, $const_set = Opal.const_set, self = Opal.top, $nesting = [], $$ = Opal.$r($nesting), nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,coerce_to?,initialize,===,format,raise,respond_to?,to_s,to_str,<=>,==,=~,new,force_encoding,casecmp,empty?,ljust,ceil,/,+,rjust,floor,coerce_to!,nil?,class,copy_singleton_methods,initialize_clone,initialize_dup,enum_for,chomp,[],to_i,length,each_line,to_proc,to_a,match,match?,captures,proc,succ,escape,include?,upcase,unicode_normalize,dup,__id__,next,intern,pristine'); @@ -8319,7 +8319,7 @@ Opal.modules["corelib/string"] = function(Opal) {/* Generated by Opal 1.8.1 */ $def(self, '$lstrip', function $$lstrip() { var self = this; - return self.replace(/^[\u0000\s]*/, ''); + return self.replace(/^[\x00\x09\x0a-\x0d\x20]*/, ''); }); $def(self, '$ascii_only?', function $String_ascii_only$ques$14() { @@ -8646,7 +8646,7 @@ Opal.modules["corelib/string"] = function(Opal) {/* Generated by Opal 1.8.1 */ $def(self, '$rstrip', function $$rstrip() { var self = this; - return self.replace(/[\s\u0000]*$/, ''); + return self.replace(/[\x00\x09\x0a-\x0d\x20]*$/, ''); }); $def(self, '$scan', function $$scan(pattern, $kwargs) { @@ -8847,7 +8847,7 @@ Opal.modules["corelib/string"] = function(Opal) {/* Generated by Opal 1.8.1 */ $def(self, '$strip', function $$strip() { var self = this; - return self.replace(/^[\s\u0000]*|[\s\u0000]*$/g, ''); + return self.replace(/^[\x00\x09\x0a-\x0d\x20]*|[\x00\x09\x0a-\x0d\x20]*$/g, ''); }); $def(self, '$sub', function $$sub(pattern, replacement) { @@ -9630,7 +9630,7 @@ Opal.modules["corelib/string"] = function(Opal) {/* Generated by Opal 1.8.1 */ })('::', String, $nesting); return $const_set($nesting[0], 'Symbol', $$('String')); }; -Opal.modules["corelib/enumerable"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/enumerable"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $truthy = Opal.truthy, $coerce_to = Opal.coerce_to, $yield1 = Opal.yield1, $yieldX = Opal.yieldX, $deny_frozen_access = Opal.deny_frozen_access, $module = Opal.module, $send = Opal.send, $slice = Opal.slice, $to_a = Opal.to_a, $Opal = Opal.Opal, $thrower = Opal.thrower, $def = Opal.def, $Kernel = Opal.Kernel, $return_val = Opal.return_val, $rb_gt = Opal.rb_gt, $rb_times = Opal.rb_times, $rb_lt = Opal.rb_lt, $eqeq = Opal.eqeq, $rb_plus = Opal.rb_plus, $rb_minus = Opal.rb_minus, $rb_divide = Opal.rb_divide, $rb_le = Opal.rb_le, $lambda = Opal.lambda, $not = Opal.not, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('each,public_send,destructure,to_enum,enumerator_size,new,yield,raise,slice_when,!,enum_for,flatten,map,to_proc,compact,to_a,warn,proc,==,nil?,respond_to?,coerce_to!,>,*,try_convert,<,+,-,ceil,/,size,select,__send__,length,<=,[],push,<<,[]=,===,inspect,<=>,first,reverse,sort,take,sort_by,compare,call,dup,sort!,map!,include?,-@,key?,values,transform_values,group_by,fetch,to_h,coerce_to?,class,zip,detect,find_all,collect_concat,collect,inject,entries'); @@ -11411,7 +11411,7 @@ Opal.modules["corelib/enumerable"] = function(Opal) {/* Generated by Opal 1.8.1 return $alias(self, "to_a", "entries"); })('::', $nesting) }; -Opal.modules["corelib/enumerator/arithmetic_sequence"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/enumerator/arithmetic_sequence"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $truthy = Opal.truthy, $to_a = Opal.to_a, $eqeq = Opal.eqeq, $Kernel = Opal.Kernel, $def = Opal.def, $rb_gt = Opal.rb_gt, $rb_lt = Opal.rb_lt, $rb_le = Opal.rb_le, $rb_ge = Opal.rb_ge, $rb_plus = Opal.rb_plus, $rb_minus = Opal.rb_minus, $eqeqeq = Opal.eqeqeq, $not = Opal.not, $rb_times = Opal.rb_times, $rb_divide = Opal.rb_divide, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('is_a?,==,raise,respond_to?,class,attr_reader,begin,end,exclude_end?,>,step,<,<=,>=,-@,_lesser_than_end?,<<,+,-,===,%,_greater_than_begin?,reverse,!,include?,*,to_i,abs,/,hash,inspect'); @@ -11636,7 +11636,7 @@ Opal.modules["corelib/enumerator/arithmetic_sequence"] = function(Opal) {/* Gene })(self, self, $nesting) })('::', null, $nesting) }; -Opal.modules["corelib/enumerator/chain"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/enumerator/chain"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $deny_frozen_access = Opal.deny_frozen_access, $klass = Opal.klass, $slice = Opal.slice, $def = Opal.def, $send = Opal.send, $to_a = Opal.to_a, $truthy = Opal.truthy, $rb_plus = Opal.rb_plus, $thrower = Opal.thrower, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('to_enum,size,each,<<,to_proc,include?,+,reverse_each,respond_to?,rewind,inspect'); @@ -11732,7 +11732,7 @@ Opal.modules["corelib/enumerator/chain"] = function(Opal) {/* Generated by Opal })(self, self) })('::', null) }; -Opal.modules["corelib/enumerator/generator"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/enumerator/generator"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $deny_frozen_access = Opal.deny_frozen_access, $klass = Opal.klass, $truthy = Opal.truthy, $Kernel = Opal.Kernel, $def = Opal.def, $slice = Opal.slice, $send = Opal.send, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('include,raise,new,to_proc'); @@ -11791,7 +11791,7 @@ Opal.modules["corelib/enumerator/generator"] = function(Opal) {/* Generated by O })($nesting[0], null, $nesting) })($nesting[0], null, $nesting) }; -Opal.modules["corelib/enumerator/lazy"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/enumerator/lazy"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $truthy = Opal.truthy, $coerce_to = Opal.coerce_to, $yield1 = Opal.yield1, $yieldX = Opal.yieldX, $deny_frozen_access = Opal.deny_frozen_access, $klass = Opal.klass, $slice = Opal.slice, $send2 = Opal.send2, $find_super = Opal.find_super, $to_a = Opal.to_a, $defs = Opal.defs, $Kernel = Opal.Kernel, $send = Opal.send, $def = Opal.def, $return_self = Opal.return_self, $Opal = Opal.Opal, $rb_lt = Opal.rb_lt, $eqeqeq = Opal.eqeqeq, $rb_plus = Opal.rb_plus, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('raise,each,new,enumerator_size,yield,respond_to?,try_convert,<,===,+,for,class,to_proc,destructure,inspect,to_a,find_all,collect_concat,collect,enum_for'); @@ -12146,7 +12146,7 @@ Opal.modules["corelib/enumerator/lazy"] = function(Opal) {/* Generated by Opal 1 })(self, self, $nesting) })('::', null, $nesting) }; -Opal.modules["corelib/enumerator/yielder"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/enumerator/yielder"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $def = Opal.def, $slice = Opal.slice, $send = Opal.send, $to_a = Opal.to_a, $nesting = [], nil = Opal.nil; Opal.add_stubs('yield,proc'); @@ -12210,7 +12210,7 @@ Opal.modules["corelib/enumerator/yielder"] = function(Opal) {/* Generated by Opa })($nesting[0], null) })($nesting[0], null, $nesting) }; -Opal.modules["corelib/enumerator"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/enumerator"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $slice = Opal.slice, $coerce_to = Opal.coerce_to, $deny_frozen_access = Opal.deny_frozen_access, $klass = Opal.klass, $defs = Opal.defs, $truthy = Opal.truthy, $send = Opal.send, $not = Opal.not, $def = Opal.def, $rb_plus = Opal.rb_plus, $to_a = Opal.to_a, $Opal = Opal.Opal, $send2 = Opal.send2, $find_super = Opal.find_super, $rb_ge = Opal.rb_ge, $Kernel = Opal.Kernel, $rb_le = Opal.rb_le, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,allocate,new,to_proc,!,respond_to?,empty?,nil?,+,class,__send__,call,enum_for,size,destructure,map,>=,length,raise,[],peek_values,<=,next_values,inspect,any?,each_with_object,autoload'); @@ -12437,7 +12437,7 @@ Opal.modules["corelib/enumerator"] = function(Opal) {/* Generated by Opal 1.8.1 return self.$autoload("Yielder", "corelib/enumerator/yielder"); })('::', null, $nesting); }; -Opal.modules["corelib/numeric"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/numeric"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $truthy = Opal.truthy, $Kernel = Opal.Kernel, $def = Opal.def, $to_ary = Opal.to_ary, $return_self = Opal.return_self, $rb_minus = Opal.rb_minus, $rb_times = Opal.rb_times, $rb_lt = Opal.rb_lt, $eqeq = Opal.eqeq, $rb_divide = Opal.rb_divide, $return_val = Opal.return_val, $Opal = Opal.Opal, $slice = Opal.slice, $extract_kwargs = Opal.extract_kwargs, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $not = Opal.not, $send = Opal.send, $rb_ge = Opal.rb_ge, $rb_le = Opal.rb_le, $rb_plus = Opal.rb_plus, $rb_gt = Opal.rb_gt, $alias = Opal.alias, self = Opal.top, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,instance_of?,class,Float,respond_to?,coerce,__send__,raise,equal?,-,*,div,<,-@,ceil,to_f,denominator,to_r,==,floor,/,%,Complex,zero?,numerator,abs,arg,coerce_to!,round,<=>,compare,is_a?,!,new,enum_for,to_proc,negative?,>=,<=,+,to_i,truncate,>,angle,conj,imag,rect'); @@ -12879,7 +12879,7 @@ Opal.modules["corelib/numeric"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "rectangular", "rect"); })('::', null); }; -Opal.modules["corelib/array"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/array"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $truthy = Opal.truthy, $falsy = Opal.falsy, $yield1 = Opal.yield1, $hash_get = Opal.hash_get, $hash_put = Opal.hash_put, $hash_delete = Opal.hash_delete, $coerce_to = Opal.coerce_to, $respond_to = Opal.respond_to, $deny_frozen_access = Opal.deny_frozen_access, $freeze = Opal.freeze, $opal32_init = Opal.opal32_init, $opal32_add = Opal.opal32_add, $klass = Opal.klass, $slice = Opal.slice, $defs = Opal.defs, $Kernel = Opal.Kernel, $def = Opal.def, $Opal = Opal.Opal, $eqeqeq = Opal.eqeqeq, $send2 = Opal.send2, $find_super = Opal.find_super, $send = Opal.send, $rb_gt = Opal.rb_gt, $rb_times = Opal.rb_times, $eqeq = Opal.eqeq, $rb_minus = Opal.rb_minus, $to_a = Opal.to_a, $to_ary = Opal.to_ary, $gvars = Opal.gvars, $rb_ge = Opal.rb_ge, $assign_ivar = Opal.assign_ivar, $rb_lt = Opal.rb_lt, $return_self = Opal.return_self, $neqeq = Opal.neqeq, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,to_a,warn,raise,replace,respond_to?,to_ary,coerce_to?,join,to_str,===,<=>,==,object_id,inspect,enum_for,class,bsearch_index,to_proc,nil?,coerce_to!,>,*,enumerator_size,empty?,size,map,equal?,dup,each,reduce,-,[],dig,eql?,length,exclude_end?,flatten,frozen?,__id__,sort_by,&,to_s,new,item,max,min,!,>=,**,delete_if,rotate,rand,at,keep_if,shuffle!,<,sort,!=,times,[]=,<<,uniq,|,values,is_a?,end,begin,upto,reject,push,select,select!,collect,collect!,unshift,pristine,singleton_class'); @@ -15892,7 +15892,7 @@ Opal.modules["corelib/array"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $Opal.$pristine(self, "copy_instance_variables", "initialize_dup"); })('::', Array, $nesting); }; -Opal.modules["corelib/hash"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/hash"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $yield1 = Opal.yield1, $hash_clone = Opal.hash_clone, $hash_delete = Opal.hash_delete, $hash_each = Opal.hash_each, $hash_get = Opal.hash_get, $hash_put = Opal.hash_put, $deny_frozen_access = Opal.deny_frozen_access, $freeze = Opal.freeze, $opal32_init = Opal.opal32_init, $opal32_add = Opal.opal32_add, $klass = Opal.klass, $slice = Opal.slice, $Opal = Opal.Opal, $Kernel = Opal.Kernel, $defs = Opal.defs, $def = Opal.def, $send = Opal.send, $rb_ge = Opal.rb_ge, $rb_gt = Opal.rb_gt, $truthy = Opal.truthy, $to_a = Opal.to_a, $return_self = Opal.return_self, $not = Opal.not, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,coerce_to?,[],merge!,allocate,raise,inspect,coerce_to!,each,fetch,>=,>,==,lambda?,abs,arity,enum_for,size,respond_to?,class,dig,except!,dup,delete,new,map,to_proc,flatten,frozen?,eql?,default,default_proc,default_proc=,default=,to_h,proc,!,select,select!,has_key?,indexes,index,length,[]=,has_value?'); @@ -17104,7 +17104,7 @@ Opal.modules["corelib/hash"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "values_at", "indexes"); })('::', Map, $nesting); }; -Opal.modules["corelib/number"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/number"] = function(Opal) {/* Generated by Opal 1.8.2 */ "use strict"; var $klass = Opal.klass, $Opal = Opal.Opal, $Kernel = Opal.Kernel, $def = Opal.def, $eqeqeq = Opal.eqeqeq, $truthy = Opal.truthy, $rb_gt = Opal.rb_gt, $not = Opal.not, $rb_lt = Opal.rb_lt, $alias = Opal.alias, $send2 = Opal.send2, $find_super = Opal.find_super, $send = Opal.send, $rb_plus = Opal.rb_plus, $rb_minus = Opal.rb_minus, $eqeq = Opal.eqeq, $return_self = Opal.return_self, $rb_divide = Opal.rb_divide, $to_ary = Opal.to_ary, $rb_times = Opal.rb_times, $rb_le = Opal.rb_le, $rb_ge = Opal.rb_ge, $return_val = Opal.return_val, $const_set = Opal.const_set, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; @@ -18290,7 +18290,7 @@ Opal.modules["corelib/number"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $const_set(self, 'EPSILON', Number.EPSILON || 2.2204460492503130808472633361816E-16); })('::', $$$('Numeric'), $nesting); }; -Opal.modules["corelib/range"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/range"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $truthy = Opal.truthy, $Kernel = Opal.Kernel, $def = Opal.def, $not = Opal.not, $send2 = Opal.send2, $find_super = Opal.find_super, $lambda = Opal.lambda, $send = Opal.send, $rb_ge = Opal.rb_ge, $rb_gt = Opal.rb_gt, $eqeq = Opal.eqeq, $rb_le = Opal.rb_le, $rb_lt = Opal.rb_lt, $eqeqeq = Opal.eqeqeq, $return_ivar = Opal.return_ivar, $rb_minus = Opal.rb_minus, $Opal = Opal.Opal, $rb_divide = Opal.rb_divide, $rb_plus = Opal.rb_plus, $rb_times = Opal.rb_times, $thrower = Opal.thrower, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,attr_reader,raise,nil?,<=>,cover?,!,begin,end,exclude_end?,then,call,>=,>,==,max,<=,<,enum_for,size,upto,to_proc,respond_to?,class,succ,===,eql?,try_convert,is_a?,any?,last,to_a,-,coerce_to!,ceil,/,new,loop,+,*,each_with_index,%,step,bsearch,inspect,[],hash,include?'); @@ -18775,7 +18775,7 @@ Opal.modules["corelib/range"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "member?", "include?"); })('::', null, $nesting); }; -Opal.modules["corelib/proc"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/proc"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $slice = Opal.slice, $each_ivar = Opal.each_ivar, $klass = Opal.klass, $truthy = Opal.truthy, $Kernel = Opal.Kernel, $defs = Opal.defs, $def = Opal.def, $send = Opal.send, $to_a = Opal.to_a, $return_self = Opal.return_self, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $Opal = Opal.Opal, $alias = Opal.alias, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('raise,proc,call,to_proc,new,source_location,coerce_to!,dup'); @@ -19024,7 +19024,7 @@ Opal.modules["corelib/proc"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "[]", "call"); })('::', Function) }; -Opal.modules["corelib/method"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/method"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $def = Opal.def, $truthy = Opal.truthy, $slice = Opal.slice, $alias = Opal.alias, $Kernel = Opal.Kernel, $send = Opal.send, $to_a = Opal.to_a, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('attr_reader,arity,curry,>>,<<,new,class,join,source_location,call,raise,bind,to_proc'); @@ -19224,7 +19224,7 @@ Opal.modules["corelib/method"] = function(Opal) {/* Generated by Opal 1.8.1 */ }); })('::', null); }; -Opal.modules["corelib/variables"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/variables"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $gvars = Opal.gvars, $const_set = Opal.const_set, $Object = Opal.Object, nil = Opal.nil; Opal.add_stubs('new'); @@ -19241,7 +19241,7 @@ Opal.modules["corelib/variables"] = function(Opal) {/* Generated by Opal 1.8.1 * $gvars.DEBUG = false; return ($gvars.SAFE = 0); }; -Opal.modules["corelib/io"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/io"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $const_set = Opal.const_set, $not = Opal.not, $truthy = Opal.truthy, $def = Opal.def, $return_ivar = Opal.return_ivar, $return_val = Opal.return_val, $slice = Opal.slice, $Kernel = Opal.Kernel, $gvars = Opal.gvars, $send = Opal.send, $to_a = Opal.to_a, $rb_plus = Opal.rb_plus, $neqeq = Opal.neqeq, $range = Opal.range, $eqeq = Opal.eqeq, $to_ary = Opal.to_ary, $rb_gt = Opal.rb_gt, $assign_ivar_val = Opal.assign_ivar_val, $alias = Opal.alias, $a, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('attr_reader,attr_accessor,!,match?,include?,size,write,String,flatten,puts,sysread_noraise,+,!=,[],ord,getc,readchar,raise,gets,==,to_str,length,split,sub,sysread,>,to_a,each_line,enum_for,getbyte,closed_write?,closed_read?,each,eof,new,write_proc=,read_proc='); @@ -19678,7 +19678,7 @@ Opal.modules["corelib/io"] = function(Opal) {/* Generated by Opal 1.8.1 */ $$$('STDERR')['$write_proc='](typeof(process) === 'object' && typeof(process.stderr) === 'object' ? function(s){process.stderr.write(s)} : function(s){console.warn(s)}); return ($a = [function(s) { var p = prompt(); if (p !== null) return p + "\n"; return nil; }], $send($$$('STDIN'), 'read_proc=', $a), $a[$a.length - 1]); }; -Opal.modules["opal/regexp_anchors"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["opal/regexp_anchors"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $module = Opal.module, $const_set = Opal.const_set, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('new'); @@ -19697,7 +19697,7 @@ Opal.modules["opal/regexp_anchors"] = function(Opal) {/* Generated by Opal 1.8.1 return $const_set(self, 'CONST_NAME_REGEXP', $$('Regexp').$new("" + ($$$(self, 'REGEXP_START')) + "(::)?[A-Z][^" + ($$$(self, 'FORBIDDEN_CONST_NAME_CHARS')) + "]*" + ($$$(self, 'REGEXP_END')))); })($nesting[0], $nesting) }; -Opal.modules["opal/mini"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["opal/mini"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $Object = Opal.Object, nil = Opal.nil; Opal.add_stubs('require'); @@ -19720,7 +19720,7 @@ Opal.modules["opal/mini"] = function(Opal) {/* Generated by Opal 1.8.1 */ $Object.$require("corelib/io"); return $Object.$require("opal/regexp_anchors"); }; -Opal.modules["corelib/kernel/format"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/kernel/format"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $coerce_to = Opal.coerce_to, $module = Opal.module, $slice = Opal.slice, $truthy = Opal.truthy, $eqeq = Opal.eqeq, $Opal = Opal.Opal, $Kernel = Opal.Kernel, $gvars = Opal.gvars, $def = Opal.def, $alias = Opal.alias, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('respond_to?,[],==,length,coerce_to?,nil?,to_a,raise,to_int,fetch,Integer,Float,to_ary,to_str,inspect,to_s,format'); @@ -20284,7 +20284,7 @@ Opal.modules["corelib/kernel/format"] = function(Opal) {/* Generated by Opal 1.8 return $alias(self, "sprintf", "format"); })('::') }; -Opal.modules["corelib/string/encoding"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/string/encoding"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $rb_plus = Opal.rb_plus, $truthy = Opal.truthy, $send = Opal.send, $defs = Opal.defs, $eqeq = Opal.eqeq, $def = Opal.def, $return_ivar = Opal.return_ivar, $return_val = Opal.return_val, $slice = Opal.slice, $Kernel = Opal.Kernel, $Opal = Opal.Opal, $rb_lt = Opal.rb_lt, $a, self = Opal.top, $nesting = [], $$ = Opal.$r($nesting), nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,+,[],clone,initialize,new,instance_eval,to_proc,each,const_set,tr,==,default_external,attr_accessor,singleton_class,attr_reader,raise,register,length,bytes,force_encoding,dup,bytesize,enum_for,each_byte,to_a,each_char,each_codepoint,coerce_to!,find,<,default_external='); @@ -20808,7 +20808,7 @@ Opal.modules["corelib/string/encoding"] = function(Opal) {/* Generated by Opal 1 })('::', null); return ($a = [$$$($$('Encoding'), 'UTF_8')], $send($$$('Encoding'), 'default_external=', $a), $a[$a.length - 1]); }; -Opal.modules["corelib/math"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/math"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $type_error = Opal.type_error, $module = Opal.module, $const_set = Opal.const_set, $Class = Opal.Class, $slice = Opal.slice, $Kernel = Opal.Kernel, $defs = Opal.defs, $truthy = Opal.truthy, $send = Opal.send, $def = Opal.def, $rb_minus = Opal.rb_minus, $eqeqeq = Opal.eqeqeq, $rb_divide = Opal.rb_divide, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('new,raise,Float,Integer,module_function,each,define_method,checked,float!,===,gamma,-,integer!,/,infinite?'); @@ -21123,7 +21123,7 @@ Opal.modules["corelib/math"] = function(Opal) {/* Generated by Opal 1.8.1 */ }); })('::', $nesting) }; -Opal.modules["corelib/complex/base"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/complex/base"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $module = Opal.module, $truthy = Opal.truthy, $def = Opal.def, $klass = Opal.klass, $nesting = [], nil = Opal.nil; Opal.add_stubs('new,from_string'); @@ -21156,7 +21156,7 @@ Opal.modules["corelib/complex/base"] = function(Opal) {/* Generated by Opal 1.8. }) })('::', null, $nesting); }; -Opal.modules["corelib/complex"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/complex"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $truthy = Opal.truthy, $eqeqeq = Opal.eqeqeq, $Kernel = Opal.Kernel, $defs = Opal.defs, $rb_times = Opal.rb_times, $def = Opal.def, $rb_plus = Opal.rb_plus, $rb_minus = Opal.rb_minus, $rb_divide = Opal.rb_divide, $eqeq = Opal.eqeq, $to_ary = Opal.to_ary, $rb_gt = Opal.rb_gt, $neqeq = Opal.neqeq, $return_val = Opal.return_val, $const_set = Opal.const_set, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,real?,===,raise,new,*,cos,sin,attr_reader,freeze,class,==,real,imag,Complex,-@,+,__coerced__,-,nan?,/,conj,abs2,quo,polar,exp,log,>,!=,divmod,**,hypot,atan2,lcm,denominator,finite?,hash,infinite?,numerator,abs,arg,rationalize,to_f,to_i,to_r,inspect,zero?,positive?,Rational,rect,angle'); @@ -21601,7 +21601,7 @@ Opal.modules["corelib/complex"] = function(Opal) {/* Generated by Opal 1.8.1 */ return nil;; })('::', $$$('Numeric'), $nesting); }; -Opal.modules["corelib/rational/base"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/rational/base"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $module = Opal.module, $def = Opal.def, $klass = Opal.klass, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('convert,from_string'); @@ -21628,7 +21628,7 @@ Opal.modules["corelib/rational/base"] = function(Opal) {/* Generated by Opal 1.8 }) })('::', null); }; -Opal.modules["corelib/rational"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/rational"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $eqeq = Opal.eqeq, $Kernel = Opal.Kernel, $truthy = Opal.truthy, $rb_lt = Opal.rb_lt, $rb_divide = Opal.rb_divide, $defs = Opal.defs, $eqeqeq = Opal.eqeqeq, $not = Opal.not, $Opal = Opal.Opal, $def = Opal.def, $return_ivar = Opal.return_ivar, $rb_minus = Opal.rb_minus, $rb_times = Opal.rb_times, $rb_plus = Opal.rb_plus, $rb_gt = Opal.rb_gt, $rb_le = Opal.rb_le, $return_self = Opal.return_self, $alias = Opal.alias, self = Opal.top, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,to_i,==,raise,<,-@,new,gcd,/,nil?,===,reduce,to_r,!,equal?,coerce_to!,freeze,to_f,numerator,denominator,<=>,-,*,__coerced__,+,Rational,>,**,abs,ceil,with_precision,floor,hash,<=,truncate,send'); @@ -22065,7 +22065,7 @@ Opal.modules["corelib/rational"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "quo", "/"); })('::', $$$('Numeric')); }; -Opal.modules["corelib/time"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/time"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $slice = Opal.slice, $deny_frozen_access = Opal.deny_frozen_access, $klass = Opal.klass, $Kernel = Opal.Kernel, $Opal = Opal.Opal, $defs = Opal.defs, $eqeqeq = Opal.eqeqeq, $def = Opal.def, $truthy = Opal.truthy, $rb_gt = Opal.rb_gt, $rb_lt = Opal.rb_lt, $send = Opal.send, $rb_plus = Opal.rb_plus, $rb_divide = Opal.rb_divide, $rb_minus = Opal.rb_minus, $range = Opal.range, $neqeq = Opal.neqeq, $rb_le = Opal.rb_le, $eqeq = Opal.eqeq, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,===,raise,coerce_to!,respond_to?,to_str,to_i,_parse_offset,new,<=>,to_f,nil?,>,<,strftime,each,define_method,year,month,day,+,round,/,-,copy_instance_variables,initialize_dup,is_a?,zero?,wday,hash,utc?,mon,yday,hour,min,sec,rjust,ljust,zone,to_s,[],cweek_cyear,jd,to_date,format,isdst,!=,<=,==,ceil,local,gm,asctime,getgm,gmt_offset,inspect,usec,gmtime,gmt?'); @@ -22927,7 +22927,7 @@ Opal.modules["corelib/time"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "utc_offset", "gmt_offset"); })('::', Date, $nesting); }; -Opal.modules["corelib/struct"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/struct"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $slice = Opal.slice, $extract_kwargs = Opal.extract_kwargs, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $truthy = Opal.truthy, $neqeq = Opal.neqeq, $eqeq = Opal.eqeq, $Opal = Opal.Opal, $send = Opal.send, $Class = Opal.Class, $to_a = Opal.to_a, $def = Opal.def, $defs = Opal.defs, $Kernel = Opal.Kernel, $rb_gt = Opal.rb_gt, $rb_minus = Opal.rb_minus, $eqeqeq = Opal.eqeqeq, $rb_lt = Opal.rb_lt, $rb_ge = Opal.rb_ge, $rb_plus = Opal.rb_plus, $alias = Opal.alias, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,!=,upcase,[],==,class,unshift,const_name!,map,coerce_to!,new,each,define_struct_attribute,allocate,initialize,alias_method,module_eval,to_proc,const_set,raise,<<,members,define_method,instance_eval,last,>,length,-,keys,any?,join,[]=,each_with_index,hash,to_a,===,<,-@,size,>=,include?,to_sym,instance_of?,__id__,eql?,enum_for,+,name,each_pair,inspect,to_h,each_with_object,flatten,respond_to?,dig'); @@ -23387,7 +23387,7 @@ Opal.modules["corelib/struct"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "values", "to_a"); })('::', null, $nesting); }; -Opal.modules["corelib/set"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/set"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $freeze = Opal.freeze, $klass = Opal.klass, $slice = Opal.slice, $defs = Opal.defs, $truthy = Opal.truthy, $eqeqeq = Opal.eqeqeq, $Kernel = Opal.Kernel, $send = Opal.send, $def = Opal.def, $eqeq = Opal.eqeq, $rb_lt = Opal.rb_lt, $rb_le = Opal.rb_le, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('include,new,nil?,===,raise,each,add,merge,class,respond_to?,subtract,dup,join,to_a,equal?,instance_of?,==,instance_variable_get,size,is_a?,all?,include?,[]=,enum_for,[],<<,replace,compare_by_identity,name,compare_by_identity?,delete,select,frozen?,freeze,reject,delete_if,to_proc,keep_if,each_key,empty?,eql?,instance_eval,clear,<,<=,any?,!,intersect?,keys,|,proper_subset?,subset?,proper_superset?,superset?,-,select!,collect!'); @@ -23860,7 +23860,7 @@ Opal.modules["corelib/set"] = function(Opal) {/* Generated by Opal 1.8.1 */ return $alias(self, "union", "|"); })('::', null, $nesting) }; -Opal.modules["corelib/dir"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/dir"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $def = Opal.def, $truthy = Opal.truthy, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('[],pwd'); @@ -23905,7 +23905,7 @@ Opal.modules["corelib/dir"] = function(Opal) {/* Generated by Opal 1.8.1 */ })(Opal.get_singleton_class(self), $nesting) })('::', null, $nesting) }; -Opal.modules["corelib/file"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/file"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $truthy = Opal.truthy, $klass = Opal.klass, $const_set = Opal.const_set, $Opal = Opal.Opal, $regexp = Opal.regexp, $rb_plus = Opal.rb_plus, $def = Opal.def, $Kernel = Opal.Kernel, $eqeq = Opal.eqeq, $rb_lt = Opal.rb_lt, $rb_minus = Opal.rb_minus, $range = Opal.range, $send = Opal.send, $slice = Opal.slice, $alias = Opal.alias, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('respond_to?,to_path,coerce_to!,pwd,split,sub,+,unshift,join,home,raise,start_with?,absolute_path,==,<,dirname,-,basename,empty?,rindex,[],length,nil?,gsub,find,=~,map,each_with_index,flatten,reject,to_proc,end_with?,expand_path,exist?'); @@ -24183,7 +24183,7 @@ Opal.modules["corelib/file"] = function(Opal) {/* Generated by Opal 1.8.1 */ })(Opal.get_singleton_class(self), $nesting); })('::', $$$('IO'), $nesting) }; -Opal.modules["corelib/process/base"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/process/base"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $slice = Opal.slice, $defs = Opal.defs, $return_val = Opal.return_val, nil = Opal.nil; @@ -24207,7 +24207,7 @@ Opal.modules["corelib/process/base"] = function(Opal) {/* Generated by Opal 1.8. return $defs(self, '$start', $return_val(nil)) })('::', null); }; -Opal.modules["corelib/process"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/process"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $module = Opal.module, $defs = Opal.defs, $truthy = Opal.truthy, $return_val = Opal.return_val, $Kernel = Opal.Kernel, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('const_set,size,<<,__register_clock__,to_f,now,new,[],raise'); @@ -24283,7 +24283,7 @@ Opal.modules["corelib/process"] = function(Opal) {/* Generated by Opal 1.8.1 */ }, -2); })('::') }; -Opal.modules["corelib/random/formatter"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/random/formatter"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $module = Opal.module, $def = Opal.def, $range = Opal.range, $send = Opal.send, $rb_divide = Opal.rb_divide, $Kernel = Opal.Kernel, $Opal = Opal.Opal, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('_verify_count,bytes,encode,strict_encode64,random_bytes,urlsafe_encode64,split,hex,[]=,[],map,to_proc,join,times,<<,|,ord,/,abs,random_float,raise,coerce_to!,flatten,new,random_number,length,include,extend'); @@ -24450,7 +24450,7 @@ Opal.modules["corelib/random/formatter"] = function(Opal) {/* Generated by Opal return self.$extend($$$($$$('Random'), 'Formatter')); })('::', null, $nesting) }; -Opal.modules["corelib/random/mersenne_twister"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/random/mersenne_twister"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $const_set = Opal.const_set, $send = Opal.send, nil = Opal.nil, $$$ = Opal.$$$, mersenne_twister = nil; Opal.add_stubs('generator='); @@ -24551,7 +24551,7 @@ Opal.modules["corelib/random/mersenne_twister"] = function(Opal) {/* Generated b return ($a = [$$$(self, 'MERSENNE_TWISTER_GENERATOR')], $send(self, 'generator=', $a), $a[$a.length - 1]); })('::', null); }; -Opal.modules["corelib/random"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/random"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $truthy = Opal.truthy, $klass = Opal.klass, $Kernel = Opal.Kernel, $defs = Opal.defs, $Opal = Opal.Opal, $def = Opal.def, $eqeqeq = Opal.eqeqeq, $send = Opal.send, self = Opal.top, nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,attr_reader,to_int,raise,new_seed,coerce_to!,reseed,rand,seed,bytes,===,==,state,_verify_count,encode,join,new,chr,random_number,random_float,const_defined?,const_set'); @@ -24681,7 +24681,7 @@ Opal.modules["corelib/random"] = function(Opal) {/* Generated by Opal 1.8.1 */ })('::', null); return self.$require("corelib/random/mersenne_twister"); }; -Opal.modules["corelib/unsupported"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/unsupported"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $Kernel = Opal.Kernel, $klass = Opal.klass, $send = Opal.send, $slice = Opal.slice, $module = Opal.module, $def = Opal.def, $return_val = Opal.return_val, $alias = Opal.alias, $defs = Opal.defs, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('raise,warn,each,define_method,%,public,private_method_defined?,private_class_method,instance_method,instance_methods,method_defined?,private_methods'); @@ -24855,7 +24855,7 @@ Opal.modules["corelib/unsupported"] = function(Opal) {/* Generated by Opal 1.8.1 return (methods.length === 1) ? methods[0] : methods;; }, -1); }; -Opal.modules["corelib/binding"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/binding"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $truthy = Opal.truthy, $def = Opal.def, $slice = Opal.slice, $send = Opal.send, $to_a = Opal.to_a, $Kernel = Opal.Kernel, $return_ivar = Opal.return_ivar, $eqeq = Opal.eqeq, $thrower = Opal.thrower, $module = Opal.module, $const_set = Opal.const_set, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('js_eval,call,raise,inspect,include?,==,receiver,eval,attr_reader,new'); @@ -24959,7 +24959,7 @@ Opal.modules["corelib/binding"] = function(Opal) {/* Generated by Opal 1.8.1 */ } , [], self, ["
", 0])); }; -Opal.modules["corelib/irb"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["corelib/irb"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $module = Opal.module, $truthy = Opal.truthy, $Kernel = Opal.Kernel, $defs = Opal.defs, $gvars = Opal.gvars, $lambda = Opal.lambda, $hash_rehash = Opal.hash_rehash, $send = Opal.send, $rb_plus = Opal.rb_plus, $const_set = Opal.const_set, $klass = Opal.klass, $def = Opal.def, $Opal = Opal.Opal, $range = Opal.range, $eqeq = Opal.eqeq, $thrower = Opal.thrower, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('include?,raise,attr_accessor,singleton_class,output=,browser?,each,dup,write_proc=,proc,+,output,join,last,split,end_with?,call,write_proc,tty=,read_proc,read_proc=,freeze,new,string,ensure_loaded,prepare_console,loop,print,gets,puts,start_with?,[],==,silence,message,empty?,warnings,warn,full_message,eval_and_print,irb'); @@ -25209,7 +25209,7 @@ Opal.modules["corelib/irb"] = function(Opal) {/* Generated by Opal 1.8.1 */ } ; }; -Opal.modules["opal"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["opal"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $Object = Opal.Object, nil = Opal.nil; Opal.add_stubs('require,autoload'); @@ -25235,7 +25235,7 @@ Opal.modules["opal"] = function(Opal) {/* Generated by Opal 1.8.1 */ $Object.$require("corelib/binding"); return $Object.$require("corelib/irb"); }; -Opal.modules["native"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["native"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $hash_put = Opal.hash_put, $module = Opal.module, $defs = Opal.defs, $slice = Opal.slice, $truthy = Opal.truthy, $send = Opal.send, $Kernel = Opal.Kernel, $extract_kwargs = Opal.extract_kwargs, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $range = Opal.range, $to_a = Opal.to_a, $def = Opal.def, $return_ivar = Opal.return_ivar, $alias = Opal.alias, $klass = Opal.klass, $rb_minus = Opal.rb_minus, $return_val = Opal.return_val, $send2 = Opal.send2, $find_super = Opal.find_super, $eqeqeq = Opal.eqeqeq, $rb_ge = Opal.rb_ge, $return_self = Opal.return_self, $gvars = Opal.gvars, self = Opal.top, $nesting = [], $$ = Opal.$r($nesting), nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('try_convert,native?,respond_to?,to_n,raise,inspect,Native,proc,map!,end_with?,define_method,[],convert,call,to_proc,new,each,native_reader,native_writer,extend,warn,include,is_a?,map,Array,to_a,_Array,method_missing,bind,instance_method,[]=,slice,-,length,has_key?,enum_for,===,>=,<<,each_pair,method_defined?,initialize,_initialize,name,native_module'); @@ -25976,10 +25976,10 @@ Opal.modules["native"] = function(Opal) {/* Generated by Opal 1.8.1 */ var self = this; - var result = new Map(); + var result = {}; Opal.hash_each(self, false, function(key, value) { - result.set($$('Native').$try_convert(key, key) , $$('Native').$try_convert(value, value)); + result[$$('Native').$try_convert(key, key)] = $$('Native').$try_convert(value, value); return [false, false]; }); @@ -26026,7 +26026,7 @@ Opal.modules["native"] = function(Opal) {/* Generated by Opal 1.8.1 */ })($nesting[0], null, $nesting); return ($gvars.$ = ($gvars.global = self.$Native(Opal.global))); }; -Opal.modules["console"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["console"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $def = Opal.def, $slice = Opal.slice, $truthy = Opal.truthy, $eqeq = Opal.eqeq, $send = Opal.send, $gvars = Opal.gvars, self = Opal.top, $nesting = [], $$ = Opal.$r($nesting), nil = Opal.nil, $$$ = Opal.$$$; Opal.add_stubs('require,include,raise,==,arity,instance_exec,to_proc,new'); @@ -26164,7 +26164,7 @@ Opal.modules["console"] = function(Opal) {/* Generated by Opal 1.8.1 */ return nil }; }; -Opal.modules["js"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["js"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $module = Opal.module, $def = Opal.def, $truthy = Opal.truthy, $slice = Opal.slice, $alias = Opal.alias, $nesting = [], nil = Opal.nil; Opal.add_stubs('insert,<<,global,call,extend'); @@ -26261,7 +26261,7 @@ Opal.modules["js"] = function(Opal) {/* Generated by Opal 1.8.1 */ return self.$extend(self); })($nesting[0]) }; -Opal.modules["application"] = function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.modules["application"] = function(Opal) {/* Generated by Opal 1.8.2 */ var $send = Opal.send, $gvars = Opal.gvars, self = Opal.top, nil = Opal.nil; if ($gvars.$ == null) $gvars.$ = nil; diff --git a/assets/application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js.gz b/assets/application-596f523b41cd0c1b75b8066512c4c9b592e85ce699428a05db4d6ac425c2b09f.js.gz new file mode 100644 index 0000000000000000000000000000000000000000..a820093e697d8120dae7a2a7967bef632e6a0d00 GIT binary patch literal 141554 zcmV(oK=HpHiwFQ$B41?!1MI!)dLze?Ao`zAQG~DtphlxF(s*VFvD@voBTB z#dKX(i~i-jI?v~m>ioN6x*lZTA7oi)Qx{piUX{~zXM6x39zDu_v#8bu|CwbkvWwz2 zn^ucA#R7rU*+sR=)>lO~tEQV9_?YA8th#`YC6t!);z%1m8D%f#xA|S2VK<#ek2+bu zTp+adDzDesZMnXJ&mVsHs58(uPe<7|0KL8g$ZxUTECaCrPricwvi=?YJE~TfgJE`i zRZg$4v|Ox<#SCiV*uLJJ-(`L1@4T2-w+`+{qwMTA%Y2pJoMri920vECdb3)bW$U|T zQD^m4wVBVLQMOza(*mIZoU=c?9-To)#Ufi37sYB-E-tfmr9k1oKjd%n*V9$GT;sf8 zDL2z~wW_mzF}fU4`_E+k&jwiq3%9y0VQ@4`7@8m=jG+5+SEK27zb^{s;HN+q2-&x42w6pe)J}vZwg!??h&E-5o`T_z%|Epgk@Nl z^Lh5C&%er!23cKY%XyK*a4!KmU_voF&!^V}rQTd#7B!;;?Eh7DYkG%~l{d>(1&v@w za98sAx>zl893_CAZ>S-)&}O*nfGaemX*DZwG_w->z^y0%2n?g5^}kwGo69Rj3S7mk zE~c=b*>&M(1#=cW#RXedS^sLiUe-sC9$f<7ZO%v2>gG|k%;%4=%A@tFC?4GaS{AFp z2#>;>d_`MY%?mvmzbn?Tssxq~ldLn8mKRwcF{!$cbA~HA$PSN>v)%@f^P*f7vmTtf zEI5YQaptR!vv&Zgn8SiMz}*8>8q96En8A722Mkw5Fg)$oa8j1A$g|DO&7H1^OdY$p zDeD?GMphw!HqzSAD`GQ~oh)mqlzsnh4CT~uV+o?#1Aqxr;g3B9>_H_P5p-UgxPH|2 zVZS%8E_)dhEb0)~O8y=}8MIN_n)L_Ro)%sj-{z}DYilfo<_6e!$E3eprg6Ydg248B zSQQT3s>o+|*}TeumW{GM!oPHQZp$egupGvfBUN6*SvsE=^-z!cMfop&N$LdBm{#1L=6u+UcumwgHTwPNgz`O4NNx zQ?pg+i>--^L@Ooh(7!6?OBi-mtfwPC8d^%<>R*9e7W3?eI+jZOErzWJaebAqaT$uY z%L=be-m3YXG^VP@i47FgSD<_k0dChN(CHOkEO_tZ3eaSw zTGW|#@e+0i?y(iN1fJpsZ|bZ3O$q2h+qEh#fw0qdu8KczN~nkz&Sp_>mdk2|*TF@R z12*~&rvwrwLbxjQXd=xgb@8THmFv5stOr+kwdxHs`45IeUx1l_qXTV*S$Vktd?Gle z%ZYYrfk_(xw;c}b2s9yPX}%p0z)1pF_+hEOZf7`58Nx&?@O77!nM9yRj`2TyMY4;v}r=MJV5yLmA3ox!q=Q5 zz2jk;o?fh0`JL&Asu}o8ZMMDDQkwA+e^L6gL2PTz-0#PpI!>VAIQv*z{JvNet9%U{ z8X&_0Nba9E$Y;ahS!{03kw{zu8DAr_cLgN-V{X-FKm$A?b+H1LDhC#OQ9@(rm?!%)bUl+o|?ON43z0m@VbPbqi(mXC%j|>9Sas@A7)Pn51x$U z%Cnds$+9kN>k`X{Sr2Q#speVB1^CX+Q^Abw3Hv=!J0M(mSQV2l;eTtyQX-7QDh5XpTDb#YEFSy z1`3N9QM}EuK|Rn_EwFF1u0USan;O{^Tqz#;=y#v~_TPR#u$)T2hl7Se5w+$mRbJ8qccBkCXqlbQtLgO+A78ildRg?=GOw&$8%%WkeWD}YyOYjg=M;wT zDvaai>H5UPX-&7AFEZv^JW(Jr12f<^8T@ZOWG3ViZzy0M=6BhwfFCn_fnET4nHF`O zukIM2!pY}w3F2xjs&#e;k2qmj1NuWN)xSmtYM9+1n9D-vi{u20;V{WWb@hGWtjN-T}t@>QlVvX;rv|aB9E$mGEaH9<1LD ztdy@VNm^2m=EdR?&doC*Os+;2HsyJax{Km=lrNX_JDoV+W**oudoob^q#GM;Z4$I! z!mw?GS%-cceysTVzJHNmMFcHrH@sRlCz=%G& zDQ>FO9aOniDvP9hQaKu;r+B^rKFPh7hQdn0(yfp}A2E+K)E5*nrCdNP6n(!14$Xga z=fNYU-Wo8_VYYx#1LL+R@e2R%*uTA~aiSh1@k z#R5`qf4Z|0)WPjBzx#&>+3hgg?7yvmHOS%q0qRK4l4GvT%m3wt@KEpkTyY>f#(F68 zqoSxeo}>vqxFWugwhl{&f}cY`>0$*eltOnxE_nfWyHodI=VK}jaHp;oFAazQ14Rk>gTtLK9hg*x7f7_tL9>YE3p-t$?wqwiSeyc4nc3#cy z%m&HKN&2_0CNP2?ZWgT?ex&X`U#yEu;8vi(?X-U*$Ur?ekJI@idz?MbUghhn(X=S% zj!+-*w~KjIt@LC2aDX-^h9iVH8V%F&`~<2ed9YlAL9zi*iO*2CvV zhF6rFq|>qCiMSrW!;o~~Zva@YH|K-+oQG2%hbu-6nNiYeghEQNJ#&|ys*cW2VUOMo zSnSL{DESvXWXu?u#KYz6UdiTv*Zz}1u>7Yn3mwwg{d(KG7t1VvgRiWw-~r>f zCc`8I{~0~oYvHeuGMsq`BN8h1j|5eK85@m8$V#5MD;FzFrt&IsNaV{_^#p*r8uE^J zjB>enQ(YI6Mpb^0OyDPrx-H!=VGYV*#%%=epkcoR_>Zy7^F9$&d1Z~W5~zAv!oLq5 zm?sQXZ*6>1Ix@v&GI_^3L_>}$)BAlyQo}xfiZ{oUe34 zD^794(6?dZXs2Pw(BjDu&&CZ%120d7!&t!A2DaWzQ7#cdbw{@eI(gvDDAGHCL~i@M zLV~$t9Z^ijtGA=#*u3rEc@+#Y@9R3E7=}=MhKl>mn$$F^0usZHhopM?IxpvSroAF_ zbGbov5NX*_$&SD35z3*f#R@B<*~X(c|1f&|$h4Zk5tytB{WaB*jjq-=^MQ8wo0kY< z_WA0zT=eSf>EkC)vn4V$fKdPSpa1Jq;7{*Zv~yQ&P?o;RZUG7`J6xe80m{#-jhJXa zK?c0s^=7Gd5&!j{|DPN8v|Qbe%Eco%#+Q$@{zI;B2E`-$Bk-6Dl3Bm{`g4Sii(Ws% zEvVgUxlX+s_KlO>8Y6s4W9)!_fmcof--v5Y7C?a|Rok|xmqoT2pK>;yj!vlpjlPJgi$ zgAJLYh%%{XHVX2?!8u#%M~xafZNNB0hXzk)@*E{Nhb=_A zDNWN8_osY*odLqpw#ioHs7)eF#9zv*>rysXig9ov&HM6ixMb$qR6vGdlO`&IL^kZP zGKT*B@cBhBOp(kMH_P>1wAnR{zCgh{?tBSoTd+!^R$wULfud?PgR7A>=O`8;8!5t% z3W%pRf+ZQUkb)N`d3*L>;)rUJhO~m=dFVz!whT@Z3OuhRY)em~G2$d|@ z8?Aindm)!!-RV^h3x99)asUzs(qNaXW+f-kz`uh6wDQ9`&bnb21JBuoTkWcC-)wq; zX;rh&xCN?tPF9e)CH5j!JG%S*{zsK92DB9IjRUs*-dMnL&0f7XDh#>(`DV?sVVD%{ zBph#f1(B9kE{0Jn=7@n!I~})gQ=ztH9r69)iEARI^b)K_z}nzrmfPy!QT0?YcR-tV zTdl5(S#ugvKQRH-DAOch@G^+Os2jF)W75(55r*Gb@9eux?QTkYIpQ*t3C7t60o*fV z=OQ;IyfMha#t8@fpodv~T`sk)J-YDV+|1Ye9avL*ob`^5dIKKfabP$VK2Y3dT4onM z%Bym_?2$2IU9qIBKVa!1-#t0&D;_cQPAGxlS&21Wnx6l+DZQB0D+~vFP!$tlRDO zJFi6><|sjWXB`c&*9Q+H+}uI9=i`J>Cb5hm{Al?a!oUA5&Jd2EPg{$tZFpzi??Icn z3@=bGsN5T>YHdokOMPnSF0S@otOl8J5v$=JdiVNOm11+B(3g|Pr=+TiP}mQ<-`|5= z3__bahfF{G&<152?=%RZ1nc0`nkUhShk~-F&Ac~u5@6peFph9+fJ6xiP7z*5;|<*nUS;j1SLlE;`HxSBo*M5>ej~~~PMl?Z zF70=m-QeHrL?`?D`#;p__x9jtAPu{rG+FFHV@B>i{QILYUl*5U&DO5wD8d=Y^(fDP z4xj>Kvp~%bp5{ArRB+<3th!)On+5)y@ugSjwO5B$WjrcqAFxYrtlUxgh+-^p5U5PhY2j1$1l^SV&>!jXVvA&orPa(iDxc_42A4>@UOB`WgCA7uBz5-Fr#e5i-=FKK5HD)1bUsF-cjlcHlc01re-Dylv5bw3vC z84GD0nU}H~xlb#=6ZV`UoIM>Rx-sR0Rw<$a-6}(LWKU|73fRA4e<#L?SJkc1x!SDR zW-&+o;cd}d71^IR#p(_(KXF|v*L5+!h%^tx&d6ybJ2OX;-4Q(p6uWj~pjlatSY&ZR zL;@wJj_XAKI*nADRuAIfIQnWpwfCB;y-(M^^LL5UDObpKaaX%;>zG5hL9gQ6a|dz& z39rH>AcU)*A-jIYjM&InBz%5hi6gmag?;cK$W;fvpp(p1F}=n)-Q?GR zxoGi$hf>%TJ)ATGe1E}eSA1$o(U1EfZ!7??o?eY`2r_k^U@ePtk(YDdEs+?2eCEWL zXQS+kY7L8U=AoVe&^vU6qxTQsPPGtdw>ir-#U0MLQQ>xB1PQw=e=4#i&A>+K;0PL} z^JS3zATPT!cSs0{z98}j%+VRctI<08F4LvZ6(9})hybnoqMQ~`hx}I7$nlZAhPqA9 zigOI1p{D&Z_}k(fuKwz_hSlrC2+@`AQ4P%W^tyn%&`t?;>1VY6XX@Ia?D-k;9B0h! zV)T*~OYEE*2uBoQM4QRxz?mE2GO-5^yVGCF%bMAJWCvnk-d9nejT{=9u{noM;QAY) zXpH1i@PZc9BbpI7e3RFFU5IH+Z3cuc2t_`#i^3sZq+I?x5f*aKl~5242N47z!4Q$~ z)Rt6gDxqhzZ_srR!h??BLar7xBypJ#h&j7W@P5q-48Vi@B-t>L0%?x=zID@Vr|rMo zcV`zzuX`9S&*(JE$TL*P5+5B2W;93QEv-hhsYu#7Lx z6Av7TKyR}?xyFk`YjIA%(~sL~yy@|!~yP=#`4!HV9jtYJ2H zNL+hE5}7?{KHbA6EaU10iru(|S>K+_yrrgF4Xrnd*Cz=ZYJdN(rGo0}dhF=dUQ6YE z+ba^T_v}e)8yLFqZW~y2yO@Y5VkTW<{gcxz^#wQgYv3N{dsPbGTezWKJJwu;b2-A> zKu_nu9L$JdXtlVWJpj^%w@Q&jrC`7HGMtiVJVqf|p=-S%EHng2-TbwmVQr^9vgEyku0$DRb=K9x(&UI)W)7H$h!Gj4b(S>+FW^!mv0O+ zTw~udB0fe4;THnw1sw)MUdhZB?U|5u03PJLoMpd%$pn6imncO7T4vQ|W!re18M)8i z5d}D%{Q7H=#3UjrIWV7xmzo zaTPLB7m{GHuqs$VGb<<1vVtuBPip~?me$6{!R&(+k7j`G7kv&l<<=(dBuh+YwA|EJ z4$dI#;@v^|ZxlLLx4OppY(~rLVm|Ha4ewmpO?k8i{kAMXcANm%6jL?4>01HvV6LNi zdvTY=cMAc|ejcGaFwf?|p(YwDsew2@pRV#Z_>^N8O?+mkjMaNii&y|BDV)zIr{<5j} zweTB;%?y^G!GXcLf1KW+g`Pe-La{}_alSH7=E6MhjRluHcIau(Z(edKv`%bFHk)QX zt%g3tT{W$HI%Y3Jk(QCbH2si@1+L}l6kTB7`ile?2+SG1vgz;v%6<=7$`A|8ISr(8N)MU_N z@k2ubcjDW~jR5C&5K}~F3P5oJ44n%Dd6DAxAVE;0YP4EyrG3k6tI6Pi{|I&I285OV z0Q7XpNR{p#4Q$r2M^ayv7Ujo@*~Ey^cu(zjK9CfhBTLA!1}PRm-`q!Arq|y#KScI) zv79<%k3znB?7?e}xhovFFa(Q1Cw-k*V!i7|Fz53+&2xsk8eN~BC`a;Eyh$mrjBo0% z`8`QsYrq^E5+CXudHw!cK)NLAzs+&M^N5y=Yu02sIh?_BdyJa?T>CR%ShD=xTJbu`YJ?c%rIJ=MAyxJPw5AQZbix-uDsGw(Cabl$nJ zV{29G4HC))>G$N7nAM0RT^3W#Z5Xpnc&xGxoNpCaiBVKf*kb?G+A%uKLf?q!2RW}!+QCCHCsfq7FMg6(^T3|kQ+7FLy~J+1fpF2zPs*j ziLPCXHes!oCTeZE4H>yd4GE$kzmLR`kW)AWj*r85i=aXdOhQu8JQHn#htSH(Ju~s) zA@fCsG>G>Ez51HdbXQ~xA6vE-=DyAsyyqBd7()|e8f}^Uk^~Mjd1oxpJ)_8xD5daB zZeVxA%q&}xFsy(l*~$<3QJMg$=1sP8LC77)G$bd9)Ueln$QM53%cgcb6s5jtGLpi+ z2pDH#;S6w`4Z7t}gi~tUyfElD($q*^-3%QVML&z<{OuG(azIArul<-hK{VR{b||h7 zBJfFR<0Moz;(c0rm9{|KCb@TU2qRLqtutX#w)Vz#_Uf)32-n^L#GY#Je1Uk%>xfTx zjaKX)gv!O+dmA|hY{0SA>;`GX_vUI~ExQmLDUZ56&de@GQ8R-W@dQIUOyCQ^1McQ8 zMHm2_-hBRiat+K^mCuXWUw!t{sU=+haL)0 zDuFKVwR4I=#5Q#K;_f!T8#PvC)a8No(qfrAFoQJvW<3>NA)Tp1csiOP?$!Ak{326B?W(%m=$Q zhL!?fx9NnEG}0EvYKm_x5=cj(&SIUY0Z(L{bS#9IP$nj^kUH}kkbP`c94Vwu=KLyBgdr%VpBDbJ`Q?*E?9fidZ#r^n>`cE)TkjkB|9;z=8`w3 zeP}^beVn@flCM*(=tosuL`GANzPi})j^GhPhD;G2Q)ehU^89bpMu+WfjB!fzkQ4MU z4qDqTCX0_ZK2)=C$Zfdji^j2zV(X%tm*~&3>NtaF&2KP7Y}<9vy(gAgXp9=hjzZNaSX$--aevrt0JP@d6)vLy{-FdEY`w}4WmYj zXHLUfDhft!`5Jm&UMJ2=BYhkN)GM_yO{ zYoaD=>GLN^88EIUDM}O0!Rmj`22jJc2w{9AylWp>RIz*CyfsGHJhFJjiwA}7ZV6aAC6I>-FNbCg>#S|ttfhzRW(B+$GQWm2}(u5YZUpKfmOiy^;YaYWO z^bo|R-^t?4xznXzneT9AU}?S!4aT%Tt$*^}sWCg2>GDpVV1?6$(;qNSDHp#mdO6RS z(J+J{WS8-krp5i3QK(RhY9+!%hhQe+29HoUtwR4vWQ!)a$3|PGRZ#6+VoK3kBwZ_0 zK@#FK%0k?|4^wbf8py@>S&Xaq!qh$S)ZCQ!#nHy`l^~Q6meTo6nKm}?)cEM`gJ^r8 z*)Alz2a4^1VDIjYGzmO0$T0^f zWXt87Vzr}B5emCRYDH4IFz`w%U+Mw357IMUgrLoHxwUE9FR?KK^obKE z7GA1k0Rm)wnU@?pmE6fB!?V0wDbunh8ilEp7^A@I+!0~llo(&(0W;JO4!m9Y+Qf`Z zaC0JsF?vSJ&3PV=T~O)u=!X!JwkXhh``u6eVg7s?suAD(!-MeX`80dRq*_`(%$^{j zdB!%@4a(TW03e*_9pg2Xts ztnO(du54r5qu?u%Csy$FT~k-o24+jB6AopvC)$u4=_f{%6gFIL!-jP=FIM>?5b?V; z57$9gyz$C!td$Y3?1x zLAaOZ|+V}U%-?UT3QTkovKE;I~Le%5UWV%)Ull}>DkfbIF*on7O_=*Vj z&piD1*~H{Fwr^wregECu$%!189P~NqIXKFdCW&)qjqIW5ow@V^`QQT)jGw{MlAM!IB=b)0f=n@y=j6(idk<2kEB1>J(-xOkD_jVnK zH`$|wl743|vIRzOP>%W*gB^&*GJhi`eoIQhggUuE88OQKrMkr-4spwJr|TgaRJ#>& z8uSOkOyrhG zizgRFj%FWqiW$>>o90=Q?HrVOPlv9q5n=XVMkU+}Z-Ey1K2Z$)@JZT^k8f{O?42>FXb+W(`QUo^ZYVVqKWLp@>Xe z5Cn&B4##b^UjE0?Mx!(XU9U5=!gdG37rNu{@EH$z#MR;FXf)z4qmeJ2=Uk}mMod5s zTBbxfgQaF5S#8d<^+rtrNSjZ{O)7^L@3Qj(ZSI}r0;7U4;&7?q^`=;Ed_;g$9+>tu;#-)o(pa#ZzvEj2@ zUhP5M!M?8>H^rd&*uH-Dm}A&?(hD!F627Nn8tdX4E7k`3BE*M@x#IU5Qt*DiE|-9W zi-&~DjuYyWKiX|U=@qA&Rb9R*%pkmLt!!a1kR7s-L)oREO|(n8b78*gkkR4>s?Jx%cynFv^KhiQekp z0ncFMe#pme>WRC6(_|?4W|pGW#CqG%2nY}u`R)?heUI>ez8 z49ZrGS{$An;Wo5 z%{AG2o81Jy2!Wn9;c)HCc5+jq=|O_@(j2ir%r?szrKWJ10OhD$qS1`R zA#uu_cm+}uORdBA?~=B=5yJe9neX}`CoOh?WxlT+Obe2REH(ZZT5L>3g|_;V)~L&- zk_*#ulk$X#P{!|a3r}vg*ey*NhG!khwd@N{9-ju@B^MlER`09O0R?eDLBnPBq~Xc* zJ;OiB1Pqc|`H{U#@gu~rP^^KKOFkCRnI}6oPvbqA8JR5%*d^-ACA4%mm>Go>xq%*} zre;=7C+I$TgU(Z)uO9Z#kaH?*r<IFpwCQ-GiPhX?#4LWAzMP(?)jj)=TS3P?Cf z^rqrY@W>n;nfQw&Qid_W%q83TEpZjGpzvXM*l*#*SKW@d$-vIsWWBQjKq>gwVznsd zfn-pNj9>CWq>z*Kblpm9po50q?jgO&?9e51aDa6lk)req{(1=T&?vg1z`~eV)MWWf zNXWOPbVzsdK6wFlr|vB zY$EQpjNL@#!ca&`@lVIrHrppyOb1mXF0k$CnsRfGpfxzcz|yuPzPMHydm^Le4SPc+ z_b3$2?;(zlj8>74Y=)6?bC6td-yg(T65Oa7OYd6UduZDR*XEJYx@D~!Hf{kxxe3_T zw$&3z4fv9BMeDEKP|R)d!;0;$GZw+Uzxg%o(pZ}R>Q~!MkM}ZA4nzX`S-eZ&yEqn} zQlrvEd~;t^3%|Fi{5F>@NlM79{wvNNnaW5QR0KYHy*X!2Slb9s{j>AN1LF`v8 zdDZ8zTG$AA68ub_Ef`aWpMv=G$?r^FL7aw0UBf~8II|`&nFPSGxfk7$<~{ z=n}6rr5;TXL(b(FWD_hQzG;P0Q@yQL*AhADE=Wd6<5lIVT?au)k7%5DTMP(o6dS`E zNoq@)6PZv*^g18&&4nW(<7w<%ZK7mmV$CnZlSwG+w?d&AJX; zfJ%OrFet&pAU>0OcyhRDIdKxV_^gZ3`wFyAhmEp$Ak*Om!$ohn0&p|3{ep^p)i2s4 zlV}w0B@^pFD4?%anD&Hv>31%wYIvTn;Q#;SxDz~FU&v4#`tg`_8p~Dr21&&kJF@$T zg!-~33(nf%F^0z`lNd6W!&G>>E@`2yRo>8r)4&ap4KjpkvD$V zRSp7@;)j%AKYl_r?S07Y9GVX^AH$P|B_VyJEBbd-FM*Wzd&Az&@CaOgC(A;c08GGl zbvff%Aj{Gii;I1LRYKRpMok}WH7ZI3M+jCFBYW~)Jfv|YvL-mM)EBdv+k8jS0=!m= zHc?z2 zmn+SzDF*(;W^OsTP(q=F%QX?gsV~k52lrdd)I!=I8?uNFgA(i250vLG(R>|kdU=ZH^NM1=3FbvBf)ULzJxHNh zoRFxEx?wG(4;)J}?iow0zWp^IAa`i#A{{*zuX)+&Tjtm@*u!ecnXex%tGYzdgENS3 z=~9?^+cUum?_uWarqyc2Q5G-jtiLL5D!5ZHLX_NaRe%MN-*s{|I2|fGe7TgTX3Ja< zl^_MGJO^dW>4^#9<1jo?V6(V-iYE`#gDX`62Ih{%{F3*;Z#wPAjcFU;zxa=xd{(|) zY;I07jzmj>1f7>4*;;w&pndUnNt~L8;Jze4Z4Jf?&vciBTleb${`;VDV*OFIj4E*j zm%vfot|~x{_Wn7s*-0QD_LOgGk14Ou(9LS--Uirnpf+7#U;=!O_Il%Fl;6CeC)PF( zOe8poU)~$_#%)P^Qq86&0~t2|AZTt{;J8(!xW(M@qz6!3v#fX8zN%TDF$7x(K0yP& zW>nyQK+&KV((|3@OZ4W)VlM&tsgM_=+#r2(*sC7|f0;u1d>Z>;9<`b5!awOKje4Ck z?iii|n0QME^&so?I=eUBZ1>U6wcYNL!=OlB1ZILK?Fxg8vJVr@>97%0UI=P8fUZ%U zw#9^Qw20jmeM}n?_XjsCEhxprXI(%T84Bn{IdjV82^I|zJ)rUQdPphLZzm0I9=T)3 zB?Ewg2|Vckl!%bR?GE)OA$sb&B%8bp?eM$}gq6oN_hW3YF{aMP!3cr_r|0mtho*Yd(mQLcOF7;avf^Dd#jy1QwL|!EQ??Jd zziw2=)(#L82aTj-@oNoho$j-qq-M}#;8GkaxahZXPkR2F9PEnTePQN{h#Q9akXsyT zOEn>_m;a?=%v8*H>BUGRI*I}`%Ye^%58#wO==2CtIuG>VCr!TkEps~zh{1Dat&f70 z2yV~M*G1#PWD3PJ~e5KgJg5(83w)WB%!* zS)eR-v&IBeUSQH`DqM6#xNs3^GFZMx-ws(j4y4|AWYmDTQ%R;{w(O8SSIP0YB9WRb z4jPuKBfOM-N3S_oB1!4|?dp+I4epz>ZqC%t(C$Z6kGH3ZiP6=?nBd^Fp+m^S{bp7y z(KvQZhbV$LG3a?57w&>k0)B4?V-PyzF=!6+{N{X?_o)&+*D#i^L*e!6&Mh5P=|c_2 zB}^&TZ$C;`#D1m*NT5vtZv0IgnrMBss&2C)(jt>I7NyH|c2^ejndmq006*a`nB!n| zsmnp1p4c<%CuO-O$$d(NeD!rMnyF#!QTSs8UH@Tov($sQ5Pq52=T6gE00V#B%&(Ah zpo)NA_z52R6G|^gg%ezDw?b47oz5wbYISpy$Bl!+30iH#i{1pzt0%n5SckXOK!8&D z2DCswLVZJ!_^Ze&pTQzyX5YS>3jAsgW8lFBwvFaiUtKCXt}7VwokbzvdAj$+qO|n~ z-vO|^CCRWZz{8O~6Yy{jAkOquIp11RFzFyydtoIyK zKOBe8-x3@;JZ{gn9Jv3HK5+FfdE%1D%lJ@_(k8dWKSS}!yNO~N+vWvIVV#z{PBIO(oX;zZ?{3y#l%{d+u zf5E>F#GnpXCkjeA%s9V`Q{He0TWG7XZ;3%GFX*nns5T4I-buLNdb$bh9o=|_W*klc zobaG9qir{GcH=)b_2XELuA~JW0+R|e{N$JiQ59X_>IXJR5)Y}q&Gvys%yBw`yqUovVVim#r;rcwYSA37#YZa=)A_Q- z+414on<=?Wsxa(MO#$7<$utSFZz`g;^wQUSuCTNJhNJ_B^%$NSjX`V)Kx)UvlY723 z=rv`-IEqq~HJ2!k%GvZSl=b6>eLxHTh0=40Im25_-$!>_N z{lIPrzof?FMueZose`vOpJwMJC7qkHe=La=b^5&D56qG8prG|%aJ>CQ#jNvzt}b43 zH35^MyDEdu?yU7~L&fkp`g-F5Ylz3>XxP*lhucZ92^Nni927p#DC@X7B;vd9a&g06 zyQl+2lkI9&#Hfe&5?>o+4aCi);D&8S&>*H3+Yy^$Q36$~IXY2oFK9B_ujt5mhIdM5poQ)G|c{*;pm!Ngam8ryOb@xl1E#Bky!-X^TXNyOE zucMV(li*Y|P~}5|D-xhP#+LWQ6;ur|v^DYNIQ1Je;z2{XYFRpYokc29%?|F1TzjI{ z|FMYm3!znTV;6To7H38{MpVoH6mKInZ#3>YDYF{<-(rmvU2L)EeeJc+qZxrJoTfwNS=ZjDLpCjW7=+(v2#xRx2hzq((4Rp|G|6x9ZF2xg=%UHyWleg{6~;$w?9oUqH8C1+?M0m8H*4PY@sWU35P>qd#oOV-J>#$x?yV*YZ95}uhv#KqgXq9;afWwdIg8Tdt_ z2`s}RLqqk7L+LIIlrx`5Iu!1k16XRPFdW&CMfQv0Rs|J)SrQmc>q;^*MPBNRacG;> z2KFWGSbzNq+fy*>|Ljx;EuNkj(F~SmCZJQtCO9eAw}=|?Dee@ z`LZ8`KEQ>T6!2CLppZq;(4_b*?xM6DqK9zZoj{e-h9Mw9UvAcY7{M?zP+EjbC)zRo zqr@!EQZkydvfB7rj~ z6EFC>0OA%T13lzV0dv5g5F#@;(ke*ebV3kM)rHJd(Or5;8U`Vgvhs+Rfk`~Ox;koy zM38pgx-7rMpyD~XZ7Z0S|2wv}d@^D`25YWGP7E><@>zIO;e`Qz!bs5B6>B+5a~uS# zM|z<~x5q&+Wat_w!&|xApymjO?lQF+2keB-aKG5`7Kh;JIeK@{C6=p+B}LpvhE(7^ z4d>OT3r&8US2Nf)GfQ&K&;bIyy}T?|joG+ynsAWX=6X@xx{FFJjWh!My{E~V>|SuM zh?B5FA*y`G7>IsWPlnmkVfN85`}kC=uz@R?M@mKDO_;?1YLfWxgY5WO_VKpn`q!w- za0V^Sw+>;2P9Jq~m>LAZIQf`n0`qxty3c6n)gUlW6>1t%aM!Mi=^Jk*W{z3H4mmqf zfBaz~4%`vuXma9Xl;*D-S0#`b<4=5m02+GJh|b*!I>}-7 z1zl06o^ujQ;j*YDYJ|FMS#VKmw#+GrLsCM zgFqn`8GIXclUtvid|U&a@We zqBV&KI0Z{p;|o>j+{I=E|I}*@fB*j0imWD@^{okC5KB@=>lY>CE!c0s^%SUO+puNe z-|@gPNpfSOeG28+N!)E19fYV^m`OP~jU5x9tQBV)cFGmU)0RodG_HezSlPrlyOwl^ z*EZc@IFGRP$@S?t%E2sW&sQQXvqeunkxt?RN7AQ=Ho#aEN$M<(wRT?MHoqrS!&N@svOy~N~w=Jo5 zdZLX^x27zG zBk$Pu#NY3>-R1kSN6{_gtgT{8n8wA?G#3fHo%X#st?kD+C5x1uS3g|qxG!=!(wSY6 z63@++W7Y_ePyz&Y2sy>4Z@}5S!^5&b2#JL9|UHnXDacG^4Gm`M8$bzFYaO+ zR+0p0j<%AB7Wq}d{cw53=WfMDv$C!uAA!dESqF~!N-PPfB@{x^)l1{KiNE)GVVjq0 zjEUy=m9`Osu&#I;rdL(P{(vZ14FU=X=L`Sb^86%x+y(o#10S)-o-}d@$&z^4aEg%tgq_hr_v}U3w?cuw9)nqoEZ0Ty`9CX5`# zS;2p1oaH6Gj{Kl(e3+%@wz47r1Y3nNm{dM@J`4(m&S*qy)R3DnzYIm%a1I=9Xg4rb zRp4`|3_N+Nl<*|VF9wk**O%C^*$#U)|4*7k@O&*=eU1SXI2BeHGov zgqS4{e*r{^lbn^1J73@U+>$~Ei1OY#4U0uzkF#y)#aB{OGy{Xkywt*kQ52aPmdE#j zPn{@0NY3m0QL(iNp?I+>;l`bZ0ae&}yZ}Eyz`uviaVm=rsW$mYY=VA5Ly)&+sa z6QP;oXxI%5jUG7^&Bj@qRu^`t_WQW8sv-(x76RSxQU%sM&w^`)e7CKv;xSUg24h7( zNAr7RM%)v4mL277M*BJ5Sll)ULGt+kUPGeHq<}M<)QxLbY4W(&GyCC zSbDJ2m~=`eRC4*dnRZgj-{|saF?}91(AfKv!}}v(95{;{%1)41_30`(0X4_GmQ2u7 z^BPco|4fh684F5Lm?AcFwfCp2vw4*xzGQ!LVTdL5IOP{$^HjDmm8dFtDz5;SDK?=v z(1)LQ+Zwy~C&}3s$|G%lZn7hJCAchfWPaDMd3Y(WD-?i!5UhfC0cqor0)0QZzrpP# zD`P?;MGn_(+8#N7Jv7e?Z#fG7AQA~>l*x*Zy27*FAB4wVmLM96u7%+JK0BT~ka{k{ zJ1pufL8Q1#CW3p{PK5s2yKO&Q$K5uLZXRtT-fwL89fczz0XCA*GDgPDUdWi-cuzv3 zg2ps{2^4L{Z%ZGXzaF|eq4Ayw>*~K3%DUD+8fg>b-gkueA4_B%=hFR5@P_Q$_ksE{ zsrece9S44vG+=oMxG;Y2oCG_cmwA)nV56>TJ`41oGaBcyH8S&F$WVD=!m?mnUr0QO z_pro1{hRg${v_2q+6R^kN%fbT&ti5bdNQN3h;X2(X3@={m#z&%9~>OfSi~op=XC0a zN>)v)&0@g;dr7kLLHOP!K?yA?C5a{hf{lhzkD}v*t|t#kULCaPHQGj z9*qwdU{bmT=yljYFPB%-pgyfAql*^%<#dS94E*AUkchpKoKPSXh&d;gfUGDO-@K}> z*|*8$PcXZ0kRyc!dk<*P;)r0WzNaS|BZUb2e8xoI38v+{C-@w+YLI&Dv1C%ER3vyI zF*)gA2_r=mn^mjw5@q!&&JsCMc3l)pmRRO*;nG>6z2iE2G779s(54ol(K}C;F8Xc` zjBwDoxLU28NSNZ(-eTM@FKp9RPR0q>)9Q9ruGjc(S~SPbBU2hitBn0L_r#Cr8%72R z>5KB`>b8b)Ez9XO$IC7+uhwd1DZm2>3z{)Gdsr^^QzwjPTaIS2$XmGeffYaq-Nk1R zRgLt0P#9?*<7oyuNOMErAy+RqQzfJVVuYg=gV>hlTO53{p+e=zkfPL5D?53MMqwb4 z?voKUt+|>;icK3?+VTNWk&@z#Psc(ATT`+N;GJ}VHzmLfB2IqJQMolPx7v)d_F$25 zP<6q9I_p!)rI%MLRPcTDPXi2$_Cv0NT??@|F+!2``pm&jZj$L8Wm7()b94 zAbmmHg!RS~*m>6Ox+YOUi09Hi!gW48mx!r0M^bS+ahG2ZF*d!*T?7Ew=-av2K-J=+ zyxgo1S=iTO=<=Zg4kx~2>YvnM@-g$MvlAVee=IA6I)H#i_bAWih7LKolX)=&bo93fQ9s(XwmP6h7X7abE%*kG&rvLj~ zrtew_vb{i>^jMst^ZKd?g3!9fCpQ{Y&6t(X`hiC}rWL7xP~GOMMZfdAPrv&5)0Z#4 z`TWZ-j$#m`*wc7Wq>m+HcS~vF9#+dyC*tp^DFp(w8&7XNEW#Xg!BFHUhD?<f zae&|a^kU&EVYT^qcXM9NqmL|ejXs`NfC~8{{)$}B+CPVFne1dpX1}xbJ-(QoyfMsVs~j89T>~!|6r~KaS{sluC73}a@6(3x_ZV$*KM^pa7Fn*S7c>TPD8?0}Ae54dfMxLIq}MI}JV&o@ z2}Tmy^tm~!Z9_cmc;eRR?!XRAa{l5bjt_P%=)1&eMPskjY5f~LrY6vc?s(&v+EW$q z<-gpi@wjOQvp0(RXgoDt?e2cISaeT3-hs*Y!sV2KsoN2$l)&6Q2x)SIdA*Xk-nRlv zfbu)sI1=7*lFkLICje%CSv*Z23w~T3hsZb%BTlsKAGP5=g2S5*ToUmgqB^9#FkxOc+aMv#*TqonQp)u~E4kF48aYs4$3)a#{OzpL7AAjN zkdS1I5Dm%~QJO$}V(E*MG*6uIix0cQpN7Vjb!a#m{kzmZ!sv7H}0XWm%fX$ zTb}BXLyqEUe1~sKw!;i5it>Sc3y`NroMA;kcO^MXe-Pccp+rFA`Ie_9q_5jnQ~D(I ztqbK&twN`u!&GR=I6hf&qe2%@7<9P^A}afZb#_tgrH1D$Ue{n^NNj_7-D74U`?5QL z=DRKE`roprgawb&BHnoat64JR5G@c2TzjF)yWzSVb&p>k1Sse*Lw3RD9C6F1Wth&y zui{?o_ihVaBiGrByhdj&3JpruixnrTxFT^f8!1xQEYz4XOG1HX#LI^G0PB8m^CFmnZu>mF3JxY$(fuCQ7&TEt#)p_c0T2L~uCFf@L4)j3O-=h&)&aF%k z-2jIJ9l+@J5PF|^7-tEQw?^zxOR|y$%-Pe?;}JSSW@nCgo=Mam6R0|lIwl#3NpgM= z1(ywiEH&*gQB5v111|c;l@XE1J;9Am)81( z)S*M^?$kJjPyy*pQI(dF`wqFot5t2_Ruq?M!qG9%PpFsCgg_y*7BP%ghiliLUt2&k`XXwFJAyZ5OM+zB!S zxRrwNnoto62PTsE$&=Fr3L(JfQVjgBI{+Vd~sPg-yPmcikn4CN^8im zdf8v~_Noy7M~%x%?TfdPV%se|hs_L#16Q@`D317r_0hd=8ldWQFW})tH3@25jNw2S5cbw6h2e84{1tMgRKYKwAWpFY0yHV%*M!3)9%mFzXnT68t%tP^Q1hgnulm*PH1T$Be{p3}P}_=9F_rYLV8}6+7=<=`eK4!4~pZ z#1uNGK5Z<=LN1+0kPUm_LzZQ)IBp$fM$a?N&XINb;mS+FK4#%|m$BmB=$Hka<7IS@ z60RGkDP!F(yt2EUy*x8sbE+Yl*azqd`j;Ze7i$00WEkuqe0XZSXV@&>eKQ4FFi%M>ISKYBK@2a2So=K!TJ$OCJS zjCDs{ZrV?)QqkFZQEyfbv>+JHcb@;HL>GGPwAP&`|8%TTE_BI9-)S_IaON}>NhUIm zECjnlO~Oh7!O?bwS8=8hdX!#s8}McY>l&w7F0Gj)*@8Q>XFphB4rVQ%Rn z5>U3!t^4RlmfBBKs&g~*!eI~@Gq#;#2ZTkExv|xzP7=o9b%-{H$U>~{{A~z?siYOt zc#DM99GIDW)fYa4IWC3`M_00)t&f;1Y>6{hgX@yKo2pgdKGa3XL=$-lY_>QOgxxNX z{x8Y$k!N~Ytj&_*&7xMquCkYrxKAo0!N6AdVMrtL*(>dvDuxp=H&|pr$H`XkBd{)P zrrk|N6~eCDCiFYEP`n}tEfhpj>tFqfpp3lnR-nFsW$gQD4qDupIJUL!01`y^LlFkf z_+NM%>ml2d!oeXUx$2^cI$|xD85$pwO1GIQf{A08EhlT>)90Mg=6h?3M)`k|mSq#R zE^ob`#@-|?Hg*f_HB;EgQNI0BhPEQK2Wo>kaP|S727X<*Fh%Yx@M}#Ll5bzSA1RO& zB|+9uS!OjxY!lGsE^x+#2qS%pZ#BMjm^8E?2Tg+^8u4ZEcA3mI{%JkUmxa{uk#Vka zK!-WZM)O_pI|P4;6kiz&4DPZi=QEAufY&%f3%RL+I-0DwBZDmfFLDckFQZif^O+X? zNBxtBC*Pia`{?_3{lSM1o{#>$`|Yr&4dRwc1Ln zt+rOX&}tW3tF5)#I?9ag9xj*j>Kv9?R-MD(dk{`W}u z)OJK*sf$k3p+ytf@CIz`?I6ZHx!-XF80Q=JedmUc8$BBMhP}NlB-)RXyu@^kNT%@T1HBj4X2X&VyrP5uVDbjKl^)|CB^%JXHxbA9{r};;J~1%TL1wa zBcfXi;?`l=rAe><{HQ0Rf`590-q%kxL_Ht(If z+L|YNR;~n8Z`2$6!$f165Sz>$HDED6ZZrXaFgNh*4&^IAFRtRl$2o4+?DfK@83ubg z%wB)`)r+rReDmekIGjg4qhxN3nGWZu7jPI?>TYK$de-gRM;~?{4H52u@ML`zpn|l= ze|(#N|9154BW$F%OtRLuqyFmrhYEWB;k$a!4eRslr~%qItov?~gP)mN=n08~x|-4v zuHbXO52IzZB%>Yk1&t=~&p}G4>8cTi+o^>iNeMS&yodu>&xf)tk>-^37}R2`7Q>=| zLq_f?2>a|1DnRoStQaJmi5Ko&pl6NFn=aJa8@{#m;i9Z2%-0a=#0`Gdc9hHr`Z92% zD0H!UE!E&^jaXHobsFp|`ipBsCR(OJY@r6%54==wO1WU7J5oTHyGklY4$v>6P^~VN z6D95f9u zpco$Eb{j&spWQ*iYb!b>{@4Y<_8FVryTkp+gba(czpZ&0wvJcSL2NhC5aY0XWihR0 zWLDv%kQ`U4FYi4p-LZ z9zp9%6rrhtiVBIIy_f2aS1YhGG4o?VFuZcyq&4!K8>X)fBibYuJ{6;97TlG7ZQ!zD}!;jL?j#7Yq@Aj!6e%BzI*{*mSp~P9G$#zYJs%& z3Hw6B-UMGp>+0Vyz63tL`U8_Y@=#$6w%M8is$d$ah3}E(`Y`KA_OsB#+OMdOdiEQa z+EBJS$Qu@(%3`e&s*pMuB9z4WKpn8rynx&t34nQ&T+}#5efU1Kvw`2E#)(9WA^2{m z=;jRt_nNT+52p@%#Ba+*zPi)tp3|=uVfK!>hCwLe$#xht+CDT%Pvk0%QWI3d5Vz%1 z6;YXdo@^FZ`C>K)X4D6QIMy3U9+{hk&y03KiLZy*`DQH&WWQ#@s}14NkJJJldz{6r zcnz4{4?{-Z|L;!+qkvZrSF!PpS;S=Q1Ujy}mfOoQVag%X{B8ixa1@;MPJIW&(#5^R z>0=AAIPG4*rcZ?D>P1GiR0+u`k-MO3KVcK^IXr400~rT=`8ipoP#PFa@mowcIOZ@s z?RM1juN&8(cneS8CuUW~iFhq`OUB!{@)haUnv0!yp@dnS@PXnIi>!lun(}tp@o-6@ z6SQi{KI%%s?3<|5M}t~UTA#N133HJG_jz8euOuL9-JcIv=8lyx7V|LesGnP_91#LX#0Xe!&>& z;FMZMxocw7;<+0Ec6a1g5I*x7;vT@?`iNC34;_oZxe`~KpauMcW9*$$T$~cq z9eGu(kz}Ypu1wA~6UQb!fUmEBV*oCp2Etvr!|2fQvRLqi#|Kk#lw8A$jEs`BUTC>$ zq;+PIbcjtx%{#E!3)hK)6j*4HV}(WZja2N3h;+KDS7kj;0FI4`@%Qc_)6M|I6Rdt} zw6->6R?JcO28nrc2Jm|gCy4Wzvd6*>V`j~cI-_;mHWXR+U^tYLa9vI(rvLVpdarT$ z4w@|3S1UkLjL21sXA|(S__Xk$V2guzSu7zUR~RBHHL4+>Wgk6-)hbM0Wy$Qwk4mBHlI}}9*@h$^ zxI{JrZCl_Bvh2_$pW{48Kqwwk&Zp_x$srlu$Uogzmjyes!aHf1Q#8vqVS?uEM%f4@A_169Vs zyDp!9^z`BMs+eBao0}}3UskJfeRabw9u!2O&B3Gb`V$VWfeIiiu*{m5N2c6Ip9(n+EpYUU^D ze_BYQ@$F%8&o^cpA*~+%YBuKb9;0LzMW5si){j?gXy#}GbyB}^yZ31FN-`(iqsdFo zUewxx@zLTMx|FQQ)q;&PhgtrnDrfADJQ1OCeO)fa+VC8Rj^@#wSC{1!KpJ=>bSHt9 z?bz*nv^hxeIhJs5`GS%Gc3s!~iLP450O$;Z9(f&7ZG3h5Z?daCueYmjFfdu2*4Nc$ z zL&h;oq9Su#vG|o{w(_O6SP^a7JnRe{u`w=wB`MQ%axwH*KBXF`1_wTAmW|ex=qUy` zI77YU7YoG~m z3Mkfb&%|WcXj+``BjW$DOBZ`+n}r_MG~BR5k5}k1!>js%8W5B>H^r=kfuJYao4lN} z(-nG^^=dLgVKWr1Ps!BP1G(aSsBAk&Rv+Yux^30F0!YcZ{2cgelFoZ6S)VvPMWr5Q znl({WQ_@A>6Lcu!&B~6=2QlD`n2a96?nP~b9C^6?)p8Pi^O#47$C5agoO2T9AH$)F zhR!BIaO_M2dVql%B)(CL!^Lw{;6#y8r6oefJ7Urc8uk(a>u+j7!XJ?>(Vxy0U90uA9v;RSGxHNp#)u!uagaWaC}~?H{)lXip!Od& zH%oo1Eh^aoQpNXBDC;{@0|h6H;?Ks_^VkcUtXm}18+b;PJk*LnpkZw+hz_|b?tv+v zCRp`|=*}=GItoM}82N!COK`>^&W0W<=p_D%zV9_0i$pdLg*u}W1&2$_SdF=Ewgb<$ zukvQ$Uh-&t#biQ8%}IvvIN#j_@rJy{kIC~J7S&kA9Q*#MP%DT8??!*bThx61$O5O6 z4R*S}>8OW@`Wgk>gm{6^R zO3dDO$0tdjp?h_YIo$ncDePBoO&{Dj+tbkKt$uIve1DffL z7|y|0$2H`jmWG-7$k8yZ;_8oGLKFq>r_(Z4lFVD1kVDn;ayC5o-?lY>-V}BB>EG(s@Dj@f#$!CeXN)_Rz0*Dqb}&f9686&N zcR$5u>p%nsj0A}SX)X8b{BIm%)~h?fjKv$^f=!E_TLU44KOpQY|y zYT56<|CPLgm27L>wm_9_JJ&}0@VyZcU-`&(AHm^~lJrsWg*n-{JR?hzH1bK!V*<1l zak|}pFW}J7%do=`${NO7U2rU=JdCi!CaqL*9+h0=sH^IM0b#!x=Of~sKcDngV?-HJkckq9fb;2?n9 zZ3`jsIVW3)FJi*ZO-R(@9r%Y|U#o* zY>!RIRPpdrZU6}su~w45)Iug7zwY}l+X#l3BKpd_GAfiei(>$`?Ub+4zF&jb1J~VS z+ExR21z$q{n_ZOFH$B|CRD_xTm|QC2zJaHZw<3$y63mub3--G?E(^~3=mt9^hnz3xBwE-R(GWVcJd#4CHoIq1s1g z$_Jbdj#=!%w)?}^+jc0_<}qY!^lQJmT@))OO4}b-lIoVCgWmI1Z87zu)%sV-r zGZ>VMJB>`7rCvKT7OD-$l6TuM!AM`ThffD4;0tTIFtH4&j!sTPW7n9EShCHBK@<&k zlF07T@@}wh;V3I)$NmIQ)eu7=b7_ zBsiYjcaTiRq`i1^=C-c9e06Joa^G;&W~YOX1+>iph+a{(usm$C1C-mBrD?O~$VBDf zFxx55SxMG!rdrrBXw|PChVDo}O2Z1tqY&Ahpw8rCRl-}jZjQY3!6!s9gT>;2ypP}7 z5|)1U2co%u@@sxNKI?3oRB(7){G$kBGd8lzkIjp)DyEwi>Ga_X`rK&2y2{W~H>)-< z%X9o+R-_vkHM#p*Da0=_`DiB28BqcZYocwN6C+qE(h$V!WD{CAvJld^FqxeRwA94C zaY8`ilYK~b?ryPabv&GI3MwCFCv-P|sxE!K0cyX#?-O%@0L<`0g7ow31&$x^f}+%Z zFAj*+(z_h;tj0Dei0qo^II(;j-4_ASFp3s!#US2642|PBB;YJy5Bv?o_c?q-Ms9Eb zEL2+e!ykTx>L;yH*{bsK_Gmtc34cIcjM|w6rgq)XvmthNK(;9GHHdBgp@J=uPsyO( zE#bbQx{KCr0@4oIbVfgNj8w`5uAlJlp$QG^bXEER3a`aBg9@&N(Q9g@+SFPpWf{is zKlU~xT+38y*PXozG;(UW*k#YbW8+51A2034%XOQg4$e~UEqo^V&>HqcTl$738xIaX zvAdFbF3F$@J182dq)za86l6i3+7)?at$5dbhm z*n21njaXb1hRoXYQ6xP#>I2c6c!)~H;?J9W{(Sh!@EL0pF+}79qd>wK>2Hi541Z&c z9R9!4VweZ2Hh9WDQ4e6;c#qiVZP(NRyC;J<5wVAf_a}^m zTX^-5#A$oxP5-zxFLl;j5RMnKKn^ep)I$4<#X@L1#uQc_Hxr7+V-u~&4l$auETK_` z5;P}36UQC+v2vE9omSn^?ru0tjtrQk58P{{Vu8C>0*v%qD}BH#OXhL4zzUbbG#E5| zO;WN8wI&Ror24f#h@zLZ%AuNZ;$mZdqOblT`n`|Y01WUS%f+>34B#gcYN_NZt2gIj zTpa{8gR$Vl!1^e7yTA2U3J4w)YL>#{qR4RH;N6Y0gpMS8ZsE*JUYtvc_%W~FqqS4h zQd@;gN7>~zE#zxdwsxisaR4q$pZhsX=m}LKK{lx}4|8e3Jn%-O_QX3=JdDA6t4*70 zhQ8Exv3S!az$r}V|D3VN-dNXE6g!Pmo4%+;@XdT>J;|M_8@qKZdFz}$NzQ1#M(YZc z65MMl&Pt%GY#YP4A7K-1?2Prf3rrn`r$^rkZDLs*-)*(J<~xh#XT8}Lz>}cUwf$JC zLtzkZ&;h|5ui+ZBsqPNq%$q~sp`$1If!03oWz>>To0?ABNlIXCK>F3xFteuTdoma7 zo+D=XKk1NZ5mF-#mNqfu_%**1!;f1~98c^=JFuLe3CN>7iA0%!;=)$K)|3qx*=EcK z%ts(e%Cy-I8pV$vnGwSaFUQu&KTFR2a^3y-@8)=iYd}3JaoaWdg=QIvRN|!xfzn|5cZ=Y)P zaM$KN*_W}Px4rkO2^d*l(uY?uKUk{ytf^?-a(Gh#Bg_e+!1Ve^^7e(UyXbw?V=lhu zTFY=E>qP#zyS0~Y$a*xU8BqePwcm;^atvybT2U_P-=J&^C1m%agDhTCb&?3%Zc3+n z+_~I-$~q7pw;xXXl#Ti>F>SqNqdB{aeD^#pKN+zsI~P5axWatLsCyrDvSO`hUbd*eO+8Kut>a@N1O4kBlHEkwS|^~WMOZs4c^Mz1>`eAHFmY*or46PV50r-Gj3Y{r z@d#alQMn{Mq-1|K2(=T}RI@wdy-f8e@Rg}YDrgnYNG#w+GR-=OcH^{6eOiiP#u_B& zqAC$_pmSU;7e30^m6-BeG6_63O;ta%P^t|#B32)a_qJ}?ft`-F#n{OO{}(&o13NLr z&~fj5anvYE8Ao?u(n)Vs{JD49j!;j22_*k{F?F-9(8n`EQ~ApFe_hTG^HaP6f>&8r zgWjBk_OfC$*}adsFTD44(AmwV#*D!uvXzVr(TP2wr-PWDX{k=wtnFD<_DDYaPkIF9QOLbgYiKNtP>s(T1_znM|-q4o2-_Be_zPL29_H92B49I8b=!+(bjjut_%;qAPn!1*4 zCX3BOvWqR3HF=(rbZ8;la{r@texHY4yp1sbw%zbc(GhzcBAELDGHWtN1br_c2!O+qjxsi(bg{LkH*c&0wD6Y3k&b@ zENA`Tb#Yfq61WHw5%ire^~f0GvRH2$ABDBNm%u5uyid8koc2?~oy4T5dl3zhT!k~7F8jcp7m~BQ;>2Z5bQO75_H%qzDmdr#@ z!5}jEcH=tHzfKdD?C%l}g2XlNfDOhw^i5mwB8B9wI3iOFF+@J@&#a{Oc0W43^?I^3 z_*VL7xwwDEqo;H={WxyW)WDaS+yHys=ev2zJSTt`EoFKW{FU;p_(T|X4ubWxe=q&U7UO|UTY_$%v4 zoEdiOs857wc`6poLy6j8PqQ4NR@%u9YUL~#)zQMbEBYk2O1C6W-(e%w0%5)(OW3qA z`S7W?tyuaADjl}evd_JJs>_4VRec{TsHWx7KFU^Slb*Op-IM8Wi73T})#|TCK02i8 zdW>&u@4=4W{c0MKutWiPI%v1<2;vBYJsqMqoau=>YBlv_gKNnGaCC%e0D9~kfF_?p zsmumEdEBpnHyBtvutt9vr^Byo6^E=8dv9N3+N`1BIYwr;r-SjkK{|HQ-@!f5LYysU z0ln&K2WYjM9l`aPpf&Z}JYAExv(Jf>j2Nj?Cq>)eRM>8ALl~s3oSKz5DwK>y$$0i$ zUlvDMzvEvOMG!vmNCzSVJH{62~4yaOgCA(O59;=_5sBZ9L3hRmt?Q%{Aqpx^yL%$0a& z5iDoG;z*8`Oz5E6XQx!PiN$&`y^H$J%rQ)L;QSP6Kg1#I9ODwW5)Fj{h@WS(^5UXE z7eO}c?(oe>4cyABE;x72Q7)>V4tX35ap&I39D-(6=Q`fP_(;5C*yXo(64ojmNkf9p zkS8&VX!xA>iBmiX&ly`}yuF*OG4mDj?)15F7|||_x@O;}VX#vaU&F-7W>`#QCD>=Q zvpB|T?z|qk0gQzm!LfuRuG=!$W&Rj0deBx_|CSmKLPF4$ii+T$W(KbpO=qq&SVwS^$;>|b$#IX^IxZ`F}g!JO*nvdJ+*(LJZ5OtT9 z4>rse6v3!(mkGsouQh4|J-kG<20G^Z8uT?$Mek#`zX_SNv4*jhYmysc|Ccq#HV8Qs z{?>ml*E(^`5by9dCjhLqE#wyogd*irFGyoVk61}&qH_t#HQ!c4^q|u-9P=(lP_#)Y zZZ0VL+c0PgtqoX!Wew6AqAX*Cwv8=95tpGAyIDU?RqB_r)5UwI^-0=dgx_wv<^B5U zVoM6KqdF|ce)430+4|w3mrpui^ZG!L+&1N@U>Zm*jb0HJ|0o<)kg_Iq z5+z*eJ>5nc&G+&i(Eu8$<055pOrFxZ+{<%u3l98p7!Vj~ks^go*3;e2!sAxOK-yR< ztr~c0>!(x$Pl;i=;b4UH`*545?!BezJ260l52x<5sPKMf6B;ZsVJm%NIF-}T5|&y3 zABq1a0@3X&z*E_RypbBAZ*fog33TSfhtL=*2u}4np=7VQ#;J!i_b-lRJOh4Z!i@aa zKo)zy{i(NZkaN!Ba7Oo3f0&ld7~C2$$>Lvv>kIpDlWI4H9TM4XvTaz-$&ThN+V*yW zd>?sU@perSiSFNKQfcm1vw=ZTBa+2#5nJUGwVFrNXnl4p)EM$mHJZ7=OMy_wd-g^S>O$IUV}cXMVb2m!uLIZWhdcxgG2y2-9qvi#<&4@O|jU1 zCxcklZRdki_1F{WY;Yd~THudw7vC_sxzAuuGz0x&QR zNsPn1_NS|=?_&-SlTFhuAyrJqLJSIPlNd|0WP5Dzz!9;Ul#{Z_N_5dS8BlZvo*G!Y_G?F%`BI8`z8{i#yni+UvRq%1IjXVXM8d zg&koiJM{9Z$vbZg;?T;BYRxQM&hjYsnE+Hgv$<1m;F--UJhxajcITt(EV_7cXI^-2 z*Ls%nZ6{IWeLG(vrdGzU*ovT&YPy?;w=z=DFe{E3(R7d~>`^*8xDXJ8gXSJ|3N$-X z>Jn&(TX;Fgh1_x?hin}?2MouzmGbeqabrs0Y0VQG%6bD52&hbVV*Bi37Tslx*pc`V z61pf^Yn?*~ViwDu9wj^*_@koTmnr|UZSG|juk2BhBLvKZ`|~(52+jLz;5B1C<}0_j z{tKg#VDHVk!cOR6Gre9$>lrjWHaK;tsY^o^lp3xVGntEd^v(Lfyn4Iq+44HS zTLwVS?5{SbbG}Qrdkde#>Ri;Kzu?AK1-%K_v{8PcS)bF_p zU$*S9>KcnvV}_-8)o=k*&crjH#p(wcZs@(K1pR7oHRwV2Dvm$XKv4+%bHBcnDr|dEm#hHJLjXkaf zfDnHsI;IQyn07iI35v#ED(QfXH^WCLUt~5TE8LUF4ilS#_{xk7VDemo^AbdG88Z4Qg|z{(#oELFCI z0KP?btGtMHw)kyoEeUB-zv0Fw{v}cVn|y$@7^dOMAiz0lu9&6FqZf@-xn^Rost5F) zxXU*fk>mrmIwXf}sTh+uM`d9shA`AnEDHSC5V2fRH}{mfAmWjC>xA+-E8@#2KrSZ5 zj7>kRNyK5Y%~YWm(&4MkI(!j@ViWD!cvPCfhK!tb0)h<3>v?b?*f-xg?B3)V%FXS} zjY5RT0$#~6#n2M=#VS&k7=kkbyXr(hpMh|!<12BBLt~qm##1uAPVlCh)9hPI+YK+c z+I6?SJluE>{BC+y37U&eqsdsHNZo!;L0bHlJa_!c7|LVnVN%PGfbswjJ(QmR4C?@^M0CF7q`8x@6X%?;I$^o;s)J$Ly73EiYSGb7hjq z&Ef1Gr#Ds70oT4|kF?n0K>%BN6kGD$Q4u)tn-ieih^$yY0Hc2H^&pHD z2+x$@J$E|EDL z1&Uab8#Ydm)WC6H8m%D(An;PZs4PPVgEYy2uB5A@t4B?sl(}dfdY^$=mXVCf`zU$fVm&DFC! zHBqt)`*Dm(@h(w&v-=|Ey`|ci-}n_9yYd<_?-g0OtzE+EA-lLyL{7#J(nq$>U>A#= z;snT&n!yL|c4hNUSq!6h1S>)y6frQo<-K2c5F$?)BB8PN8BMHbQWH(^yzug%DtX`q z`r(PXtjjw~PY~@C;&=5zTu|oGQ#ta~piIq^)4p2xRx<3=X{i!EQjD-<`XRWJj#FN? zSh|OT4^O~a8|th8EeOQ4giLkLxFe7SDQu~>FLWe6&T3lnVxPWW8+r*|)pEpWsw+g) zKGb(j791Z}n=6hZ?j%|WEc;8F@gbamx3qR!Iw5BZO-zdjH(e%X=Qm0d!;CNsa2Ph{ z)-r8k&21O|2*%v}3c@JZ;%O@HF(bksu9gUNP5jsTT@Hhykhd~MHT6dVXo<=Cm8H4*ehvL6Zl#~ zWFoV94=WBsUa`fcw(wf2VF_hqhv+xjZ(`q5k1?GRxF8WBS&LCu$MA1|-tsQF-2uxI zIo06DXh)JHe~kL?C>19?*ez~%6 zzv7EuX)CHjmqKJIzstAvaU*MVV~^~(fdAGhF}7OiL9e#S{2vo;wJn6p&emvk!o*=4 zg5aQN?IK;~BR;zuN!VIzHYZ@I#>x-MC2l^!lp|pCiI=KGUf3u8f!qv(LN##1m36?6 zu%HXvV3km7nEHi=9)TW&M9(z29W=6m1nl^jOSpunRfK&>c1Zq3?!yTns9H+ z1jS_R7+&U!;lCAZ zktT#&uW~$jU;BQ4E~}jB`i-+8H3NE3?K+^CJC?+NO9cIq%UU~OdazSMIN7oT<$QQ& zss)hkAQ-C)Ddobj7@tbK){T6>S11;D5TC$UK7p}(0%N%|7|SCYi{()WisjL-gTzwz zAkwpkpB{Q|fOxu(X9zQ*QiHzZ!zAvY=@_f32dCzbtxgd3xV!6px|p?f?h{64a{!rp zf^tz2&fa7c(g8qd045Kf$;*OmoOC5H9Z?FJ(@A+dE8fH8;Ks_As-BAsXv?^mWf9w& zDM=={!9q8BNdYS{K05BCMKoTZV>9Cz(IX6mmSe>tuEX?xF2{OHRle% zj`67$v$843j$6Zha|$~Kf!g3~hX8gwCpLhyv%$f=*UeuNt>B~W{_1zm{h$fiT6!OD zr$5i{MY81d-izfK%JsV)WdPqZobPvrU+Rq;XMU?8C-O)JYLRdV1c^eHp*+VH8mCX> zaIcair$d|@7t$b~-G&$Rx**5OTEN#_CZwRRG1cq}yEMc?AZ6pON3v}aq{n?3>P{1! z1Y)?Gvs-4@&blx!X5%4y8S>m=F|V7Kq`qIon(K8UfvZzpW*UaQX4zcOYfLn63>RQs zO@yJV>Vy?kZ*fYurfgKxK9X4w)hqf0P-d zTbeYFzU>~Y?Sp3Z*@x94Wk<$p%t+-`nw3(uG+nwOyp}}mPIRRpO*{K{r6;ar+)lZn zxDk-32ULen!%hY&u`voFwyt`kh!12#J9-p9mQHgl(#2LYk>WpnD{6x)RSA z{km46%iTj~0Z%3jIGQN>asnCi*$V$jUe8w96`N)`|7@w)LS?h{bO-~Z>nTADy5v3B z@xgef=_;A8S>K;YO)%RT>;_`hf?E}c0F!52Ta0mxv3DyrQ6EMb3b@z~V29Lm^(d`0 zdy;@B^1E!Y+F=FftiW)dvbF#(F43Z#!aichf=%cWYh9&R30nUq1zUy$UPC8|&{!pC zWJIS(ga;BX7Orx-+F^o7o+!{J(sh5X5+1eiKg;wa9&N}!joY0%JY?i*G#Re)$v6Ww z^2JY$RUr_s7RuFBgdAJyY}pUcWP?hkN|C$)q!m3zB^5$>p;F-(U+xBR6;NtdV^cjl ze(s$WkS+f_yjs;)RO#}wRdlsZ7h~i;^BGF+GS=16da-1!SnwUilx<4{p|%3wK}#Qm z&eIs2G4mflIQzk;Y2=gB3uzQhSIw&M8NO%Dor2{2Rs-YcNP9ISvQQ#;FvR^Fcy$dhWG^5a#nJCWZDrMRl8btvK(75!GEVu5|qoZ%txh z7;T3PD$~VH%W%mNH7PQw97SlT+h}$3HpLWD<>xgmZ-?23+_AXD#5g2g;@?fVl6|pj zI~-qu-Qkdz8xGac@O`snPI_zQ!X{r`ey+mJ>eED@YWilk1Y6T*&)8ae9XK>IoD#=E zvb8il3rTE*tg?VMFO$b$M$OHYenx$L0VJp~&m;lUwT042+bV?!&z2GcQ@Q6QUXp<3 zdBM`)ah&PSl`gQN0pvzq+>81=Iv`eD6&a8$$si}VeM~XV^1)&~TjkU2tozgQpafb` z6zhbw7}_lD@Pj7D!K)(SrG%Te7rd#4g4TJ6k7Q8E`gVc(S}Mg3YvQ(}U(@{pV&#Me z?!#gOn_l9Re`C7d>fm?lfBJuG;AsO#Vbif#7`aT(h27Y z1**;~2ls@mP7qH5CcaJ=FII7nhqB*A;8c3kS>dZaz^Tak8%S^_0-Sxo>rB5Rit@~U z2vD!dIb$ztwgd z^v#F?K5J~u>YO2`!v_@&BJP2jT8KV%HH&|_O@a+$32kwB$z`_sPIT$p%lJY4q3Sjd zYK8U6sux#Q;XaS`#jd-NI-Bf^;I8nHt7Ap3^e_G21R?u`RPp;jsxSmOJ`eIw;1pX0 zr?AHy#&E_N;ZVtSPt9-ZqzGGCA1-w%&i`Qv$OS6d?CoU(UU)Ob#O?T^v?+-~pll6y z^0Jbp(gN@6hJ$NZJPo`l3_T+}ZuDV=Aw(a(Cr3%fH*JoFlo$ z)QT|9Q)56f-n|IzSdlGgT*WogrFODLC0j6&)rD@dfI!TD4iT-m8bg2PcPUyK5g74Z z5Ez-i1v>6lLs zY&btVkc^xfH>96oU=;}aC(N$481;`>X7e0~S4I;JZ`o7EZ(UMCeF$%hqr@OOJBMR2 zOcr#zPkX||#mk4{nXhn6*pj)TL3yrI`b78Xlln8ae4npI*XDp#;Sq#9ZE+v|BQp_g zt*t~l>{cSD-ZE8=TfgKeE1zU1rwn3?g9P@D1O}os_Z@Z08J5qrBsO49XzoQwsZ{rP zn1khNoX;G#fTw!pIos36wMZkvCf06L0P64PxB;VZh zUnoIO&rAI8>LSjYju-Ew1HOoal0=}s%;c}kT1N+-2do2hr!dn&Ox+>aRI8s5S9#u2)a`a#>e8@zC9P{wnwc8Sjfe z$d(8mGOl*=X`EY5*iS=F*!Tff49)9l$*9xT0y%@@E)<&MgstbKS;LCUe4g`;RYbOr z(AJD^1l_0Dc2J>JKBPg^Kx5T2j+k2D-Y39}12v4&MikmBOvZT~i)SIuiK&vd$2H6j?~#w*&CM zsf~S7Tzc66?K|-TU-}|ORj^V!Z!M^G45FzeZW0TbDk?qk6WFJXy*br{#Zvj zuRBfhlybY#@=3FE(-ii5&1_=1_DUF<1^fv_2vT26V^dM3`>dmiYq`E)JQ=#O4H{1b zBUcqcVUePJgc0jXctv6f3JQb1T7x~eZ(1s4VWU7|J#O0V=CXQjmV9m!QaNoeruCh6 zO~u5qda<{I>bO}Lv)gIh8`;~*^^rHt+f4cl`bMoQ!`bKuwvWH14Q91<%vb+J>`3`N`z)VXfUEo0P&ZSDyU;L_7nI~p z8a)$r7j9kaX?RR(x(ILPIx5lh;j14Y3mfR)TI^Nf6vW~}oZ zfed@t>KI(F^R#ot)M0pa=rI{q9Q#lf8xP202-8`66>;xGyu9<-s)+cpxtDR!@{yFv z9g7<3YjW_q0ZEfe-Pe=z<(u>k6>%)mN+-rYHD67NboJ+An&vY(LsYp@*gFxSsnDmu z{F~?hCS6^3FDFI8iIkUa%9%OUVGcmP&>}ra%N8;SZUf(AEQ1>lK$!KVac-+$oXHft zUhPHp_p_px_uIz@HFieR1A`m^AAzAE2%I9%*70qdTc5j+Is>gX8tK#e8eYSYXTGCWql!N`ZyU6Afa0xkx&&Hi$d~(eGIk*D8rQa^i|F`&T z`T6PI{`pBK?wwu~;}7hw1C7avhe>purDK*fNlh4Gu2-Xx_mAyDRrE7Fqh%?v2(No>J89-_t<$(Wu@>3d;74m?JrZz@B^}iU5IS*@;Y6-EXG;<7f%YXM{HJO$==8?#xnvYyel22TpeQx+6+wjTxah{88(KmS>2A@e=*kx4ACO1dM>uwS#oXJj_8`p_v_igmg{S>xs}f2< zdkc80fv3P_I|!=~rfmP}SUNxo$kobxy>%$-fa?qU0;+946pnQ9aQ#wHzD7u9v_G(i z9ke#_RmGA6E*aiMz-}4!!U_OUtszbZEGVxUjeX!6v;OZ_>!{xSG+;f5bJfhO;IFm` zJr~S9Nv9X%)ZBHH76f{r&)%Ti`nOWcb$yt;IgXf6weakeS@x=sf>8}Zr-Vm5@a{qQ z#y26|EMglnTGR5XMOAavT`lHzSBrT#Rw8^2Ik&imK3ab7R1+u7s~1QiKKiKp?rYu; zr!A*HsEi7$j^HE{-q0QoL*w!^1 zk2gm@hz2Ng2nKj*!60E;Gx&)l%8Q^6!*Vso2(hl6A_b1!zM-Ng288Zk;2sm!1?PG! zbRP(;rFU*}u_x9L(e;5xgdlyC=0jO@cM+M{3&^(=F(%WYo6KzXZYm1(5FYN`J|UChi$ft0wm%?T_)60PTx>>YxJj{soY zVj=|iRgjhV_gCNl>DwP(IkPF#!z>76w0w(z$(ygj{aC;Rw>8qM4hA7kbJHr1e{|JuHCoSe>C;LdXWgxPIO3`BsxT;;vt6Ij@8#Cq*u(spY5hDQq)536k z(56;yB)R(+8(uh^C31Mv8s4-{RnUUNAa=~@asS`NX_%u zb$k$(_in#{wlE%>W2`LotMt|zF480fuBc47?y<4h-p1wcfsmZgBCq)5^zm9v?ql5B z*3E<4T>-L3A{L>QNK=GJFRn@=~fu-i}WtC~*0d({zWK<1?t_A4F_XH+s;yA4(NgP#OK`E7IO2+Scwg zZcS$D@;c&<)BM3fv<9ErNHaN#(%G0|Ab zhYEM-Rv=`v-0q%TtBqxut%eFbRUKb%r4@&P!vyfUmt=CRm2oRI55KE1rQ@Zg*F`mj zSPnMHVw7>3eh5iyeK-K=hp-u!Er$G_)n80e4*BO-U%mM2*FVAvVyphiWVMIPGDYLh zBFnA?dqn1o>BSO<6IAIz-hYYuxKQ3|umiRYpr?}KPz7>cLMU;A2aV@S4XNryq%0jh zDjD^eD`vikOQK8FP|`FFH>C@=it$Zlm;mmF4tcrby%qLRVBNpW78n_qziY&Y0(^3KoGtdYi!QQk7J*g@#H805 zx42SO(=|O!Zz3M1H+`4p6LjdgfnZor2485Qi2TZQcpK6TPb`zm_hm7>XYM zsJ6;cOb2S!*xzjgK9RALV&ek@QX>7$-nOQBez^uTR z7$ZCRt+3Mds(`I?S0gM@Pe8gMK6CMg$}K~0sPdtE!UtFnBP&}H_)o{oOVQOpg9Dfn zltX_TQ8qX)-F8P5YPSbAQV=?v?>Y|O*fxr$QvE?MoEUgMAu?&oWjF+V`A1I6V9v2CLC$=i!JRX`F1-{8AFY%T^ z%RqR;!e80qT{>xXJdf}l-gb!R-pCC_*6BK;RQE_shQ;OAR8i{HN7MBZui1IA%;Ao3 z+Jh|wTLg;<)bvSl0mcE@0`od%d20rQlO&QLIsSP5ZS$aBlaNh)FTT11#V7*;wE7 z6kkVs*x=J0!wSY7&m&07r!`oo%l!5>`pnH!!BVjd)Ui6moi{=d8iNPfpt}UR^RivR z=2~^b;H^@NoUPJ%(A&auV<|`dEU1Pmary76g*H{3= zit_mn6b#FQL&~G-l69TFB=JkiN?m&z6+a{t>9ioc`eft+b?Dn6+&PgI8@Tt4I$}Kob zAToUGMtes#TMOhH0@|8n0#Y2~0Yx0)a}ZYAFs{+^ZUH^I0jM**iP-4);57Sz4S}0g zh+lKARC?H&R^_R2saTos$)HxX0%oNFP7xK}iuAU=0`X5^1o7vbB(*@FYqdRkq9(lv4_%>Z3 zGBHLYu>DY?8FT7m4gd+(-~rntx+LJVH7XX_B)>QS=mu2Z$U#9qHkO0WqrYS`Fmh)6 z@x={ptEk_7+C7XuKX{;cRK6jtQ1vV&!ILS{*`MKn^hioXD*i|WEfuNsOP)qdTNU$) z81>$m^nAW35`Ejhva~@0LBPvma&vA@KdLR9<4y_C5yc|6(2ZzOr-l2LksLVRCVJkg zK%HDxVnyoYsUO=OQ>R#BFrqKrbUvTl#KuM;(Vlw`hzZe0iu!GHn3z;LqvrjM3)dw@ zdA@`f^fX_=aR7I}C|yNt19Gz{ZQ9wAU z;PfWxYPA@GJtEkL!CE|sJk;8MsCBYUGbIYNUqKU+T;t4Y9fv|H_JmbAd(^-}N>E-g z3+kDJ|B;zaPg}2EzxnqUU&EdBn!8ep6UEXF56^)wc=hT(U;pqUu=xuMa}~Xy;p2N zlVWzoQXf7(=O#VIyvu1vpe_2Xg2YjXH(HUdH`1F4m3(jzy(CA2G#X6`&_);-{J1rT z8~~20J zyz&HQpKf2MTCmp3Z$IgY)u(EZ#-BV1Ad~ks$iz+wCNj}vG5d=0irJ;frE&8(bv(eD z{CLWnJ(o-(ZwxP1exZf0GIB80?=pcCA|CwkO5c>3u0^K(+_km8H>2AQYi6lyAS-!i29D99WSY(sX}g$U?8F4#QOPu0FtWH>-JB$>dJ!Xl9&X8a zJx|EyI@w9co<2br$z+eSgJ9&qzN}g1OGe=YsZNfMlLcej7c3pk<`ePe&>6@?gkT6W zl6R$4uavRtX1t{~y^DBPOGmkZbT&|81l|lKbgk=B5)qQiE{b_<<>{A{&Fnco97+J7rND z!Qy7`d8|=s= zh7a13t@8<5t*Oe;g(U(PG>F#)#%UB^g$$^dMZ`9mP_ZMOU@xl66{FOU6??1dlIC%$ z`_gI+KCf2u<R`;CUI&vD0Co1?J??%u7#E}EK|0S5_!HuKHJv=L z^gC?TF7qo!e+isj9T_lp3rvn>s{UO{CiueE4`?FI-e|pYW&zODSYpbaU5qHMqV%G8 zr=BUH<=`vo9O)nm2^I*c@SSSpmSp?cM+9^#V}zTN+M;Gu;Qm}9O|HA47o^&1p@62p zg@NKqDMC?AyXp)*5JA?8Jst=%>xsUpX>$UlYN&R~N_zD?RgbaoD1(hTZ?T%frjORTQAl}<%wry+@*)TRGQNwTRrDQy1p`)qOoUrnDOVPxK_F=&fC`}I->)yk z&j-34Qp6q&Ao1}!w-_r9mO2*##eeFLn8-ysvIf6Yhw7UY;HoLJV%S6jY7H{5{R97o z@aNe0Kac(_4HoGUV_PM%EHAIwjO6R7m=GA?0T(Nwb@r~N?(&egKRS1uq(CU zMBs+1*_BYU-xPmmcV>F zk;4q0c&|Gs0NMhgBM6pBJT0^N+)7j>4$pw*3YuT1qB36J8r2ze7f@RYcqVnW1836P zCDv#Oq3Lp;>NBOh^LQ3|CuxJ$f;^QGBrvSmlNAkx)AKU06I2G<79vfW?F&^?$3JA1 z!MI91-_Z&yl^mhAZ4>&Sxw5AoS9UTgNkcy6hu{j{`Nc2xMVc>aqzk}{&cYqw$hi0# z!~|%(@+W!n;MdoDM8e7k+8x|VVQ#HysqlqzZX3-D7}rqNf8O+q}~FgfJ;9qOf#q49d|)Gt^l zozfW@1P`Xx$Kt{%UwtEKJ|c6~cw$p&HJPPW#ro9*ZB}$-?Mv))_9568OQqu&iC*Vd z*Aw>tE0Itv#+i(uc~MNpL%13iC=bw5#ovo;naQ#j@-Gr1@E_CV)iz;YptKOYiegd_ zYqcWL&tf8n66};s?(%IuA9AY|Abo8V{-m>2o5y7I8JD$`39yh4A@uG{rBi%I+nh}H zP~yFwp0?!dw-R&Y;I+o#FHk>=tI|Rnt9k4Eyu+v=N^@hstu5aV9&=j_ZB{e3-Ms*o zpGpZRE3I>k5L@4W-$A<AG~U<(z$(aUIc|y8j1Rm-^%Q3wqAwMzRWWT@y~Xj~si#M*e(32DH2{6ZN_jtd z173t+-bHOFKHF^PEVs_qynDxBRMq6Q^B#oVLP&TkPgyUU4idX}ROM zSowGsi~JL+40{g77b_Dx=3-Tb9HUjv0fU_O1>Itg4FM1-J`ok8^N-mCI**w_siBuw z3C|8A?1DdyvUSF%zGCm-0UDh4q>n>IyzV6``_`25F3SW`} zF-UZbac$gDw&TUz6AOc!m$7cXkr=tV=4}|Fu=4M7gyIgOZPQ^>XWf6Es8{U25-kd5 zA1q5z7Z!`r8jIo##@rw+6coeGw-z>vrv=-X?6t$F2a4Szwlh|pqcbqjWp#E!sI=@` zJ*nwt5z}gTpa8J4kEV8-u zE_7K9p<6{{O%e+bBt-&|4D)>OAb{`Wc#=AAX5+{jl1SzDeCv6S2ctvS4V=m!=b?tU ztck+O*zyc}Aw9iFZSVr!;0)$RmpLl&Wb_QC&K6V3t6rB4peO6(C}QxJYUmzB5JXO8jqkQic1bRp#$(e2rsm=bk;J{WutBS(5>?*&O>)j zt|5(tTkVh%Ebu1kJxVURThpTW?boC`eTuzcdS8=Cc#X0`$5W}`(uUrAFlUjZWvTByxd>4!!| zzAn;nqXKV=)$8eek^%Fcl^3lg2k>}(Ju z0DR^b>v_%2{g92;i+pv{c>JgYZ&J#%hzktJHk)g|nvDv;t!P;6zq3X0=lop`=GG01 zY7x8rMU0T%xViwm)UXv3m(X9z%)<(Og;C}kwglqV$-k|q^M>WL8>Vg%>n-dr<~*3a z4xn|Le9c~1<%B}df&0)1O%ZCx$i#}hoD|D!{Qs@9b=IV{|Cik~-5BZYs$yGcIbc&b z5r%8e-M8gK`BpoI-+tAwa*vU5%?Ze^vJZ_nD=Hfr7Wyi`$QF7T+ruhup<@fkh$-(`zd30G6YVn*83dvT>iBZ+P?qDt2=60tJ-?Lr!&REb^% zP^z?<0p3gH77V9WUgJBftW%81+%@d>EE^OfXUKg(n62Z|YCRHvI?nE)b|vQnU-TP4)d;dN!Y84Pz+H5b`M?BIsB#P5xk5Lxhpx-ru?GJyuy{gakJIa` zmwn+?VjgLPV6MkUr^_K8(R&!Fv+Tc}dWh3hm5n<~sSO06)$&eb6nDeas~3=_P}=~^ zFaGm?_dArUw;%c6YWPYi}}q0ZS3Ngo#?O!J!3tLUX0Ue^r!4*#?A`( zc7mTGt~jfDwa72lt75_5K7ttf8~yXEA6|a{`nw-_53yN%_LCIJGp&aGlFDUFB+s+R zNVgI>dHI}lMBq2iwui19z{%WvyZe3kYe1WcfD*!IUCMj~7`r@_3zD<7Owq8D?K+z< zBD<{0MuV@)g__u^Ol;=z(U3p{tMa}@{-CmR2)|aIhrlU}eHR{vq-SMRk1f%b!7c)5 z5e`5_1t{NLksu^=JO3nphu}EEXk%9^4bkEX>PB=%k%&LGfiXdN5hw`(xQXWp8Q3J> z<3pQG3WQN=-!CeSn5DbJ(b$jfE*SK$gzF6P9Zf-FtVgYZ7&t-a6pQ;5sj=-p>0=;E z8G6&yhu2#yv=DS)DWzGw!8*p8HKhH-)^Q2e`bfZftHm}zOCd39!O#aA;o|t7o;w!) zBQl=B+@D#w$wDfa{U63Uh+Q?@-R;}{(B=^FBYMt}W%*~HX-PF4fc_S0_wat(Jw6UJ zoc%n^e%^gpr}g7{O^w%cYc0^HBItz$t~iz#7J3zVWm1=mEc<(Q*Elv*OF+m&AGw@I zol9aM4#Q!nN2X4k5;1%uStSLcrXzsNg$b+WNI1LfC>VoF!Vsl{mI$OBD-Lg~Q>2 z;HY^}Lg3q%sNp$AtApNb&cGw)Q95D|ctWtKrf3wlu-fWTQ|tTdeX7)t&9#U2)O1iIZ;& zELR_hi7MT4W9)Dy%=s9_0xg}r#VJbnaBQNn4{0J7Y|A$5R(tE%*Bvk2x zCX?4KkVvylE3(i=0z5=s#=#JK&o?i8YXaaa$H}dJ#_^ZDfIsG%{ON4A{)9?G6Zag342vGYMj05v7&=vr2CkxXfx(;5Ip+vNfcMT zH^IR~5Aa*_p{=_3@UC6N1ASDZr_G+^s)vuZG>Ot*3$%mAOS-d_{##Fbwej#}|Ha)# z0X-$8GI<^TonvQ&O?0L@GAN@9=RM?=}@FDvp{Lgu8@Y_Q^n??ywt0-S~x<|D8nxdHv zL=?}HXUQ=j#iOW#0Og+@KTl|@lxYiVSnRx%Gi{0^yk>UlKl0eC0P*jy)0H~S5?~rI z2k;vY`T~BlS74nO{UUk|UkA#;97Uld0;O_2J#&9x1iz*=@@3rDa`L2}@y3>8fQW-b z+H(1l&E4dh5yr)}#W|?pG=ev3}}qDZoy<--&3-Cu==xNHw7VkAM$gnAwgM_qqqhImFNcd<1kZw8-5J15YVL0cN`V3!TFWTIKg)(^Bf=Q#`1R6~f$(~A$ zoA*`&*&khJjKKssNIts+tH%uNhSv+QY_hQp0f<^mj{}yXe{``v{N2!*O%vCS=9Etw zZ4fbIq0t36EOSG^jP(XpPn_q$J#n>aEPl|B12w?QKd+X$JU=e!iC49~ac7RJd-E*V znaQfLKq1(ZXEi!lwZ1q0NW+$OO@$Zt=&KXNLO+PeZuXX(+yHlxY zR#W}s;L&38T3A<_9x7LS=d(&@x5jjCKmS?MW>diOtA_>t@OZc2?E*ILBh&wY3OhJb zi~#;e#-3YQG|m{2m|fAGm!i@gapw=aPoj(LI(?TH>jeeJcuyse(5(u+F7|MFmyaRF zA4!5D#3_)W86!}RX6YC%-NQ)jkY(3ILfTQ>8O{{`#Hu3vIY2T;$Y~byNnxq=tU^C`)_@C1sXH5cjdH;9;oFHfM2EY>+Wa}0he8-%MUWY6+=LJ zz)G6fTXQNzRM>V){X=W*>aT5v!p;ssU@03tQKglOi}E_#@tDE z5{y8hl1>t&zsV&+t(+w5S^hJ|)MHi7k|n#`Mi@_zZQ@a~Via=;VJ^s*X_;ItiuHVW zag$`}=z0hgc9;XoPqLQ)U}tjtPcYHY1LHkE76#OCkDaKveDH`|CVbW5$9TwNN-a^8 zB7f|Q;Cdo}AGDpIF`o2X*aS;w`$i+w#CGHJ>0%wtyM?n>umAGq+wWh!eDMRg^$0n< zo9)$q{`l(6pI`l%WjYLI`sS}+|M>cA@>zPsb5&cf&;pvqE457nwmC!Fv@p_!qcO9!I~>oruVDYTKO>K)aDmh03F_N2AgW#?Z7ud~!#^4gWz2O*0HGyVgT zCoA{^ro}GisQU-yfw_=Wi%jg9g>D%!SsUOp6{YC|NU=5SPc zJaZ9L&FGQ;^hJ;SrxQKW4lk_%V%XTAM%3t2ZZ~bi3ahu6YSKn$H6DX1TV*{0DSy@} z!+TYxFK%#ZU1RE>dbTs|2qKtdnEkqjzl>_E0-8^4hU=LEM^u|vrKwehR(H!G!ln?;t*BDzDar1~%_ss7>e6rIy@P@29P>*=_ zzQ{4)VgJe4q9N*MX|sKJ`C#H{k7EbZk@9v&WDIm@RJ`NSG!G-3rX?$} zTtb}9rF`uyqfxq4A)-8!%htr~5vG<*-*XydrJ=~)rw(>dER`3j8r01rJU2|6JS z=QH+3@L&yVlK@f%dY~@nla#H@a>>{$@Nu8uJ-{ju(L=9TuJr}G6sHI1EQmNhPYvW^ZW&gh#hRJr*{o+9G(+so}Hij~+iyEnyj2wcQ;G zqDIULzjC08PG|7I4_Gb9plZptw4JEdllOYZM0U=?;TGYR=>@d_6d|JF~J!|X!G4S&OR7WM{ zMPX%j^@{O2JeL<_UB0{V@qXG?Y}O9w-^4rI_l59NZuzN+cye=3qp`F4O`sZ~v8)Zk)0gpC8^R^eY4*Vib zIWN3pi;U4`#uu;-y#RyzzqLDh+TYO#zuhtCL!O{x{lJ4wBz-sq6Ix)^?y!JbJG3We z>*+(7neu@uOU?{^92lSTt1d(>ggxm6yGBP9afULCLTAl3~cU!7x z+UY_K-BjyHR<^<$i}5HlQE(aw^OA>4k98|pl~`?-ThdulOxhQBEfZLJS~&y?UO9oM zpd?ToA&Rc*`aeTGU*(f=w)?26=N_c1jURvI*jRizcz^sbS*q&pE{gc#URCrM2U@Et zTp!A?tw4R47H_1)t|X|E zVWJeQWa_VFs#jx?2|gp5LG+;7mvV#XM804;ME-_6GVyVA@VB#rxchmB{r8mpdH#84 z_h4WK-&xBLlJ=>mEV%X1`^>1kn|;Ve1paH7>+tOM3!Rspr>hma%Rv)J`A+*9%dd}M zlH$``WIMF70Slq^iPy`6@V0fXQ|2Cu2QB>+PZB5NkSMw*P>nkfEw6sb`h4;9K6u_i z*!p^b5>Ln~y6Jfn?HIiTrKC}gb>*OKKOutM_J0sESmeb*9Q=lL>b>pQV{?Y$FoQgw zHU;i;30~L*+q0kyMsWk>v~ra%c0i`(DQJpJorp-jI;xt!_3%fWzOcn*JZxa@_sq|D ziUt+8fB{o?TPLKjM;@wQP)Rf|mO=Lg$QVWu-1q|3Yc6$W2$<5Dg77MBzWMexW$466 z`1SQ{V$7F8#|i}|WZy!WE)BQsfm;-ADu_6e?fa2F;g zpRL**gFUmC#yLnOU6CEwOt)d}pl7Ba7?SpmdDYIf7AUmg1TxBcH7PFAiFii!$^ay)jl2zHYwBby`BzjCw4(Ig^_oFdlH@Bi~2rm+j4Ir zB&a98M-qM^JH{`A@Un}|Mp0a69@9w zBsOJK#iA*|y2zvT%q9!oMF{X-I_p^fV4~@a$$w!|edpg@>1x>BC0RYhJOmS(QI_~co9cJ_X+1I`4A5!-!M5EU3RO4lO81B^RtM8RyKGOC5*dN3%8A+kGI9K}`e zLZ(5GJ683r>7e!h{yGz2*-im&R9hHUh0DRIw9K*GSfh{c7HbqIB@YEMeG>oF(ND4U zbo)s)@RQwu8_x8nF4|BKXx88s{;y(7_{DX*Ps=ud{ha6y?Y9J^7!L_e>U4@i!gE=+ zs)w|ZEGPiJxf+Q-sZf>Jh|9Rm_M|GZi9qh2?_OPc0`W&8=}dt%etBK2Cu6jJUeD*n z0<_BcEPDOwag>fm#R6hp>KgIsay;u!^Ud{p# zc13*MslcGl^BYVfE{n<7%bJOg#GQTFaO0`Ln47Q4K{|xlwuEf7n=Pkiy3s9d$h`sT zYE1byjWd(F(QT9vwK60e8X94Kn7jERQ$M%`J4`9JE*Wed6-Q{wu=XL|Kg&Rf9Q~@> zDlCUyaR8jdxMm5W!z?9@ zn`FhUeDn3n$R}6do0UxS0j<$(&Wuf=_EcF#ZY}KHs3(H074i6H^=fx3Q=kVvNq7=T z8NAV$9>YE$A%{9Jw^bJ9;|8O{bNQbCdT+_NB=q!m#7%BdY{x4rG5Pq1&E=^1_(O@- zQ7mLoe<(6=9tJHnp-QiM4KqJ*tU_gNtRSlcjrV~S(jTa-y3andya_WXkZ{5#fKfxC z**%Pf88o;>+Yk*na8kfQtyr(X*p4qot4hnM%ujFY$hEnO#`crfbuu ze9ZYPtkV^5TiAu%d4z35tcUOIUZ>+XtEsWUl#LG24a8JfWS7~3jE8XRS&enV+8Ko( zsJ~D}S*sq46AUQn)k~G{c(&NM);hdUfcAtjsfx?XWoD_IDJ`BgdOMH<;s*YYa)bVX z+9jK0{sdS?J$6lS<7DS4A%KI`otxi~ipwOU*h90J#tq4GGR-J>7`VA~W=~YX{hAw^+*E@Kuv*PyO4dCe z{gl#h8y`|NRkcnZBX*YK5Tkw{eXQWDdWVq)DNxP#y-(`dT;6H0taNAhKZe{jiLB?Y zxkTzCU6!iCL0Cv_aszrVYRN_Whj$W;ign~yw{!)Lb6tvwV$2%zdpFU2fIIqVCT5J7 zL(IiLJd>wILrxYG)jRKKkX5GkD#+cDd#}yK8867b_JTCFca0Y$YQR8S)xr+v@Rm4o zyPjKJ_do9(ZcX2;o-GP8f6umj7{5)TccGp6RtvuCa{+v(zP}6XT{xsN<-&&$;bn{y3J+zGiM)JL)2S-$u4l{Z z{Bi|qs=o0Fo$tCT(izx-jAbl> z%}=*1Ra&5mh%bUqbj2eJtk|^_v?P4stHvaL(C~RD1iwP%27yQBMoNNZ{&#evpox%5 z0#97oI?-dfT>O48UKDDs0{IXrV46e51yZdvH1SOWpZ(Y|;N$WhvJ+HI2RpXMvJBmI4TvG!n=?5(Q^HhtUBF4;ySYlpvJ}^nlQy*_3=(u@YeD&1%YF)l|@4 z!A?72XC*o_<_u)x8pV6U!x08$_l1W;gW_`;%TRLyD_Q5is)20i>QF#753~ml`v6NZ zP0_YokHe=m5qkpkv{l$J=^heq7Rg1!q@nL&BYJ5PuVwVw#4C=2g&NC*@-+Bkw~#9@sWhx1Gd%5Wu};ZUIQC|1MXVpd9QGjaz{CXKufnUA{B2%Q9*o zLsAm;K77%snblGc`=1HH2YPAM*l%#0dC4f{3-$o$lrAKnekki%03k2YPcbqw>Pfh` z84|jO^-R+~Sb*x5_{!(JN+9SV*HzQz#^{a>E(OG__i~Ct)#1 z=n?#`y%hJA3m{cs+9y|IK5=*WC5P4EKJl>dwq_B(0@-K_<^tS1sa5vh?ykvsP<|jA zTK=x-^LT4?9qtB+g3b7{#d@?V7BCDG(;OR9{081fbg_51Bniu~!5Wr4y2fwd2xkVh zm47wNgFvUfdlBAN(n1H9Nb+hCV{g(?zPj0Lm+1yX2FD+(^4`pKtc_6ZC96@mKs~Vq zw2vfXP*L1uggzQ)z*tFq=7vftw-D251)#^}0K&Y7w!TdGnzkKDkYUB! zZYK|H&dBFYu55h)rf9Ut#`y}l0stqv$XENT_xX5?xZBh8Dj!Ag7>X{kN%20q0!Q9e z5q(qqJ)cZcRn@$h++4CG0D3@$zXan##T>>j2GbyFS(61WvU!$*q61ENHjV%V?MPK6 zEQ`n4JJu%K?cFK0)-4uSU|jsy9}dRFXnF7-*~P)XrSH-oMvHvDI{04Li5&ceq&pN7 zba_A>IG|=--yK1FKIc2+Ibf_kdlnr&ty*Y=?04-o?|Hg}=i$#{c_0`3P z;IwB8DH~W)@A;|SWWB5(#(@9BLmui!9h0ir7oCgYaT6KiBmr7@WEY$&e3SgZjix-9 z-9o>nsvy&ZsyZ;2!K$rS{2WJn=2xl0(=NAT$gdJ)v%xH?VP){@RNSTTHZYXG{`l4Y z)0T`Z8P4LX*Z>5bjbiqRKPF^%>cMnC_z~ZJ!B7*!t5yAI6S@Ho7CF^px4}C>q1ku= z!^Cdm%PY{(x?FALMLlDj4i!6L#O8=^lxH$+9};_t<8f|Q6DR|Lr9|H;FpKF=$B#MW za~&03wxq)RR>kK4hD~%AtAB>SdGDRNYF_x3(U(|SviN%3kQT_J9I|rMnUq=pOpz5( zOYRjxWZJvZ*VJuCEE5~#xhVm$ELb$7`DWlr+I$gs(vxjZS+x@q#wFz5-k8&ItB zVyrgGWk&44?Cf9uRej)GiYhi6YaY>f0=4T-<|*ZFO?9ZMTNu-c+Izmrxv6J0^Gs9n zO}e`7rWZ>p4PiQ9PV3O2W(r+aX|OP#L#H%PuPVMHmX6(hxK8>aglg=2tCIpi3Ao6Y zyGegF&pjU!ADMryFW@#Z4}x|8{hQWr3(lL}@p*Gpkc28LZEXA7OR+h?W{_>^6TYrT z`j!ZG+6Cj3kXeR>QY@Tutf)6+gX$Zc2cn|>uC0Yj!Pke3UOV1hP==v_8sN-bsY2p=T!$4;-5i#n>BY{3RCIbP{Q`aqIGpe1YY9g zB~8Y=KfJ)I(&tnjNKb$SmNRi-n$UOejy))ACftJ)!lkU|)b-1vsyc>ja z2eC6}7)c@KNU~cO`7B-Bv^v$c$N9=58CK~Hjp8`gZ?D66+P}`{*#ex4IWd5pR4WdlnV5Z4z5I8QgN^XYPw=R-6{2Smryvk$%A z{@I5oU!8xh&>YdaPG%&88r%y&%mw5Xuh2wD%s?2O2n`x?{Y_xTuz;XECKYN*Nf zrXq^ii{D@eEP98vo8*@_Sjo)G>h%3ii48WqE)$``rb&2n5%}M;MZw3#Dje(K7`(1f zl=YeM`t$d23(7LsCR85T_%q#>5>-^!n;wacD_pZEi?n8Nh01RV*4{xtz8Re9({w4m6}8VC3zn za$1sJ$H0qMtV&C_U2P_~IJ@SSF&g$+9?J}2gMpG;Lx{lxqi2WzY}WEXmK+O|0|L4~ zI9r^Y%}#a?*!sEPCDL8os=7|aG1lDKtFBs2FtDVeB@a)InD;4KGwR%hUcGC zx}{N)v#6{_ZmnIwnMpgm1ngv~FR}9+iad*wO{vyQD_3&ESCs8{wxFCEUE6%X^pN`hYvQW*{y>ONu?%(%WSm`lR>Da z3JwJFnA}riHs44&iYU@KMZ^JH5EW7`?%}!X?{&P`bco5$_2k-*A=^h&#G?l%izW8h zd?{+>j)RwVZ&2biuJH&OhoptIQEdQLBtE3t9m9yX))vkfUC4ZoYWh+I6Z2_bY=2+q z<{Q4PQFk*m-37z>BD>5#SR_sV6w^P=1Zh+zq|u?T7Vt5qRh!A&I!@#g{){&&-UBe( zcHb>YEtWKk4Qf~vHWKCV$y}~4L-S0ZV*01qJX4v_JkwXplp51EpJ$6uQTzIo+r#ip zx%((G>e>Dp6z^vsJt&3V*Bk#>5LxNp{IS-j^!#82CP5Gp;HZSJlR1(&|2x1mQAKDfEiE&G= zQ_I*5Ix|l_;X4Fb`I3-Yj+{&HgC{D1ZTRIqtv;!jMxBDPE*Fa)bt34~G!t)bJ}`)| z%(fNyS6?L&27|(=%RI!5Z-_xA1C3%Oa32MhI*8+wBNAKva(LTeKjiPvI|txrMJSi> z>PQVtk{SH7cMQ^qUo2<;^fX6j8TK#4X*l=#{39*`&j`}BJ^YFJdD6fWBZ*Ck>tH48 zBS)4l7r~-9u*{*#v+$-XOb~9MY(MaIi7V<<3*XLSQB>&~TKSLL$a zNwCNjIG!g5ejzPhzu)jC*3ayq8c+T_`7>>_h zXz}$mT z?gUMbJv8a~*qD%j<7I5qZ*v-1=Z$m8p)OCgJmU3OK_hLaf)YQi&HCmu*3YXbznn(v zx>MIvC#-$1W3P0bS%TYZ2-npNsTHi{;{M}mfL0D|?|G&0Z~T$+a1#U9Qs1i0eOG-N z3*lG6dr5v3wJaX6q>V@c5z>}fx&Zc)fa34sR7E>c+pxsA+EJ|y-j&1C2l*87UDNT| z2SaAjrx?@fIZLTtI5zk^eJ=>?Q&!k-!taYeZK(xdJwnVprj)VrR9qWhfE8BEFcvge zVbA>;;Dw{|aIZS0+3%a_76)w7dD*TC5Nq$x2HrS0LgkI)>z&qEgKpB)8Bt-43(`Z^ zo$X5tW=m}8OjdJ>+K$l$H|Qr$`|`PApX%|lGnd8_4O(O~D3C=qO6=_fR+qed(G!ef zuxJxr=g!y;()PjUQO54h*=m2BF9FUjnic!gd^yQdFl62b9dJ5g*Wx~Dm=VHM)Qcd4 zSm-!9U`+Q}i@OZ;FVEJ!-jlEP;h!(RV*h;%>G01Z_TMKx_Pzh);t~G$i?j7%uQ%Gq ze=gy_hfndxA^v#W!yk{?kIU>5{(E@|N$j6XcoXZVIKzjcc`Dk_hu)L+5im!o0VKjd z_AlsT=6vKIE}Rc5`ml07%;>|+`EW@eE}ahx`mk_5yrU2A><_JWgdbW?i8Cs}{?*T@ zo{L~1$F_~ETuA+yG`e2+-a|0Sr|jFg#6XZK7CU{tK$-YL2UF{L^#=yu>(9 z24=!(YnNP#PFm-2M;byCOeG`w{(NDmJ~lre+Q6Z=#{P#4@t%1LxFdv-*d=lBQqYgfaJSM4)mGP=4pA_-; zu82qLV;z!AH|IF5t7AV;Xea4moPB;Jn5oKbBw!Mg36y**pirr<1KoM7!+;({pM1=I zA3kOrJp=gE#OH_tE)>S3?_1A9QwOoPC;XlQR05x#tN; zCoDs2N^5v?$ZMDUW!e9K$^JiOOmJ^}_TjL1{<-dU6u!!o>#SEaqds%#%%ixWA)f(x zh1GRDx=T4Y+y7Vd^sOah3C0|i3L8e2L$@Kl9IG{)Dqk%XC&e3;c#-;97Fs`Y#gIoA z6U+RxI|1z?V(6h1!ctTz5H0WdHDm9I8dU$9K^2iLvbdHbL@q)%5ZM{w2Z8}lW9dCY z4R>4`W58(2rEH7UKBeVnOB=qE$`2+%+WU?Ge&M_Si;`_rLs0i=BW!CUsF~plcOJ_v zP;0#*=ztZcjHNX52+aLx<09x2`$4PM)P)(ca=&K2WQ(Gt(I?HJ5wOpP zUwq-pOu{3VWAD|Hi(yIU_t5I@&8hL))av;gR4wMV7AR;r64-*b zmLn?QHq^P%!l(Y;u`1;RCxJ zS`qd9iCK-Od;8}now#>;QH(#pU){aV?m_N1zPZlQG5az}uMz}PFdU2cfq-=7U2a^7 zu;tr(?ISB?zkT$ehDi=(?irZ{1cPXhd;PaRwBd9^N9lL(Lpz||^qKznsF4^R)aeeY zcVUi!ui#;c&73F+LdRkr8*jupQt1kJ$U-I#w4*0f+ro#3HJKC@satrFnF`QP+ z)5S7-Jri44?Z#nzvNJ@puQu?%*a=&Fo-f~|Z#eozha-VDImHVrfHX^J_9oY2A$5V6 zeOKhO)eABJXo-qjAro7zgr-#qM2)q<8XRp*EiX4V-K!irWe!{>gG{v<sFw<;<@0K#u3uBm8e`ov?h}>-dTq-J4UO?^eR+wFd+xX-)zWUeTIadn znKJkAdwc`%_c@qZx7+6-8QZA|IiX#}iSJ9EV31>29D)4g&1UA|S08vTti5=@K_Elwr)Dab{!*GNi>{pW*+2u3jg0W6q;J%LDtB2 z%!YVZ#$J;VHGSfyQ7@Xme%S+mzYbloQEvJN}JH=)xwTO-bdQ z%z@-l5OWkZ)o~1T9OIn&s)dEC^jdsUdi{=+UcewN@z-&L(C!3b$Q4{B#Gz}=ytIl@ zZ3ldkeFZr?i|t_mt5{YA(gwPneE5vnG|gx99HUnD#bek~zZq{-Rw?g`yx3(;!ocyQ@)FBP^Zao$Ca+F$!98xsbM<0ftQtCoxL#I0{NT&x56d?_-EL3ic)X;KBZ#iJe zqi5j;J!UC!^sKrJ@uE+$bb9W%1?bMM_P0;ot+$pDNgVcE?f6hk8#|Gj)>g(wFgL9M zRY)ro^p1{9e?16u$CyigUC-CcYvqzDq>Bu=s3W4&b$iTAbUfnd-Z^?a_= z_FY`e>Uw|~w0=ilgHDN4mJ`3gK)hiSf;30Wb_44n1$~KXbBidNAL|oqoPS1zhIS1a z>rq0TL9Su-1VtTkb5HVVzA8bI+-3b37K>p&Y(+ZoS&hJSov)LL! z0nGDl&Zo8WKLAI5y+eRWTd&I>IF#;UjL*cS1Unz!O2WV)zVR{r#7E3jc1L_j%J#c(=g!{YE+X1&FVzZHe}3(XxAIp z&$2t{nNaGbuLTQz*6TNC$UbI>LQ`MXVOrIE7R6}wGcVr9he^a{TE*w9#eu$0=WYlQ zk=o2Zgsi!&H#9gVGGhLZ`1Hm8f3rVyQXcR2lHGo?d*~VcE~pN7dsbZSBTDiGXLj^% z(w)D8wPl;-(i}ddG&8C<;}MedZrHBn+hS}@bS?O5Ql#YcuDKR)KHX#oO=ki|a70DN z(d*eI1X;T=Q};!3ofuwzYkpr`&gvP?of*#K3$}obW*G`7;y}MN=aBlYO6C^wIWB1g z2HL4ZW01$A;;6cSiN~MM$T^RGJdYkeZf=v9&rrI@>p&lB@-FH4NXkd`v-;oXW`$mr zY9+PB!-aj^`IvrK=B~2(a_IEL=e1Sl-()i-n|XMZcJgVclTWwX$#MNI^?RW{^?Tdx z)Q1M0dK~Q3<1KZ{QBH|1`)hf-)nQRMl81AF5WI&eYDPOElsEAVA(>MWQTW*5ES+W| z;=@nNd@TNk!VXHAUa40^Wmbw;4ThWf_EK>wycJZv!r!r0NRw`3^MrW9?+7*-d?HTI zjmhXg0ipXZrogTLBna$Al5$Pj!}HqK%<>PFR8KY^MIwhInb&H?@K73tn&(+w?{=IO zY*UT0{9U$)uGoKPt&Y!pnHYo7I|yIJn#H%MCBuS`g1_Kd^&P;4n#K4AWf!A&r?7x_ zH9L^OQunDM-Ce%k(|idgSNhTA-2&l&+7qP)cYK}+XO6!`gSOk;^;3!8+F}#6-R|-o zftiCfRxBT<0$ANBolJ0s%Pk1?BI$fSxxq5DXFc!LflfQ<*szY1J;0E4J;ftpSe6M4 z8J2ZW&A2Wdy0g4DV9Avg5`DFZL6OKfsG>HX3W z7NB^^QK#51eIVtL)3{4UJ{vC5*%f2JM*uwt+Us<&N+L!Ug*s0MwSibnfW>=jfanNi zEPTT5NpDOin-mAALS45RHf&Mfs_@swvdFqbcH2RQu6)~JsHAXOIGAj}vG{ahBZB=W-?87{rjS(MM z8DEN^LPNfxjq&qMVNaSe?jaG4))7ZeGcp(132CRb?Q?h0yEZcXOg#f5lcCXdINS}{ z1kf_>x7{d;dT%^gN?L`ygUzz)jHK)(xV)Gv9Q8NujMIW8zE|s92W?07k(aaJZh&&| zct|*xVT5Q#U2t8)IZ)_>6+VaDn<=r>s~!e<*1~ta4|E1wB9yfKU?%7WW;tuInGV(bNzNsWSJ zqBN9Cvtuermvfg`bqpT3G|+pQ=u$i)$WD0Hnv^WUTkq7MW#`V3xh)s&A$usv`E#3* z(=R!wM)i3O^&A#LSYB^`JB z7RVIrflJF9X13LNCRI1C^E-CS+mc788K&@VErI#=Q+tQvGe)f>B0wFQUxV)derUgM zk(%BCC3~XAE#T`x-J@4}ADHLc{p#6Azifd7-0EsuGa(?upwGi`et8+$ zyqF@KCO4}U@e=oWI>yGqq};d%qLUE65Ai_EgKtxDtyM1_mjlMh61Cwa&JR(VG`)&C^%_+KgU@ZJocWFDVn9(80Mr6Lb`-$B)@e6?PQ zjrc3bM5;w1NVSwG#OD~~j3#t@YVr{EHuN4pV{Tjme_Q`KptWgV*#1?h^T6PLz?@;pt99fVYdm;m#bo)MA?VY zB;=e6*=l&_%50_Xxv+DfF?FEmm&pmEp_~bg76Q%f?q(3jh7p*!1zl)?WK0gJ1X4Fm zq6?PS=lCiO-U}Ni6l<<@WyI6tKovn@Bhhg01SG&^h}lB&2F0!KHkMEd?m`zXvBNoL zT}ZLviyFAFy1gIzy81Ynv}3xXr4Cfy1IN)-Sqvv&X|2sWAvh6okF+X=`SxXFADrp4 zsy3(3t@EQ!U#g9u*`)pAbW?7vXUE2-f;}eE!h={E6WDYdOSAKEd{|m{cex&oVxMuT z2b!eRVNlYi3cwWEcUgdOlM}WpS)QNQ*=&?8hm0wfal@f#Y{Ao=2^Z}a&O0tODp>C!HOV}eei@*(gI$XMXp;6Vv%>0$L`ANe>u3>3$l zQ5oqa4qF9Xj_HqQ$THJgm?i9(qjcpG`Z%?=g}0;Ti0B``ugsoPMxo`%ww_xRxlG3$ z9;9Yl+9T9%v)R+re1FliQ&cFSgX9S59V)*+vuDoy?t7*xH&pMtR1__h@R%FG%hBdK znpOZL#;L~MiRAO_@4d`=H?%cLLGsxO9t$H55x;tY7*v0<@qXY-wOu=u^a)^V6P*`+ zs&l<)Oa!hMqQ>C)hu%tvJXXMmcW6!i^&O|3D>hl5ahemxLtlYvbCE==>D&loPyj7g zYvW8DE9qu1{j$~Lljg!fcXB4q2}T2@N|A@ue6SAT&8SGOaQr3Rq`Fg3DLJqjt#Oq> z3ny5QL>V}W^!Op%fjqmi%>kULGPb?_J+UhFoMO-N7**QeohrQuv{s?6CV^oSXm_*g z7ud6n#P@=GWW;6&v{ZefoPxpA<@DA#Y5q{C(Di!9%rpP2u(26^r=!`V`@$8U0-T%` zPMYvSotofEY@hpEt+|%6)xU+CwW|s>D_-sLp$fAZdO7E_&a}-RN^U;-(qRr-f>;-Cc zvvI)2r}wc4hV&+|>}>Xrk9p+wnj@X3qqp{!f;6l!U4@RMwT`VHi)hU*IGUM1P!&mZ zQ>>%udby(b$*k

wJ+#?NPDFCi%qy@%ab57hTTa-&S*ell z|I2NS$z$0kAz{Q=%5yRPuYfpXUGf`emH+j}ulAp|C1NGsce8Xd4CU;UdYoG4alD?# z>^>DMTWd0D7+%UkpNN_q_Ug;GLo*6OXk+rob5y=P<;}`yNh+?^*4`h1uCt-Fyq{SW zE&Rv-`Qm1k;k^l&PS5?BvY#g>WtFhwmx>&LEXBo7jB6R@co_}Zzr&$FV`XPR8izL- zdszE((37Rb{|e{1nYK_E0$WVv5_AYb3fSq)m#ci1iBfH?$Qoz^ zvITHq2z4pZq#!rjeFvXMf5~PbhRMd!#SH>2ME&m5?qT%#!2`}-5q}_H80c4`y#&P< znUHXBiN5$kzeMtX8p;2e!0DOY@Ut;YN9=*O6j|IaEIW--WT9UP@nj-#iH5+$-^n!i z!5K9<8uoWWYbTQ6KalHs0kB6hBmKnAUaH=)CFU29NE7%IyR?>!3znZ$3Vgm8UajO8 z_(6%Qe3~t_bo@=9CVGBALfy@N&VH7m3E1D1Z$4S;HNa2$fb?AZg1_n0IDeOqGwmBC z@P_pdIMNWWk&7qW}&&xD^Kk%T|gj;9bN80bfoLG+E?UGba!iIk8^kH_qg zt}m8xJ4;8`$$Wjm7IcU!J!Um7)+300l&~d*U7zr+zbY2PB|ClzW78AdaS3t?32uks z`|E6$>?A^KmRwE%xpkII(|N)nOp;MCWn953!OikMUCa_pK0Z!Zhfk74wwxEUG28ej ziHcN{JWoDPR*Rb?QljC}U$hNU%qYL@)}M3~>y@VZsGm&yEu|FJSYK zJbT9eJZ3E&C+t}@huqJOpC`z}Bs@BDvMgBbtMo1XHN3c?4zsBM9EpU{dHk>gW7B9g!7b2j-a=-4HD z#SfvuQ89sW!N5o9O8jIE13hOm&BzveGwSp%Rw#EIK@7S-TMY$mVfiCSMm>psVcVOrsdPyUd0WSl zbjEE;Vha-aRO#N@t5xgaVzrR4%^ox-Axzy>gI^OhZ77szdBNt-F951dx z&1`MnZiaW1tVh0-9l!uU*{Hj{OJ}dxrLlF2D=ds&Ewz^^Bq@HmX2B|7rCo3hi(g~Y za=8Z*NNlEMZr?9s+PvZcz56AgKWYF7&{aT+S1*;!uqFMZ@j%F&mzQ`t7y3Ah4oUv486P+qo7`|eRp7Bj5 zB`ubuLJatA29n-gGsw8Ot*udDUVmgF&m@>;YtBUKAI({>w3_2l=XenwI~<}j>uIdB zuIZn)4(Ma#vL%5gYmCqyqbZ{Cm=qi1X5AgsUtA-+TS?Cb)={nUl0Z5#L_=#2HKY&a zG?DVurHoqcJJHA5Sjbd`350xGX6&J)#vYQz4or4gEZ7~JUao*}`6&@)(xNl)-{xjV zIsw(FjQppWPmfJ+vSO!3Z_dGr00O9Y1~nF*gtpeAQ(}0*>3f~U)^cwBA{4TGx(TTz z>n`jc+LvMfFnFsRZudI$hjLeLHbIJQ+v-b}(Oh+%zqCUcdx+evr{&lQ5aR)&ui86Y z{_ovF{9Dyd;@RqND80Z(*;l+ldwV@}w%5bp_Ih}a+!pWoG@Wy5g(L2&kN{xYKpHOz zhF-R?s0XuG6cZcz>d`BawJwWSw!NM?EwiMU%ml(4X+2wo0~^Q#XvQv3rD_RtRJ1Hl zxJ~Mx9+=kLb%u#G%nT?P;}-lkpIsf%-Neg)dUd_b#_Fni5E3ex%^G`K&Q86634YP5 z6&GQ{S8qw^1KY4dfA6A|rLc+P8-SzRyMh)mBRFhU2z0h^3pSk-O`(quY1dA%h76(q zMV;B)W(WyGbl}_+OIvDS(0kouB^-Z17Yy85K?Xe6N5#wgX5{dikYoqO(~dZNu5(4m ze3dtY6;@AUx9)y#KrdQJG_&@_W9P2h%XsXl+ zhWrFx8u@7qy@v1i*KfXh{pR(L|JCl)dpLQ-NtW-rucYa|4s!&A;k2y`k$}1Ngg9(b z__3D9TTUJfG{Awvy|SSTbDTJEHA7Ir22;>8^BV8Hid){W+zzhzgDp*$vArk;W2c%D zlzE#^Cfxcb7YG=(B(**t408Xe7@%`ea9U})jhU>olyhKBI@`?pDZoeQi}eQgvds8! zV+BJdA8N7!K`uQq74GYd_l}8I=7SPZt(PK+l*|OH;WR(*)B}C6_BikB%r;i}xSiFV zy!Q7)7%p|LB(iTZ?<7i#^UGN=%kHd$I07AyPe8E>-l* zx_0XcIpJ|Xov#3~83qCFkLilNDI;R^s-;tOQClbq6q3Hz@V3V5jSuEn)MIZwC8#RB z(EXv?c%ACu;umk-LAnK#=#z-6^q^ErWvN5y&CJ`7W;s+|Hc@LII2!@V&&jx!Tu$zX zb+bYSidJ3SRb8&mVxKvMw|EV0a1Jb~xlK*pur{bzSrxbUCY*&DKxk<>?aJivJ6mR{ zv3bqBm3vpLgj{pMJMRE4RCAj5eo?T6HP8zO%JQeukD5&7bUEvB01kOmGjD{v}(c47+LmQ(`!&f>&PS}!WaCqoa{tOQx3 zjHo)$T;(Jc+*)otG!@ew$O4P1Vy0jS;&Hl4O9`ziUP@`}y{e!!@0;qbHc6_hw(TY~ z+3A>+$FWxG2hElGU*3y?w*J}48He3~iLtgUlrEDj@zB0Bqc~NSTeb9YgX{4Bv-j@p zZRAG2@c;T0ZALR9?UqbZ@?|W`PR?G=&N;~>PqNQ>c8^{y4<)wbwkc9WQnr;u``KSq z749gY(IjPilI&$HqH#x|P$*RW3Rj;YSE7ov41jrZg#eQ|Nt-k8n$-4&wDH-Bj-n5F z!YVIi?}!C2aF@`BQTw)GKdJa{rO&s{Bl7f=I&GuKKG+3c#qOHsq50>Q^3gp#d-(eU zQKKVryI5xU-BR49PaDkc$SGzpt%dogPmB5OqUZqpZl^%+OVGa+%j@xUDh~D)C^2T@ zpK4Zon$PxD#k;Y%#-CT>H<=1fb|NG3j0=;aU==oo!!#U&pX$}S5yCk!%*A|cIuK3H z=&2Y-`r+%?!qFI2H*SYRm=5~~Bt6u+d}9#sjX{)e3?9sa3A?+7CTN|_OOUHrs-%XU z?F$KMy^nK}T3X;Zu{R&2xM*a85Tkhd+F+>SXU{!f{UQ%*_2f4x&NKSMJJbU6x?$A3 zZaDnP(%VL4sEkhY2;_xA@6?1JC!3?{S=E;zuQ?H;<$IjEV zu@qW`zrd85SYFDIwYXN+hhAE0%3s){U}2A<3w!j9S~)+Ub%%X<;vNCMj)oo=lM$g! zx)CKdG&?X=#!Y0Egy&kwdL>)?JWKP`6Z^s1*v6jZzhRksIi^E2J3`)y*!e*!mPN}R&qTmp$bifn!3rRMA;R#ryO&RlN$51QB{%Ppi zKS|oj-I?Caz*D4cWKff3QnQ9p4FIo2jB1>n#ja`0koNS9tHLq7X~WE3emxhCrVHM( z7k%e7mO@XSC|jXMc1JBDC4MQCgX4w>58pHgyjoP=B^OdGbRAZ3ggmXis&t{Gw8-rI z91{N_iGPD}4>mM5O&!|QKo-)CV|wHR-6$x?D9X+CO=yIWGQKaGux5e-z;lTp^ub+v zNa&({LN8{PEnVDWl7-6FB+~@urhd1kRYtc|YxwW!-tOty-dVTLvSw%79_-pqvd!L1 z$(=R&81Ajn$DG|Y`ncBqlEofihaL8RNjvNx8|?34gAqWjzr`rE8{b`&!F^dAdwc91 z#owZjqFdr<9SxW*XVvwvIzH8ur{g;e-T@Dz?|_F}eg~9u)SXqIir;}wycgB}eOrn@ zP3&EJX<;~ujWfU&Ws~ zrU%0d4XVMK9EKDW+u`9C^B4M-(AN@_7e1v^n$(>NK7Dr`%uS++BMroIvB;#1lOqhs@V%hkHbO;E075TDVJkQ3uNi63wZ)jFZ^X^G+VV zx%=a^cPSb-rDjuIu`omi#mgY92n#GCP$Mu}pMSr*sf@-4{RWhsg~Z|)2Oc^Oh~pLB z1jYq5*NJnq5lPHD^^VYMU>D_#?86VkUPCb}+C2Sq z)w{_%xF-3N8RyUn{ z*JJOwS0u#ku*JuWLr&$&I^hBY0<(Xh6%LfZoPy!YSQ|do(tdsoHU%xT;!?pOo`xbY zM;^4KG&CM00jG6V)pXGd04@h7Zv^#8)|l*`dZ}T%m-mc8>Xdp3F&M}76rQv*nq;6# zqZ8c*w=!>4L-dT4ux#S~s!16WW&4w!Ws0-+rEh)h=`Z-S7#U6EQA1~kPxRCSpx%Q`#|j%tn3>d-)pbBfC=YCX$y_#r;Q$sJP7lV(lX!bclj&xR6)ROooDD8O_% zjAFVR{_tS#Xh86eP5zEU3h{3!IQhB1MOmRsUG;?pK)3P^bjrva>dqtu0)?zUa=Lqc z!AZ*L3ua_AIL@MkeWCidAZeVML6=senY$R^PowrS@R5vVj`|M~xzw(|RqWEB;Ma*> zdNlY)_|i7vOHGL2!7ns`>Cy0S#lg<3#qisYVS03!+Gz42_6uyW_>*sXYvD6#izPYy zx{*%5`C!|rL(3cuM-OpkS=GmH*BFV(zgZ_L$vVDNrTvFH&z}9`JWHHs&JVR38X6T7 zTsxzP?}X0D#B510g{aSY>zFmizn}y6D|@s*TKmL}%;8R35^6<23G#XV3pnOqd?SmU zAFTXaTjdvDS8~8Us}Of$gx|6dAvpc2#xNod5$fcq0!!z}P++-vAJ*4Ox8-TDjsiUN zqbMFaeR&WK7E!khpam4G{{9wyt(riV=u;YGiHV+o!`=oo(C-Fc@dlXgD9{uq5i5d3j+XD@gCWRv@4mf0Kz9fj#WXd8@FZ)9i zs%g$6*JlBI_OmE__Ot#sNUk=ygwj?6poW_Zv_m3XUU+JnvGX{iO*4!OojOkU{pf)z~c%>GEDE&*x$_RPE#0L{>OnR0Jx= zl-IE`Cnn4dr`6Ne3uzXAioSzqO;D?azGAcGv02 za(MEM7@Tv%MsMHAbOnLWEb;hvja-Aj4Gyt(M_EihLx0r-e7u&)lrMV-gD*$SfZ;O+ z1UhRhoR+U>vBL<3SFtZX&yM-3Bn45=Ede6@4NZ4K9M7Nh4W?X8xSV6{)XP%#x)a?n z&9O=LrZ_pl_s1>0qSC#N_E@c#A4Dq0QjSj4@uiq(?i9xld51V=%|63T?tdKN-_8-< z?tw&8K$eB#vtc)hNSQjlwQ%9H1V9$rmLPK2rSK{XUmS^|q(3`Mi6gQ$Gc28u5KYDx z7q{29)A4FuC)-RzNuTS2WB$dv+u4Uupom)bnZBAax@^|Y;jz;DooLuU*^^$pwpchi z_#ZjT2Q&(+lU_cjZ#D~xDt}|`Z{P=Ob>a~>g*k)Soc(`#SIs!?59!@B*M}_GOkZc- zNRO~FckD+)fUe0oj$)i63d8^GXzQFqNi4Vu5L}AR*x>2eP@^5WwaF`K*_NTuC0$wa zEl>Mreh$?=nPCuQxQ3Sy#`m78E~x?!ZpIln{u{6@IZ?bhGB5W-G%9eZ$_47bO{XEM3pKn(~P4f{6t7G?3`ThyE9fxtHkC|>Z z>UGUnduX{)WbfgB&yEc^9d&X7F%OZj9x=Uqa95`8SR6-|yBqvE4gmD*u8Qg8diq1R zj&-v(-KZnosKuFge4N4fFtV<_fo`w6^{igi*EG25+!ZXR{YRMr~e+$*{TH#R?>lxcyx1qQ(B`N3D74-$OI3A6GbY$%Nd zxr_xUV2*FrelHP+<9WnIC5jJj!-Hqx+kUH9wzsqTXLlb#N>sdskMSL00LiWWpo=7T zLL8?%hi-=ny4^i@Xtykc_&>S5s3zYCEnD63&8OY-*QahccmuS2`+_gQ!ar1ZaPX;i zav}%BPnKPfOHWl@3O1L=7e9xy{QPwH+`$)bI(wiFLHJPbvfC(Mu3!iF2Z2b!u0)TZ zvY6jy#J57C6cPpgYZMC5gW28aaxwpNH5-jDE~@2{+B-HJgBoChhFT#3Vu3*c&~GuG zEd{r~9??vw+-P&lL=g>F-dSePFk5skzL^fYKx1+{jbow*s*B|cZb&>|GBoF)6-kg!za&Vq*uneDt^p>_-l2)3yKH{Yt~dx^XGo5f;`sK^}{ z&f=~k{uDeGd7&qwh_57AjG;_(6gL;oo1OvGqu5G(EAVktKGz@YUQEY=^GJm6u6`Y* z#yUO5C<2ubqEm9Gz#0$N2`;BPC6=n7ZepW_tk?8qSQei|9_qJfxo6_FV7K{his=Lu z_~P!gf99O2GId}ZKj8uc&5UktSCTiV_1G{dw_zBWykJ?a0&XDEx)8fXoQH9qATmX{ z!UtI9M&_Vu*aCa7PZV9ivF*SvIUM9*`L4cPi31xC2KuZI2bCM(?kg+cVU!O!j7E;% z1|j!c`G}>&b-c-C`*ZC@mlFvI1}?rvS8Bd`S1qE8q)KjKg{YzCsk2r6VyrY&`b|}E zQ?xst*5jp|ABBYoOAT$!NK{ zJzsYBKv;NNo}83;{+5>Vvc%)Q9IsXjaorzJszrHTUDdNvZ1l4FjHEvjf4?o?l*?6h zQ@$==pOkM-%KcxLVrrMmYB5^98_y`u>(}Lza$hubQhryCu0(|^^&M+{TS}LP@=>Yw zRr$CCpz(5izAT@Xc+$!+BgE2`Jg*6M_k4`5ip$#@41fy=oU_$P?Fz|Z?UyH{RKJ{K z$sidj61g?o?y2B4B+IPXznmWaM(^D}$*sF*q={C21uD@*vgqzw>EcjZ&GiE={RFYl zoH3Ym0ILsY!VnJ#Oj=YIRV~(YBxcg2s*D3S$tpIUT~+4iYJPM1+59}ebADa`5s7IX ziFtT8pICK%sBdnn$;f)TbIv{-tH^rO^+yKhGs(|3YZROnlw0~VME8;ztj>?KOL(Ta z^BVBNH{m-@5TV1QcX8O_7>8X{c*F898bMgT7}}zBeRi)2!MrKCDV)#_bg6Uf8bgHH zycAwNgoA`f6yP}Gj$>bL5)UMFS@#4mtP3PCT0xtxgeWDXcp)N>%1!KZG}snRVoAV1Mcz0GkA4~%Yct(u|YjM4<5DLa#Xx{7({L)$&pPsQab zzz||y`9!jEQ}Ym}vY7zEbkGB}Q`cEbB3+wuDRFS-5zxK2Q7NL9Tw^X=pRTZM4*Jer z%dsyP^%_3Q>}??BHg(wmQ9!Q0FF^es z!m~=E>m^#8H$~pHSencp;XLwnchY5JxeB=^_P!&bLu51uLBVjx@B15;2_xoDZVc#z zZf!6dG~`@}5fh)8DVGZDoYz0Al`FP)35J9hO18{#9*HqGrA8_X%gCs-jf94o+mM-ZNmjBh@i+(5&&jk?hW#U5a6q{-Ih;B6SBz7$>c zjP&@|Ozf0$Ev$W8Zn*&ZQ4xNt=#@mYy%=^A8D=ryO`%1I=z%R}4ASRmfPLX%UijMP z6xsztnlOH#LWu~R9+ZxnLfCo#CKY5A63=q5!>`U`oB z8<+aQcdEBPGIjz>v3(&)Gga`L@B_|fvD5^u=Cf3^A(gZxrk$lNB}xH) zx613Tk=2=I5>$4m|2)4Q*E3Cuc3Z4SWA6Z~xyHuuMr}n87|%dseO0Z*JXYuQdY_Js!546Tv#**DFBBuE}@btE6FLr#j+7e9f7&4Esq_vJrPTKpT zr)H`HU*h15PV;t7PAkx4{vjF$SN0+*Gu#JNSj+lqmOLqqy2i@hDD}cJ&`}^d?n}&I z@SdRZY=ueZP}ci$dbcKk(1}t zBw2f85TcrF72|`mxy=||OIGLUJFP1e3IpaHv&+|~#^lw1usc3qVu;B3sD>F}_j6ia zI5}y$9*dK5RQ39{WC)co^b-#Kgri`y+q=l&ywFp58 zlcWX@((btcDeaVyr=+6}A9KB};s}85wkczCb9Nv*lrf_T~SZ3&#>2;dkv)1Ve)r#U9!$R#E z?FsX1IWXCR=VF4hS<2ROPbhxk&65`n812ztxdX?SEIBfMNcNcMLBN}mwMG*VwQDE^ z0Q~q*C-7Bu@>M@i-?|y^d-5Co*Vt59hE|}}XlrhD@lM?5);F*UeE^IZl>eoS*kdWA z1Wd#qoIw>>^65-q?891YMQppGmQ&IdP8Xn`YuPM`9>BboAcmKqYXa*cX@qHvhn|!+ zNUCGmw5UGSVq7hZi8itw$}k3MWBc<@KuEs1Pp+*FOx)6#%79dcWXIXbtZB_++p?oZAdE+w-2uRUP=R_syCg`%bMEGkj+6ZLFLPr!S$N&GY7H ztCQV^k9V$G*KzBRI~%bh2-=u8ytd|S;A2Td5m5&Ll7t_jJ^>)%TzM>GXGzWx=cZv7 zzVCWH9L9P$q#k-0JT4t7V=bRN6G3wjG7kD-!N$=~-$Tl&ROxGI2*dL8F=&wOa`I^U%f)X@s)KIMrPt)$KG_jUOE?|;2M;7`MIL|&3y57 zFF=t?ORlR4dw*iCOPhOT5FeCI8MEq>y59WVJ3jnRMMz)K-$BXa;f;w(%GGmFG0&&f zUaz;IpFsR#U@|o#j22<`oGU@|WvT&PhJSwk?fhaq{a?4&Hq- zVA=;dG}T0bN(cm@Kve-gMs=X1_z`-k3z4C7zNp3@z#b=Z)L%;-*#;P>tfA-x) zoR^Bt0JdwOJ#5aAbHq-^f4*D)bd8*h8kInO(Fvu(zE)r8mrDK*C;30h2UK7JO%Lr8 zcqkIln-&iZ^~I#{3QfTstR7u1<8lFW;)h*yB#59Q6{Halb+aU(K3l~qxWtJ3Dpuudbo+c#Ud|WNsZ=RzEtm|YjV*CGlrwbc zx^1hUrA8V3dzXiPD|Y=?6om{Su=0@Xv?O^Hhdy6aHy9WbPM$xl<~J|`dH5e&a?#S* zRnOgc8&Ck&es|C%)hmMXBvj73m!Br$0=-<77V4*|C2sEuEHym7y^_&0Jb7}v#tpiM zkrP~Ygjk)LPQ%dDRMAXX9hBa1(tlOwIHh^>l&iWE=$MET)pNVxE;m&YoPv;%cZ6C~ z>Q#%3%9*bx0i!M!)nHl$Ybn^;%E?L9cpfMYAV5qCu}y^pJtYzW2%}H+>K#}Cj%jju z`B`88n^v=l+e>J zMPQS5DZPFLQ@XgVFi%M)Gv2{*#zeahmn5pp^VF>pAYgt2K8AE!QU8vedxKFIYVGY} z;btMs!C^0-AHp`?bLGcmekl;S%u^;N^aV0U7OS-L<~nq=RRd&kx9jmu9(VI%lXRt& z>yp^~{1f44tQ^D=66St;O9Sj^Opp3iuoJR$MZ!#;f{ch4&wxsd*!h9JKazMCa9> zZ2mCqItj-n9HEnkOjglg)lFxTOjpc;^w$t5s6Lm_U;dIfHA6XaM#LEueNpe4S<@yJ zy4awX4dmdMm*9TpVSHKHx^V+@VH`|)LLM=h;<}>ct+?!06Vki+4?bQ6UsWe6Ks9Oot0nPg-elULhEowy$bC8E* z91);#rIkFZ02E(Eg(Y{=hz4AGdO)H=Vm8ep}9h}4I$P8gLUK32mkDyL* z5SX*O>F9O|T%)S6^?6rtwn*X_mxP?-_S%{vhX0_5ZBc}?#;TU=HO*sFi|T#wGC*mG zGnO)BaVab7S3O^;9}j%K9{#{`HuVc1 zV5Tn*e26{!$0c!-GmL%i%GeNFI1#t%6J{L19B^~rGmOrUM)$BF=n_85s#ry_OwkBV z?PECQMRCdxyc7?;1hYcXmq_w+gD3FY}gk$obTu>Gz4Np~{jEA(H#W~YC5x`O{3%2T+Vk2!4z-VCL+N40XE z^+RRS(?y%p(?Khdbp{v=oOI<;837isARvbUOi8YI

%{I^@UWNTzzriGwb2OXWi%?` zqNW|r2z1Q$TNC0YL_MT;TJL@KCjeI<>@w_i8j#*0Iq!_=_D|| zUCpQS@r2}~9mNXesJi~vIGQn-KUT1Pw{H&Uyd_JAr~<*7 zJTbAF!W1j$8mUTrHbmq)LBS`ay}}n$;fwB)8}tx9VYdnl9&Wk>A2jv#{m|dys~`D$ z7!4ua5`-^Hx{o+a@}Z@ZBL7+urqdpfjb3#G9%{{Q&f|C_TAtCXSzsf%FbP;y)Gi0V z%Biq1f(S{K*qojl2xCdB<42@$Fj`SX4>s@``yJClTlfpqal`ggJFG(Wvoknny-GmzM+te)x;PUp_YF#ua*$5RGdvW z^Tnz#O1@t~!*Vmn`}-uOq}&C{*nQ>)&1&eo2K=^l$R>mZEaoTKHdWlvy-YKhfV@b6 z9d1W%l$Ti2Yi(OHBt9>6&n!YGwzh zMbv?ZVprFotv4NyeY=)0)@ub?!+0+k9Y%pkCb;Ox1Q+G&L_&&G zLjiXp1+{7~QrG}iM=AgVuSi)$;*`alO>9cbH}XgY%I*j2h*=OF$6rmcrut&bc0(J2 zXA>rc{WQ6_%K^$%5d^K*MEp&kFruUN34f=sG;JhJ%15CJt-O?A`u5R0pPH1&yDInA zEDo&2_+mBs@JR}Y)Bz_Ivdxy_BI@U|6GbM7=r+2l^w89A?$MZeSZ3dF*~i-G12aY? zwX0a=KJ9MdEmttT)fl2U&M)7}cUp`k;k@RO4#hm+O7PO3Z^zTO<$n3N6boFwF86<3 zUR0tVf)p>yNi~}bvV!dg35)XNq`aKY#jmI3cjZ6L;l%x1{<&I+`t?RF$LGsZEKI4j zHjm21{8r5L>ytMk@fu!2%X&E)zbzkW;8c7@R`1Zt!2d10A-@KcR8a4fVt38(&H7C# z7`j-Hi}~z*SznK@#7I@hs`%S5HJ$r5oc|R36EPMyvQ_K>^`CSn^aJV+gBJxe=i@{{ zTCS+UoU(7p)%Pi+JlV~%@RIR)>a0mV9F1gDdDIeH zb6|bws>fVrLg=;Fk5QxCUCup;hnpi`;ft+yB5|B|p+*&0lvWAH2^;`}>mXML{KB&6 zj`3zbhG#6JlmQ;_s=!oGdUwxdrU9F2fSGpB!_X@SyJ~yu={fIt&r0f+BV-eR7^Hl3 zW&QnS*BRl3p!1^hr1Q#4*$+}42Psd3l<$I+?}L=T1}Xm)wq-XKcfk;Q?ceWitRU_v zDthr>K?W4n!sXz+DkO0g^=vgSZRBh z^UES4qNC?T5gqvDxSm!MYlLDGj)k!MD)ms=^b#RPibY?C zLGN2GCrzIlB`Db@$TVJ~khJ|t(;A51jaTnb_wa`w_nKy}pE-3PK6;{yNa@Zd^;NxE zw%YZwjCnZJ39R}Z--$0FR=U$-&hrsSlDV7Sl8QapEc2n;Qj-PJHFVsmqG6)NUi8}6 zo3j;bMQ2yJ%lnN=^8YKO{eKpB!KG-^97l9J#Jlr6sZ*hhj(Y207w;6^M(wyLD{l3{ zm_=GkW_Ri{GaWAcJAI~{H7PNJ>A!3-|NM+70?t(Y;k0>uz?uA_d(CY!XS3Cwsp)ot9^Ki|&XhDE~q z+Zy#@r+dbP<&nH|OB|VqyNFZC>f>-+vE{I%!Qp6@!Q{FX|-)`zuzT>I;K& za&I3II1NGbVi+4XkM-tsAT?68(5v||S2Wd2xxD9hY)M&hQ@fUtxGt`@v|xetWW1{W z0LE*T*lSD2FiuY{3ku$>ZNjqGw@Xwk%>rH0{Z81@BdO{W3kbgvPYWO4*Fn_48ntGt z-_W!iBycVHTMB`8!*Wdqtg|e|*1iHD71?=E1VQgTS6#}KJE`Ho`VoB{slbpuYGrn8 z%!YpCpj84hYDG-gZ^3$sx9N!8Xk3^0u9X$+G)fyx`AQyaDTGc4nd@Q$yV`mq$>8o@(Gx@h6nvy01PBwjk=vlTP13N3AvMbN1ukLwPs=4c=*M6p*z z2lzS+-}-)jN8iuytnX*GLLvuil(X@Mj&z)Bf~dBuc3RK&hY6Q3a1}^wMIgy~`Onqz z!kpXs@f{8+o5<>=*pw!p6i&pN1<0UHw>HP&2c-!3H!Il2+)bu6euOx(G+ zDM_ixPs1wh#6ZY{eFc03c@a`14OEK-`eRQuVkiA20?9@8;NDq*HTzs#ta{NsK9(h) z&;*C9o_sBuqR&{YP0cmenr!UN35{{PjVBs>z2ycY{tJzK_`JHRXWDvJ>Iw8C_;D!p z5^be2DnU_FT$t7Cf)bUT6UxUOt(X4_+n^%;$i)JjsRNK^3(g{V@ zBCI)g@sZ1*9$EbJx|oT7o;=|Ip%(?1X4OIhlQN0Bmfqq2<^-j2n)lbD=qvg6n_|*q zq8v`t;`lY*v*Vp?Mt6>?RizuXj-6XhzB*SVLw+j_)4H;dx(C1ogN(Vo4;FdoZdgIc z6*!d+-=06k%Bcuhm$XAA zg^qJcdPRA#YWIp!&-hY!k>RZP#bChv9PKVTY!0v#xD})!?eu5w`E2mwSkEBdp!~sS z6CXtXZYNlqxVuGifi3$SvV6y9xDg9NRV=PNBYQU^JmQGK-A>17X1~y$364R1%8VXE zC9ZEoAF-E*w^f~rKUB2!fdd9ONLzd3pEtMeC-GZ-np9J91#-SpQWN-@F$gtA?<%D| zHk#fJG+en;cjw~Q;cx^LtG-!DCc}6#@xF_c7~~pje9z#p<$5eI_WgvHZu=0R7r{Dk zY7y)Fz_dQ$IXzbn7TVWBsJIBu>*Tc1lo zV&x<7V0iqvBrY?mFU!Sz1uhJWu^{g8s{Bw@H;}x1cYAp`tsa%HvCi_*Nl65KdM4)S zb$L6he=h%8DzH5Co`C&S-D5Dx?qRAXW{CDMT< zu{?cR{ILR~-Qr`l0JFL!m~{W2mqqtY@#0|6E9SH5U2!Y!*5g?*zY%01sCiP<%HNe7 z)IYteW(Cf~fo>UIaBpYg2(K^eYI2}j`&V%(S6(0}Gl)X_%NsZw4pu*R3UMwLVsirRE-s#4%qP`VHN$`Rfp6@K#j38wBrOgu z)Z?dU{#=~T^=fZPp_R%U4gIifh-q z+jBu?*H1sbg#Qz_?enKE4*Ca!r!YD1mn1nIykGw6x6gj~VgI+!kA~g|eiXv+JJ|fx zvRG@0J|LDu3}ZQ+e}c(gu*8BrUcIY=Uc+jhSMYIsEh@C=;7>wy!D8aVwXDyIt{-I(pe)J#;HVBc^)pNmO^21TWURbK-&9qg#Of1~>K^56(aMbv>&I_K0$ z1P~J$;O{Y!6C#rU!QMdi|2=&6xu7Fnc4PH!ESKb0($quGo4XT49q+2~$672joF{@I zfjIh#TdJ8Dl~@`0hZgL7{QTw7%l@e%3ve;AQqGQdT>TZcbR)Q$k9e?< zceWjOtgAUL(VuS5=@nj_?PY;%+jIeLh?pd})9yb|te~1H$fYoo@>muecT$+MyPyaSKw(u4HhT6gM%6Q4Shtu1 zcXp`!kLrR-KNY%-Ll!cGJxW&-Y3)^ty)nVtmH1tKqRl|Z4K24(AiH|kvZ#kf|7sNo zG_k03rba!mbRiM{WhWzkAL@bXGdH@mSdoi&@QyuS1TW!gg!uJ1^7`y_P!{>?U*!a{ z5l!S&oz}xMscsd$veoNDczhTf$Dg?I4P}Vx_1dvbLTolVF2^@F(>uAEr+vLZa(cDc zA(I14OsYk+;+O2Pc28`EOC zhr<`oUliA(-xp&LmIU?J^V_9{z$5}&!U=jVrf(^ZGSdLbB(SmJo+gg?i}7qFB?Z;M z7+aps;YRi8U48KmyCn`NxJd}Egh!BASMcv$2{FU1UG<)XtGQSmaY&(_q+UsG0OKl_ z*AN0pK46LyQr2tr70yi6lUR@K-11n(BOS_~1E4I(kz($hgIUhJBth=nadX&a0@^n7 zIlj8muh+CF9%UU^tLdzGl*MzeND&5RT9Dw;OJGK^cNzFE2TXl>=IB|G-baG;2LV*6 zZQm;!OzT{;Omk&TEH0MZTFgOf8dtWe4SpESh{=Rv3Fl`!;N;B_lF3%kRw5hFSqEDZ zkgPSZB*I#U(O?o#$zD~`%muAz9lICKgccMa-46U$?4Vb&0NzRkV-}1-`qRpzQY~}D zk{3qz##pb|;FiDp&429m+8gl_7srZMb0M+USA5f&{)~n7uzhQv7J?aDj7!&A5K52V ziu6GiTf2X7FzjV^EqJ}w#vqP$xOKQn7a{*(E*S!xXWqNp9Ti`It_Y#9FX*Dce(OtNk{lJBplL5#vurYPYM30w(J;kY6@<6BK@8{i-#>;T`{-#=1IoV)oO=lCS(&P z4mE;Li18rh^K=&Q5d+jKb?@-z1jfm5fBW57T&u-I2nv-d=K_?+?j=rAixI)Bo+Kq9 z{TSATKcrKcAQ?viXSTklk3L30_-u+USy4kR^3v>r(7hPaj3v$v~W3nJc-a(0vz zG1c7YA*q}j0i7l5`A9u{h{KX1oe0_l>Y>L+SCfpdAnYrKRvOBwXsk``742TXiKYZ?@U|cvf2rKy4f9S(!8te&hb_h8Xwb3$MHs~ zNGfWq@2Hfu=Vr{#ONuCbXAgSsl=B1zp}+q$`@;eZFIIQm?%18OUf2$nmwOPvHaWkO zcwhY9+~;@$KN8(iTZC&cZ|L`lh}X7}w$CSNtTudC?8a?)ATHhrg}~7Qpx9-33K--v zLsB@}CyLc+X^|)R>tcRQ$SF#w*>Q4!7ZJwef#2FfLKG@60wsNuK44Pe|F-CZXN|e6 zS(!?D(U(^?=EAm`)4#e|uwvB}?+>_|(YiHSuXRjgzdbc7rh)SuXbxQt!etN9FXJ!X zdfrBh>La>eTC>HxhN!L#SS31seN#|CMovCCj-ZNoBM>S4aKo&OJ}xrWM~Ynj`qyyb z!qx}OrjXYb>zbozGccI3#Bcuz+}R>7(tmufs6+o&-J2xqzFAhclR0j*<8Wn_N4q^d zs|1J{HtU8}eBoYffnq|(pRuIYtzOXYG3n)+(uc1THd(MBStNA zS#zmG_om5oM)#T?E#x>h9!ALH zGvK&safMw&uWFZrH?@)A_YDNY)z-NCj~UP8bY$(*vlD)0#Fch1P>Uli77G-vNlL*-bTrj1-*MdkfNMZ%)Y@V5ivJL^mX=p1T@D$%_ z;#}+Tu6*tl@UM`AMIZ*}(}^EoxL}3P#y8fqxYcanloUrrH!XJO=)5AbZL&I^E&T|Y z4O^nJ6zpRv~pS-(FMJeOvFH$FYo%*^J-l^-(`a%R0z1(6R^Y z#ephqX||D1(Y$YmQ8n&mOTv%aW3}N-j=;7yU-IO;!$jbTySI#hCz1*LVleF9fcNWS z7O?^j@;BQ8^F@*t!N(~htsblQw2{^lajNA6gq;eaQ_GyEaz4Ds)M<0;@p3u$kZ~}n z?Q^Q{+rvFX%UAN`b2RKJ=Si9hscA(dH1QjPQYn42>?wPHq-Xi2cQ(E0nu4KtwugfL zIdyU3{WhwXi1PLpiV6EN5mTai*Kns)rY)O$2LL^I^G-6W|Dx_=cGULsP;kE4_2cva<*0<`%^M|W7TWfcj*Ae?tE(<0`F z4W4yYHzR(N|AY26L*Hu@Z=j)`7kaJhL4(r?Baa(!A%&?*fOgX;V4y_TG)~!VN&Y}s zPsF`1ZW69mJI}H~Za|`6Ak*=HEB)YbS1Tyo@5OBg+~{?*Z!A3)SPbKm1EPJ`%=22 zX_3UjHlzO4>^%*hM z4t9wrw!z3Xj?klv`ORI-{Te^Ej6LQ$fM!J!lc-=mSzux}P7?S%izrOaZOC$o!=GB} zcxV4naP}WX&;Fy}>}Qs`;mqRw8j`lqDNGg{RlbqsQG<+U=qBC(3O0^W63S1z@Eo-} zc-Bp72))d?T0*Ya7a^oaJ|#U5DCv2WlAdpmlA7TQ9+ajczQ#=_Cu_h{4@@z>3xI_sx&i;d6+M|LYM|9` zwsN_cU!OyOUojaz!_^=B%NVVYWVemovREbD=GB|U5DP%3sm)AJNeU~(3N1r@#bpt?^7>C4EYyUjMnQ}@noq|fv z_`4~;>Qsln?raw)b8irGa&e@zecb+;zWZYpY4!yWwv(JScl=KZhLF+9@gqz}(QAK+ zOoZ9JsQ~tE6g?KW9EtOR%iivwh}Q6Jo)}zr*`woSaCE$k9vv^&Jvt=upqK!M$Z_5& zqWf8|5I-Ltf0WJj`R(N;MqrOoRiN(BeKYO;cuAuN#6c`*otb+s$jmTAyCIOVj`R~&y6#z zFHr0os0{>K76Ug57}e^YTQ#r8Wb{Cmg^V8OTeP};Wzlfs+JO0yPsaqOoV&xv6_c23Y2YrR6xU<;d2`u{p+XIa1< zJZcSvG7#r1g|PJu5M9`S$?Z+I$GKH0$0CGl@y;qe$?ntv+9@-41AguX(YYIJI(HFx z&~nGT`sA*bKFNH6SP~hSkxB-Qkc`#~Ufn%blx7a|^KI+$J1Rm1{n5EMSMY zSy?mtehBW#85gR71>;D_t(qu|Z1o@Zjh+*vI72XZo8mlWF>MK2?(=P(+|rsZ13vpNskEh;xGIeJ~rp~*gw1R@@l@H``;}?6huU$hK}#E46P^il|SiM-FgD7 zC^6+C!_v1+ql*#aotT__VhM7fqE>eH?MoN>zMerBSt~NkDZS-@y@@KDph#_F?E5gL zyACxA_T7PV&jf&?8{r0B>ql~m1M_j$&~Y-amc?woD&CDhR>iMG)x~wSdN-ehrgsiK zVic`nkCu{%5XRl>jN0m%7vuwaLNc z9WuB6biihgsSw4-oHIq{Vo#GWQ2PbNCUgS56yJXzAXigH6UPMuX;F+aE<0$cMkJ@fqJ`)+oiFkhX00itM5P7z zn6aoj+r!ET(2Or0JPX8wXHoIs+4jVPwh!kGkL7D?3t>t)e+`qKT-$6<4KMSl z@K!r8q!>mGDTdF#nboehu+C(=8s7c!1Nof|U$l%^ZVLmA9r$_5HvjWfHvaNKKnkZD zU=%jM4L0K7vGAP#z}@>>z}=gEY1lp7K3@rVZ<>X>=LSu$R=%8oNlJGiBh)NoXA5S| zI95!)EW=-3+bG>xz9EH@vN}<9r4>pn(o+z0#ELMaW?#7o1ySa<8eu3J&q%#(W0(=G z>|}?K>anawWjW4Ktu|ha5+Da!D=U##mi45fz(c^Z&gZwYiI4~S2L}iJPA}~v@gObl zV`hhBM1IkoAbkx?rptOd_4c($33N)@);{Pu^9SE7*V2RbIx%yKF z+JY17a;5$j6Z38rSd{3dle{5UpLNCSQ(8UxhCV;O-0S%q6cHVl$_72Lqh~cEW2_ZG zOI&OvvR5w_KFfLD+r2>1fEE{~O=7a_UWf*}(voWT9Ieu{7)U-sWg$rZtZLphqTP(?b`_0srRtg3xb>uf5Z(%Ji#Rj5 zKn^GPvytcy=ZULp9yCq4?Ar-0S1;=07*@jtc8C$Zq(XNpzdbsW-Rw6N5BF^__0C{L z{;a`rE5n=({K9yS#hLY`8UCSbWT&`b2D7e-37Z3~4A5?ldQ=opJP zNPpbCJ3W=(UP#g7=6AM!NxkmHf@d--G6i%n&yHUvg5N?lU3XQCMpacOwW?mN$$)N! zb^URZ@y%5TnU-!c8Utl(+DrKmZWNf_aq!3vB_p4ORU{etfEFGPQCnrA!r7{x-BwYc z08upz8H*Ym%b;hNjWg-pyazaNQGY^9+aN0Ul69-D`%VS9@6*xBmqH-Fcvo}-f)s-u z3-+pA`(H8h6+{NK$o#J7&Eff?8h<$U>+ipct^?H3P=(Z8xpiEQm#Y!hK(&?j?o)dY z{jC}RI#~O#0G}Qzi$+GJ&mLr{NXihe0)?^~1hFkzu+~hDv)GrP$YOu^!)7cmPoX25 zw1QN+{PsAmgfwLt&F;qL|E>eTBfB~DwfIY#Afuq9HS|33I+c!u;DSWx9`%kl0YkZ5 zRMnq7b2m!st`(kDnnuymhnKwY4iH!p$<~Qn+=o%LdBLEI^<)_v5qx*Y11asCcUE(Z zWvAQnfMm-Zh6(P@Z^qNZ;Rx(hx=t2Zi>7kxm8{(HPjYe0f2i(`gJ3nP`tf9PoJt)tHz7z9d0~&9|W0=BCFks zKKQ=Dx|vh?#~Ej#zz(=Sp#KdytB9Cy7~?9v8eA%j5LG)d%Q??fyv;eBO#=Na64B<2#C-cvF6+=i#p zdWIS$&NxDTA_IxTe)qa+Wk|RcAF{w{LUw`=dC5X_`VxTkQr$Q=fngHaB&A`aa*dKQ z?UCAow`oKvjlURu0%c!YuLSFn&!T9;db_M9{L`x2(iR~Z^4(>O>2C{^xa6~NI}YJ0 zVvJoJ7nXqJAcQ&$S2RIITQyTdIE9`!_39#h!lT_}Bxsz04 zS@Q2l9R8z`5q@Fv@DgZFKyM4ESi`D&&?!gY+hHCoo$(*w^#1;`TTjSWe&0h{(VYlP z!DQomrw0cIXM3CvpxYAZk0!mHZC*&RG~<2J^K5L5<^*;UnCs?{rUW zGFi|2c|Ge2s@Q{#w`azFyc6}wiwJ=LLX3}>e>2m~$r`W6H(l3Vy?2~z;S~gC zb@`APnd_6boG(_R^E>GwAx!`}9Qd}cKRD3AYN)bP!4sLstQ=Q3X!(1mQD5y~)?H4O z14^Hz7qHLs4q_+93TN5QhXNf40L_bc&ndD1oj4U#GOv+d7BywU1X?TtG~HevFsI>)OxGyo8vSo z=BgDurH)H9{Hxn?1)K zVYY{OG;2RSdJjFs3@w{ic>VQ-{;%6-ZjyhR{|^0$0@5 zT$E>ft3pl&M1=emQE`cXz+0)y~<*VBX*`N1|!7tEi$TSjF3aK%q{EkB7BX?@#pu-Rl zIeVE3c*`#h(${b{ZKAd7vG-me65=t2#K#PNp>kzC5(GTqKzhg{`Wr@Zn#IF7rRVb6 z7imR8lpl(3Ib*A5&0|ZB3Hy|YOy#WA)2GEBv9hJ;NL7f8;@XLdPy!u=|LzaU;^5$b zehBh=H~%!c9?$MTD|_Igx=*U*h3JzwdPbMyi`9HlkEdO#NtJS^M{NgP=Nn=RU~sN2 zX(c*uScBS5k0suy(T+j4EqE_g)TDX$7_6rmwEd=9T;Hx3bYANNAacZLz{(Z}EP5?6uq;X`Pm?x|knY&K4&?N_euiyD1VD|7o*jRlQ#3c15<=|pGRlf87q`+ZjPt0+mkqjt- zf{%k&NY3I#4hZP>Jx%p{F>L6gp6d7ETcKU81*47g`u^;U8OVK*V&F|aDBjm=0hJI_ zDU)qD6*V}wU3G(T#lT;09mp~GB7}v9P;f1251ssg79F6(ePl0N6FBj7+q6g$@fxT zYf51trsnZum=bXcG@+0%!8GqT2`})=3M|mydQ^dpLkifT1614q9n|D_T`kRxk6j4; zSWidO2#;uh z6=p34Y+*BFX9;&?P9+sZI7~(uO~${JMKg6(nGrIjM#9?(l$by{kvSTGPIwiJUG@tg zl{im+z7^(MI(lAtu6r|y31QjC*`IOJDc%7*ty3(4nd2Ei1(!u4i?qT>WvRi zxpqGkXF3gLit(|G*`Bt$@LtpP%jJL=`z&DRvLuS$*8Yd_pVp`;mRvyIlZXf4^IqZ+ zJ=PlaTes=m=aqBTEW8ziUYIC^pP^6>f5i`GaGtNFY* zudm=4OHy>F$Mi)K0!^>e7ez(%sUOUxxF}SM(R4n)c}4SjeC#}VOR7l6VPjUn6jlCu zaxG4+9`VTeX8PhmYgFaEBp3jr5YPpghEYleT4bj0+KE6Wm6_I8Bqg;B*Pbt!lg|bh zpuz6%U(01a?ICZ_aq&z$EDvaR(R*n>94 z(R&|Q9aCELU4}kqJk3}cANG}+8uA~h17PICC@}Kjvo9UJTDje11RQQ~4>8UmC)zng ztcyuXMkEU_dlAF6Hes)6Jva|%`a%xQhtJbNuidF8aewR{O;^dn#&1_5{v zqXBpiUu=OInv;D6J_FS;R6IoqRHGk-;%*RlZj2)Q@17>`xCSwzO$b`2GjFcxK}~bHGn> zufFVVZ;|XSo1SKNbrgmSu)ieENs}q-wDht+G@CNb`Mm0ffLHwxZ z8@dDS?|+H70t?1FoMqGU#e7xVJ$FM~V z4OWbn7x7}7Zp4fEYP|A~GEDQI^cuiZW@ZFZ4;Sn@1TDgFScnt%hw)+sJ|Xm%u5;!Y zsw6b-DS+=mI;2iu0lkh3*^Z6c#Z@i_i+Y;xAOKxJqQ6fN&r(eSs{ig}SvwY&nj0rW zALr0NnssH$^H!DZwWS4CvcNASSRD1c7l|jKQcg$2Ip)GP*u@_Ksbu(yb8F?>C8dbK zU;K;UttaE9=Qvz`wRJ9LD^_;WLbQPdvzNs92JfDaAxhIOBJQ(uz54;9ojDmr7ymTA zzL{2k9M2~6>pd5$3f>u3bKOI6=Mo~CLx@%2<7Zi(7_NI{3f7C1bQ$gGD#{oPtol3iz42UZ*H@r0@3wSbak zSvo?lZ!@75hre=XgdBE$;gw_gYG|=&hq~D%wItqbr51 zWr<|zt~I5pXVv+Qw8M$=6&(Y>qR(a%)ZABQXPZKVaWk#T=2^XDrXEn`FcJ;fxw~`D zR0U9)?8oMR12iycs{)Rc5F;^)f~-4G%mbBt0LL3XL$EbDg*JK{x8$HG>g`6=n@-!9 z*EiA()tSycIh}hw79`oFoF0gO+_U}~5BpSF?ZYbsCtJ`~?00gg%Ozag4f2b!fRtOF ziFJv&&EUjucW5FZ49p3&5!JmV?>6_CAwyB9swXbBYU{W6DOa4~y*QoQ$XM(^!cK=<Pv)A3$><)erF`P@Mg6@LiFs(qr?W*(KbZ0J+T9}2C_zIo^<_c3$GgiNzwm&$gHW5 z#=SdUs%!yFerwLgSAPG1N15#Y`!n7e7^cl#V`pJtQr{GVexEOGuL*BY&EDzb=EZF$ zhbxaTCe$SW>7kZg9Rf?(fu^BFWpakm^x;FWShe4fSDs*-bt`^p|0O?~<53BW zF?pRa87%4|XW`8OJ-Rn+4)*GT%sejCn8cr<0lRe`BzW5e_-J3aT~vpMhKoME@a91$ zn=Dpyd}ccXoaFk1iq41eAk(k_s^f3fbiLAsDM}{r0Oi~GV~c--S8hs+YVYZDh8ow( z_^=v#YRJ>o9}Rq6{m~$%tEVqt_LZB^5i;MpqlOkrs#FyT3={-9CUf-m!RPtZm@KVF>XZRp@^D_mA z>}#mP_YoynlDZtG+4%v`r3?4_2m>%mG0A*g`&_iUz=xjGd_AEiXCr(PjB-2-pd79Y z>K(a9DlUMz9i@OfL-?yHf~S=!Gu)s(=Ttf!08{75tl#Ho)|eQMV1MRAl(ReC3?f=5 zd`#46tRPJGv}K1qalXw+pb?R?CU#G#+;I9g$W%qh6HgR00SI+H`}RB@@5H)-M~YtZ zm@SE^)$1Map==cd7CEh6_|W<_eA$i>m8$OLSqFr$0>4Wf-0rdW2abY7|TvhNa#YQ)&uWIy+%TF{4QzP z2F+{L_~f_Idg-m`#3mylG^4ohXh)bf{hZ)dj)j8cNkkHbXX_I=edHASQH_#hmnOP< zt`60mROkTCw@0uvkD1-`UG$iO;T|F0i$^`dcE9%|4gX$eE0pYL0gO;J_v2$gN?c(n zKIW(^RkmjJ5OW!JGbXM0}Zfu zfHS8X5&QBkjQP3JCYAWzznE1k-kT=(&HVaiyr`FA9p{&HDd>Lg1wqF#Dm#6>3%_2D z#Z_z4Nd^xwsHiLKI=B@QZof%o7)7jA4((2*2XfCJvw;XT&+A*x;jF`>)O=@P zTbocS`mL;&eMwBx&FK6tMmpk?T;CVX)MI6CLqLA92Ud^E0sH##mw|r#WmG@@@=LgZ zvF4r5xZEHT0bw_K{H(?wJY^)Lv{Yzs0!O<>wCao@jZpCw4vf;H$F#|kaaenqbJ*V3 zd6=VflY5VA>zc~GuiyJ}DD#H5$;%yRv%Qr>{dODblvc?XVAhO-Lqvq%_z|cRR@}Vf zqp8N=8G5Hl#^^BS_bydAvZ`QnzYFFf?&Ss_W<4lQTLGx1Ia zJ#PqkE-L-Bn9r^R1y;Z}3$Ut}VyNnd5Jix*l`J}5QHGj+cB{`Isa6x3t{w}WA_J%^ zxdm2mxQ;Nbx+x~VppMhRD;U*S*M?>BNfc270|{HXCu3H=*AT%L9av8LmKOaZz9U2G zz)JOF)F?uUaw*7`$)gryaT}QXe!Duko2^j49)FHIxOhRNtLvN9T{MO?_j(z`VzHWI zUfQK|?Wrdx{m@;^Kar>eTx&F6j0SOs3A~`qKN-&){NbuQD9LlvhDJ;l>Z!4Aw_64r zKQbRyiD)Yib)L!d&{DWG;B4Fl)ij7znxCN zC>uW`^q^1H$Gi+{*9B^(`np<%%kr!*HWe+3xTuR>1+G$z`mr|4QisO)suF(IJ;kgg_T9x^tIKK2(KHA3e5 zd9YKdQ)96PeTb{_~TrF zGZd)fsO{VdN5k=~=~{#u-c~quI;D97!StX-$(CcrQ$1_QUhGsTE`$!e04=+jIyWFd zPH_V1q|tcRU{Yx3%vG5LWj4~eIW{+u4Wc(jStzs_I0>sIbCJy?m>9VbvACN~94wgq z6-z{cnQ2QR${``<#mb!sdFxG?t?JqFN@hS4*smLIX}pCDqB1PsR2Z-*m)sc}NSXLc z!p2iV_-`4eZ5yRhTRN8;2RsZA{#%VK-S2VA1d2LMz5!PA`))(5Qi%4GlP{qjrcEV7 z0n|ZY3aFLt&rUA}uGJXi@VXYfyJ15jqc&z@3Z2=nsr&n0U$`&<-Z0;X!z3FinNR%S zanaftN)hKDjXm<#$qfSGl^-#Ae!JQ%B60+3ckYE;Py!-!AaZ4UcG!ihil^Rw7B&B- zFMy>ntMNSWZMRBuUEpO*XwHa{^edD!)x83~3yBgGBygX#ZL$*X$hvn>98gRq-Cn}Z z$;y>!tDy!=CD8`UX`#f#+k{rap7jeeK#T#g1y_D)g1N{HRJ87BX#38 zTPhl5;aM1E!C8Qu`?&6-U;*k9tU(3v7VJJa<(f3ru7L}zOs=hAx<8g`BhocfK@N-l zbM1u@5D5w3bn!I`nvOVqKFf}&vrJW6z)+`_vr*JB2m|PsJRA5MB+$8XMt}d_mBQcC zweRjh^Op;N)iE6LIFt_(yNiv)j>mYx_dn^Q+m@nMwbo>`|BuctjU8Ufv5Cy1yAPExDVVp^ zq_G(2p%DdVv}27f;~CRpU%OR zhxcTJC{}7r?2x#IWLUZq!2^1+lE9;BkUdnN` z)BpPQ|2KKE`}AN{EmzcXk9PpnrBd>Of*=(2C?LnquZf(THwx-1e z+trqDQEKS!BTwhw=YXwAuvNc;ewD@D{FVT95C=~b{Q0(CRK?!Kd{Is7^QU+!KE+WT zbQop$?s!^{6(i`3Z*Bx>!f^mM^$wedB4tA!=~te}^~hv<#OJ#n-*nK*aT>2nx1xsAjv^FvDm=4!Hsljj|MYS3KQX>0JcOU$;aOD-4qhG%i^orQ zY#s{x+B(Tfsk^+GLi|$s$)u>yqy%)nQr94Q#{wO7zP>J}XB!Wu2hF%chEsq_ny>8z(j@waO( zq$@E=K#+4?yZEz|yGteE4}IRsif;@Z%Zmr-IaDQhgWBCyzr~-(lBv3hIAB+|=gaP% zQSloW{GUKlzZIdeN-X^UREpd-!~`aoATtOoQ|*0C*!x} z_yO8rYY?H?!V*9lbguEY$FO5(-xpGT$G7o!i=-P=;C;OXB|-r`Qr zPA~^58Q;>~dZ*A9pE#3U%|PU>N$@3NLh9*?hxUZ~?sy?i!;#`m@_cPZ`usNuU8l3# zWC2Cb6cnuA1dxcPkVV&Gi$)rt(MkH~+LtCVGHnv-BZ<<*QNB+ZC?{9SK0R|J3mC^p zG%#qAE0pEGYHphZ&KGdw7frwq&)kh7<(@XfZ z+rlGO_$XoVDOEah%ObJ>ZDY|2zM8VvCp8_}{cN(LqYBq|^O%c+LOOuYFAKeXc!B&k zZ(iJSc#C!HuZ2HB{*~OiokDHQ?NlVoHW*8QMw0Y7#ey?52U^CiXm>#etTS$W|H??ZKCK1J%i8S(C1Rt;(f$t zYWf3}LHS0PQH_e~oqLxweaOt9x&&6F}aeE;~U=5#!C1k5v<=(^P2ao~0 z3w;lf>i|z6V z)8P?S+)7|Oo6Nj6?^Jda26x6sY^8jbX7kK-GZ#Yu9S^=pXHjql`;kUSiqe6D^ zPb@Tn4N@&j3$I&If{U;vdux*`X_;kzVs`R!sgO|gs`)O4Q4d41!1x%%&hr$+x(%Zx zwvs|svF?bU-)hPAqaZ$mS8;np7AAktDXV(vRAx3KP67k{$blx)>M#!c>DS~u!|yjN z3GY5@$?6`AVox?8S>tYAF>&eQbMl&*lj&;r`Iny)*JWOov7F-)V>n?40lewO*BwXI zY8(+=#>+0+v$ha!!;^@bpo3_~_Xmxm=+RI<+6cm|+wQKERl4S=YaHtdJ6N%1Kd>k5 z`cVgWe4}4I8LAO)>8$ZKjDiV{yjE=Fm;{27bAteaUYIcN$!Ke?sBmhkI?It5L_gXJ z3>VXCyl|%mle$}6Qlvdu>v8D)D+amjd13Z2(Ugfv&y9le@iY0O(Wkv_^C_X~BOkDexjlKoPO(Hj` zOEV}w5j-#E_IX?NGDscDw5D~Mn@1r>lV8YpW6<9w@jEtSjQ$~*Tjhn9J-a9I*`;?C z=U9n=h-FMUWP~%#KTJp6(>QOU3%|a*} z9JZBdGLLUph05v4s9m3|RB8sX+i$ooi?F|}1u)W<79#7W$KGNj@%6&bxM)XRJ88>@ zk6bsq1&2A>+sCnIrE=^Q3!l{KhV=(nEqTL&E$l$Q(&P`tIOa$SAeS z-p$yowP*5g=#Lt^x-w$MmTs>}3u7DX$F(4K*>^fra>H6tL<@%*$>gY$yv~vFvf}2= z$Ct#`+QF;oraXML!E+y9ZSXv%{iH7s9Dk%yM5h1dX#CILYoIOXe&MQKMJ^}gw@PR) zRY!$qG|p*@96714Jld><`0TVqxn)6;8?S#nq1WPbQ{$F}^H{~=iU zAEGP&!#B0^zGieQYfnIR!EFT7Nrg1*w^SjKOYDipS5CB!2H+mmVOqD9c(a~Wa8#ZN zs7uE00wN=m_2@x9Xc#M_d8QAfcpeVE>cDBl)Jnv3Vn~WScMA=Nu`NVjVippPZ3JT# z;k{g<%#HjnZDe4StLY^{!wHxA$d*E)DW%QlFlz?eGx^#W&3&=g;hg(*c=Fsgo9;37 zsEldb2u48v-_@Oz&q-wM0I`55emNKIy&}tB6ex_{Z)u>iPEVmg2WRdKj)z5cQPm&O zkq_A>U>atL^We36zsZvQK$JWG9DmF)+@cDWYq`mIu`rIkVQ3( zwidxwZ;;U<52#thi1q;(Fcw)Ef$uco@p7ez8-mUCTR`VN#gHdgHPpajP>vSZtXgeHwR}?8-C!2{jWBDYz zSu~0yAoSRvViuMUx~)o}c@QH6&pjLx`n5#8*@?6_o){eE{^z4GHYS(RtrHes%#5S{ zF*8*B9!Gv~v8ceC#3U|m$pX-t z&cG?{JFzM3bTXzV{7@b=EVI8+=dN&40vi}~r1DE->|yu3#83qUpL5#({Gxv}IQrq) z(6)3sJCM7^nT;n;5@%81K42fiM6nPqK!rd`I6U6PA%m0DN`p#b^SH4{?g21vJe}To z9L^(hm&`pL9-<;Qx=2l`&%Sq*Nc!S7pOo6d>eJmF+cfr+uI|jNFt?T@isqIa@=%&m3{>6G@Y~xJklIbI%w=R^^btvZ&rqe>IUn@-NH*lX9Ss9B znPJpSX85;iCga4UQwd+&Oa@ewKGEGR^WUu~P@I_IYdWo|bfaAa$roC$px; z5ZJ|S3zHJcX8hg;XV=n0xCB$SPMYokhf(I~NL{h6-JQ}STCe0_TnpUW`s zdh;5o=Zk zPKH^+irKLd#G6ezDIWow?a{=0-lGEoDtwEJl)`5As<5p_>vU+^m_79894vK$U(h_QSqUmWTZq zS<;s;bqRVXKijY3MzA&K+-7pd;PpNOrHJ%yNAgdqLnV-)rzJQgA0CYr2($<(a_Up}|~~P6##EB@;@Ep0o5hVfpHcZWPjav`P z2E@@|_;F82_?RL8=xmM0jAyFfbj%oA?LcRKAbTD;1uW={3kuh9B4Y>q8xQ+xGtc{- z92qAHnbiP0om?DJS=li-QrSbG5j{cKCaCs&%lbUy_`@T{IQ}q-FM4+Z)Q;b%4Ps{dd6Qg$C?2l_?|>_uD`X^=Y%!iK1&h5Ng->|yH*`Pn zFo(U(=H$=Wc42|W4XAtJcqr)T7nachZdZu)B1J+(Ji*^)B)xWmqT69#UVIkFi_fAY z_H4WNn8f+H1({G(3Ijg&iC)gSVusdWWC`bp)de`5XI+2?9}iH-*|st>uy(V=D zjK8^#IZr0j;k+&Vuia*$fbqF(5({#@EH_mE`7QeFAb1HpjJ^aOzWk+}?2(JBjdif@ zX_ie?$+L{I$U`Olo);_B`WR!1e^JWwPoksXweKkU+IQ6d#h5%M>{Oa4Z!P;oj)k#| ztA&lCD(_h-x}jPT2jym5FHDqkHrvnBw~*uHkpRH#>UQsMKF zcR%Hc=E!L8x`HS{85y(U=t77silckdE|9L1>Goy

nZzV8Y1fA|F=Oarw&&uNxLv zj>fBCa&-V*!S3_I=TdN`wF2mNAg1$jwW!7Lk5xcjHb88vSg>y3*Xn2ZUzJ9`;vrqx z@UKD4R`FqK=bFX>xl+J$JMQez34E@@>*|zfsM?$9?b2!ze$t2Qdggq=-*Vvguydl* zisF;{V?D9M;!=V%#9iFk0dE&_%2xGtWp@F8%XzY^npV-UyVQ-3W|>Wj_>5uSL?`v6 z>x2glmV3UaCs!&O?reNr$pE(hI-QSKZeUvzB6l>ZC!>-0htlA0aTO@vl#j~Ck1@#Y zYluvH39)l$;~9jYy#zny>a7W!`=s12uP!F#^y0ewu6$ZvE~?KM7`HB`6Zli?DY4No zCR_Qqe2q0ON$mnEPyP{`g{_1TK>+ZgN?Bf{1f z#4WZT;`S%xChG;cwS(EpaN@LpU8>ay@PglO7W12~AJG=hY(TLf#Pr8=(2sZ#kh!(1mAJdF=f5;g>`Gz!8d7c zV3&Y_%Z_ik>;8k&e`}8foV+?>qB_Q6$a3aVat6+B!#83{)RT-48+l zX=?=2lQvCx;R)Tjyco~+R)vfnNi!%-b{yc*dbXMu$ZtAvM}I3Y9~`GP2^kqycL{5g zgY{)vw&oC875G=D$F|aB-G!|y^RCNIUJvX&$F*t&aN=wFqASyIA)o`or9eu{e@cD& zwD=$OOdP=b%kgCeeF0RUrT2jM*FMrFZjEr(C=}#lz*~P}kccAFhMFy#t%1olZ93Lg z-Oa0>xmkN5d|=lS&n~fn8)Z{}XO> z!0~l4B(jG7#2GgokE30XDR&3!vcZNuid8&ueTy;%x@*Z%-OiJa8!|6*xclsIQBYnh zhHCbB_ct8x{(9qm%#OD)2IxjZeZ1jNAFnsmr|eLdf>FOyp*|mGyiYeA@6+|h`yIb? zq1svdD4C5TwuPKx|3|v1+_4aJX;Q9PLSDxVXX(Du2G&bcNsK zuQ2xeW_(dC-__3i8$o%6_0G1yeGeoE1EDAQ?3ETlN>kI z{a+{aJQ(*Ux4HeC=Kh-}jKL52?fiF6JC7sk9Ei@6$*|EQnclv;KB0xjsIhr<^CCtG z_!djGuQ-XdpEJFjD@}jD=NZN75&v$ydMEhqC-!Ve9h}&eKgwrM6$^qY89>j(EXjw4 z(2c=5#+?pNl{Q)Q7Y%#eNzzXha+Yztb_UZOJ&h4#V95PX^Xr>w_1W!v-|ahk=3EAj z-i$}N5tfQa(uSF7I62+-Ewpn+J(qd@o$ykx5H*C(T(h;} zago>PbSe&=0P8M_CnvTVLRS9f&6^YZp}x_ZJ8lG1)l<&|Mx=CSllrRmqng+%z`V=x<@kcsPFnOC^h;G04=0W}aRT5_ zq6&I~InZCR9y04Dt6D%{GU?f{CTu&iWbYQP6${pOGVscp2u_pvi(&ie#XLAO^-V}&ImMg6`CFfdBLic zCMs7LpUgkaR&#F=Fs-|E0Pwv~_LwDS_D#lSmz9<{25uC4YzRX4iEewCiT^))U)tWr zaU}d*zha0`;XoXK0C*NghM3l=>6?)RrP(%0g{rF zc%O|$^z>O>U0qdO$A%L#G3aLB*>K!dtb{b??e>~kz0&Q5@Ny!`mU6c5fdH6J22+^s z=u|hFH0;W*2D5Yi5r(opo~Cen^lQ4i-)B3QjwO;$$tap#%7L6ZEkjA_a5!pTxZ!y$ z?aqbc4FUxPabsTP+3RqC+%%VEv_9F# zd3xcM4d{zZOO`K3Gt>I+Xwq$4@tSl@iSNQ6Utr|VBQdnKt? z_6f7p`5*xwI3TvFMO}w$yi+bu@#)3LzP_mFKbl!$5cnN)OJ}{lxo1$YfXZp9ywbGT zt{B~j(xI>ut>t;%0&NxGk;)l;H!jm_{ku3$rig)^SfVXu=DEa68a`^*9~%#QeaOC; z13{C}#z2K~A_r{1Meowt6eugZFT&WHod~s|2|pvMtK-6iEwlw*n!>+vva(&7thCFK z6>`Awjt?LB;5#un$%Hs$PlIAsE!4=%wlTJu4uJ5)GtL2zhLNiW@ZBBA*4o(rI~a@W z`#mGcmw;;Hl#~PnF8DUb5d}o$BbvFA1d5XsO=sz_mvu*{0lb&r`PjSV(9dmG9t#6) z|3JpCh>Rwl()&4Q`?ZAixfa>?U%i?h z7#%)MIAcl0drmqG<%}~5zHYEj43E}ZznfQ^;- zk4wpi?_a5=zvV2bSJMHbEx@5xdcEozwNbzC#R4ej7|>Zj zB3&xOI*um&vSBVkqBGG0MZA+Fx~!})E_zT~)Q7_sD{z3za2_Kw3?_;NxFvaac_vkBF*?f4BO{Y;BwWl*xV=#5D5yv+5#C1}s zIxAz$UOL2yon+B4J4&*p+!CUe zdq0$ZBQ8nY*%D|(hoG}>%op6H=b_s~MmRA{q)OfbS{M#HmzewzXJcE2N?~>%bf`=lHo<;5Iiu0?;Rg7%6^c0ej-*6DWxh+v4T)sCBG8k1^(xO6yo@$SbwImD*Hk`9vuT zPwiPyteW_gvE-)gy7I&G*YCP755HaE;m8Mu*FW|o-Pr+W9?{G_%COJ+U<$QVdhlEXZb>KI z!1ETX)H;sdMy{4rJLX^oVv?Vzze$H@Sq}L!CZ?X8yfQTZTtbX?Uz;yxW^=oXl^+gY zuPm~n(R_wi(+MKW)W0m>#?f0?rCn3NQTx&OFWiVg{QXvQqrKVLXh)A^+Xh^W?an6L z#(M0_Vhcm#mFBd}qg)hSn=f*)`D6q)H3ll^(DPg!U+eZB&?^)-_Azv1X zhZF!FS^Jj-gjrC*z%ZWzgnb07Vm&hD4r;h}l|;s7q=bm}kp3Nk38oHT2R~ zq?O(eGAvywmW+5ND{eWlQNdv4__a)ga#`NtJ$jMr0G>r|7a?ED*4C!DaUUP$R~1I+SJ0+hkM}7O0U|GTI7OPaozeQDC)CNL0j4Q>!eLfj{u_ux0Zck#f z1XNvTCs8Bxlvlvh%*VE?6PDyUI$?zpXdtWIuagrF<8^UbcU+t*WD@;%b#c15cNZts z`+t;+(-Z09bWhTD(3DQIquX4-j;=5pJA1Czl8(e1^{}B`>UTbZaz4ijzDJrjRH5S$ zr`(>Q*(W}FRTl-g$^|h;mRpoH^unbI^Hg_?*Q(r@>rS;017b&gafd} zVkc-{zAdg6P_R_Y$MI-7KyxcEP{c9=yGbpcciZz|1JjkKg9KWUbjVD*pD(^_Tgdbj}v-E!l*;TBX zG*9NIr$Bx&nEYRRYlz?|@0j{R=LKo_TaWJ7^L`fQ+roW_|k z4Q&SYK!ag#lHrZOM)_tib0GsA6LaE);a-kj6=%fkdmMVtOpPW-gJUKGU!R_um#p|` zJZHLhEUUJdq60wpl+=oj zV*o3!7`#VQhk4YNhp%59zCL{S*Og$bv|t0D_N|IVmfQF1=dbg-j8RyHbNLtgsMbaIA) zjVN~3f|)x(lE&|Ap#+;O^Q1^d>Cc^s0{rNd#v#|kK=RD=3@-Y4pK?{gLIbrhc_fOq zwTJ!+qmy4?M%_Ul>#(di{)*%Cbea`_XFBiounJPK+;o^+pUD5R5@FiHv5{a*B_`yx zS6&US;SSN-Q98SO%9baUqPI<#S0b;Ss=^KMJ#|VawyQKzgr&^bIEk071^j#E$19Z> z&$rU)$B9Myu_PXPtsG55Td%=XDJv;6Jy zwt6;1ja>1?{qX!Rl|0p7cZQz3cOM5&(gPY}E4oA9Iizt6w_ z`5;`K&W)&k_`0AvGO|!TeI2ZUrXxVqHghJ(4NQ_~b3Is#nUdg>X~Dri`04H8_djZj z;037T=`=f?*2czGYh$;w*;;R}w{}`P8{3_&_4W0w_D*~2pwZqcO(TLS$0ukmyHLjQ zaE9?fKJca%lT`Xh|-Xw%$R75i^v2%yxC8n<_!BtlZKwq91RnbHOgFmF#-s! zCXbRV?VWe=rKyV!M%T&1WID^n$;mWJC%to-aU1}M*+~T?3bTu6%qjmwh;;YHB#_1Z zVoX9v9KqRO4smJjq*99WVOT+vwi>6#ezMaoe!%7nJ4}le;V@+P`GEwKv>UVsWtSw; zN{=9?;bdH+8KL|ObE)M#^bBSLkFTpLk52~^K%s~bDdLD+N$tejC_5!tU`EcjRYVM^ z#Zjk$t5IywingK%4;fqdp@#@6&HyXRG?Cb9 zW4w_WEwvBf=E2t5qo)=V%7TY>r1G8zC{L0Vd>V^_z6|uWgguR_S7=bf^3ga}HM*s( zvsd-ozb}+DY7!9QOL9z_#CK#Um@`HRgZ|Vp%ud5Weei1;?-5Zg7-B64nw27F@z5ij z&4>Vg6wia*M{rA~!-yVLYm361Lx`=(fjIwqR6hI|rwT6Zq7OXiSpo4%B4(qL38xCE z-WAkW7BHf#e#$!^nqQ9fPb~Z<<2%hbz8IIi-<8$fTxwz(T&jq5GqM=qb;2ykLg9fe z-CnA0JH#-T({^g zGhpPH)?7vgO7$Qyoem>NG5j!UXt)vg>c54}6MG7!dNxWq+e*L=+5Yht+#bI4RWJiQ zo4HK@vFa|&ZMfl8<>57Wov@pw&bt^^kL;YApcWggAZ;Bv`GQMqoT4?Mlg5B_IX2cD zaQ2kl=5#hI+nG7Ezeg>irO}U~lKddTkJ$C3@)IE5SUVN)=MsNs=5DGNnFqyD2$%d; zow>D=%PQ~NdE)h0iu+EufSbF~>QK@B)(S8;Uhdc3IExaL3m~d490wrtOan)FSQ}q7 zY`K`lynhX2@`5(OzIYlGM%7PyR{A3>2{N+yF~n8DWj&vuW53o$YsbaQW25z5<+WY5c*~< z=?R@k29l*!!_xuZx-yG^>qRAUgb8sXmSoEN)JQgB!f09?Qd+Di!^y1r4gwOG7Lg4k z7i3+=pky1Cxfa)}0CZ6;O;a~HSAbj{DJDteX)^*M36+LF3fyu@2&g!8ZwZcuqppleEhfjPpLHkY z%p^xaQ=Ay(!Y8FcF_Y1@s-{Fy1s%UI z;OL`{&Jl-`Oe@PJ7?V%w*zAnUHl?eaCH794;3}%#JK90fV{F35dVb4m9Qp+`Q9D3uH z={ro_EvS7FaOYrh^e^K3(a_PrFs^H1!QZzJ0o+G1b*95znrT!L&{u*Yz! z0u@t ztNKuY6luB;f_tC6VYbRsCSxA#Onf4{K*n`A;$5M14SfV9>i|D2I3BJEkW7%K90&>8 z;Z^5IyPh>0fMQE0@ZQC$t+j+#vT*JWNj$w2%agG~HaLP+R>;+n+P5y2*q3gJxbjtY zYk|8ny%u+;@c?n#n-eKgiX9|p-;P2d!7TyDp^+r)_#8)sP^_*ypC;atm;4RufvXZGQ6`8m zy)^7AeM2K^^DH7drWPD&;4>`*M1diQfOL%(A|S6-fPlI8(&8vsf^oiEBqRvZs$C=; z3@ad^bt3--P|%Pi%K6{xt_q}44A@JPN|xi6n0F?AlRk)7Tw99{`Cg;f0JkdDk?CI?Ip7~3+U%XdeNI-q-0ixOQg^@{RozPb)Hc+C-xi;1Cb0o#RMIr zNkrE&{xA~EPgoyTNV$``{VYbc99Ilq%wavqD_3(cpc2NIt*KWtExp-Xaz&bLg$80o zOz)?Rcq2XFA&i8)5&rA)MAil=^wd26Ghuq;W#WZpOxT~+LL@bY9O1+_!d+obiFq0m z9cBYUCN|+AAdq(sb|{0QQ##AW)+vRO9K8yD4olgN(rw^8jmQpi^)13XTg;1Ds=kG` zZ%ry9ypp6WrNbB>_uD?~l3Tnq3_U^z zhA~s(SPPPylF95^-c4CDu6@78-ghJnN!SA8;_n=#x*z(30EQCDh*vVq1<_ol*sk?l zw|_XwL~PQCytOULFYHnDyPMgcNZo@$t)nPCnQAG5lZa@m5iQwB&S2Ae&C3acFSPa*=tZ=SW75iQJ1(Q9K;FsD_T6Q)=UtynN# z-V4%A!?Tpf+j3oHfx1zR;90#&$%0OO_Da&cCg)+zBTb065u2|z6)-^~ zG=ba)DrX>K`11+eyO-H)(0iMGoM*#cW`;Z-a^mSyBHEXt zSAS>|Y2$>|!`i4&=Xu)Jg6DmIE*3MSjPe4h|2CW4M87cxWY(qVC=?r-dHTdFRI*av z^8y#0SX{MiyJee4v|Azj2=>J?0NL}ABw?v7w7I%9ey9zz8#J2OZXtFHGWs?e2ouv# z06;Z$8SzfPTU6xf0cA7V%gJ`p^xEF}47|i!u_kpo6jkhJlkH~AovsMvfG^CNwO&MU zJ+VGYj9z(cBQT-<+|3BC@8w+yN&_AE1Il|~#}oVveAldZ4uZQU;Rus*#GIv_|8mw` z{-lpbYk^{&{Q$`#y|{ogB$o{98%@UN=}%~c6Zoz|5#OK8=b%vv8a5=sh z^ajGr9P>D$Z8>pJ%xr^=SQ51nWWgSSEdI?sNU$G;WFQiQ|xoMGrl z)uSI?Ygba-e&o5|Lq@3Ww* zk>%fN@V&X#Y&L7GCjMd7_1f$Ohbat`N-oj1>nsoG{zYJ;BZdkkZwo>90WO90;c<(e zr_#yvJiX|`)!w%sO4S$4R$D%sg~5(vOSl=1j!_52JfiC!UsglJf02}=6 zF&j?jldSvU3h_%WM=yj*xUF4$4CUX&Z+{dHUu=v;VqZ{v3yMNPVJk#P3XC2x9nDcw zPO*nzNA(yJ{rPyMM8t>k0UmyWL061`P7kDv1``^`cDMvQd3Yt`Y*&mpyv1#pV7S5` zeZ>(%9MD3nUKwW^=hub8<#vc+Q#CY}O>t=eYCx60*5}(KgDdw80D=_8M;JvtkQadu zN+X;?#A20E)Oifkma+u|y?W_up2t1;6mf`h=$SNK%9)tp*oe4BN}+($N;)22V0d4o zKh&Qt4U>>fI%rqSCjIkM8PmfWQrD(UCYIps6|a~y4we1ysGrM-3&F*F_C`czASLdt z0H7z648VrvBpA9h#!^O|KjBK<2 z2I3`%hPkI*^@gL-?H7w^ifUcryR7W7VKyZ@8DR#RX~)<=Af+W!5ybrG*%m~+I9fgj z(6eVQd0jr6;s1B?vj7=Yi=|_?y15yKV6`lmgB5{u^{8myu}^$XKZ zBRRHpz@mF|&YJE@Q;U^CqZ~wv_zVpF8b2&d*rYuUN|+inx%&y7E9g|{Nz=(-cJmm} z0$CH&6EVzQKY8N8l#3bu|3(>1;Z@6GieCK|n6l}?l+Ci3lJDpl!j#RggekNK3!@6p zh;tX1!bd5a5SG!neHXjf2jQJoT8>*;RUd#q=dngu3WtMhE1SW55O;G>432(7J2;}xr~+Rhrzf@ zL#>ehX@#Pgro-6^P(4yohjJH-PPihU2rE)zu|wi72Zic)w;$tll3r%BY+`9qRe8M3 zgnV;zM8MFT4O*5O15f6GTneF80w4OJ0_S939mr*>qMrJ`U3owPxF9 zMNCazYBsTitro0kNGR0%&o$0M@M?KA6AEd-sghPrMgwSx&ss1@Ig&~sgD(I6WHMq< z*~-_^(cst^o&iRFXIZhIMi`HD#eHaBTZ?%7&Atq_K8@0gtMq0Xou{9&2xCB7jr92( zt&GN~&sGDr)mD0}mdvc7vQ>Srz|2Wc2U%U-i|p$bbXcqciIpUhS%Oi zpTndiG5Rh%jr@GHU0tA&2$uUGmkxcF6~rpajcL@jhx9?GLLTI~Wv~wgOwm_N4bTg9t~wp+>ZdPjWQ8Kdo!7j+=3*BicE`9Of0d3`wS`Une;`2yGv zJx_oMXKdi{h_Ii)=nV`Hfj`?&?_xBhj6?u*e+|+j*qwME(vFVJYV!T;6<>5c{BXun zh~IH^eCHi2@G|Cock{h0h2GFgy^k&METxBFXLlrB@5!@g$&)AaIK|?m|1ug3-FGT{ z$YKv$C>Dt~Eg8)G){j*zA-oxmyj(1Co-kg<51(YcZ19QLGhQ;f8tOlhrwaraH$s9_ zGsHsCBW2Qp#sh>ObKL?-OD*t3BImD;0kluk~Wx^sn(nfB^pSKHW>0vOntg zsCCgVSTgF=C!ExMZ@VH9|$wqMq{yFFL! z=b`y82EH;pHLHnGklgjHIcnDD9q`j~8SIaeytKtDm*lfK^zFufFxr1G+J7+GF7rW` zubp7F>_a}CS#}9CT@mu*q#i*ZC?nM@zam0!qb48YHVpDD1rHi!JzfwDkxc2yi3X*T ziTZ=n(~SICS(er~yT&^hu0Xoy1nl50Yl?*CvG-<#-cB-R{9CJ6vN*umbzLDz7E6GI zB_>&SA+gD9y}0a@$mG8{;*-aHNXOD@);lPe*m+047MsP0+}Gl*Y@R5n<%P8lF#F$h zaYgSL{8y@F=|`fadlesK0eTHEQ*Yrn!13AC#(K4{X#6gerEJ`zl|QfG%*C(&XZ-qy z{;Re^YvkM&D{OxM6Ju5?O)j@adH&|x|0OHFdhq+J6$w*DQtN@b z2d}ZK7^*}+q~n;seDQVs@4=gIetdhNCrIR9ULJh&^S64rjL^ltzkU7+o3--rY%sdx zmxNpdbF%0Lo*A6yh~kX2?AIsd_M%Ec?-qe43h%io>DLoVW;@jL><&emU7os=)x{tF ze7@NEYA$#@P|)AVMF9d(Bz_8haCEIq{}v!h8rIm>34`8MtM&QpR_Tb=ux^EBOtt3P& zaw@&}`OS*r9|DyQUcb~5jRz{deE#k^)LPH4_1%x(A3&{*a9Z<&=P#dsLzTj_`oA}a z?|7w+dN4^Y>~PKfDsVZj$=yb|etI*ce`m9s8rg3Mthilz-9E2 z$1apHgY$Mp^~8*6U6r0TEb`D6n8->+u^nQsjQ&X-5z*XM8d0f;t5-C)Q@B{qSB#rK zCd=QFPY(b>`RuUBa!g1pkmhC#4K0y}ikug>0{KwWbm*L`pavdx)-oBslXo_Wf^pq3dWNb^X^;uaG&^o0#2>rnu?2=oATDag`~r*_0W z?-;Ui2(`m;CAm*Gw#Rr5)BhXH&e<;3S*NQ^Vm0GVYCDdV>iPb%w>Txpi<_qeOX4ay zxyI>aHWfc6+00L!_|urq-R5X?wThuIF7o-14_}i^Qh(&;TJsEVhSSr&@g><=T8Ano zyHUAT3uh`};IP|>I3q0sZ#+{BHDnTJ+)l_(j>R(YMXrN?_S{^opPk%y0)|`_X3B0c z1>D>V;#VGSp+x4O7Z#RuSCWblWvI*WGht=S;h7?qYl*M-sqitBHJ3r)j0;27;Bwum ziqeXF*|HFAQHMywmlz%EyQ8yS?)tfegYZ_5B)+GBgCAe1mjG0=faHN(GPD7~JJUGu z5&%K6=K=&vt6kxRo`JW#(}SQkE;dwem^${a3I387!_+ysNGr!YZE6yY#?+m0G;=_Lp zeC4dfSYF-+yFb?6Q~-Ou!538z7XQJTuf3n_zaP?n*6jAIM(BbV7cpEa$!aWC7?=cM z5!2|#b)4EUr|s zr5td27*+Q;PqMS@daNS-nY^V`t}!fl?5(8f38|VJj9vTFq}q0GI>)+v;;8_oYIkhA-wK+9US`u~|J>c`Pa>1qQmH2I#FZ{uO#eUO!8-;sh z&&aKWb5dl+QX~xO=oIRa_oqpPiMs(F6f)O^H=B%w**hOyj%#%P-;dr;-VcvgL*06AMAf@{vGUjSE*m2d_D+h-`Rp-2RF;JwD~t!spZm@Q zH~DZSM_5dVFs~o>K%|>{-%`xjE1O-;BurjdN~%=^Qwc&d6rLHo+uEN8RuH^pD+(U& z1~);N_U0LVPk7W;1%_h_i|tr^p+M~_v_B7AIU0Af>s~fyug;Y2M%VW7U6fe@CX+o& z1(+{UqmpNkUbsRv|KJC)rI`un|GuvJ&%Wy9N~9Sb-A_53m47bScQA_dZSJf5+seMH z!Xzqpzuk?#%?=l9cqu^w8$e5vAPRI&_zUWS?|}>VDTh@sd;wvd57+a68r-eo{WO9e zemUo%mwdLuop>GwyA8W@ezx&W_PTO_G5~KpNk-jxi#5ZKPYc=q^q$HLYF!9 zt2jx|mQn(XoD1)c^j~ZoLklK~^gg_vA<_;@o3O}FPzDaz-UI=b#7vJEvcASDLBng} z{XAOW>8-Vf+Q4_<@2by3HZWdBxgJP;oSqL(X8_lL-qN#IxmxQI`9Q*{&JYwerpl9X zUv%ZReRbJqd>YV@9|e2V38S7ghZX@dsoyf`4WY982qcT+JanWQ;gqUVFDj`<_mR6r zj!-ML8S-U_t@RF|oeydE!AlnBLmF#ThO}&SZ;-|jDnhz$bhnW??4eJ^y@<9JnMa+b)y@Vbvli2We=#9G3m&LI?F;^>b?E&M?J&g zEEnLJM2tPW>~`HxD*r+OG8i)-);p3b{y{p2-w$cfM7-?kdj7?|HzGDkd00$ zyODGSaAO#_-dk_qy*zx4{##s8Je~C^-xOb{@TYAdL9f;8;a-0H`JLGf51MZF)5be6 zx1WPIZ_IvJifyZ(j@}P$Id(O=kPb;_7o!vIz6GT;7^4DP1G-uY;93;$H^tg@{oH8LKbzmMpPL8t&lW4)=B3-O%FF@g zTW$ud^G?S*q4k5inb+a#?+;%e=(Ay9#gl`1_~Xu--*sO<|KXqjq}CpDFs;8@1f((pkUcMLHhCbmL1G*Lw)*(-XzafDW5a;u#b*$w$3{c6-!EmrRZCuzBpGSOG-uS}*oPUVf z?2vS^?Qtsz*Kio3sLII*ZnJb)R88dQ&ac&jD=wWNFIrSHV|kj(*PM+eMK#GsrKl1b z2^NBlOfrjV@g&3fm6ShexDF2oTr?b=sG?db=tM!q!KkKRq5&kc7=^qr1RqF5SOfn5 zGMz1cY-Ff>#XInVB*<@gLjwfj5_p{RJ()JE#1(KN9o$u#&TKj!4g0Y2ee|Dy`c(MF zONi_z(APfmi)YUCEQdgHn$3FW2~RGNyt){rvxEm7;BNLjGzR1|&~D zPmkj#8_y7BSy{~f;htP>ARgD?pE;m;-*-fG4fBCV#@wjt5l|}V4to+NMIgQ0Xb-(@ z^J!R5JKRD6N84{ym9YJ)+3&)d*QGbZ#6D%1(7WcTCY~d86p1FNXY(O@Nlokq8Y5;o z>HxWL^yTA^eL2Qi4?LM!R#x<&^lNMLDOVaGv|-O5>t>Ib5xFZ)cS~;w0ulQV=naH7 zpfkw9k1zoB>^zGYYH=TBeVBpX2eV8z(9n}_LK}(8jX2aPWuYVY!s%lZXnJEje}#QL zJd4s{KYI8r>(%HFNb+b1C>iMGLza!Pi`gXYeLy3vt3e+mLhNol$$En+oH)HZ`fR2O z;I#q+oR2R0G(dJa9!(Gt-8IiH$LQKnVxhl%W-ER2jI7DbrBY5K8HKO=A-mCgMBNqi z(LI5cX7mtKV!V?idiV|e4=$94*9jZ@FCHi(UE|&viCqj3Ivrd)#l!5Z`)f8CF>CAa z=l|iTdpVkFpIT*6hN3R$!%~6X`qk?nUmrwv zpRe8mSN@YdiB~@yzWx~_Ky{4LpT37eDBUnh|90@^M=aej`~B(p3k-$S-ZF~+@9-ss zhg!FKesk~w``FrWid)!8XJ^kzQS;)vgBSnP1yQ5>>ig&4zKv~rK!U)Z*@)#6reUin zJ;iiPbj~nYny*`$+CtsR)2em-IcIgWfIC_pqbz5GPe3(iS3r*MXnCAsRaoD*2Ot){ z`>y-^&9^b&y1hI^|7V8xd-=)CMx*F7yHdx|SR`kd=+1>vw8U24DIWag9nI13S-BdJ z6{>bt_0K(^9Z{qGxa4%_Lq@c+zKEarQT2-9?4rxTHJp1)2Of#4P>RXMuwQH3&i#xF z1l>ER0<1~7wBA-%9dl)U_w{xSjc4<3$WK4M4dIO5(K9nJL)oNICPWk@7-riLGxk4_ zTFadp>a-i3yPqB3qQDGrc0N@hxj5r$u8{NXUHERH%M&po*B1eFA$YuK=VRx zAFtwXfJ=fY-xEN3F*0am^obf)jItEk=Ip#i*Y>pT&bZAj8HETIS@{ zc@}MM+w&eY8fFX)w#UHpO*4>SF+2~*PH_65@7A6ZUxOXaPJ3f}V`qJ9W801XQ4TOH zM;qHE7G-u6oea)u^_=(~;+tV`mT#70H(vOv!V+ zL=I1LDMU|xJdIZ#uHY*hy|4kPh;nNt(ZKW{rQ;~iy_RB51X?4;SIwTWDkf2qEQ?jH zXp46QDb%7_v!2QjH^AW*0!Za>4zS3uP(9c)1cGQdYLK&`)rHmrD|kP2i(1Aw7S{Ae zLlDPxPa`cEp;$`xah?r(*<(%uMfOz>DJ%g5eQ=s!WXvye8Ge(xu>Jn$Q!aa$AH{O) zsqeYN{%PT1QIuME*wsacMX7AzQ5%bnN)qD2!?qS37KP1)M{OIUva*h+Y~53~;VIkn zlx=y+wmoG#p0ZsFDqJU{Ul1!qzE`LVK!U ze-<|xpGRI~vkHggi3c&?|7KyPtH?voumEvq==TH-cvhZay7-m%pKT0w^@g0ue&9gX zqzob6yO950ga@beD-A$RioXB_%(~<}n+~RhSQI{_3_>nUty{6Aq+3y@M5&R9bnYH7 z*1Edz8v;Q<7;b-&1t`@?iFsNAY-i8E5u`=pIpLM;36jqe|Ds2_S$vJ7VMZrJW|#M_ z!70+{mY69Oc~|7DNNXb&o@86Ml#A!RC1;&A*+lA7GJ7+=oq?( zzXRQS%1T|#Zd3cWhgO%7ncc3WGSRtk9$EK|bEOvCow+xsxHr9`dYHjt&7SzkZ7y4^ ziJbJu9o^GS8$_=1ej&w*I!MMdLC&N#Q3MA5CmY^er7mFGN+Ek|i|$E44$oEZGNSsJ z{;ifZR$Ly=ASqA$cPv}@pPxqmkJeno;+7+fpC1%0B4^?i@Tc$L^9G)>xrJx!K9RV@ zjaFi*qV=2{Z1U`>4~C4CEXzx!}yfsWSAq-df_x9>qepNCV!cN<6pJsHx z5D4A*?-b3y^z_&Fw@WWzyZi#Kz1#Aaf@QV0iq>^qdSR!fmvvfZS)acs>!X3?-;fK^ z`esIFK)Z#qx21a4_x?YLqta{o;IpqoMx|?Cj1{}}2K*ivyWjaDz7m^Qyrcj#XLFW$ z)aWkgQCVf1z2lWP`ED4mTycBTR_&<-w+2jSRGp>iE0$i0*aqkWU z`BRTDo_Wd+JY{E|vTySh!{o(SN;X0kWiWl6z9u_D|1-WY@I4%!V)E9T9Gw(YaYVZ? zWv-@u2tm^))V)IM`Pe2OaPqg{plk1tp@+J?z{r_rWZ%yD=5)Y4(J+Yg-OubSIJ0jn z&CENpaH6wpjhig*1VE*J)IKK58kH^9Lk#0hlud^wIH}V2fk!m88Dr@mkc5r;u zSUuja$K*R#$23SQ%k9>3$2O!XD^#T(!RWa~yVlmC*P~f9xEx<(XlsShbh2JLhq|-# zY?1*$vS>JpFv81}ESfO}D34Boff1X9j)Tzuq3T{4bN%D_KPX_rKhl2)2SU~Dln-o9 zZ7^hker~dvW%U&{*XwyjK`HyWq95&ZP7D>mXl1v`^At>O;`&kRc+Z2X;qCwdYC(ij zom1Y!z4BHVOnKKlos2GDaF5AY#dL|uwT}h=WN(BN0h0O0t<(#1kZVUA&q;exQ@)2i zVK59^9pNcWd$VkkYs^lT=Jpst&NTUL!dk@ zhB6+$KR~<)h=Kh}=NGfbck5M7juasg$M0*dc^+`;W%@%b5_2GLhIQY_JYbb$h|VxY zbD~X@+iu-vwk%&;be?mZnVooL_(q`ntC< zn23R}hMoY3u+oc}w(JWG-K^5Zu~m=8PCRFSG~@;29}=sPtYY-T-UZ0W33B%!oDY7@ zl3{j*K@4Xpkg;xtYX-`Xv9l5k5ud1t)3XVNPUOU`n_UCLGKAXcY&PkpJq)!qnk49u zbdk+Q!)}jup1xv)?QFs$D^38jr_fdeVZ>xP6gd%x=g61z=VSH(XDHIdBr+cli_|ES z#_+#@*Bg&8YNO=$mJ*!&g(EK4Pm8>ZEbi#?r>G1Xa#_}GO1cDt1WzRrb1 zWyAhZU{5xC_7f!s-W@Awl2_zY@vA?-yfi{Q%6O7fEvXvY96P5PD~++kBpOkA&1opb zkf|&o1ClvR|xCy;5vU*{#a1&LLT@JF1=6ot5m^ zXgnB#^gNhNYk`QH+CGMxHkXN1=`5&dha!NWUmPcCS2*r)tWn`kY?e?PpB*3!tsU;i zmnu0Y#T833AW2!YVo+C1&<4mt&56mTWW;q(mMV$c?0VzwdWAQ=bYz=18=usUVt5}aGD`>3>eQs0+U`*m#0~wcY zt*#Dx-3d`8KyzfYM}9>V>;aqf8%+K&4f(n5@=hk%!&}0NqC4PFElvgFB(7qZRI~4# zS~wA!T{R9REhALGxyh@NO>)o7WX98ens;#wN6NUYW6u=z_S)SYlQ(ybdv#B1!6ZBC zV4CnObzsYanx-cZ4F1`(%cuOq)c7I@D*bB#mL&ueG*YJ@;e?lcH9Hv$(}~dzbJFoFv!O;P&pRX0uGVvQlQb>%R&w=A*#u{`KRpo) z&to3Ykna=9d9jg4smU<`uEtsvvmZ5z5l2*ZHL5+U73O&Y5zs+EQ5rMOu5PC=)|SE| z7fWwgie!Q11B%faas9#5$OvjIV=S@1&8QcYQV1r1EUIc~gmklFNXN1|imlf#cUmO7 z%F-uP`pv6XmJSsrpgY`}$<5`CU??aBy<4Q2w1HWiY;v)*lKSq9uDa7Xh~Q@+g&K*f zzw}12$`iAmXEUv>eBs^7SFn}lPFm}Pk&42AN&W`e9nZ*NBr-;3Ycj`QHOK#KE0%Ei zl075RyaZeG^Sf7#otm$A-v+$lh@{j&|f~i z!pv{eS*1Yua)z?GHxzzO?l|xBQmM4jLb^6rD@y;R7t4iimIRI^`vU&EpH9^Ko0PzL zNvNS!4fFKy>wa)CnB5qyW$rRA^BWm*{GI(QG_fy6!%x`+)#dUdUU*L0JuTM`WhGJh z%#=!jQkqFI{)ivKM9H#8M^XyK?=ODZ+HAGjwc}&_#aI@W@c#IilGbbZ(TOeLp%W4w zI-2mX=!q+FyI4u17fTQQKt7|sOFzKnkFST1qx0EpJbk>jb~c!u&rh1b=dGP)lhJg# z#&X!N!BkGxPB%OK)6@QL|FpHSv3at)-fQ)CTU(pG&gsr+>vUu5q|@8(?51lJDzo{^ z^iSWncQ-d0-*;N;9c^86V36_Hh^O~G?Hdy7pHQ>4XL2dN+s&wv_TOqZ2!nw4vNSKn z)zyI!{89`byb&L0FVV37>e@i&m~3*)3sH9X3@@PVSFh+=lBG|e^q|$Ud^4eMI9M~f zzM`uXUrup_R%G2JW7YQC5(Va@X84TmJWE*TQa4AZauiT|Efl?i0>sIsu}~Z9rM@mj!+~(0?uq zx2j-cJEKSvBB;SfE8-TL!!`uZ{Nzd0Zbkpp>NX^ZSK+TV(5jXbw;92mLyY9qPAvbGS5=q)V$tQ_EAT9Objb5b(6OYa)PN$%l%<8pRzbWB zDB*-soH3cKI;yQj?l&>4N4;NK6l!mMe^4`}nsr;MSr17y>;HOE&0T55@-$)(3XqZT z@bpwez)(d%_nlnD&3z#o2g@T7i|E!^_RWDMbIYeqrVemBfp%TQ&Xu|=cyHJ!x)DOr z4Gl$o!1@C}i_oq#8k_ie8+2LkI7DgF-to=Qj&J@!l)fNQ^0UNcKYtaHws9vUZN0M? zNkiQBk+dxv!M8#PzV!!5tAyRHTOsRLCy3AAzBoK=?0j?hE=Ozq&Ef0kZ~j_JX}xVD z+I9%hwo6jd-_eukojrP5uX2uwxk84r4|I3(EVtNezK;;z`T_9Ykc!;ud@uO4xbT*F z?@6yI4AOzR|F$zpPgB{p)(+qP*x1?G+-@3kt79qHbNJZtPMln%2*6 z8`LCcQtbPkPAFjWT;9Z)krC6txt!JVV91Qox*Cn)p9qK4PtzV)Lr0JOn)GW3o47dx zi@J0=V90UI-3#T+VWBjq74=?QP+j!BlE*Ub$an4BzMKh{?9_8)t+QI*xQiPw&c~>y zF|GLH8ath}`t1ltwYfMzX=cbB;FvVc7EfbiH!@3~uE>OS(|Rv57yuLRrD zMcW%Zi=$KC8na+bIpy=F#8vziq9Pm_4X>Ctb?m)uIl&SH&~L=As`#7>*k*ag^8%Ii z!%z0!ZS4fBu*11$rW|j4H)jUNvd+w|eP(t;XJ$A5%m|Hk`4eLw6b|mYJSfCfdl>ED z_R-f8Tc_$3Z=1ku8YOHpui=)!xb>V8}!*}tm0O>`w(wJ{FxC`{> zfaG`|*UVvR4m=Cx66~*pRN@gfsHuFmG6hbP3|2vBu@oDpWqBB}WtB46ZB{PanyQ4! z#<-IHL(XAQh-uz5Imk{g^cIp+ne^Q$&727@Cf>Q_-V>gK$x~WhIwrqaeop#l7Egfi z>4EFtM0Yxd4bVE*WYs-o@}P?=xY(l=6?kN6@l$ykMy&qdFB)23D zbhnx?TRC^Jo+&U=qIh=@t&cLk183RH<)V3EJm_ENFkg&=>I!DZ!+%*dG(J?ZPcTMk zE8vqG2ByZsz|_1hj?9lc*2h(sc!FcqeFu3cjRT#7sr4khAF-FBb$wzwYvg>=%TOlb|Zvbrna4eRR4`kCs#MsM3hq$1r9vn!;r|J6}A60?HKK3@yQBhyYmv z6Jeu?PwW>IOUFv_MfvVW%P;h(3@><8hAOcQJmD8A#cr^oGMscT2SXzu1pVeg9n7!} z6xac3^aq~?{Y-1Z3Y^#p3&cpkCaJym`Sxf|GwBNnVX6K`R(mT(3 zAF_UOiVc?%Aiv33dU=^9jby-jSxVO6PqORI_E!v4b<}LdAqCi!M1z$dQkE5Sp*RBG zAQSonh~}-!&*uT02OP6`AiO4=DnA{HIzJr-E4>_DrUUNoAn=oUV*6Y+>R!KH4tiT; zp~9GNPn74%!aPqZc(Ei=TRG_SDvl3}c7Mp=d6eT98Od0SID>*?2W{WAYVBk1O#`>U6Y8EL`U>p`uA^&hZXlhIX#-}fvFzt3La3wq{) zpMPN+&{=2$MAoj~{T4``@k?z2V{fgiNHDsF(u8XxV)bTGQn$OqkqOc?XYO}u{vGKF(aoo7(-8%{%T*ISC`jQz^#pe>} z(_0jOdbtSns|h`G3pL=inh2C%(ebF+vVlxkh;V2%+uN<3?auZ#R0O=+>2v^dI_n;+ z#Olxv``g&r*=%p_YNVvYc<3UoYwvG-U&Cd4D&el%LhpSX;gUzhH zv(?$zY1s#2OH|vW&RTG2b~f7fklUix7S)22)7owC+I{VaTH6e2@PD24ExWH>QOo|& zZXwS9N>B$8r`g%s+-w6Z5%G4d4M=$>5)YrZjZKnAt7#oBj-4Gs{xs;o?rGww?89j$ z+8x!>-Uy$)>ECnuV>%d$e^~)=nc`n6=$%Yv^e<~E8Ujl5e|q%q^%(!*y@}4IA6Z-K z>o^pR2f?+xE?6VuHGzE!yeO!TzQ{AII~9jV{MG~T_>_x=D1&q59HeD@d|m&|9|q`J z4S8*c`w`>eoynw>rpuhGk4KWZJBIPmp;HUa z>!zMJPbYxhmYx-h;_Fb*6w7Zj(CP9J0JaF=GrC<8+etpqFb=Z9KY) zI|+2|XgZIuDt5{ z>a1^WZEeDxwhMo?wac%ux!c^_-QL}5t#58_Y;SJtwmTd8Rny*pi*>67Rkk;P1BCy; z|Frh4CN$Y?ukW<6(pIO{hDqoh!2P$rySuTqvAesovD0qv!2P?sn>99!IvZP?aQSt1 zc01dxjh)SHoUTy^2HM?$n-u1_4mGxSH@7ynwzutmfKO=c>}s#Af>pQ!x zPRH&C7;D&%4zMNbJDVNov$MNyudB1w-fhA6jTX!vc;%g~?UubRU<`I~XSX(Yf!p5d zAegeoCa(fm?x=C{ECyz^uih>`^pCVam8-8O4_R>A0Ol!+O0Q81>mx+>_?IZ{z~3eirR)nw&9` z@rZ2{%uGRo5q9LZv4Zi5XnjNvXH>`hh&KR!WVPs<7d*(g#vQ@R6R-#{@_vNrt_h`Y zLf^E_i%Fm&VYkCT%722agQ6--8gpp3*LSgSvkfE(i)q5}LF;LAo3%sg*}+OQaq15! z;WoAJw02ua?&&iw5I*Z&bT+nj+EjBJ|AtElJ@|QDnx4CtL-HiwliUn|>?cfUVZ=%q z5PFhb!%xjXq?Bt6bNp}7C77!QI!6%;0k+Q)lV zq(4i97EN4^*+c!1;3bjw1JYTzvl^I5&mOc003*wK1E;~$Cx-yAX9ri!KE{^y#C0wv zXe!+6fCl}u@4X)Uwh)=6N>&)A?XmcJ(YUkpCGGP->zaa<3ba~%pWuh-9CuT+BtQ!fRrX6)t?F1zeR&Z#UJ+BNGrJ0H@X$q6)VNjm(P}T+=32Sj zHi3rEyX+qKbT;btEK&p|%aQp+tS>V?K{?iAxn^RXd_gRMp~}RAzgRbCdfJ||8EuBvekknH^3w<98s(7_r}#iW ziW39fA^{Md;e9etW2SCMbRQ+X(G=767^!+rK{)?4OIQvctdFN3DM!N5IBEP>vYK?e z%&fNG?Iw+6m=5=oHOv_FO9GNbC;2!ZCF9WrCg`~yC%_RT&yuC532X--aq{R1;Gf_{E%@r_*y~J(mnoiANP+hy?RF!Y{yhmdptD?-c(t!2e7V z9;!b1HJgm~VJg$XZ14#>dBdB)y5MVyX%dPO0u7n+kV%PwI>vo`zXVWHle?sVr4tJw zIw&_>`-1Z36|%DkV2SrSERklzdq1{J@0Zx*f4S}#88{r2r?ugCD3(x?QaB!r5#-+k zJ+M31>;ucJK8iFH?*Oh!L4oOBQ<_{Y-d{fer=#Vv%-2^ueQN9!Z{7uHb+eDl?Sd@}yI)t^LtRdC9i=(dr{_Bk2`qB<#R@OL z=)B$vi(*~97PMcIb8yX=?gytTLZI}@TX(Wr2XDo4XbdG872{juzx?<{QURqcC@rdq zqa#Fi9a1pNam>%4fCnopGOAhi&kyC9<@I}|V9tVM;zGGH-df_n61`%%Qdx&%d;NpqJoFxv1Ye5EaZ2j>)j(jmB2=o;!Q{VDzh>~9U*{}JENU))oR4CMXzRrboWHfo z1Uy8+m$!X~4->I3pIF(cCnCMHP;StV(Ik_94lc!?Ls@xf)V>yf{3^f8jMjrs;?GNE zp&!a6D+Rxh4T6QAZTF3)Dm_uElM|^3WEvxKf=9g{Q~XM)H>F@7Enw5 zIHFR-TA??hifwPjHdS0cQML&Tt4lMnOPLFS0jzqw)tg;3qka*0#3*x9+m*g(NYq12oy7A*)d=A&oNgr-^;*=_iX{S<)w@$Hp- zi|F>WS8H=p+J}lkY#B>!vCrpr53mGY{fSO_8*XBu$`&;E_zb2l-Wg+$SK?$ zmJ=nEl+^$j0WovMxN2{mw|(~6dl0%IHEFdtq#w7r^x-4>#!zxMUi68m=*h#d`V57} z@ubyj1;a`MCv#v~oCo=UI-xHaLgUWZdr(=?+SKQv zTieC`BzSWL^vT72`R=)5Tlt{DOZjuf%`lJ`OoUCw1f;0rf}u52G|SpaeTcL1wDbkw zaf6bf$V3b=%R|$530MJ<;3Bx1jD}~x%%kEIouFi|5yMw|6n0CXBV4Q5Y}adn=)82q znN+Xwb*-w-TI@Cgp6*jNnMLLSVmFhJh6+q}m>}GA;IAxB+TqP4U8os-@-)4eX7!vV zUNg6fh-VY<0;EHmN5?q%G+uzoxaU115jTIs81-QD-z#4Cz*+a;cew6D;b2&5<%3cy zpExU@{0>)M?v%=MT7slY??|cP~cyO`C_j;rHxHQqC4}H;P`}NoW1YEKWlmzn@b9d$Rd5y-!VQl7)nfG?g@OMVxg2%yO`!+%0gdy zSnWyHoB=>+?v8h~?4UQFxjo>TymK_8;BgM*DXV*=BL9f+c`R7SC zzDS|=T6YaoWvsaKUR#UK(_#N2n?@%fuSVpFH;teu5^TcMvqXmLvHgf5p=Uk^@U=1a z7M3wiC)148RN$%``9ZKZSS?e?K8;q^R_qrBn7NoCZ7=pZGouz-Fl(DbF?BYhDM%8vHA#9M=&GD6R`{y-gOSgeMIhE%=8>^n@%)NyHG;S#KF5Iub+6g-T! zJqYioQO_5#&mOR`g7*NHw8K+q*mG!QL zTc!QjGoAS@-F+FqUUAjmk9&V9KmG-LO}RK&#+kpm?|#rhTRx5(>~|3tlH-DJFhRok z$>faMzSs}CjQ|HlJ`ZGj(3fx!g+gfQWj)->;Qt*vwtIZQ1K#Ta7kJ79 zq`8KpP?_&`?s0<;_|c;;qBw9P?3dQXOYlElH+iO?9N?Nw7j!Htbe9jg85|L9camdOz#+leGjowW zC5#f@@Z?;s4zup8{^aSiq>(%_9O74%oB1%@0pe%GC$1SpT>sW^5l?ZE&4iNU+ zuK;ATfd87R*C=8$g8$kdlxZ$}ETc62TQ(WJ1WJH=t#qf1HW2A*)jW~m_!}(^Ljj}P?;Y5+B1Cy|}wQU^22uS!7`>N;qQ1h2Q>JJ)N?|(QGEVUJN zX7V3)y*hS4;?B)S3ZG6~LY=`9>4U4UWU!Rqs(PFE(jgLgp*2U^R-h_()vlUlFU-{A zG_O@a7=%q6oHOJdJYcCvV>@<=D$*E!uX}1}1`Di;K0EV7PU1>4q7BcP5d%i{Fb`a(zoOQKDz@@WY;>i{dS4X+En3Mi9_kI5I+k5$2*h z=QY*p2&Rr*k9r6M&5|cKh5)0EdP|QLYq_Wbojlw6YB*JGwPgT*K!Cp&*uJ0Dl*3{j zdn?(wE*ydZM4$j_V=~o`ASEt$zA70CdR5ca;YCNsZjCroAI={!0BDghZcE`TuXuLr zhh|e{0t+D!>$?;Nc|0?qbyZK!)c`V;ikRUcll-P94@@O(-UWJDtZT>{<1Vnwmg{ob znM3S7DDzUw7^uCwLSSbIGkAxE(fYMZoTv8ponW*%I!A3AE5BI85QWj@LWX>8l)g90 z`EP*JVKV(ikXjr5)>wVZkSPkQ3uC5yZG;Y>v5uSn2B_&><-K5`Hqx!J@Ro5`6c&~X zyz)Cm#Sl&vBBLLNzW^#0#H|SVjVXk|T%l#8CT9($c;q{lv4X2u6zy*t?nI-${&**g z$y(aBm(d%<%Ca00z_5Sj&ly^%iE!v0E11sV>sN=b58wTD#X*n?u`CMl$97NGgnF&K za0(ZTPQe~ZIUy&JcaEyUVh5*f*t^|}@<9V!LH9Zxy(NVyTB!Z{<)gXwb68YmpR4Y) zLAJRSerVIZb?ZeYt<{jB6NXBUtg@A|tI~?hNa74#l&M4@4wiKf>o4INrz^{vZ2ILc zXwz6Du3=NyPqlV8AxhY#kW4)+7ZFNi{I3g2Hvh$7No^Mf=G}PD>sO9qBE?F}JI{X= zU-AD)e`9TKur!7GUZnFU5{K18Q$Y^3iy$?$T@1{oTh)oK;uRH)WZL5vo;|(I7`bI5 z3HisCQ_^-?b&}{~$LPA3L?4o9Cd+tOGPprAef^lKS{}6LNmofQx5&Yz%oJ7u>_Fc9mOp;phTkj>6VH z-h+$3$_DWtDc11yjeX&8=Nfs=~c zEh#0daik%gLmgo@d4x_wq;`?jA+T;}9?#*3>#Peq?XsD1lyL0!cn@(mYmj~{TMx2)Ik*Ysiyc!1{ly&=V1+~H%k>KTAfLJUthbN- zCO1?xn!_lAVKU8n$>f*$be3Gue}5ef$%Aj20PuQOS@xmZqbdE;$KpP^+?|dlaOc1{ zeQ2=s6y5OvLgce|G3o(spIs*Dv_~sE%VzNF>~ba`B67{nabzf`N|&?!A|F0X8kH_p8Z(|MfNnz=^+EZ^w%HnVyd(vn~!BMPfic8Xt-e!w2Af^N!t~ z2$QGO(|@Pb#jEUuI%M$)o{uN&7tQCt*wa9w@YtGd}bU9~+JXAAXi0gTyB>;(x+KWHHQ! z{Y^}mj}J~QrFV*A9^g?QNZ9El?S+`%JzoecjL>D;A&_W7h%4Qtc=wL5iK9hJz<9yl z6XoffOj0S|JT0Id4$FM=KoZKX)833Tl(o7i?28IBmt93KQ3B`l#5f<=m1T>AwVOyJ zkT8*}0jn*F_FTrBLC3?oE{Vp=%RnR9B=xoP&qx}44rOw`Z0Qkw$^ZZX)+G^LOcCBpxE*R?xNfY?mTe1+QH0+FM-OY`J-1uo1PQ!_7f`HqwSA^l&_=^O zuTPDCP;Ua-OaBsm4DBV^0#J=QC7qHS2TZZXn2wqy;)ua`GZOcqT5Jdu)2jiBm#hwO zP2Z2MvdIg$25o_<2W8R9FL2%;%bsB!_6vxpc$%H)6+6L-m+3^WxE`#Sj*W^NIX&L! z6*q$wf0-ML*~+PSp;z1v&vAaHSKJ9!oMvOa;%>0ws5jFpwp+o9!_gL% z+ZiBEDNxSGUKAR{1CYpG8}(>fpwf9&jTcR}Zk3M@1YU*J^(bh*iLv8gdm%5Fn3VEw>AK%Osl5dR!|} z+3-ha`1k{$xFTeD9{p|*kdWRZ%a~ z>ubtUnCh~^j(hZRFtSjoA|!}jXmDtZooMeNVq>VdEsJq4 zWbKYDCisiub=3*LTo!K}t2h`vRlIp@z`}sHLsVQrICq^bTB3P`FU&-M?0i z@Yryd?WG0+7(BV+N74FLtEB_oRZ1vj#DgF--KTMrk{J*+bwxp7=RBC&`VkW$Lzj|E zCRPBV*87~c@Rkpi`0W_8x7hdn_x;C5t;Qz&wYDPhDMni#?> ze21Y`AI8%sJHV*JS=ENYxW=n`lg_ar&+uXFRvT8U&13VaQG-Oxro}=!@53fXkJ0|~ z5hL$Y=tqpPhIeZaZq`HS&%^0_JRVJESs!lG=e1_Dc34Yl|AT-0tyZA5b8qPPwbk#w zd;G%>?`ui)zShwGhHZXdi?VCf&1ZeGC{+vR7rDM|9(KameHYtY4oL%_hIDIm;P!mo zR%J-&(XBtqrl_yvfMhNP5k}gZ(lS#u4`E#kSHH6AposS@Hdf6R3;8)W4_l5k1U-+K zhntE@Fe{gXi;DqMz$H<)Kfk=ZX^THP;*a&bSgrqR{ED_>y)UiMZo$E#YRdwD&5m8O z6RNpx*IX~fFB$xRV1pC9Dr&SA$UKmWyrbhV;HfKZoU@$uC+6RNx>F8bQ z%uZW3EYaB=MRxz~*ta`j&cYl^5o7kb3>(q$Qkb(#lf0Z={y|&*pe=vUmftgNxhJ_u zQJEa6C?wLf_7!_k$Mlyh`d)fgQE;MOa}z9Q8Ri+j~sAb+r78qA*37t0-tKm=|X z|Jipfg7s%y?i%c8jv1R8(DiZe-x4ZS+ibvmc?U=7B;^87TWO)*(S1uLMC^>5_U#fj!!1>3Z?U+nY_nNR z*3H{RQt>6c_L(*LVvBn4fEXYH2ktm2IX7^$th!iX)yq!UgT}RoY4q?UdYDBIzkB@f zhsO`!Mi2j5Gw(s>hH-RM!!GCJ^eeF1jj_|dcfBFHL3sp`0Y*V!>ZWajN zUdq3q)=RPxgbMn1mNrRLfL~Mt85Umt9V)(59rlw=XCSA;lw#V1cmdS|eusZ~%Pfyn zJyCFs2`JHw7B&LSeNEh4-jY5<&}@bTcRuThKl_8z(`=Frds+QA-7b{11gb8*rlWn@ zz38$2(RT&0(KL~Q|F$`QHU(8r{Pw)r*j2S6N4}B^(!?yS%;D-7E^(AL?2r+h>@NeT z%iFODtL5zgoY)6VU1}dVZDPQA#KwITEs5#xYh)`9b1r6UrL(UeNpJzJjvgCNsTZe5 z@{=SFN%R}c`!RinBgcNHlfmrfan#tr3tN2*kOs7{Ht7PE}dNO{R5gYsn>$S~#tkLq?ilE;lsHmT`MyFpjvHj|-DRR-MGPw&7Iv z%lx9K&6e(Iqu&r5)e*UWWUoMVkoSH_XXnk!^g4#=_^Kp0rtd@Dqp0=-*q@J0KtVws z5~F*9A2G!j|M8V8#%h=j%G)vQ;NZiGML3atqy+XBTLY!bALrS0dFSpK z8^LLks|GMN8lw|tZLILpdN%7@@ivm7n36ZZK3uXb!8P#Tj6Ik!KLaf2Fn&RJ8(`5o ztHXT`uw;WuPRa8Ce{Zr&o%t^qLD_ zr|p(~pSD|}3zdD*ZdB7xn_V%;_VOwEud>41>u%x&38BqA>R%{Mkbds?$wBugM_dar z;eTyBylgz|D<&Km&RV(HO?kaM{Iym#wApmt>zS*^l4_S!358EP->#voj-X&M=;~!I z21_amNhB;t{X9mHU^;*L`{2gj1Ql48l^F7b%9>M}qD;>Mo+_#NP8wY;YfOz(E) zU&fk^*lV-x-tH*EaZm!nf*W>-i@2CGL|M%#9|F@0L z^)=}&j}|GOGx{bwJGdSwl}=xz^P&S`5ce!`d^rTy|(QWX(I z^d*Mqn)2IqgSORV)=`OCfj3PRbgX!39_9>68FSWdSEM86G2Sa4-D{Gi%F7QQ6mcEt zb*lvzej~{FV}+uLi+jkrM8xgHTzE_4244Ydr2<7fjE~+ox_|n6>-f>*-&#rMb3K0F zU#;)QM+ZM1KdQ&gI!2O^9=fNnT=;pB;v?qOppUOy-Gm$o?f4h+7}bDF`~~>G9cf%*gH zKIzo|Q=ootbTJyDiCWAWFdDq_c!d)69Ua&C)33%L5{z{la}IQ}GB-5a1WcgHv}iY$ zuLs0WJaDn2ZBVbUz!Ye--+d_ZMaW=~&uyp0+!M}hHW~@nr@yW|w&HIPYOM-WR;JT1 zgMM)5D5tL%R$m+kVXjLw>Ak>6B&jnkg+3^IU@AHG&4Oc_BR;G!;^l%PO6^ctuznNV zBF(S+Nb43ou#U_1ePZ;@%FeCv_)*7&;TnVM(mdK1oK3#~q`43!39sBZS^f&|YM5Ut zVF)8f_;oOSoxWz&2=BjjxbEmjK1SVCnAvx?!d-mDC_B=J1(B)pK!>*@0Bk5E03EzA z+MSZaUM#l0TaNlukR+HLKSOU;K%v_BvIbaGOD}6BM;KQf;in&Hgy%n$9pQ)D(a%9? z`uX-&1CcCVYMk%C|VAPy=J&9_qTHV_da%}8R zs7^t41RLfy2`%bZYf;D|b94FVsjHtb1q+`D@i>YbuGCRCIZowGfuj%)!(vF%pBVL3 z_@S)%8!NX8r^Q2(VFHlnOGAf5ICrab>>9PuKCvmH`5V@5QSJQ7*1*W&a_;(B)Uuga zy>;!e)$!-h62#I=PD}c^geTU{pIEDvKeZ5Q{jGpKX4r=Mf#l=T>@OKzG{W!3-@?c0MDxmOw9il^rgk;BFm?vV@hn=(tVXa&rvz$I=CHr_7?&D#} zE_wxE@tG#QBcr5p{lD~xU)SZwyj*+OUwe2{cC=UJd*-h*WqbZqzUQp*@b4#$ha06~ zG%4Trp?FFfm+kyb`Ofj3s%*FKJp1~WYD2*~ibq>pi(Ze04YUU6r<4BU=)Vu&Mt_M~ z>#cS~{>4lu>CEN7t-1WtkF=BCC-3v-@-Kb+$m5j@b)Q6?jn-y+E0-H6i&K#sY{%4r zX%9zy?DpXs!NBAk*h_Ae^Jz4=4PTaUrl zqMjKYEc#q;I$XZqx#%oy{Oa#ao40(u@Jt<*^_caHB+P&Qlk24eOHtw#<994UuOkG# zgzGMV9gm0|Z`J%W@INA!vzh|xk~#?w(hBAinoyqTs({2$85u@*0fRi#TJOrJdSm?J zCUA+t^B)(l^j0Y^ENg_dQqTFfO?9D#+wqL91>ng^^QM?oE8CmSy@svDeo2QdnLw9* zbgwiM&(pzVN?K;EOg9VF!?iHGD3#l$x862>XdT;6dSVvK`Ieq--6YYNEd8+M8Ef(_ z!~f3z;=&Rh>W&RrtOiP=jXF<&NYSE=Pc6$>PJ%|!dA)kO*bT(fgTJrsx*1ko%aF<9 z97l~Ei(bjTb>EIX+q;NwsAUf;(`c!a%QY!5m1axJVdYvtahPJqq3k#g5`-?wHvSL9 zul07_lGXw#OZl*y>;B}<0%eP^kPW$KwiB30KU~S$hghl|bZ8=${;B0;)ztpvJ7jQ9 z!s1$N6%RkEUoXy13xdxege{Iu(xYNqGtv_XX>I#sn{oCpKTx22_=_S<)NBJ;v-W(( zJT9ab{d1kd>LaD>PGQiCY&IHpdlWgFOg~h>b#FR=o*13G#?<^t1Ew=H2d&XPq=zzBAq$sAQo@GrPnaIfD2dPO#w3Uf@Yo;K}yj$++-BU-b*V zYUCDGK7(%ROaI`>91%!65y}V=%GnS|K;g|Hf!*m@8_u%4ED~QScf-=tgb7rb&j7O& z5SZt~>G|Mvmh?tLU{{9eWww-Drei(717>c}(=#v>@20caWNj$4{*^5YhpHn!}`L$+LtR_#}bqio`YQt>BD|QFdlWXFP%) zIN=i%ko^~s>1s6TcM*>hQ&bUjS(hK&G1zlrdI*PM7GjwCEi=Dz6|p#C~jk3fv>VN2ilJPsEZ4(%C{)Te6%7MI1QFO1jYTo0Nzxv_MrMo%hO zf+Wo_Uu_OXeytwmNdu@&Cbp&)!O8BRY}%V=R3{PMDSE^XmU0TZ<|W5CJEa>S;(%vq)tMmibU zHYU7oJ6ElTe5=+&&dLT|XLws|#>=UFwCL{D?k4tM;}R0=iFFToj$rOxW1Yd^#UQM+<)94Eg57f- zjCe)Z*M2%f*8R87W(|fyq8 z5jS`%8nPZx)X>MG*jIt`XgN{`4lPZ(a>OHXc=ZL=t4D9Y8O`B39b!sbHor(tY#Pl* zFo!H+-A9BbZfq<52*KnT7K-NyPJ^y0;!D;!%nW!pvvx4`# zd20dxzrAm5Z`(Q&{_bA^Gi(LM5JgJ1 zY)h8CPO7xt#&RCp?RHmDScrrq*d)P#q-`~EfBSo8=G-p;NKr}JxBGNs5$8T<&YYP! za|w9!>y3@2W)Al1Zi87#gLZ^8LsWBMO%X9{%RgW&0i_S3 zmx6G6mnKNT^*}6lMb>7A|6^H9FGafS;zCCGo=5Rz{vn%EaC38#NZk_^553pXvl*)8 zip^E;Wn$K#qEj#Ga$_Vt4TP4%4%y8K$~{kbxn?U~PTx<9k5j=a&3XKG?7Q0rm0=7l zVW;C=lXDUJrXQ4s9@FiJXT5!%sPi6*(_zKv@Q6etBn#r@7nuc-XrF@yk8^Xl6+-2K z(>hDc3;y&B0@}6Df!#enZJ!G)1dpyD-y42D_Qd$Jkv{}b4fodCb7CeV(DCxnTJzS8 zw^vgryF14?9ktePA@Jzq_V*E5g8PL2@18K1hJa3r?fLWEUtV z3ai`yMHg;8^?d>4LXlo>*kg)@Ok^&i`6Ok856%#g=NJY%;91eCCxo2@xDMx<$r`S5 zql+6e3Yu+xah!C7x-hQu!+_P1z!{}Zu0k0|<0r`ySOL8HIQ_0HW?8woj-7^nsA=y9 zWWdyt;$^gD0&k1mQXFJ0F)>FiA7VA?uoa(ysi zgu#a-pS|lzGgxk#+WcFS8Kn$eEx5U$HWc2xe}9dP1QHQsz)#K8hR2v!Q1V&kq7gwL z0|5m}8ZOIuHtHj{pUB_4{2@xP@nTg2(yHRpL`Z!r_7dZFnRJvy=Y|fB4|B@fGQ1;8 zA;ua40Lo={=+xdlb^$M26Xy}q< zSoyT$vmdxC*KM-}tbtk-s

diff --git a/blog/2016/06/23/opal-0-10/index.html b/blog/2016/06/23/opal-0-10/index.html index b23d6348..51b9fc53 100644 --- a/blog/2016/06/23/opal-0-10/index.html +++ b/blog/2016/06/23/opal-0-10/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2016/07/19/opal-rspec-0-5/index.html b/blog/2016/07/19/opal-rspec-0-5/index.html index 0bced1fe..4ce54728 100644 --- a/blog/2016/07/19/opal-rspec-0-5/index.html +++ b/blog/2016/07/19/opal-rspec-0-5/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2017/12/20/opal-0-11-0/index.html b/blog/2017/12/20/opal-0-11-0/index.html index 8b8d5843..6a69df67 100644 --- a/blog/2017/12/20/opal-0-11-0/index.html +++ b/blog/2017/12/20/opal-0-11-0/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2019/02/05/opal-rspec-0-7/index.html b/blog/2019/02/05/opal-rspec-0-7/index.html index 665adde2..94ac39cb 100644 --- a/blog/2019/02/05/opal-rspec-0-7/index.html +++ b/blog/2019/02/05/opal-rspec-0-7/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2019/05/12/opal-1-0/index.html b/blog/2019/05/12/opal-1-0/index.html index 25233639..8490bfaf 100644 --- a/blog/2019/05/12/opal-1-0/index.html +++ b/blog/2019/05/12/opal-1-0/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2021/06/26/webassembly-and-advanced-regexp-with-opal/index.html b/blog/2021/06/26/webassembly-and-advanced-regexp-with-opal/index.html index 420b01db..e9d10762 100644 --- a/blog/2021/06/26/webassembly-and-advanced-regexp-with-opal/index.html +++ b/blog/2021/06/26/webassembly-and-advanced-regexp-with-opal/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2021/08/09/opal-1-2/index.html b/blog/2021/08/09/opal-1-2/index.html index 9b10d24c..d7db5130 100644 --- a/blog/2021/08/09/opal-1-2/index.html +++ b/blog/2021/08/09/opal-1-2/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2021/11/03/opal-1-3/index.html b/blog/2021/11/03/opal-1-3/index.html index fc5e823c..114c7493 100644 --- a/blog/2021/11/03/opal-1-3/index.html +++ b/blog/2021/11/03/opal-1-3/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2021/11/24/optimizing-opal-output-for-size/index.html b/blog/2021/11/24/optimizing-opal-output-for-size/index.html index bf840b2f..14b5bcae 100644 --- a/blog/2021/11/24/optimizing-opal-output-for-size/index.html +++ b/blog/2021/11/24/optimizing-opal-output-for-size/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2021/12/24/opal-1-4/index.html b/blog/2021/12/24/opal-1-4/index.html index 15514a6e..6c96e8e1 100644 --- a/blog/2021/12/24/opal-1-4/index.html +++ b/blog/2021/12/24/opal-1-4/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2022/04/13/opal-1-5/index.html b/blog/2022/04/13/opal-1-5/index.html index e03b781f..3c2dbf13 100644 --- a/blog/2022/04/13/opal-1-5/index.html +++ b/blog/2022/04/13/opal-1-5/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2022/11/24/opal-1-6-opal-rspec-1-0/index.html b/blog/2022/11/24/opal-1-6-opal-rspec-1-0/index.html index 827cc7f3..26955e53 100644 --- a/blog/2022/11/24/opal-1-6-opal-rspec-1-0/index.html +++ b/blog/2022/11/24/opal-1-6-opal-rspec-1-0/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2023/01/06/opal-1-7-ruby-3-2/index.html b/blog/2023/01/06/opal-1-7-ruby-3-2/index.html index d5276a8e..e4a3c740 100644 --- a/blog/2023/01/06/opal-1-7-ruby-3-2/index.html +++ b/blog/2023/01/06/opal-1-7-ruby-3-2/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/2023/03/30/opal-won-fukuoka-ruby-award-for-outstanding-performance/index.html b/blog/2023/03/30/opal-won-fukuoka-ruby-award-for-outstanding-performance/index.html index 371d7a09..ee59af2b 100644 --- a/blog/2023/03/30/opal-won-fukuoka-ruby-award-for-outstanding-performance/index.html +++ b/blog/2023/03/30/opal-won-fukuoka-ruby-award-for-outstanding-performance/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/blog/index.html b/blog/index.html index b2d452ae..6bae05a0 100644 --- a/blog/index.html +++ b/blog/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
  • - -v1.8.1 + +v1.8.2
  • diff --git a/docs/api/v1.8.2/corelib/ArgumentError.html b/docs/api/v1.8.2/corelib/ArgumentError.html new file mode 100644 index 00000000..eb06c8b2 --- /dev/null +++ b/docs/api/v1.8.2/corelib/ArgumentError.html @@ -0,0 +1,154 @@ + + + + + + + Exception: ArgumentError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: ArgumentError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    UncaughtThrowError

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Array.html b/docs/api/v1.8.2/corelib/Array.html new file mode 100644 index 00000000..8237fb3f --- /dev/null +++ b/docs/api/v1.8.2/corelib/Array.html @@ -0,0 +1,9576 @@ + + + + + + + Class: Array + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Array + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/array.rb,
    + opal/opal/corelib/array/pack.rb,
    opal/opal/corelib/marshal/write_buffer.rb,
    opal/opal/corelib/pattern_matching/base.rb
    +
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #chunk, #chunk_while, #collect_concat, #detect, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #grep, #grep_v, #group_by, #inject, #lazy, #max_by, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #slice_after, #slice_before, #slice_when, #sort_by, #sum, #tally, #to_set

    +
    +

    Constructor Details

    + +
    +

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

    +
    +

    Returns a new instance of Array.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +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
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +
    +
    # File 'opal/opal/corelib/array.rb', line 101
    +
    +def initialize(size = nil, obj = nil, &block)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    if (obj !== nil && block !== nil) {
    +      #{::Kernel.warn('warning: block supersedes default value argument')}
    +    }
    +
    +    if (size > #{::Integer::MAX}) {
    +      #{::Kernel.raise ::ArgumentError, 'array size too big'}
    +    }
    +
    +    if (arguments.length > 2) {
    +      #{::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arguments.length`} for 0..2)"}
    +    }
    +
    +    if (arguments.length === 0) {
    +      if (self.length > 0) self.splice(0, self.length);
    +      return self;
    +    }
    +
    +    if (arguments.length === 1) {
    +      if (size.$$is_array) {
    +        #{replace(size.to_a)}
    +        return self;
    +      } else if (#{size.respond_to? :to_ary}) {
    +        #{replace(size.to_ary)}
    +        return self;
    +      }
    +    }
    +
    +    size = $coerce_to(size, #{::Integer}, 'to_int');
    +
    +    if (size < 0) {
    +      #{::Kernel.raise ::ArgumentError, 'negative array size'}
    +    }
    +
    +    self.splice(0, self.length);
    +    var i, value;
    +
    +    if (block === nil) {
    +      for (i = 0; i < size; i++) {
    +        self.push(obj);
    +      }
    +    }
    +    else {
    +      for (i = 0, value; i < size; i++) {
    +        value = block(i);
    +        self[i] = value;
    +      }
    +    }
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .[](*objects) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +97
    +98
    +99
    +
    +
    # File 'opal/opal/corelib/array.rb', line 97
    +
    +def self.[](*objects)
    +  `toArraySubclass(objects, self)`
    +end
    +
    +
    + +
    +

    + + .inherited(klass) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2540
    +2541
    +2542
    +2543
    +2544
    +2545
    +2546
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2540
    +
    +def self.inherited(klass)
    +  %x{
    +    klass.$$prototype.$to_a = function() {
    +      return this.slice(0, this.length);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .try_convert(obj) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +157
    +158
    +159
    +
    +
    # File 'opal/opal/corelib/array.rb', line 157
    +
    +def self.try_convert(obj)
    +  ::Opal.coerce_to? obj, ::Array, :to_ary
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +
    +
    # File 'opal/opal/corelib/array.rb', line 161
    +
    +def &(other)
    +  %x{
    +    other = convertToArray(other)
    +
    +    if (self.length === 0 || other.length === 0) {
    +      return [];
    +    }
    +
    +    var result = [], hash = #{{}}, i, length, item;
    +
    +    for (i = 0, length = other.length; i < length; i++) {
    +      $hash_put(hash, other[i], true);
    +    }
    +
    +    for (i = 0, length = self.length; i < length; i++) {
    +      item = self[i];
    +      if ($hash_delete(hash, item) !== undefined) {
    +        result.push(item);
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +
    +
    # File 'opal/opal/corelib/array.rb', line 204
    +
    +def *(other)
    +  return join(other.to_str) if other.respond_to? :to_str
    +
    +  other = `$coerce_to(other, #{::Integer}, 'to_int')`
    +
    +  if `other < 0`
    +    ::Kernel.raise ::ArgumentError, 'negative argument'
    +  end
    +
    +  %x{
    +    var result = [],
    +        converted = #{to_a};
    +
    +    for (var i = 0; i < other; i++) {
    +      result = result.concat(converted);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +225
    +226
    +227
    +228
    +229
    +
    +
    # File 'opal/opal/corelib/array.rb', line 225
    +
    +def +(other)
    +  other = `convertToArray(other)`
    +
    +  `self.concat(other)`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +
    +
    # File 'opal/opal/corelib/array.rb', line 231
    +
    +def -(other)
    +  other = `convertToArray(other)`
    +
    +  return [] if `self.length === 0`
    +  return `self.slice()` if `other.length === 0`
    +
    +  %x{
    +    var result = [], hash = #{{}}, i, length, item;
    +
    +    for (i = 0, length = other.length; i < length; i++) {
    +      $hash_put(hash, other[i], true);
    +    }
    +
    +    for (i = 0, length = self.length; i < length; i++) {
    +      item = self[i];
    +      if ($hash_get(hash, item) === undefined) {
    +        result.push(item);
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #<<(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +255
    +256
    +257
    +258
    +259
    +260
    +
    +
    # File 'opal/opal/corelib/array.rb', line 255
    +
    +def <<(object)
    +  `$deny_frozen_access(self)`
    +  `self.push(object)`
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +
    +
    # File 'opal/opal/corelib/array.rb', line 262
    +
    +def <=>(other)
    +  if ::Array === other
    +    other = other.to_a
    +  elsif other.respond_to? :to_ary
    +    other = other.to_ary.to_a
    +  else
    +    return
    +  end
    +
    +  %x{
    +    if (#{self} === #{other}) {
    +      return 0;
    +    }
    +
    +    var count = Math.min(self.length, other.length);
    +
    +    for (var i = 0; i < count; i++) {
    +      var tmp = #{`self[i]` <=> `other[i]`};
    +
    +      if (tmp !== 0) {
    +        return tmp;
    +      }
    +    }
    +
    +    return #{`self.length` <=> `other.length`};
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +
    +
    # File 'opal/opal/corelib/array.rb', line 290
    +
    +def ==(other)
    +  %x{
    +    var recursed = {};
    +
    +    function _eqeq(array, other) {
    +      var i, length, a, b;
    +
    +      if (array === other)
    +        return true;
    +
    +      if (!other.$$is_array) {
    +        if ($respond_to(other, '$to_ary')) {
    +          return #{`other` == `array`};
    +        } else {
    +          return false;
    +        }
    +      }
    +
    +      if (array.$$constructor !== Array)
    +        array = #{`array`.to_a};
    +      if (other.$$constructor !== Array)
    +        other = #{`other`.to_a};
    +
    +      if (array.length !== other.length) {
    +        return false;
    +      }
    +
    +      recursed[#{`array`.object_id}] = true;
    +
    +      for (i = 0, length = array.length; i < length; i++) {
    +        a = array[i];
    +        b = other[i];
    +        if (a.$$is_array) {
    +          if (b.$$is_array && b.length !== a.length) {
    +            return false;
    +          }
    +          if (!recursed.hasOwnProperty(#{`a`.object_id})) {
    +            if (!_eqeq(a, b)) {
    +              return false;
    +            }
    +          }
    +        } else {
    +          if (!#{`a` == `b`}) {
    +            return false;
    +          }
    +        }
    +      }
    +
    +      return true;
    +    }
    +
    +    return _eqeq(self, other);
    +  }
    +end
    +
    +
    + +
    +

    + + #[](index, length = undefined) ⇒ Object + + + + Also known as: + slice + + + + +

    + + + + +
    +
    +
    +
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    +
    +
    # File 'opal/opal/corelib/array.rb', line 444
    +
    +def [](index, length = undefined)
    +  %x{
    +    if (index.$$is_range) {
    +      return $array_slice_range(self, index);
    +    }
    +    else if (index.$$is_arithmetic_seq) {
    +      return $array_slice_arithmetic_seq(self, index);
    +    }
    +    else {
    +      return $array_slice_index_length(self, index, length);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #[]=(index, value, extra = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +548
    +549
    +550
    +551
    +552
    +553
    +554
    +555
    +556
    +
    +
    # File 'opal/opal/corelib/array.rb', line 458
    +
    +def []=(index, value, extra = undefined)
    +  `$deny_frozen_access(self)`
    +
    +  data = nil
    +  %x{
    +    var i, size = self.length;
    +
    +    if (index.$$is_range) {
    +      if (value.$$is_array)
    +        data = #{value.to_a};
    +      else if (#{value.respond_to? :to_ary})
    +        data = #{value.to_ary.to_a};
    +      else
    +        data = [value];
    +
    +      var exclude = index.excl,
    +          from    = index.begin === nil ? 0 : $coerce_to(index.begin, Opal.Integer, 'to_int'),
    +          to      = index.end === nil ? -1 : $coerce_to(index.end, Opal.Integer, 'to_int');
    +
    +      if (from < 0) {
    +        from += size;
    +
    +        if (from < 0) {
    +          #{::Kernel.raise ::RangeError, "#{index.inspect} out of range"};
    +        }
    +      }
    +
    +      if (to < 0) {
    +        to += size;
    +      }
    +
    +      if (!exclude || index.end === nil) {
    +        to += 1;
    +      }
    +
    +      if (from > size) {
    +        for (i = size; i < from; i++) {
    +          self[i] = nil;
    +        }
    +      }
    +
    +      if (to < 0) {
    +        self.splice.apply(self, [from, 0].concat(data));
    +      }
    +      else {
    +        self.splice.apply(self, [from, to - from].concat(data));
    +      }
    +
    +      return value;
    +    } else {
    +      if (extra === undefined) {
    +        #{length = 1}
    +      } else {
    +        length = value;
    +        value  = extra;
    +
    +        if (value.$$is_array)
    +          data = #{value.to_a};
    +        else if (#{value.respond_to? :to_ary})
    +          data = #{value.to_ary.to_a};
    +        else
    +          data = [value];
    +      }
    +
    +      var old;
    +
    +      index  = $coerce_to(index, #{::Integer}, 'to_int');
    +      length = $coerce_to(length, #{::Integer}, 'to_int');
    +
    +      if (index < 0) {
    +        old    = index;
    +        index += size;
    +
    +        if (index < 0) {
    +          #{::Kernel.raise ::IndexError, "index #{`old`} too small for array; minimum #{`-self.length`}"};
    +        }
    +      }
    +
    +      if (length < 0) {
    +        #{::Kernel.raise ::IndexError, "negative length (#{length})"}
    +      }
    +
    +      if (index > size) {
    +        for (i = size; i < index; i++) {
    +          self[i] = nil;
    +        }
    +      }
    +
    +      if (extra === undefined) {
    +        self[index] = value;
    +      }
    +      else {
    +        self.splice.apply(self, [index, length].concat(data));
    +      }
    +
    +      return value;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 51
    +
    +def __marshal__(buffer)
    +  buffer.save_link(self)
    +  buffer.write_ivars_prefix(self)
    +  buffer.write_extends(self)
    +  buffer.write_user_class(::Array, self)
    +  buffer.append('[')
    +  buffer.write_array(self)
    +  buffer.write_ivars_suffix(self)
    +end
    +
    +
    + +
    +

    + + #any?(pattern = undefined, &block) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +558
    +559
    +560
    +561
    +
    +
    # File 'opal/opal/corelib/array.rb', line 558
    +
    +def any?(pattern = undefined, &block)
    +  `if (self.length === 0) return false`
    +  super
    +end
    +
    +
    + +
    +

    + + #assoc(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +563
    +564
    +565
    +566
    +567
    +568
    +569
    +570
    +571
    +572
    +573
    +
    +
    # File 'opal/opal/corelib/array.rb', line 563
    +
    +def assoc(object)
    +  %x{
    +    for (var i = 0, length = self.length, item; i < length; i++) {
    +      if (item = self[i], item.length && #{`item[0]` == object}) {
    +        return item;
    +      }
    +    }
    +
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

    + + #at(index) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +575
    +576
    +577
    +578
    +579
    +580
    +581
    +582
    +583
    +584
    +585
    +586
    +587
    +588
    +589
    +
    +
    # File 'opal/opal/corelib/array.rb', line 575
    +
    +def at(index)
    +  %x{
    +    index = $coerce_to(index, #{::Integer}, 'to_int')
    +
    +    if (index < 0) {
    +      index += self.length;
    +    }
    +
    +    if (index < 0 || index >= self.length) {
    +      return nil;
    +    }
    +
    +    return self[index];
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +638
    +639
    +640
    +641
    +642
    +
    +
    # File 'opal/opal/corelib/array.rb', line 630
    +
    +def bsearch(&block)
    +  return enum_for :bsearch unless block_given?
    +
    +  index = bsearch_index(&block)
    +
    +  %x{
    +    if (index != null && index.$$is_number) {
    +      return self[index];
    +    } else {
    +      return index;
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +591
    +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
    +
    +
    # File 'opal/opal/corelib/array.rb', line 591
    +
    +def bsearch_index(&block)
    +  return enum_for :bsearch_index unless block_given?
    +
    +  %x{
    +    var min = 0,
    +        max = self.length,
    +        mid,
    +        val,
    +        ret,
    +        smaller = false,
    +        satisfied = nil;
    +
    +    while (min < max) {
    +      mid = min + Math.floor((max - min) / 2);
    +      val = self[mid];
    +      ret = $yield1(block, val);
    +
    +      if (ret === true) {
    +        satisfied = mid;
    +        smaller = true;
    +      }
    +      else if (ret === false || ret === nil) {
    +        smaller = false;
    +      }
    +      else if (ret.$$is_number) {
    +        if (ret === 0) { return mid; }
    +        smaller = (ret < 0);
    +      }
    +      else {
    +        #{::Kernel.raise ::TypeError, "wrong argument type #{`ret`.class} (must be numeric, true, false or nil)"}
    +      }
    +
    +      if (smaller) { max = mid; } else { min = mid + 1; }
    +    }
    +
    +    return satisfied;
    +  }
    +end
    +
    +
    + +
    +

    + + #clearObject + + + + + +

    + + + + +
    +
    +
    +
    +687
    +688
    +689
    +690
    +691
    +692
    +693
    +
    +
    # File 'opal/opal/corelib/array.rb', line 687
    +
    +def clear
    +  `$deny_frozen_access(self)`
    +
    +  `self.splice(0, self.length)`
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +714
    +715
    +716
    +717
    +718
    +719
    +720
    +
    +
    # File 'opal/opal/corelib/array.rb', line 707
    +
    +def collect(&block)
    +  return enum_for(:collect) { size } unless block_given?
    +
    +  %x{
    +    var result = [];
    +
    +    for (var i = 0; i < self.length; i++) {
    +      var value = $yield1(block, self[i]);
    +      result[i] = value;
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +722
    +723
    +724
    +725
    +726
    +727
    +728
    +729
    +730
    +731
    +732
    +733
    +734
    +735
    +
    +
    # File 'opal/opal/corelib/array.rb', line 722
    +
    +def collect!(&block)
    +  return enum_for(:collect!) { size } unless block_given?
    +
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    for (var i = 0; i < self.length; i++) {
    +      var value = $yield1(block, self[i]);
    +      self[i] = value;
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #combination(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +751
    +752
    +753
    +754
    +755
    +756
    +757
    +758
    +759
    +760
    +761
    +762
    +763
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +776
    +777
    +778
    +779
    +780
    +781
    +782
    +783
    +784
    +785
    +786
    +787
    +788
    +789
    +790
    +791
    +792
    +793
    +794
    +795
    +796
    +797
    +
    +
    # File 'opal/opal/corelib/array.rb', line 751
    +
    +def combination(n)
    +  num = ::Opal.coerce_to! n, ::Integer, :to_int
    +  return enum_for(:combination, num) { `binomial_coefficient(#{self}.length, num)` } unless block_given?
    +
    +  %x{
    +    var i, length, stack, chosen, lev, done, next;
    +
    +    if (num === 0) {
    +      #{yield []}
    +    } else if (num === 1) {
    +      for (i = 0, length = self.length; i < length; i++) {
    +        #{yield `[self[i]]`}
    +      }
    +    }
    +    else if (num === self.length) {
    +      #{yield `self.slice()`}
    +    }
    +    else if (num >= 0 && num < self.length) {
    +      stack = [];
    +      for (i = 0; i <= num + 1; i++) {
    +        stack.push(0);
    +      }
    +
    +      chosen = [];
    +      lev = 0;
    +      done = false;
    +      stack[0] = -1;
    +
    +      while (!done) {
    +        chosen[lev] = self[stack[lev+1]];
    +        while (lev < num - 1) {
    +          lev++;
    +          next = stack[lev+1] = stack[lev] + 1;
    +          chosen[lev] = self[next];
    +        }
    +        #{ yield `chosen.slice()` }
    +        lev++;
    +        do {
    +          done = (lev === 0);
    +          stack[lev]++;
    +          lev--;
    +        } while ( stack[lev+1] + num === self.length + lev + 1 );
    +      }
    +    }
    +  }
    +  self
    +end
    +
    +
    + +
    +

    + + #compactObject + + + + + +

    + + + + +
    +
    +
    +
    +827
    +828
    +829
    +830
    +831
    +832
    +833
    +834
    +835
    +836
    +837
    +838
    +839
    +
    +
    # File 'opal/opal/corelib/array.rb', line 827
    +
    +def compact
    +  %x{
    +    var result = [];
    +
    +    for (var i = 0, length = self.length, item; i < length; i++) {
    +      if ((item = self[i]) !== nil) {
    +        result.push(item);
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #compact!Object + + + + + +

    + + + + +
    +
    +
    +
    +841
    +842
    +843
    +844
    +845
    +846
    +847
    +848
    +849
    +850
    +851
    +852
    +853
    +854
    +855
    +856
    +857
    +858
    +
    +
    # File 'opal/opal/corelib/array.rb', line 841
    +
    +def compact!
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var original = self.length;
    +
    +    for (var i = 0, length = self.length; i < length; i++) {
    +      if (self[i] === nil) {
    +        self.splice(i, 1);
    +
    +        length--;
    +        i--;
    +      }
    +    }
    +
    +    return self.length === original ? nil : self;
    +  }
    +end
    +
    +
    + +
    +

    + + #concat(*others) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +860
    +861
    +862
    +863
    +864
    +865
    +866
    +867
    +868
    +869
    +870
    +871
    +872
    +873
    +874
    +875
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +
    +
    # File 'opal/opal/corelib/array.rb', line 860
    +
    +def concat(*others)
    +  `$deny_frozen_access(self)`
    +
    +  others = others.map do |other|
    +    `other = convertToArray(other)`
    +
    +    if other.equal?(self)
    +      other = other.dup
    +    end
    +
    +    other
    +  end
    +
    +  others.each do |other|
    +    %x{
    +      for (var i = 0, length = other.length; i < length; i++) {
    +        self.push(other[i]);
    +      }
    +    }
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #count(object = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +695
    +696
    +697
    +698
    +699
    +700
    +701
    +
    +
    # File 'opal/opal/corelib/array.rb', line 695
    +
    +def count(object = undefined, &block)
    +  if `object !== undefined` || block
    +    super
    +  else
    +    size
    +  end
    +end
    +
    +
    + +
    +

    + + #cycle(n = nil, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +644
    +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
    +671
    +672
    +673
    +674
    +675
    +676
    +677
    +678
    +679
    +680
    +681
    +682
    +683
    +684
    +685
    +
    +
    # File 'opal/opal/corelib/array.rb', line 644
    +
    +def cycle(n = nil, &block)
    +  unless block_given?
    +    return enum_for(:cycle, n) do
    +      if n.nil?
    +        ::Float::INFINITY
    +      else
    +        n = ::Opal.coerce_to!(n, ::Integer, :to_int)
    +        n > 0 ? enumerator_size * n : 0
    +      end
    +    end
    +  end
    +
    +  return if empty? || n == 0
    +
    +  %x{
    +    var i, length, value;
    +
    +    if (n === nil) {
    +      while (true) {
    +        for (i = 0, length = self.length; i < length; i++) {
    +          value = $yield1(block, self[i]);
    +        }
    +      }
    +    }
    +    else {
    +      n = #{::Opal.coerce_to!(n, ::Integer, :to_int)};
    +      if (n <= 0) {
    +        return self;
    +      }
    +
    +      while (n > 0) {
    +        for (i = 0, length = self.length; i < length; i++) {
    +          value = $yield1(block, self[i]);
    +        }
    +
    +        n--;
    +      }
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #deconstructObject + + + + + +

    + + + + +
    +
    +
    +
    +2
    +3
    +4
    +
    +
    # File 'opal/opal/corelib/pattern_matching/base.rb', line 2
    +
    +def deconstruct
    +  self
    +end
    +
    +
    + +
    +

    + + #delete(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +884
    +885
    +886
    +887
    +888
    +889
    +890
    +891
    +892
    +893
    +894
    +895
    +896
    +897
    +898
    +899
    +900
    +901
    +902
    +903
    +904
    +905
    +906
    +907
    +
    +
    # File 'opal/opal/corelib/array.rb', line 884
    +
    +def delete(object)
    +  %x{
    +    var original = self.length;
    +
    +    for (var i = 0, length = original; i < length; i++) {
    +      if (#{`self[i]` == object}) {
    +        $deny_frozen_access(self);
    +
    +        self.splice(i, 1);
    +
    +        length--;
    +        i--;
    +      }
    +    }
    +
    +    if (self.length === original) {
    +      if (#{block_given?}) {
    +        return #{yield};
    +      }
    +      return nil;
    +    }
    +    return object;
    +  }
    +end
    +
    +
    + +
    +

    + + #delete_at(index) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +909
    +910
    +911
    +912
    +913
    +914
    +915
    +916
    +917
    +918
    +919
    +920
    +921
    +922
    +923
    +924
    +925
    +926
    +927
    +928
    +929
    +
    +
    # File 'opal/opal/corelib/array.rb', line 909
    +
    +def delete_at(index)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    index = $coerce_to(index, #{::Integer}, 'to_int');
    +
    +    if (index < 0) {
    +      index += self.length;
    +    }
    +
    +    if (index < 0 || index >= self.length) {
    +      return nil;
    +    }
    +
    +    var result = self[index];
    +
    +    self.splice(index, 1);
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +931
    +932
    +933
    +934
    +935
    +936
    +937
    +938
    +939
    +
    +
    # File 'opal/opal/corelib/array.rb', line 931
    +
    +def delete_if(&block)
    +  return enum_for(:delete_if) { size } unless block_given?
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    filterIf(self, $falsy, block)
    +  }
    +  self
    +end
    +
    +
    + +
    +

    + + #difference(*arrays) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +941
    +942
    +943
    +
    +
    # File 'opal/opal/corelib/array.rb', line 941
    +
    +def difference(*arrays)
    +  arrays.reduce(to_a.dup) { |a, b| a - b }
    +end
    +
    +
    + +
    +

    + + #dig(idx, *idxs) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +945
    +946
    +947
    +948
    +949
    +950
    +951
    +952
    +953
    +954
    +955
    +956
    +957
    +958
    +959
    +
    +
    # File 'opal/opal/corelib/array.rb', line 945
    +
    +def dig(idx, *idxs)
    +  item = self[idx]
    +
    +  %x{
    +    if (item === nil || idxs.length === 0) {
    +      return item;
    +    }
    +  }
    +
    +  unless item.respond_to?(:dig)
    +    ::Kernel.raise ::TypeError, "#{item.class} does not have #dig method"
    +  end
    +
    +  item.dig(*idxs)
    +end
    +
    +
    + +
    +

    + + #drop(number) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +961
    +962
    +963
    +964
    +965
    +966
    +967
    +968
    +969
    +970
    +971
    +
    +
    # File 'opal/opal/corelib/array.rb', line 961
    +
    +def drop(number)
    +  %x{
    +    number = $coerce_to(number, #{::Integer}, 'to_int');
    +
    +    if (number < 0) {
    +      #{::Kernel.raise ::ArgumentError}
    +    }
    +
    +    return self.slice(number);
    +  }
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +973
    +974
    +975
    +976
    +977
    +978
    +979
    +980
    +981
    +982
    +983
    +984
    +
    +
    # File 'opal/opal/corelib/array.rb', line 973
    +
    +def dup
    +  %x{
    +    if (self.$$class === Opal.Array &&
    +        self.$$class.$allocate.$$pristine &&
    +        self.$copy_instance_variables.$$pristine &&
    +        self.$initialize_dup.$$pristine) {
    +      return self.slice(0);
    +    }
    +  }
    +
    +  super
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +986
    +987
    +988
    +989
    +990
    +991
    +992
    +993
    +994
    +995
    +996
    +
    +
    # File 'opal/opal/corelib/array.rb', line 986
    +
    +def each(&block)
    +  return enum_for(:each) { size } unless block_given?
    +
    +  %x{
    +    for (var i = 0; i < self.length; i++) {
    +      $yield1(block, self[i]);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +998
    +999
    +1000
    +1001
    +1002
    +1003
    +1004
    +1005
    +1006
    +1007
    +1008
    +
    +
    # File 'opal/opal/corelib/array.rb', line 998
    +
    +def each_index(&block)
    +  return enum_for(:each_index) { size } unless block_given?
    +
    +  %x{
    +    for (var i = 0; i < self.length; i++) {
    +      $yield1(block, i);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #empty?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +1010
    +1011
    +1012
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1010
    +
    +def empty?
    +  `self.length === 0`
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +1014
    +1015
    +1016
    +1017
    +1018
    +1019
    +1020
    +1021
    +1022
    +1023
    +1024
    +1025
    +1026
    +1027
    +1028
    +1029
    +1030
    +1031
    +1032
    +1033
    +1034
    +1035
    +1036
    +1037
    +1038
    +1039
    +1040
    +1041
    +1042
    +1043
    +1044
    +1045
    +1046
    +1047
    +1048
    +1049
    +1050
    +1051
    +1052
    +1053
    +1054
    +1055
    +1056
    +1057
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1014
    +
    +def eql?(other)
    +  %x{
    +    var recursed = {};
    +
    +    function _eql(array, other) {
    +      var i, length, a, b;
    +
    +      if (!other.$$is_array) {
    +        return false;
    +      }
    +
    +      other = #{other.to_a};
    +
    +      if (array.length !== other.length) {
    +        return false;
    +      }
    +
    +      recursed[#{`array`.object_id}] = true;
    +
    +      for (i = 0, length = array.length; i < length; i++) {
    +        a = array[i];
    +        b = other[i];
    +        if (a.$$is_array) {
    +          if (b.$$is_array && b.length !== a.length) {
    +            return false;
    +          }
    +          if (!recursed.hasOwnProperty(#{`a`.object_id})) {
    +            if (!_eql(a, b)) {
    +              return false;
    +            }
    +          }
    +        } else {
    +          if (!#{`a`.eql?(`b`)}) {
    +            return false;
    +          }
    +        }
    +      }
    +
    +      return true;
    +    }
    +
    +    return _eql(self, other);
    +  }
    +end
    +
    +
    + +
    +

    + + #fetch(index, defaults = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1059
    +1060
    +1061
    +1062
    +1063
    +1064
    +1065
    +1066
    +1067
    +1068
    +1069
    +1070
    +1071
    +1072
    +1073
    +1074
    +1075
    +1076
    +1077
    +1078
    +1079
    +1080
    +1081
    +1082
    +1083
    +1084
    +1085
    +1086
    +1087
    +1088
    +1089
    +1090
    +1091
    +1092
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1059
    +
    +def fetch(index, defaults = undefined, &block)
    +  %x{
    +    var original = index;
    +
    +    index = $coerce_to(index, #{::Integer}, 'to_int');
    +
    +    if (index < 0) {
    +      index += self.length;
    +    }
    +
    +    if (index >= 0 && index < self.length) {
    +      return self[index];
    +    }
    +
    +    if (block !== nil && defaults != null) {
    +      #{warn('warning: block supersedes default value argument')}
    +    }
    +
    +    if (block !== nil) {
    +      return block(original);
    +    }
    +
    +    if (defaults != null) {
    +      return defaults;
    +    }
    +
    +    if (self.length === 0) {
    +      #{::Kernel.raise ::IndexError, "index #{`original`} outside of array bounds: 0...0"}
    +    }
    +    else {
    +      #{::Kernel.raise ::IndexError, "index #{`original`} outside of array bounds: -#{`self.length`}...#{`self.length`}"};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #fill(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1094
    +1095
    +1096
    +1097
    +1098
    +1099
    +1100
    +1101
    +1102
    +1103
    +1104
    +1105
    +1106
    +1107
    +1108
    +1109
    +1110
    +1111
    +1112
    +1113
    +1114
    +1115
    +1116
    +1117
    +1118
    +1119
    +1120
    +1121
    +1122
    +1123
    +1124
    +1125
    +1126
    +1127
    +1128
    +1129
    +1130
    +1131
    +1132
    +1133
    +1134
    +1135
    +1136
    +1137
    +1138
    +1139
    +1140
    +1141
    +1142
    +1143
    +1144
    +1145
    +1146
    +1147
    +1148
    +1149
    +1150
    +1151
    +1152
    +1153
    +1154
    +1155
    +1156
    +1157
    +1158
    +1159
    +1160
    +1161
    +1162
    +1163
    +1164
    +1165
    +1166
    +1167
    +1168
    +1169
    +1170
    +1171
    +1172
    +1173
    +1174
    +1175
    +1176
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1094
    +
    +def fill(*args, &block)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var i, length, value;
    +  }
    +
    +  if block
    +    if `args.length > 2`
    +      ::Kernel.raise ::ArgumentError, "wrong number of arguments (#{args.length} for 0..2)"
    +    end
    +
    +    one, two = args
    +  else
    +    if `args.length == 0`
    +      ::Kernel.raise ::ArgumentError, 'wrong number of arguments (0 for 1..3)'
    +    elsif `args.length > 3`
    +      ::Kernel.raise ::ArgumentError, "wrong number of arguments (#{args.length} for 1..3)"
    +    end
    +
    +    obj, one, two = args
    +  end
    +
    +  if ::Range === one
    +    ::Kernel.raise ::TypeError, 'length invalid with range' if two
    +
    +    left   = `one.begin === nil ? 0 : $coerce_to(one.begin, #{::Integer}, 'to_int')`
    +    `left += this.length` if `left < 0`
    +    ::Kernel.raise ::RangeError, "#{one.inspect} out of range" if `left < 0`
    +
    +    right = `one.end === nil ? -1 : $coerce_to(one.end, #{::Integer}, 'to_int')`
    +    `right += this.length` if `right < 0`
    +    `right += 1` unless one.exclude_end?
    +
    +    return self if `right <= left`
    +  elsif one
    +    left   = `$coerce_to(one, #{::Integer}, 'to_int')`
    +    `left += this.length` if `left < 0`
    +    left   = 0 if `left < 0`
    +
    +    if two
    +      right = `$coerce_to(two, #{::Integer}, 'to_int')`
    +
    +      return self if `right == 0`
    +
    +      `right += left`
    +    else
    +      right = `this.length`
    +    end
    +  else
    +    left  = 0
    +    right = `this.length`
    +  end
    +
    +  if `left > this.length`
    +    %x{
    +      for (i = this.length; i < right; i++) {
    +        self[i] = nil;
    +      }
    +    }
    +  end
    +
    +  if `right > this.length`
    +    `this.length = right`
    +  end
    +
    +  if block
    +    %x{
    +      for (length = this.length; left < right; left++) {
    +        value = block(left);
    +        self[left] = value;
    +      }
    +    }
    +  else
    +    %x{
    +      for (length = this.length; left < right; left++) {
    +        self[left] = #{obj};
    +      }
    +    }
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #first(count = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1178
    +1179
    +1180
    +1181
    +1182
    +1183
    +1184
    +1185
    +1186
    +1187
    +1188
    +1189
    +1190
    +1191
    +1192
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1178
    +
    +def first(count = undefined)
    +  %x{
    +    if (count == null) {
    +      return self.length === 0 ? nil : self[0];
    +    }
    +
    +    count = $coerce_to(count, #{::Integer}, 'to_int');
    +
    +    if (count < 0) {
    +      #{::Kernel.raise ::ArgumentError, 'negative array size'};
    +    }
    +
    +    return self.slice(0, count);
    +  }
    +end
    +
    +
    + +
    +

    + + #flatten(level = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1194
    +1195
    +1196
    +1197
    +1198
    +1199
    +1200
    +1201
    +1202
    +1203
    +1204
    +1205
    +1206
    +1207
    +1208
    +1209
    +1210
    +1211
    +1212
    +1213
    +1214
    +1215
    +1216
    +1217
    +1218
    +1219
    +1220
    +1221
    +1222
    +1223
    +1224
    +1225
    +1226
    +1227
    +1228
    +1229
    +1230
    +1231
    +1232
    +1233
    +1234
    +1235
    +1236
    +1237
    +1238
    +1239
    +1240
    +1241
    +1242
    +1243
    +1244
    +1245
    +1246
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1194
    +
    +def flatten(level = undefined)
    +  %x{
    +    function _flatten(array, level) {
    +      var result = [],
    +          i, length,
    +          item, ary;
    +
    +      array = #{`array`.to_a};
    +
    +      for (i = 0, length = array.length; i < length; i++) {
    +        item = array[i];
    +
    +        if (!$respond_to(item, '$to_ary', true)) {
    +          result.push(item);
    +          continue;
    +        }
    +
    +        ary = #{`item`.to_ary};
    +
    +        if (ary === nil) {
    +          result.push(item);
    +          continue;
    +        }
    +
    +        if (!ary.$$is_array) {
    +          #{::Kernel.raise ::TypeError};
    +        }
    +
    +        if (ary === self) {
    +          #{::Kernel.raise ::ArgumentError};
    +        }
    +
    +        switch (level) {
    +        case undefined:
    +          result = result.concat(_flatten(ary));
    +          break;
    +        case 0:
    +          result.push(ary);
    +          break;
    +        default:
    +          fast_push(result, _flatten(ary, level - 1));
    +        }
    +      }
    +      return result;
    +    }
    +
    +    if (level !== undefined) {
    +      level = $coerce_to(level, #{::Integer}, 'to_int');
    +    }
    +
    +    return _flatten(self, level);
    +  }
    +end
    +
    +
    + +
    +

    + + #flatten!(level = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1248
    +1249
    +1250
    +1251
    +1252
    +1253
    +1254
    +1255
    +1256
    +1257
    +1258
    +1259
    +1260
    +1261
    +1262
    +1263
    +1264
    +1265
    +1266
    +1267
    +1268
    +1269
    +1270
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1248
    +
    +def flatten!(level = undefined)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var flattened = #{flatten level};
    +
    +    if (self.length == flattened.length) {
    +      for (var i = 0, length = self.length; i < length; i++) {
    +        if (self[i] !== flattened[i]) {
    +          break;
    +        }
    +      }
    +
    +      if (i == length) {
    +        return nil;
    +      }
    +    }
    +
    +    #{replace `flattened`};
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #freezeObject + + + + + +

    + + + + +
    +
    +
    +
    +1272
    +1273
    +1274
    +1275
    +1276
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1272
    +
    +def freeze
    +  return self if frozen?
    +
    +  `$freeze(self)`
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +1280
    +1281
    +1282
    +1283
    +1284
    +1285
    +1286
    +1287
    +1288
    +1289
    +1290
    +1291
    +1292
    +1293
    +1294
    +1295
    +1296
    +1297
    +1298
    +1299
    +1300
    +1301
    +1302
    +1303
    +1304
    +1305
    +1306
    +1307
    +1308
    +1309
    +1310
    +1311
    +1312
    +1313
    +1314
    +1315
    +1316
    +1317
    +1318
    +1319
    +1320
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1280
    +
    +def hash
    +  %x{
    +    var top = ($hash_ids === undefined),
    +        result = $opal32_init(),
    +        hash_id = self.$object_id(),
    +        item, i, key;
    +
    +    result = $opal32_add(result, 0xA);
    +    result = $opal32_add(result, self.length);
    +
    +    if (top) {
    +      $hash_ids = Object.create(null);
    +    }
    +    // return early for recursive structures
    +    else if ($hash_ids[hash_id]) {
    +      return $opal32_add(result, 0x01010101);
    +    }
    +
    +    try {
    +      for (key in $hash_ids) {
    +        item = $hash_ids[key];
    +        if (#{eql?(`item`)}) {
    +          return $opal32_add(result, 0x01010101);
    +        }
    +      }
    +
    +      $hash_ids[hash_id] = self;
    +
    +      for (i = 0; i < self.length; i++) {
    +        item = self[i];
    +        result = $opal32_add(result, item.$hash());
    +      }
    +
    +      return result;
    +    } finally {
    +      if (top) {
    +        $hash_ids = undefined;
    +      }
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #include?(member) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +1322
    +1323
    +1324
    +1325
    +1326
    +1327
    +1328
    +1329
    +1330
    +1331
    +1332
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1322
    +
    +def include?(member)
    +  %x{
    +    for (var i = 0, length = self.length; i < length; i++) {
    +      if (#{`self[i]` == member}) {
    +        return true;
    +      }
    +    }
    +
    +    return false;
    +  }
    +end
    +
    +
    + +
    +

    + + #index(object = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1334
    +1335
    +1336
    +1337
    +1338
    +1339
    +1340
    +1341
    +1342
    +1343
    +1344
    +1345
    +1346
    +1347
    +1348
    +1349
    +1350
    +1351
    +1352
    +1353
    +1354
    +1355
    +1356
    +1357
    +1358
    +1359
    +1360
    +1361
    +1362
    +1363
    +1364
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1334
    +
    +def index(object = undefined, &block)
    +  %x{
    +    var i, length, value;
    +
    +    if (object != null && block !== nil) {
    +      #{warn('warning: given block not used')}
    +    }
    +
    +    if (object != null) {
    +      for (i = 0, length = self.length; i < length; i++) {
    +        if (#{`self[i]` == object}) {
    +          return i;
    +        }
    +      }
    +    }
    +    else if (block !== nil) {
    +      for (i = 0; i < self.length; i++) {
    +        value = block(self[i]);
    +
    +        if (value !== false && value !== nil) {
    +          return i;
    +        }
    +      }
    +    }
    +    else {
    +      return #{enum_for :index};
    +    }
    +
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +703
    +704
    +705
    +
    +
    # File 'opal/opal/corelib/array.rb', line 703
    +
    +def initialize_copy(other)
    +  replace other
    +end
    +
    +
    + +
    +

    + + #insert(index, *objects) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1366
    +1367
    +1368
    +1369
    +1370
    +1371
    +1372
    +1373
    +1374
    +1375
    +1376
    +1377
    +1378
    +1379
    +1380
    +1381
    +1382
    +1383
    +1384
    +1385
    +1386
    +1387
    +1388
    +1389
    +1390
    +1391
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1366
    +
    +def insert(index, *objects)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    index = $coerce_to(index, #{::Integer}, 'to_int');
    +
    +    if (objects.length > 0) {
    +      if (index < 0) {
    +        index += self.length + 1;
    +
    +        if (index < 0) {
    +          #{ ::Kernel.raise ::IndexError, "#{index} is out of bounds" };
    +        }
    +      }
    +      if (index > self.length) {
    +        for (var i = self.length; i < index; i++) {
    +          self.push(nil);
    +        }
    +      }
    +
    +      self.splice.apply(self, [index, 0].concat(objects));
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + Also known as: + to_s + + + + +

    + + + + +
    +
    +
    +
    +1395
    +1396
    +1397
    +1398
    +1399
    +1400
    +1401
    +1402
    +1403
    +1404
    +1405
    +1406
    +1407
    +1408
    +1409
    +1410
    +1411
    +1412
    +1413
    +1414
    +1415
    +1416
    +1417
    +1418
    +1419
    +1420
    +1421
    +1422
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1395
    +
    +def inspect
    +  %x{
    +    var result = [],
    +    id = #{__id__},
    +    pushed = true;
    +  }
    +
    +  begin
    +    %x{
    +      if (inspect_stack.indexOf(id) !== -1) {
    +        pushed = false;
    +        return '[...]';
    +      }
    +      inspect_stack.push(id)
    +
    +      for (var i = 0, length = self.length; i < length; i++) {
    +        var item = #{self[`i`]};
    +
    +        result.push(#{Opal.inspect(`item`)});
    +      }
    +
    +      return '[' + result.join(', ') + ']';
    +    }
    +    nil
    +  ensure
    +    `if (pushed) inspect_stack.pop()`
    +  end
    +end
    +
    +
    + +
    +

    + + #instance_variablesObject + + + + + +

    + + + + +
    +
    +
    +
    +2548
    +2549
    +2550
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2548
    +
    +def instance_variables
    +  super.reject { |ivar| `/^@\d+$/.test(#{ivar})` || ivar == '@length' }
    +end
    +
    +
    + +
    +

    + + #intersect?(other) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +1451
    +1452
    +1453
    +1454
    +1455
    +1456
    +1457
    +1458
    +1459
    +1460
    +1461
    +1462
    +1463
    +1464
    +1465
    +1466
    +1467
    +1468
    +1469
    +1470
    +1471
    +1472
    +1473
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1451
    +
    +def intersect?(other)
    +  %x{
    +    var small, large, hash = #{{}}, i, length;
    +    if (self.length < other.length) {
    +      small = self;
    +      large = other;
    +    } else {
    +      small = other;
    +      large = self;
    +    }
    +
    +    for (i = 0, length = small.length; i < length; i++) {
    +      $hash_put(hash, small[i], true);
    +    }
    +
    +    for (i = 0, length = large.length; i < length; i++) {
    +      if ($hash_get(hash, large[i])) {
    +        return true;
    +      }
    +    }
    +    return false;
    +  }
    +end
    +
    +
    + +
    +

    + + #intersection(*arrays) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1424
    +1425
    +1426
    +1427
    +1428
    +1429
    +1430
    +1431
    +1432
    +1433
    +1434
    +1435
    +1436
    +1437
    +1438
    +1439
    +1440
    +1441
    +1442
    +1443
    +1444
    +1445
    +1446
    +1447
    +1448
    +1449
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1424
    +
    +def intersection(*arrays)
    +  %x{
    +    if (arrays.length === 0) {
    +      return #{to_a.dup};
    +    }
    +    arrays = arrays.map(convertToArray);
    +    if (self.length === 0) {
    +      return [];
    +    }
    +  }
    +
    +  arrays = arrays.sort_by(&:length)
    +  # When self is the smallest among the arrays
    +  if `self.length < arrays[0].length`
    +    return arrays.reduce(self, &:&)
    +  end
    +
    +  # First, calculate intersection of argument arrays.
    +  # Array#& is faster when the argument size is small.
    +  # So `largest & shortest & second_shortest & ...` would be the fastest.
    +  largest = `arrays.pop()`
    +  intersection_of_args = arrays.reduce(largest, &:&)
    +
    +  # self array must come last to maintain the order
    +  self & intersection_of_args
    +end
    +
    +
    + +
    +

    + + #join(sep = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1475
    +1476
    +1477
    +1478
    +1479
    +1480
    +1481
    +1482
    +1483
    +1484
    +1485
    +1486
    +1487
    +1488
    +1489
    +1490
    +1491
    +1492
    +1493
    +1494
    +1495
    +1496
    +1497
    +1498
    +1499
    +1500
    +1501
    +1502
    +1503
    +1504
    +1505
    +1506
    +1507
    +1508
    +1509
    +1510
    +1511
    +1512
    +1513
    +1514
    +1515
    +1516
    +1517
    +1518
    +1519
    +1520
    +1521
    +1522
    +1523
    +1524
    +1525
    +1526
    +1527
    +1528
    +1529
    +1530
    +1531
    +1532
    +1533
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1475
    +
    +def join(sep = nil)
    +  return '' if `self.length === 0`
    +
    +  if `sep === nil`
    +    sep = $,
    +  end
    +
    +  %x{
    +    var result = [];
    +    var i, length, item, tmp;
    +
    +    for (i = 0, length = self.length; i < length; i++) {
    +      item = self[i];
    +
    +      if ($respond_to(item, '$to_str')) {
    +        tmp = #{`item`.to_str};
    +
    +        if (tmp !== nil) {
    +          result.push(#{`tmp`.to_s});
    +
    +          continue;
    +        }
    +      }
    +
    +      if ($respond_to(item, '$to_ary')) {
    +        tmp = #{`item`.to_ary};
    +
    +        if (tmp === self) {
    +          #{::Kernel.raise ::ArgumentError};
    +        }
    +
    +        if (tmp !== nil) {
    +          result.push(#{`tmp`.join(sep)});
    +
    +          continue;
    +        }
    +      }
    +
    +      if ($respond_to(item, '$to_s')) {
    +        tmp = #{`item`.to_s};
    +
    +        if (tmp !== nil) {
    +          result.push(tmp);
    +
    +          continue;
    +        }
    +      }
    +
    +      #{::Kernel.raise ::NoMethodError.new("#{Opal.inspect(item)} doesn't respond to #to_str, #to_ary or #to_s", 'to_str')};
    +    }
    +
    +    if (sep === nil) {
    +      return result.join('');
    +    }
    +    else {
    +      return result.join(#{::Opal.coerce_to!(sep, ::String, :to_str).to_s});
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1535
    +1536
    +1537
    +1538
    +1539
    +1540
    +1541
    +1542
    +1543
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1535
    +
    +def keep_if(&block)
    +  return enum_for(:keep_if) { size } unless block_given?
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    filterIf(self, $truthy, block)
    +  }
    +  self
    +end
    +
    +
    + +
    +

    + + #last(count = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1545
    +1546
    +1547
    +1548
    +1549
    +1550
    +1551
    +1552
    +1553
    +1554
    +1555
    +1556
    +1557
    +1558
    +1559
    +1560
    +1561
    +1562
    +1563
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1545
    +
    +def last(count = undefined)
    +  %x{
    +    if (count == null) {
    +      return self.length === 0 ? nil : self[self.length - 1];
    +    }
    +
    +    count = $coerce_to(count, #{::Integer}, 'to_int');
    +
    +    if (count < 0) {
    +      #{::Kernel.raise ::ArgumentError, 'negative array size'};
    +    }
    +
    +    if (count > self.length) {
    +      count = self.length;
    +    }
    +
    +    return self.slice(self.length - count, self.length);
    +  }
    +end
    +
    +
    + +
    +

    + + #lengthObject + + + + Also known as: + size + + + + +

    + + + + +
    +
    +
    +
    +1565
    +1566
    +1567
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1565
    +
    +def length
    +  `self.length`
    +end
    +
    +
    + +
    +

    + + #max(n = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1569
    +1570
    +1571
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1569
    +
    +def max(n = undefined, &block)
    +  each.max(n, &block)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1573
    +1574
    +1575
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1573
    +
    +def min(&block)
    +  each.min(&block)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +
    +
    # File 'opal/opal/corelib/array/pack.rb', line 391
    +
    +def pack(format)
    +  format = ::Opal.coerce_to!(format, ::String, :to_str).gsub(/\s/, '').delete("\000")
    +
    +  %x{
    +    var output = '';
    +
    +    var buffer = self.slice();
    +
    +    function autocomplete(array, size) {
    +      while (array.length < size) {
    +        array.push(nil);
    +      }
    +
    +      return array;
    +    }
    +
    +    function processChunk(directive, count) {
    +      var chunk,
    +          chunkReader = readChunk[directive];
    +
    +      if (chunkReader == null) {
    +        #{::Kernel.raise "Unsupported pack directive #{`directive`.inspect} (no chunk reader defined)"}
    +      }
    +
    +      var chunkData = chunkReader(buffer, count);
    +      chunk = chunkData.chunk;
    +      buffer = chunkData.rest;
    +
    +      var handler = handlers[directive];
    +
    +      if (handler == null) {
    +        #{::Kernel.raise "Unsupported pack directive #{`directive`.inspect} (no handler defined)"}
    +      }
    +
    +      return handler(chunk);
    +    }
    +
    +    eachDirectiveAndCount(format, function(directive, count) {
    +      var part = processChunk(directive, count);
    +
    +      if (count !== Infinity) {
    +        var shouldAutocomplete = autocompletion[directive]
    +
    +        if (shouldAutocomplete == null) {
    +          #{::Kernel.raise "Unsupported pack directive #{`directive`.inspect} (no autocompletion rule defined)"}
    +        }
    +
    +        if (shouldAutocomplete) {
    +          autocomplete(part, count);
    +        }
    +      }
    +
    +      output = output.concat(part);
    +    });
    +
    +    if (format.match(/^(U\*?)+$/)) {
    +      return output;
    +    }
    +    else {
    +      return Opal.enc(output, "binary");
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #permutation(num = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1590
    +1591
    +1592
    +1593
    +1594
    +1595
    +1596
    +1597
    +1598
    +1599
    +1600
    +1601
    +1602
    +1603
    +1604
    +1605
    +1606
    +1607
    +1608
    +1609
    +1610
    +1611
    +1612
    +1613
    +1614
    +1615
    +1616
    +1617
    +1618
    +1619
    +1620
    +1621
    +1622
    +1623
    +1624
    +1625
    +1626
    +1627
    +1628
    +1629
    +1630
    +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
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1590
    +
    +def permutation(num = undefined, &block)
    +  unless block_given?
    +    return enum_for(:permutation, num) do
    +      `descending_factorial(self.length, num === undefined ? self.length : num)`
    +    end
    +  end
    +
    +  %x{
    +    var permute, offensive, output;
    +
    +    if (num === undefined) {
    +      num = self.length;
    +    }
    +    else {
    +      num = $coerce_to(num, #{::Integer}, 'to_int');
    +    }
    +
    +    if (num < 0 || self.length < num) {
    +      // no permutations, yield nothing
    +    }
    +    else if (num === 0) {
    +      // exactly one permutation: the zero-length array
    +      #{ yield [] }
    +    }
    +    else if (num === 1) {
    +      // this is a special, easy case
    +      for (var i = 0; i < self.length; i++) {
    +        #{ yield `[self[i]]` }
    +      }
    +    }
    +    else {
    +      // this is the general case
    +      #{ perm = Array.new(num) };
    +      #{ used = Array.new(`self.length`, false) };
    +
    +      permute = function(num, perm, index, used, blk) {
    +        self = this;
    +        for(var i = 0; i < self.length; i++){
    +          if(#{ !used[`i`] }) {
    +            perm[index] = i;
    +            if(index < num - 1) {
    +              used[i] = true;
    +              permute.call(self, num, perm, index + 1, used, blk);
    +              used[i] = false;
    +            }
    +            else {
    +              output = [];
    +              for (var j = 0; j < perm.length; j++) {
    +                output.push(self[perm[j]]);
    +              }
    +              $yield1(blk, output);
    +            }
    +          }
    +        }
    +      }
    +
    +      if (#{block_given?}) {
    +        // offensive (both definitions) copy.
    +        offensive = self.slice();
    +        permute.call(offensive, num, perm, 0, used, block);
    +      }
    +      else {
    +        permute.call(self, num, perm, 0, used, block);
    +      }
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #pop(count = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1684
    +1685
    +1686
    +1687
    +1688
    +1689
    +1690
    +1691
    +1692
    +1693
    +1694
    +1695
    +1696
    +1697
    +1698
    +1699
    +1700
    +1701
    +1702
    +1703
    +1704
    +1705
    +1706
    +1707
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1684
    +
    +def pop(count = undefined)
    +  `$deny_frozen_access(self)`
    +
    +  if `count === undefined`
    +    return if `self.length === 0`
    +    return `self.pop()`
    +  end
    +
    +  count = `$coerce_to(count, #{::Integer}, 'to_int')`
    +
    +  if `count < 0`
    +    ::Kernel.raise ::ArgumentError, 'negative array size'
    +  end
    +
    +  return [] if `self.length === 0`
    +
    +  if `count === 1`
    +    `[self.pop()]`
    +  elsif `count > self.length`
    +    `self.splice(0, self.length)`
    +  else
    +    `self.splice(self.length - count, self.length)`
    +  end
    +end
    +
    +
    + +
    +

    + + #product(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1709
    +1710
    +1711
    +1712
    +1713
    +1714
    +1715
    +1716
    +1717
    +1718
    +1719
    +1720
    +1721
    +1722
    +1723
    +1724
    +1725
    +1726
    +1727
    +1728
    +1729
    +1730
    +1731
    +1732
    +1733
    +1734
    +1735
    +1736
    +1737
    +1738
    +1739
    +1740
    +1741
    +1742
    +1743
    +1744
    +1745
    +1746
    +1747
    +1748
    +1749
    +1750
    +1751
    +1752
    +1753
    +1754
    +1755
    +1756
    +1757
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1709
    +
    +def product(*args, &block)
    +  %x{
    +    var result = #{block_given?} ? null : [],
    +        n = args.length + 1,
    +        counters = new Array(n),
    +        lengths  = new Array(n),
    +        arrays   = new Array(n),
    +        i, m, subarray, len, resultlen = 1;
    +
    +    arrays[0] = self;
    +    for (i = 1; i < n; i++) {
    +      arrays[i] = $coerce_to(args[i - 1], #{::Array}, 'to_ary');
    +    }
    +
    +    for (i = 0; i < n; i++) {
    +      len = arrays[i].length;
    +      if (len === 0) {
    +        return result || self;
    +      }
    +      resultlen *= len;
    +      if (resultlen > 2147483647) {
    +        #{::Kernel.raise ::RangeError, 'too big to product'}
    +      }
    +      lengths[i] = len;
    +      counters[i] = 0;
    +    }
    +
    +    outer_loop: for (;;) {
    +      subarray = [];
    +      for (i = 0; i < n; i++) {
    +        subarray.push(arrays[i][counters[i]]);
    +      }
    +      if (result) {
    +        result.push(subarray);
    +      } else {
    +        #{yield `subarray`}
    +      }
    +      m = n - 1;
    +      counters[m]++;
    +      while (counters[m] === lengths[m]) {
    +        counters[m] = 0;
    +        if (--m < 0) break outer_loop;
    +        counters[m]++;
    +      }
    +    }
    +
    +    return result || self;
    +  }
    +end
    +
    +
    + +
    +

    + + #push(*objects) ⇒ Object + + + + Also known as: + append + + + + +

    + + + + +
    +
    +
    +
    +1759
    +1760
    +1761
    +1762
    +1763
    +1764
    +1765
    +1766
    +1767
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1759
    +
    +def push(*objects)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    fast_push(self, objects);
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #rassoc(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1769
    +1770
    +1771
    +1772
    +1773
    +1774
    +1775
    +1776
    +1777
    +1778
    +1779
    +1780
    +1781
    +1782
    +1783
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1769
    +
    +def rassoc(object)
    +  %x{
    +    for (var i = 0, length = self.length, item; i < length; i++) {
    +      item = self[i];
    +
    +      if (item.length && item[1] !== undefined) {
    +        if (#{`item[1]` == object}) {
    +          return item;
    +        }
    +      }
    +    }
    +
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1785
    +1786
    +1787
    +1788
    +1789
    +1790
    +1791
    +1792
    +1793
    +1794
    +1795
    +1796
    +1797
    +1798
    +1799
    +1800
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1785
    +
    +def reject(&block)
    +  return enum_for(:reject) { size } unless block_given?
    +
    +  %x{
    +    var result = [];
    +
    +    for (var i = 0, value; i < self.length; i++) {
    +      value = block(self[i]);
    +
    +      if (value === false || value === nil) {
    +        result.push(self[i]);
    +      }
    +    }
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1802
    +1803
    +1804
    +1805
    +1806
    +1807
    +1808
    +1809
    +1810
    +1811
    +1812
    +1813
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1802
    +
    +def reject!(&block)
    +  return enum_for(:reject!) { size } unless block_given?
    +
    +  `$deny_frozen_access(self)`
    +
    +  original = length
    +  delete_if(&block)
    +
    +  unless length == original
    +    self
    +  end
    +end
    +
    +
    + +
    +

    + + #repeated_combination(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +824
    +825
    +
    +
    # File 'opal/opal/corelib/array.rb', line 799
    +
    +def repeated_combination(n)
    +  num = ::Opal.coerce_to! n, ::Integer, :to_int
    +
    +  unless block_given?
    +    return enum_for(:repeated_combination, num) { `binomial_coefficient(self.length + num - 1, num)` }
    +  end
    +
    +  %x{
    +    function iterate(max, from, buffer, self) {
    +      if (buffer.length == max) {
    +        var copy = buffer.slice();
    +        #{yield `copy`}
    +        return;
    +      }
    +      for (var i = from; i < self.length; i++) {
    +        buffer.push(self[i]);
    +        iterate(max, i, buffer, self);
    +        buffer.pop();
    +      }
    +    }
    +
    +    if (num >= 0) {
    +      iterate(num, 0, [], self);
    +    }
    +  }
    +  self
    +end
    +
    +
    + +
    +

    + + #repeated_permutation(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1660
    +1661
    +1662
    +1663
    +1664
    +1665
    +1666
    +1667
    +1668
    +1669
    +1670
    +1671
    +1672
    +1673
    +1674
    +1675
    +1676
    +1677
    +1678
    +1679
    +1680
    +1681
    +1682
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1660
    +
    +def repeated_permutation(n)
    +  num = ::Opal.coerce_to! n, ::Integer, :to_int
    +  return enum_for(:repeated_permutation, num) { num >= 0 ? size**num : 0 } unless block_given?
    +
    +  %x{
    +    function iterate(max, buffer, self) {
    +      if (buffer.length == max) {
    +        var copy = buffer.slice();
    +        #{yield `copy`}
    +        return;
    +      }
    +      for (var i = 0; i < self.length; i++) {
    +        buffer.push(self[i]);
    +        iterate(max, buffer, self);
    +        buffer.pop();
    +      }
    +    }
    +
    +    iterate(num, [], self.slice());
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1815
    +1816
    +1817
    +1818
    +1819
    +1820
    +1821
    +1822
    +1823
    +1824
    +1825
    +1826
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1815
    +
    +def replace(other)
    +  `$deny_frozen_access(self)`
    +
    +  other = `convertToArray(other)`
    +
    +  %x{
    +    if (self.length > 0) self.splice(0, self.length);
    +    fast_push(self, other);
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #reverseObject + + + + + +

    + + + + +
    +
    +
    +
    +1828
    +1829
    +1830
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1828
    +
    +def reverse
    +  `self.slice(0).reverse()`
    +end
    +
    +
    + +
    +

    + + #reverse!Object + + + + + +

    + + + + +
    +
    +
    +
    +1832
    +1833
    +1834
    +1835
    +1836
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1832
    +
    +def reverse!
    +  `$deny_frozen_access(self)`
    +
    +  `self.reverse()`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1838
    +1839
    +1840
    +1841
    +1842
    +1843
    +1844
    +1845
    +1846
    +1847
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1838
    +
    +def reverse_each(&block)
    +  return enum_for(:reverse_each) { size } unless block_given?
    +
    +  %x{
    +    for (var i = self.length - 1; i >= 0; i--) {
    +      $yield1(block, self[i]);
    +    }
    +  }
    +  self
    +end
    +
    +
    + +
    +

    + + #rindex(object = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1849
    +1850
    +1851
    +1852
    +1853
    +1854
    +1855
    +1856
    +1857
    +1858
    +1859
    +1860
    +1861
    +1862
    +1863
    +1864
    +1865
    +1866
    +1867
    +1868
    +1869
    +1870
    +1871
    +1872
    +1873
    +1874
    +1875
    +1876
    +1877
    +1878
    +1879
    +1880
    +1881
    +1882
    +1883
    +1884
    +1885
    +1886
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1849
    +
    +def rindex(object = undefined, &block)
    +  %x{
    +    var i, value;
    +
    +    if (object != null && block !== nil) {
    +      #{warn('warning: given block not used')}
    +    }
    +
    +    if (object != null) {
    +      for (i = self.length - 1; i >= 0; i--) {
    +        if (i >= self.length) {
    +          break;
    +        }
    +        if (#{`self[i]` == `object`}) {
    +          return i;
    +        }
    +      }
    +    }
    +    else if (block !== nil) {
    +      for (i = self.length - 1; i >= 0; i--) {
    +        if (i >= self.length) {
    +          break;
    +        }
    +
    +        value = block(self[i]);
    +
    +        if (value !== false && value !== nil) {
    +          return i;
    +        }
    +      }
    +    }
    +    else if (object == null) {
    +      return #{enum_for :rindex};
    +    }
    +
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

    + + #rotate(n = 1) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1888
    +1889
    +1890
    +1891
    +1892
    +1893
    +1894
    +1895
    +1896
    +1897
    +1898
    +1899
    +1900
    +1901
    +1902
    +1903
    +1904
    +1905
    +1906
    +1907
    +1908
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1888
    +
    +def rotate(n = 1)
    +  %x{
    +    var ary, idx, firstPart, lastPart;
    +
    +    n = $coerce_to(n, #{::Integer}, 'to_int')
    +
    +    if (self.length === 1) {
    +      return self.slice();
    +    }
    +    if (self.length === 0) {
    +      return [];
    +    }
    +
    +    ary = self.slice();
    +    idx = n % ary.length;
    +
    +    firstPart = ary.slice(idx);
    +    lastPart = ary.slice(0, idx);
    +    return firstPart.concat(lastPart);
    +  }
    +end
    +
    +
    + +
    +

    + + #rotate!(cnt = 1) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1910
    +1911
    +1912
    +1913
    +1914
    +1915
    +1916
    +1917
    +1918
    +1919
    +1920
    +1921
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1910
    +
    +def rotate!(cnt = 1)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    if (self.length === 0 || self.length === 1) {
    +      return self;
    +    }
    +    cnt = $coerce_to(cnt, #{::Integer}, 'to_int');
    +  }
    +  ary = rotate(cnt)
    +  replace ary
    +end
    +
    +
    + +
    +

    + + #sample(count = undefined, options = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1937
    +1938
    +1939
    +1940
    +1941
    +1942
    +1943
    +1944
    +1945
    +1946
    +1947
    +1948
    +1949
    +1950
    +1951
    +1952
    +1953
    +1954
    +1955
    +1956
    +1957
    +1958
    +1959
    +1960
    +1961
    +1962
    +1963
    +1964
    +1965
    +1966
    +1967
    +1968
    +1969
    +1970
    +1971
    +1972
    +1973
    +1974
    +1975
    +1976
    +1977
    +1978
    +1979
    +1980
    +1981
    +1982
    +1983
    +1984
    +1985
    +1986
    +1987
    +1988
    +1989
    +1990
    +1991
    +1992
    +1993
    +1994
    +1995
    +1996
    +1997
    +1998
    +1999
    +2000
    +2001
    +2002
    +2003
    +2004
    +2005
    +2006
    +2007
    +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
    +2040
    +2041
    +2042
    +2043
    +2044
    +2045
    +2046
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1937
    +
    +def sample(count = undefined, options = undefined)
    +  return at ::Kernel.rand(`self.length`) if `count === undefined`
    +
    +  if `options === undefined`
    +    if (o = ::Opal.coerce_to? count, ::Hash, :to_hash)
    +      options = o
    +      count = nil
    +    else
    +      options = nil
    +      count = `$coerce_to(count, #{::Integer}, 'to_int')`
    +    end
    +  else
    +    count = `$coerce_to(count, #{::Integer}, 'to_int')`
    +    options = `$coerce_to(options, #{::Hash}, 'to_hash')`
    +  end
    +
    +  if count && `count < 0`
    +    ::Kernel.raise ::ArgumentError, 'count must be greater than 0'
    +  end
    +
    +  rng = options[:random] if options
    +  rng = if rng && rng.respond_to?(:rand)
    +          SampleRandom.new rng
    +        else
    +          ::Kernel
    +        end
    +
    +  return `self[#{rng.rand(`self.length`)}]` unless count
    +
    +  %x{
    +
    +    var abandon, spin, result, i, j, k, targetIndex, oldValue;
    +
    +    if (count > self.length) {
    +      count = self.length;
    +    }
    +
    +    switch (count) {
    +      case 0:
    +        return [];
    +        break;
    +      case 1:
    +        return [self[#{rng.rand(`self.length`)}]];
    +        break;
    +      case 2:
    +        i = #{rng.rand(`self.length`)};
    +        j = #{rng.rand(`self.length - 1`)};
    +        if (i <= j) {
    +          j++;
    +        }
    +        return [self[i], self[j]];
    +        break;
    +      default:
    +        if (self.length / count > 3) {
    +          abandon = false;
    +          spin = 0;
    +
    +          result = #{ Array.new(count) };
    +          i = 1;
    +
    +          result[0] = #{rng.rand(`self.length`)};
    +          while (i < count) {
    +            k = #{rng.rand(`self.length`)};
    +            j = 0;
    +
    +            while (j < i) {
    +              while (k === result[j]) {
    +                spin++;
    +                if (spin > 100) {
    +                  abandon = true;
    +                  break;
    +                }
    +                k = #{rng.rand(`self.length`)};
    +              }
    +              if (abandon) { break; }
    +
    +              j++;
    +            }
    +
    +            if (abandon) { break; }
    +
    +            result[i] = k;
    +
    +            i++;
    +          }
    +
    +          if (!abandon) {
    +            i = 0;
    +            while (i < count) {
    +              result[i] = self[result[i]];
    +              i++;
    +            }
    +
    +            return result;
    +          }
    +        }
    +
    +        result = self.slice();
    +
    +        for (var c = 0; c < count; c++) {
    +          targetIndex = #{rng.rand(`self.length - c`)} + c;
    +          oldValue = result[c];
    +          result[c] = result[targetIndex];
    +          result[targetIndex] = oldValue;
    +        }
    +
    +        return count === self.length ? result : #{`result`[0, count]};
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2048
    +2049
    +2050
    +2051
    +2052
    +2053
    +2054
    +2055
    +2056
    +2057
    +2058
    +2059
    +2060
    +2061
    +2062
    +2063
    +2064
    +2065
    +2066
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2048
    +
    +def select(&block)
    +  return enum_for(:select) { size } unless block_given?
    +
    +  %x{
    +    var result = [];
    +
    +    for (var i = 0, item, value; i < self.length; i++) {
    +      item = self[i];
    +
    +      value = $yield1(block, item);
    +
    +      if ($truthy(value)) {
    +        result.push(item);
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2068
    +2069
    +2070
    +2071
    +2072
    +2073
    +2074
    +2075
    +2076
    +2077
    +2078
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2068
    +
    +def select!(&block)
    +  return enum_for(:select!) { size } unless block_given?
    +
    +  %x{
    +    $deny_frozen_access(self)
    +
    +    var original = self.length;
    +    #{ keep_if(&block) };
    +    return self.length === original ? nil : self;
    +  }
    +end
    +
    +
    + +
    +

    + + #shift(count = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2080
    +2081
    +2082
    +2083
    +2084
    +2085
    +2086
    +2087
    +2088
    +2089
    +2090
    +2091
    +2092
    +2093
    +2094
    +2095
    +2096
    +2097
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2080
    +
    +def shift(count = undefined)
    +  `$deny_frozen_access(self)`
    +
    +  if `count === undefined`
    +    return if `self.length === 0`
    +    return `shiftNoArg(self)`
    +  end
    +
    +  count = `$coerce_to(count, #{::Integer}, 'to_int')`
    +
    +  if `count < 0`
    +    ::Kernel.raise ::ArgumentError, 'negative array size'
    +  end
    +
    +  return [] if `self.length === 0`
    +
    +  `self.splice(0, count)`
    +end
    +
    +
    + +
    +

    + + #shuffle(rng = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2099
    +2100
    +2101
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2099
    +
    +def shuffle(rng = undefined)
    +  dup.to_a.shuffle!(rng)
    +end
    +
    +
    + +
    +

    + + #shuffle!(rng = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2103
    +2104
    +2105
    +2106
    +2107
    +2108
    +2109
    +2110
    +2111
    +2112
    +2113
    +2114
    +2115
    +2116
    +2117
    +2118
    +2119
    +2120
    +2121
    +2122
    +2123
    +2124
    +2125
    +2126
    +2127
    +2128
    +2129
    +2130
    +2131
    +2132
    +2133
    +2134
    +2135
    +2136
    +2137
    +2138
    +2139
    +2140
    +2141
    +2142
    +2143
    +2144
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2103
    +
    +def shuffle!(rng = undefined)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var randgen, i = self.length, j, tmp;
    +
    +    if (rng !== undefined) {
    +      rng = #{::Opal.coerce_to?(rng, ::Hash, :to_hash)};
    +
    +      if (rng !== nil) {
    +        rng = #{rng[:random]};
    +
    +        if (rng !== nil && #{rng.respond_to?(:rand)}) {
    +          randgen = rng;
    +        }
    +      }
    +    }
    +
    +    while (i) {
    +      if (randgen) {
    +        j = randgen.$rand(i).$to_int();
    +
    +        if (j < 0) {
    +          #{::Kernel.raise ::RangeError, "random number too small #{`j`}"}
    +        }
    +
    +        if (j >= i) {
    +          #{::Kernel.raise ::RangeError, "random number too big #{`j`}"}
    +        }
    +      }
    +      else {
    +        j = #{rand(`i`)};
    +      }
    +
    +      tmp = self[--i];
    +      self[i] = self[j];
    +      self[j] = tmp;
    +    }
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #slice!(index, length = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2146
    +
    +def slice!(index, length = undefined)
    +  `$deny_frozen_access(self)`
    +
    +  result = nil
    +
    +  if `length === undefined`
    +    if ::Range === index
    +      range = index
    +      result = self[range]
    +
    +      range_start = `range.begin === nil ? 0 : $coerce_to(range.begin, #{::Integer}, 'to_int')`
    +      range_end = `range.end === nil ? -1 : $coerce_to(range.end, #{::Integer}, 'to_int')`
    +
    +      %x{
    +        if (range_start < 0) {
    +          range_start += self.length;
    +        }
    +
    +        if (range_end < 0) {
    +          range_end += self.length;
    +        } else if (range_end >= self.length) {
    +          range_end = self.length - 1;
    +          if (range.excl) {
    +            range_end += 1;
    +          }
    +        }
    +
    +        var range_length = range_end - range_start;
    +        if (range.excl && range.end !== nil) {
    +          range_end -= 1;
    +        } else {
    +          range_length += 1;
    +        }
    +
    +        if (range_start < self.length && range_start >= 0 && range_end < self.length && range_end >= 0 && range_length > 0) {
    +          self.splice(range_start, range_length);
    +        }
    +      }
    +    else
    +      start = `$coerce_to(index, #{::Integer}, 'to_int')`
    +      %x{
    +        if (start < 0) {
    +          start += self.length;
    +        }
    +
    +        if (start < 0 || start >= self.length) {
    +          return nil;
    +        }
    +
    +        result = self[start];
    +
    +        if (start === 0) {
    +          self.shift();
    +        } else {
    +          self.splice(start, 1);
    +        }
    +      }
    +    end
    +  else
    +    start = `$coerce_to(index, #{::Integer}, 'to_int')`
    +    length = `$coerce_to(length, #{::Integer}, 'to_int')`
    +
    +    %x{
    +      if (length < 0) {
    +        return nil;
    +      }
    +
    +      var end = start + length;
    +
    +      result = #{self[start, length]};
    +
    +      if (start < 0) {
    +        start += self.length;
    +      }
    +
    +      if (start + length > self.length) {
    +        length = self.length - start;
    +      }
    +
    +      if (start < self.length && start >= 0) {
    +        self.splice(start, length);
    +      }
    +    }
    +  end
    +  result
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2233
    +2234
    +2235
    +2236
    +2237
    +2238
    +2239
    +2240
    +2241
    +2242
    +2243
    +2244
    +2245
    +2246
    +2247
    +2248
    +2249
    +2250
    +2251
    +2252
    +2253
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2233
    +
    +def sort(&block)
    +  return self unless `self.length > 1`
    +
    +  %x{
    +    if (block === nil) {
    +      block = function(a, b) {
    +        return #{`a` <=> `b`};
    +      };
    +    }
    +
    +    return self.slice().sort(function(x, y) {
    +      var ret = block(x, y);
    +
    +      if (ret === nil) {
    +        #{::Kernel.raise ::ArgumentError, "comparison of #{`x`.inspect} with #{`y`.inspect} failed"};
    +      }
    +
    +      return #{`ret` > 0} ? 1 : (#{`ret` < 0} ? -1 : 0);
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2255
    +2256
    +2257
    +2258
    +2259
    +2260
    +2261
    +2262
    +2263
    +2264
    +2265
    +2266
    +2267
    +2268
    +2269
    +2270
    +2271
    +2272
    +2273
    +2274
    +2275
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2255
    +
    +def sort!(&block)
    +  %x{
    +    $deny_frozen_access(self)
    +
    +    var result;
    +
    +    if (#{block_given?}) {
    +      result = #{`self.slice()`.sort(&block)};
    +    }
    +    else {
    +      result = #{`self.slice()`.sort};
    +    }
    +
    +    self.length = 0;
    +    for(var i = 0, length = result.length; i < length; i++) {
    +      self.push(result[i]);
    +    }
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #sort_by!(&block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2277
    +2278
    +2279
    +2280
    +2281
    +2282
    +2283
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2277
    +
    +def sort_by!(&block)
    +  return enum_for(:sort_by!) { size } unless block_given?
    +
    +  `$deny_frozen_access(self)`
    +
    +  replace sort_by(&block)
    +end
    +
    +
    + +
    +

    + + #take(count) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2285
    +2286
    +2287
    +2288
    +2289
    +2290
    +2291
    +2292
    +2293
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2285
    +
    +def take(count)
    +  %x{
    +    if (count < 0) {
    +      #{::Kernel.raise ::ArgumentError};
    +    }
    +
    +    return self.slice(0, count);
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2295
    +2296
    +2297
    +2298
    +2299
    +2300
    +2301
    +2302
    +2303
    +2304
    +2305
    +2306
    +2307
    +2308
    +2309
    +2310
    +2311
    +2312
    +2313
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2295
    +
    +def take_while(&block)
    +  %x{
    +    var result = [];
    +
    +    for (var i = 0, item, value; i < self.length; i++) {
    +      item = self[i];
    +
    +      value = block(item);
    +
    +      if (value === false || value === nil) {
    +        return result;
    +      }
    +
    +      result.push(item);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + + +

    + + + + +
    +
    +
    +
    +2315
    +2316
    +2317
    +2318
    +2319
    +2320
    +2321
    +2322
    +2323
    +2324
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2315
    +
    +def to_a
    +  %x{
    +    if (self.$$class === Opal.Array) {
    +      return self;
    +    }
    +    else {
    +      return Opal.Array.$new(self);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #to_aryObject + + + + + +

    + + + + +
    +
    +
    +
    +2326
    +2327
    +2328
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2326
    +
    +def to_ary
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2330
    +2331
    +2332
    +2333
    +2334
    +2335
    +2336
    +2337
    +2338
    +2339
    +2340
    +2341
    +2342
    +2343
    +2344
    +2345
    +2346
    +2347
    +2348
    +2349
    +2350
    +2351
    +2352
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2330
    +
    +def to_h(&block)
    +  array = self
    +  array = array.map(&block) if block_given?
    +
    +  %x{
    +    var i, len = array.length, ary, key, val, hash = #{{}};
    +
    +    for (i = 0; i < len; i++) {
    +      ary = #{::Opal.coerce_to?(`array[i]`, ::Array, :to_ary)};
    +      if (!ary.$$is_array) {
    +        #{::Kernel.raise ::TypeError, "wrong element type #{`array[i]`.class} at #{`i`} (expected array)"}
    +      }
    +      if (ary.length !== 2) {
    +        #{::Kernel.raise ::ArgumentError, "element has wrong array length at #{`i`} (expected 2, was #{`ary`.length})"}
    +      }
    +      key = ary[0];
    +      val = ary[1];
    +      $hash_put(hash, key, val);
    +    }
    +
    +    return hash;
    +  }
    +end
    +
    +
    + +
    +

    + + #transposeObject + + + + + +

    + + + + +
    +
    +
    +
    +2354
    +2355
    +2356
    +2357
    +2358
    +2359
    +2360
    +2361
    +2362
    +2363
    +2364
    +2365
    +2366
    +2367
    +2368
    +2369
    +2370
    +2371
    +2372
    +2373
    +2374
    +2375
    +2376
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2354
    +
    +def transpose
    +  return [] if empty?
    +
    +  result = []
    +  max    = nil
    +
    +  each do |row|
    +    `row = convertToArray(row)`
    +
    +    max ||= `row.length`
    +
    +    if `row.length` != max
    +      ::Kernel.raise ::IndexError, "element size differs (#{`row.length`} should be #{max})"
    +    end
    +
    +    `row.length`.times do |i|
    +      entry = (result[i] ||= [])
    +      entry << row.at(i)
    +    end
    +  end
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #union(*arrays) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2378
    +2379
    +2380
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2378
    +
    +def union(*arrays)
    +  arrays.reduce(uniq) { |a, b| a | b }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2382
    +2383
    +2384
    +2385
    +2386
    +2387
    +2388
    +2389
    +2390
    +2391
    +2392
    +2393
    +2394
    +2395
    +2396
    +2397
    +2398
    +2399
    +2400
    +2401
    +2402
    +2403
    +2404
    +2405
    +2406
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2382
    +
    +def uniq(&block)
    +  %x{
    +    var hash = #{{}}, i, length, item, key;
    +
    +    if (block === nil) {
    +      for (i = 0, length = self.length; i < length; i++) {
    +        item = self[i];
    +        if ($hash_get(hash, item) === undefined) {
    +          $hash_put(hash, item, item);
    +        }
    +      }
    +    }
    +    else {
    +      for (i = 0; i < self.length; i++) {
    +        item = self[i];
    +        key = $yield1(block, item);
    +        if ($hash_get(hash, key) === undefined) {
    +          $hash_put(hash, key, item);
    +        }
    +      }
    +    }
    +
    +    return #{`hash`.values};
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2408
    +2409
    +2410
    +2411
    +2412
    +2413
    +2414
    +2415
    +2416
    +2417
    +2418
    +2419
    +2420
    +2421
    +2422
    +2423
    +2424
    +2425
    +2426
    +2427
    +2428
    +2429
    +2430
    +2431
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2408
    +
    +def uniq!(&block)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var hash = #{{}}, i, item, key, delete_indexes = [];
    +
    +    for (i = 0; i < self.length; i++) {
    +      item = self[i];
    +      key = (block === nil ? item : $yield1(block, item));
    +
    +      if ($hash_get(hash, key) === undefined) {
    +        $hash_put(hash, key, item);
    +      } else {
    +        delete_indexes.push(i);
    +      }
    +    }
    +
    +    for (i = delete_indexes.length - 1; i >= 0; i--) {
    +      self.splice(delete_indexes[i], 1);
    +    }
    +
    +    return delete_indexes.length === 0 ? nil : self;
    +  }
    +end
    +
    +
    + +
    +

    + + #unshift(*objects) ⇒ Object + + + + Also known as: + prepend + + + + +

    + + + + +
    +
    +
    +
    +2433
    +2434
    +2435
    +2436
    +2437
    +2438
    +2439
    +2440
    +2441
    +2442
    +2443
    +2444
    +2445
    +2446
    +2447
    +2448
    +2449
    +2450
    +2451
    +2452
    +2453
    +2454
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2433
    +
    +def unshift(*objects)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var selfLength = self.length
    +    var objectsLength = objects.length
    +    if (objectsLength == 0) return self;
    +    var index = selfLength - objectsLength
    +    for (var i = 0; i < objectsLength; i++) {
    +      self.push(self[index + i])
    +    }
    +    var len = selfLength - 1
    +    while (len - objectsLength >= 0) {
    +      self[len] = self[len - objectsLength]
    +      len--
    +    }
    +    for (var j = 0; j < objectsLength; j++) {
    +      self[j] = objects[j]
    +    }
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +2456
    +2457
    +2458
    +2459
    +2460
    +2461
    +2462
    +2463
    +2464
    +2465
    +2466
    +2467
    +2468
    +2469
    +2470
    +2471
    +2472
    +2473
    +2474
    +2475
    +2476
    +2477
    +2478
    +2479
    +2480
    +2481
    +2482
    +2483
    +2484
    +2485
    +2486
    +2487
    +2488
    +2489
    +2490
    +2491
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2456
    +
    +def values_at(*args)
    +  out = []
    +
    +  args.each do |elem|
    +    if elem.is_a? ::Range
    +      finish = `#{elem.end} === nil ? -1 : $coerce_to(#{elem.end}, #{::Integer}, 'to_int')`
    +      start = `#{elem.begin} === nil ? 0 : $coerce_to(#{elem.begin}, #{::Integer}, 'to_int')`
    +
    +      %x{
    +        if (start < 0) {
    +          start = start + self.length;
    +          #{next};
    +        }
    +      }
    +
    +      %x{
    +        if (finish < 0) {
    +          finish = finish + self.length;
    +        }
    +        if (#{elem.exclude_end?} && #{elem.end} !== nil) {
    +          finish--;
    +        }
    +        if (finish < start) {
    +          #{next};
    +        }
    +      }
    +
    +      start.upto(finish) { |i| out << at(i) }
    +    else
    +      i = `$coerce_to(elem, #{::Integer}, 'to_int')`
    +      out << at(i)
    +    end
    +  end
    +
    +  out
    +end
    +
    +
    + +
    +

    + + #zip(*others, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2493
    +2494
    +2495
    +2496
    +2497
    +2498
    +2499
    +2500
    +2501
    +2502
    +2503
    +2504
    +2505
    +2506
    +2507
    +2508
    +2509
    +2510
    +2511
    +2512
    +2513
    +2514
    +2515
    +2516
    +2517
    +2518
    +2519
    +2520
    +2521
    +2522
    +2523
    +2524
    +2525
    +2526
    +2527
    +2528
    +2529
    +2530
    +2531
    +2532
    +2533
    +2534
    +2535
    +2536
    +2537
    +2538
    +
    +
    # File 'opal/opal/corelib/array.rb', line 2493
    +
    +def zip(*others, &block)
    +  %x{
    +    var result = [], size = self.length, part, o, i, j, jj;
    +
    +    for (j = 0, jj = others.length; j < jj; j++) {
    +      o = others[j];
    +      if (o.$$is_array) {
    +        continue;
    +      }
    +      if (o.$$is_range || o.$$is_enumerator) {
    +        others[j] = o.$take(size);
    +        continue;
    +      }
    +      others[j] = #{(
    +        ::Opal.coerce_to?(`o`, ::Array, :to_ary) ||
    +        ::Opal.coerce_to!(`o`, ::Enumerator, :to_enum, :each)
    +      ).to_a};
    +    }
    +
    +    for (i = 0; i < size; i++) {
    +      part = [self[i]];
    +
    +      for (j = 0, jj = others.length; j < jj; j++) {
    +        o = others[j][i];
    +
    +        if (o == null) {
    +          o = nil;
    +        }
    +
    +        part[j + 1] = o;
    +      }
    +
    +      result[i] = part;
    +    }
    +
    +    if (block !== nil) {
    +      for (i = 0; i < size; i++) {
    +        Opal.yield1(block, result[i]);
    +      }
    +
    +      return nil;
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +
    +
    # File 'opal/opal/corelib/array.rb', line 186
    +
    +def |(other)
    +  other = `convertToArray(other)`
    +
    +  %x{
    +    var hash = #{{}}, i, length, item;
    +
    +    for (i = 0, length = self.length; i < length; i++) {
    +      $hash_put(hash, self[i], true);
    +    }
    +
    +    for (i = 0, length = other.length; i < length; i++) {
    +      $hash_put(hash, other[i], true);
    +    }
    +
    +    return hash.$keys();
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Array.self/SampleRandom.html b/docs/api/v1.8.2/corelib/Array.self/SampleRandom.html new file mode 100644 index 00000000..5fb04d1b --- /dev/null +++ b/docs/api/v1.8.2/corelib/Array.self/SampleRandom.html @@ -0,0 +1,269 @@ + + + + + + + Class: Array.self::SampleRandom + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Array.self::SampleRandom + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/array.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(rng) ⇒ SampleRandom + + + + + +

    +
    +

    Returns a new instance of SampleRandom.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +1924
    +1925
    +1926
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1924
    +
    +def initialize(rng)
    +  @rng = rng
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #rand(size) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1928
    +1929
    +1930
    +1931
    +1932
    +1933
    +1934
    +
    +
    # File 'opal/opal/corelib/array.rb', line 1928
    +
    +def rand(size)
    +  random = `$coerce_to(#{@rng.rand(size)}, #{::Integer}, 'to_int')`
    +  ::Kernel.raise ::RangeError, 'random value must be >= 0' if `random < 0`
    +  ::Kernel.raise ::RangeError, 'random value must be less than Array size' unless `random < size`
    +
    +  random
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/BasicObject.html b/docs/api/v1.8.2/corelib/BasicObject.html new file mode 100644 index 00000000..4c91adb1 --- /dev/null +++ b/docs/api/v1.8.2/corelib/BasicObject.html @@ -0,0 +1,1184 @@ + + + + + + + Class: BasicObject + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: BasicObject + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/basic_object.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    use_strict: true +backtick_javascript: true

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    Object

    +
    + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initializeBasicObject + + + + + +

    +
    +

    Returns a new instance of BasicObject.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +5
    +6
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 5
    +
    +def initialize(*)
    +end
    +
    +
    + +
    +
    +

    Dynamic Method Handling

    +

    + This class handles dynamic methods through the method_missing method + +

    + +
    +

    + + #method_missing(symbol, *args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +144
    +145
    +146
    +147
    +148
    +149
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 144
    +
    +def method_missing(symbol, *args, &block)
    +  inspect_result = ::Opal.inspect(self)
    +  ::Kernel.raise ::NoMethodError.new(
    +    "undefined method `#{symbol}' for #{inspect_result}", symbol, args
    +  ), nil, ::Kernel.caller(1)
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #!Object + + + + + +

    + + + + +
    +
    +
    +
    +52
    +53
    +54
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 52
    +
    +def !
    +  false
    +end
    +
    +
    + +
    +

    + + #!=(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +57
    +58
    +59
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 57
    +
    +def !=(other)
    +  !(self == other)
    +end
    +
    +
    + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + equal? + + + + +

    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 8
    +
    +def ==(other)
    +  `self === other`
    +end
    +
    +
    + +
    +

    + + #__id__Object + + + + + +

    + + + + +
    +
    +
    +
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 18
    +
    +def __id__
    +  %x{
    +    if (self.$$id != null) {
    +      return self.$$id;
    +    }
    +    Opal.prop(self, '$$id', Opal.uid());
    +    return self.$$id;
    +  }
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +143
    +144
    +145
    +146
    +147
    +148
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 143
    +
    +def __marshal__(buffer)
    +  buffer.save_link(self)
    +  buffer.write_extends(self)
    +  buffer.append('o')
    +  buffer.write_object(self)
    +end
    +
    +
    + +
    +

    + + #__send__(symbol, *args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 28
    +
    +def __send__(symbol, *args, &block)
    +  %x{
    +    if (!symbol.$$is_string) {
    +      #{raise ::TypeError, "#{inspect} is not a symbol nor a string"}
    +    }
    +
    +    var func = self[Opal.jsid(symbol)];
    +
    +    if (func) {
    +      if (block !== nil) {
    +        func.$$p = block;
    +      }
    +
    +      return func.apply(self, args);
    +    }
    +
    +    if (block !== nil) {
    +      self.$method_missing.$$p = block;
    +    }
    +
    +    return self.$method_missing.apply(self, [symbol].concat(args));
    +  }
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 12
    +
    +def eql?(other)
    +  self == other
    +end
    +
    +
    + +
    +

    + + #instance_eval(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 61
    +
    +def instance_eval(*args, &block)
    +  if block.nil? && `!!Opal.compile`
    +    ::Kernel.raise ::ArgumentError, 'wrong number of arguments (0 for 1..3)' unless (1..3).cover? args.size
    +
    +    string, file, _lineno = *args
    +    default_eval_options = { file: (file || '(eval)'), eval: true }
    +    compiling_options = __OPAL_COMPILER_CONFIG__.merge(default_eval_options)
    +    compiled = ::Opal.compile string, compiling_options
    +    block = ::Kernel.proc do
    +      %x{new Function("Opal,self", "return " + compiled)(Opal, self)}
    +    end
    +  elsif block.nil? && args.length >= 1 && args.first[0] == '@'
    +    # get instance variable
    +    return instance_variable_get(args.first)
    +  elsif args.any?
    +    ::Kernel.raise ::ArgumentError, "wrong number of arguments (#{args.size} for 0)"
    +  end
    +
    +  %x{
    +    var old = block.$$s,
    +        result;
    +
    +    block.$$s = null;
    +
    +    // Need to pass $$eval so that method definitions know if this is
    +    // being done on a class/module. Cannot be compiler driven since
    +    // send(:instance_eval) needs to work.
    +    if (self.$$is_a_module) {
    +      self.$$eval = true;
    +      try {
    +        result = block.call(self, self);
    +      }
    +      finally {
    +        self.$$eval = false;
    +      }
    +    }
    +    else {
    +      result = block.call(self, self);
    +    }
    +
    +    block.$$s = old;
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #instance_exec(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 107
    +
    +def instance_exec(*args, &block)
    +  ::Kernel.raise ::ArgumentError, 'no block given' unless block
    +
    +  %x{
    +    var block_self = block.$$s,
    +        result;
    +
    +    block.$$s = null;
    +
    +    if (self.$$is_a_module) {
    +      self.$$eval = true;
    +      try {
    +        result = block.apply(self, args);
    +      }
    +      finally {
    +        self.$$eval = false;
    +      }
    +    }
    +    else {
    +      result = block.apply(self, args);
    +    }
    +
    +    block.$$s = block_self;
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #respond_to_missing?(method_name, include_all = false) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +153
    +154
    +155
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 153
    +
    +def respond_to_missing?(method_name, include_all = false)
    +  false
    +end
    +
    +
    + +
    +

    + + #singleton_method_addedObject + + + + + +

    + + + + +
    +
    +
    +
    +135
    +136
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 135
    +
    +def singleton_method_added(*)
    +end
    +
    +
    + +
    +

    + + #singleton_method_removedObject + + + + + +

    + + + + +
    +
    +
    +
    +138
    +139
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 138
    +
    +def singleton_method_removed(*)
    +end
    +
    +
    + +
    +

    + + #singleton_method_undefinedObject + + + + + +

    + + + + +
    +
    +
    +
    +141
    +142
    +
    +
    # File 'opal/opal/corelib/basic_object.rb', line 141
    +
    +def singleton_method_undefined(*)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Binding.html b/docs/api/v1.8.2/corelib/Binding.html new file mode 100644 index 00000000..ccaa498a --- /dev/null +++ b/docs/api/v1.8.2/corelib/Binding.html @@ -0,0 +1,895 @@ + + + + + + + Class: Binding + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Binding + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/binding.rb,
    + opal/opal/corelib/irb.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

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

    Instance Attribute Summary collapse

    +
      + +
    • + + + #receiver ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute receiver.

      +
      + +
    • + + +
    • + + + #source_location ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute source_location.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(jseval, scope_variables = [], receiver = undefined, source_location = nil) ⇒ Binding + + + + + +

    +
    +

    Returns a new instance of Binding.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +5
    +6
    +7
    +8
    +9
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 5
    +
    +def initialize(jseval, scope_variables = [], receiver = undefined, source_location = nil)
    +  @jseval, @scope_variables, @receiver, @source_location = \
    +    jseval, scope_variables, receiver, source_location
    +  receiver = js_eval('self') unless `typeof receiver !== undefined`
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #receiverObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute receiver.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 46
    +
    +def receiver
    +  @receiver
    +end
    +
    +
    + + + +
    +

    + + #source_locationObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute source_location.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 46
    +
    +def source_location
    +  @source_location
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #eval(str, file = nil, line = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +40
    +41
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 40
    +
    +def eval(str, file = nil, line = nil)
    +  return receiver if str == 'self'
    +
    +  ::Kernel.eval(str, self, file, line)
    +end
    +
    +
    + +
    +

    + + #irbObject + + + + + +

    + + + + +
    +
    +
    +
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +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
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 110
    +
    +def irb
    +  ::Opal::IRB.ensure_loaded('opal-replutils')
    +
    +  silencer = ::Opal::IRB::Silencer.new
    +
    +  ::Opal::IRB.prepare_console do
    +    loop do
    +      print '>> '
    +      line = gets
    +      break unless line
    +      code = ''
    +
    +      puts line if ::Opal::IRB.browser?
    +
    +      if line.start_with? 'ls '
    +        code = line[3..-1]
    +        mode = :ls
    +      elsif line == "ls\n"
    +        code = 'self'
    +        mode = :ls
    +      elsif line.start_with? 'show '
    +        code = line[5..-1]
    +        mode = :show
    +      else
    +        code = line
    +        mode = :inspect
    +      end
    +
    +      js_code = nil
    +
    +      begin
    +        silencer.silence do
    +          js_code = `Opal.compile(code, {irb: true})`
    +        end
    +      rescue SyntaxError => e
    +        if ::Opal::IRB::LINEBREAKS.include?(e.message)
    +          print '.. '
    +          line = gets
    +          return unless line
    +          puts line if ::Opal::IRB.browser?
    +          code += line
    +          retry
    +        elsif silencer.warnings.empty?
    +          warn e.full_message
    +        else
    +          # Most likely a parser error
    +          warn silencer.warnings
    +        end
    +      end
    +
    +      if mode == :show
    +        puts js_code
    +        return
    +      end
    +
    +      puts ::REPLUtils.eval_and_print(js_code, mode, false, self)
    +    end
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 11
    +
    +def js_eval(*args)
    +  if @jseval
    +    @jseval.call(*args)
    +  else
    +    ::Kernel.raise 'Evaluation on a Proc#binding is not supported'
    +  end
    +end
    +
    +
    + +
    +

    + + #local_variable_defined?(value) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +36
    +37
    +38
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 36
    +
    +def local_variable_defined?(value)
    +  @scope_variables.include?(value)
    +end
    +
    +
    + +
    +

    + + #local_variable_get(symbol) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +19
    +20
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 19
    +
    +def local_variable_get(symbol)
    +  js_eval(symbol)
    +rescue ::Exception
    +  ::Kernel.raise ::NameError, "local variable `#{symbol}' is not defined for #{inspect}"
    +end
    +
    +
    + +
    +

    + + #local_variable_set(symbol, value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 25
    +
    +def local_variable_set(symbol, value)
    +  `Opal.Binding.tmp_value = value`
    +  js_eval("#{symbol} = Opal.Binding.tmp_value")
    +  `delete Opal.Binding.tmp_value`
    +  value
    +end
    +
    +
    + +
    +

    + + #local_variablesObject + + + + + +

    + + + + +
    +
    +
    +
    +32
    +33
    +34
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 32
    +
    +def local_variables
    +  @scope_variables
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Boolean.html b/docs/api/v1.8.2/corelib/Boolean.html new file mode 100644 index 00000000..0921c464 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Boolean.html @@ -0,0 +1,984 @@ + + + + + + + Class: Boolean + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Boolean + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/boolean.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    use_strict: true +backtick_javascript: true

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    FalseClass, TrueClass

    +
    + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Dynamic Method Handling

    +

    + This class handles dynamic methods through the method_missing method + +

    + +
    +

    + + #method_missing(method, *args, &block) ⇒ Object + + + + + +

    +
    +

    See: https://github.com/opal/opal/issues/2230

    + +

    This is a hack that allows you to add methods to TrueClass and FalseClass. +Do note, that while true and false have a correct $$class (it's either +TrueClass or FalseClass), their prototype is Boolean.$$prototype, which +basically means that when calling true.something we actually call +Boolean#something instead of TrueClass#something. So using +method_missing we dispatch it to TrueClass/FalseClass#something correctly.

    + +

    The downside is that a correct implementation would also allow us to override +the methods defined on Boolean, but our implementation doesn't allow that, +unless you define them on Boolean and not on TrueClass/FalseClass.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +93
    +94
    +95
    +96
    +97
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 93
    +
    +def method_missing(method, *args, &block)
    +  `var body = self.$$class.$$prototype[Opal.jsid(#{method})]`
    +  super unless `typeof body !== 'undefined' && !body.$$stub`
    +  `Opal.send(self, body, #{args}, #{block})`
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 34
    +
    +def allocate
    +  ::Kernel.raise ::TypeError, "allocator undefined for #{name}"
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #!Object + + + + + +

    + + + + +
    +
    +
    +
    +45
    +46
    +47
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 45
    +
    +def !
    +  `self != true`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +49
    +50
    +51
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 49
    +
    +def &(other)
    +  `(self == true) ? (other !== false && other !== nil) : false`
    +end
    +
    +
    + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + eql?, equal? + + + + +

    + + + + +
    +
    +
    +
    +61
    +62
    +63
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 61
    +
    +def ==(other)
    +  `(self == true) === other.valueOf()`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +57
    +58
    +59
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 57
    +
    +def ^(other)
    +  `(self == true) ? (other === false || other === nil) : (other !== false && other !== nil)`
    +end
    +
    +
    + +
    +

    + + #__id__Object + + + + Also known as: + object_id + + + + +

    + + + + +
    +
    +
    +
    +41
    +42
    +43
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 41
    +
    +def __id__
    +  `self.valueOf() ? 2 : 0`
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 10
    +
    +def __marshal__(buffer)
    +  if `self == true`
    +    buffer.append('T')
    +  else
    +    buffer.append('F')
    +  end
    +end
    +
    +
    + +
    +

    + + #clone(freeze: true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +77
    +78
    +79
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 77
    +
    +def clone(freeze: true)
    +  self
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +73
    +74
    +75
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 73
    +
    +def dup
    +  self
    +end
    +
    +
    + +
    +

    + + #respond_to_missing?(method, _include_all = false) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +99
    +100
    +101
    +102
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 99
    +
    +def respond_to_missing?(method, _include_all = false)
    +  `var body = self.$$class.$$prototype[Opal.jsid(#{method})]`
    +  `typeof body !== 'undefined' && !body.$$stub`
    +end
    +
    +
    + +
    +

    + + #singleton_classObject + + + + + +

    + + + + +
    +
    +
    +
    +65
    +66
    +67
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 65
    +
    +def singleton_class
    +  `self.$$meta`
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + Also known as: + inspect + + + + +

    + + + + +
    +
    +
    +
    +69
    +70
    +71
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 69
    +
    +def to_s
    +  `(self == true) ? 'true' : 'false'`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +53
    +54
    +55
    +
    +
    # File 'opal/opal/corelib/boolean.rb', line 53
    +
    +def |(other)
    +  `(self == true) ? true : (other !== false && other !== nil)`
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Class.html b/docs/api/v1.8.2/corelib/Class.html new file mode 100644 index 00000000..03155724 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Class.html @@ -0,0 +1,941 @@ + + + + + + + Class: Class + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Class + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/class.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .new(superclass = Object, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/class.rb', line 6
    +
    +def self.new(superclass = Object, &block)
    +  %x{
    +    if (!superclass.$$is_class) {
    +      throw Opal.TypeError.$new("superclass must be a Class");
    +    }
    +
    +    var klass = Opal.allocate_class(nil, superclass);
    +    superclass.$inherited(klass);
    +    #{`klass`.class_eval(&block) if block_given?}
    +    return klass;
    +  }
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 127
    +
    +def __marshal__(buffer)
    +  unless name
    +    ::Kernel.raise ::TypeError, "can't dump anonymous class"
    +  end
    +
    +  if singleton_class?
    +    ::Kernel.raise ::TypeError, "singleton class can't be dumped"
    +  end
    +
    +  buffer.save_link(self)
    +  buffer.append('c')
    +  buffer.write_class(self)
    +end
    +
    +
    + +
    +

    + + #allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/class.rb', line 19
    +
    +def allocate
    +  %x{
    +    var obj = new self.$$constructor();
    +    obj.$$id = Opal.uid();
    +    return obj;
    +  }
    +end
    +
    +
    + +
    +

    + + #attached_objectObject + + + + + +

    + + + + +
    +
    +
    +
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +
    +
    # File 'opal/opal/corelib/class.rb', line 106
    +
    +def attached_object
    +  %x{
    +    if (self.$$singleton_of != null) {
    +      return self.$$singleton_of;
    +    }
    +    else {
    +      #{::Kernel.raise ::TypeError, "`#{self}' is not a singleton class"}
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #clone(freeze: nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +
    +
    # File 'opal/opal/corelib/class.rb', line 27
    +
    +def clone(freeze: nil)
    +  unless freeze.nil? || freeze == true || freeze == false
    +    raise ArgumentError, "unexpected value for freeze: #{freeze.class}"
    +  end
    +
    +  copy = `Opal.allocate_class(nil, self.$$super)`
    +  copy.copy_instance_variables(self)
    +  copy.copy_singleton_methods(self)
    +  copy.initialize_clone(self, freeze: freeze)
    +
    +  if freeze == true || (freeze.nil? && frozen?)
    +    copy.freeze
    +  end
    +
    +  copy
    +end
    +
    +
    + +
    +

    + + #descendantsObject + + + + + +

    + + + + +
    +
    +
    +
    +53
    +54
    +55
    +
    +
    # File 'opal/opal/corelib/class.rb', line 53
    +
    +def descendants
    +  subclasses + subclasses.map(&:descendants).flatten
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +
    +
    # File 'opal/opal/corelib/class.rb', line 44
    +
    +def dup
    +  copy = `Opal.allocate_class(nil, self.$$super)`
    +
    +  copy.copy_instance_variables(self)
    +  copy.initialize_dup(self)
    +
    +  copy
    +end
    +
    +
    + +
    +

    + + #inherited(cls) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +57
    +58
    +
    +
    # File 'opal/opal/corelib/class.rb', line 57
    +
    +def inherited(cls)
    +end
    +
    +
    + +
    +

    + + #new(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +
    +
    # File 'opal/opal/corelib/class.rb', line 60
    +
    +def new(*args, &block)
    +  %x{
    +    var object = #{allocate};
    +    Opal.send(object, object.$initialize, args, block);
    +    return object;
    +  }
    +end
    +
    +
    + +
    +

    + + #subclassesObject + + + + + +

    + + + + +
    +
    +
    +
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +
    +
    # File 'opal/opal/corelib/class.rb', line 68
    +
    +def subclasses
    +  %x{
    +    if (typeof WeakRef !== 'undefined') {
    +      var i, subclass, out = [];
    +      for (i = 0; i < self.$$subclasses.length; i++) {
    +        subclass = self.$$subclasses[i].deref();
    +        if (subclass !== undefined) {
    +          out.push(subclass);
    +        }
    +      }
    +      return out;
    +    }
    +    else {
    +      return self.$$subclasses;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #superclassObject + + + + + +

    + + + + +
    +
    +
    +
    +86
    +87
    +88
    +
    +
    # File 'opal/opal/corelib/class.rb', line 86
    +
    +def superclass
    +  `self.$$super || nil`
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + Also known as: + inspect + + + + +

    + + + + +
    +
    +
    +
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +
    +
    # File 'opal/opal/corelib/class.rb', line 90
    +
    +def to_s
    +  %x{
    +    var singleton_of = self.$$singleton_of;
    +
    +    if (singleton_of && singleton_of.$$is_a_module) {
    +      return #{"#<Class:#{`singleton_of`.name}>"};
    +    }
    +    else if (singleton_of) {
    +      // a singleton class created from an object
    +      return #{"#<Class:#<#{`singleton_of.$$class`.name}:0x#{`Opal.id(singleton_of)`.to_s(16)}>>"};
    +    }
    +
    +    return #{super()};
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/ClosedQueueError.html b/docs/api/v1.8.2/corelib/ClosedQueueError.html new file mode 100644 index 00000000..c5a6f8df --- /dev/null +++ b/docs/api/v1.8.2/corelib/ClosedQueueError.html @@ -0,0 +1,171 @@ + + + + + + + Exception: ClosedQueueError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: ClosedQueueError + + + +

    +
    + +
    +
    Inherits:
    +
    + StopIteration + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from StopIteration

    +

    #result

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Comparable.html b/docs/api/v1.8.2/corelib/Comparable.html new file mode 100644 index 00000000..b764040f --- /dev/null +++ b/docs/api/v1.8.2/corelib/Comparable.html @@ -0,0 +1,638 @@ + + + + + + + Module: Comparable + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Comparable + + + +

    +
    + + + + + + + + + +
    +
    Included in:
    +
    Numeric, String, Time
    +
    + + + +
    +
    Defined in:
    +
    opal/opal/corelib/comparable.rb
    +
    + +
    + +

    Overview

    +
    +

    helpers: truthy +backtick_javascript: true

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

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +62
    +63
    +64
    +
    +
    # File 'opal/opal/corelib/comparable.rb', line 62
    +
    +def <(other)
    +  `cmp_or_fail(self, other) < 0`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +66
    +67
    +68
    +
    +
    # File 'opal/opal/corelib/comparable.rb', line 66
    +
    +def <=(other)
    +  `cmp_or_fail(self, other) <= 0`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/comparable.rb', line 34
    +
    +def ==(other)
    +  return true if equal?(other)
    +
    +  %x{
    +    if (self["$<=>"] == Opal.Kernel["$<=>"]) {
    +      return false;
    +    }
    +
    +    // check for infinite recursion
    +    if (self.$$comparable) {
    +      self.$$comparable = false;
    +      return false;
    +    }
    +  }
    +
    +  return false unless cmp = (self <=> other)
    +
    +  `normalize(cmp) == 0`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +
    +
    # File 'opal/opal/corelib/comparable.rb', line 54
    +
    +def >(other)
    +  `cmp_or_fail(self, other) > 0`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +58
    +59
    +60
    +
    +
    # File 'opal/opal/corelib/comparable.rb', line 58
    +
    +def >=(other)
    +  `cmp_or_fail(self, other) >= 0`
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +70
    +71
    +72
    +73
    +74
    +
    +
    # File 'opal/opal/corelib/comparable.rb', line 70
    +
    +def between?(min, max)
    +  return false if self < min
    +  return false if self > max
    +  true
    +end
    +
    +
    + +
    +

    + + #clamp(min, max = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/comparable.rb', line 76
    +
    +def clamp(min, max = nil)
    +  %x{
    +    var c, excl;
    +
    +    if (max === nil) {
    +      // We are dealing with a new Ruby 2.7 behaviour that we are able to
    +      // provide a single Range argument instead of 2 Comparables.
    +
    +      if (!Opal.is_a(min, Opal.Range)) {
    +        #{::Kernel.raise ::TypeError, "wrong argument type #{min.class} (expected Range)"}
    +      }
    +
    +      excl = min.excl;
    +      max = min.end;
    +      min = min.begin;
    +
    +      if (max !== nil && excl) {
    +        #{::Kernel.raise ::ArgumentError, 'cannot clamp with an exclusive range'}
    +      }
    +    }
    +
    +    if (min !== nil && max !== nil && cmp_or_fail(min, max) > 0) {
    +      #{::Kernel.raise ::ArgumentError, 'min argument must be smaller than max argument'}
    +    }
    +
    +    if (min !== nil) {
    +      c = cmp_or_fail(self, min);
    +
    +      if (c == 0) return self;
    +      if (c < 0) return min;
    +    }
    +
    +    if (max !== nil) {
    +      c = cmp_or_fail(self, max);
    +
    +      if (c > 0) return max;
    +    }
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/CompatibilityError.html b/docs/api/v1.8.2/corelib/CompatibilityError.html new file mode 100644 index 00000000..60dd7a67 --- /dev/null +++ b/docs/api/v1.8.2/corelib/CompatibilityError.html @@ -0,0 +1,158 @@ + + + + + + + Exception: CompatibilityError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: CompatibilityError + + + +

    +
    + +
    +
    Inherits:
    +
    + EncodingError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/string/encoding.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Complex.html b/docs/api/v1.8.2/corelib/Complex.html new file mode 100644 index 00000000..73a64558 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Complex.html @@ -0,0 +1,2580 @@ + + + + + + + Class: Complex + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Complex + + + +

    +
    + +
    +
    Inherits:
    +
    + Numeric + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/complex.rb
    +
    + +
    + + + +

    + Constant Summary + collapse +

    + +
    + +
    I = + +
    +
    new(0, 1)
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #imag ⇒ Object + + + + (also: #imaginary) + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute imag.

      +
      + +
    • + + +
    • + + + #real ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute real.

      +
      + +
    • + + +
    + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Numeric

    +

    #%, #+@, #<=>, #__coerced__, #ceil, #clone, #div, #divmod, #dup, #floor, #i, #integer?, #negative?, #nonzero?, #positive?, #round, #step, #to_c, #to_int, #truncate, #zero?

    + + + + + + + + + +

    Methods included from Comparable

    +

    #<, #<=, #>, #>=, #between?, #clamp

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(real, imag = 0) ⇒ Complex + + + + + +

    +
    +

    Returns a new instance of Complex.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +29
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 25
    +
    +def initialize(real, imag = 0)
    +  @real = real
    +  @imag = imag
    +  freeze
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #imagObject (readonly) + + + + Also known as: + imaginary + + + + +

    +
    +

    Returns the value of attribute imag.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 23
    +
    +def imag
    +  @imag
    +end
    +
    +
    + + + +
    +

    + + #realObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute real.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 23
    +
    +def real
    +  @real
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .from_string(str) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +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
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 273
    +
    +def self.from_string(str)
    +  %x{
    +    var re = /[+-]?[\d_]+(\.[\d_]+)?(e\d+)?/,
    +        match = str.match(re),
    +        real, imag, denominator;
    +
    +    function isFloat() {
    +      return re.test(str);
    +    }
    +
    +    function cutFloat() {
    +      var match = str.match(re);
    +      var number = match[0];
    +      str = str.slice(number.length);
    +      return number.replace(/_/g, '');
    +    }
    +
    +    // handles both floats and rationals
    +    function cutNumber() {
    +      if (isFloat()) {
    +        var numerator = parseFloat(cutFloat());
    +
    +        if (str[0] === '/') {
    +          // rational real part
    +          str = str.slice(1);
    +
    +          if (isFloat()) {
    +            var denominator = parseFloat(cutFloat());
    +            return #{::Kernel.Rational(`numerator`, `denominator`)};
    +          } else {
    +            // reverting '/'
    +            str = '/' + str;
    +            return numerator;
    +          }
    +        } else {
    +          // float real part, no denominator
    +          return numerator;
    +        }
    +      } else {
    +        return null;
    +      }
    +    }
    +
    +    real = cutNumber();
    +
    +    if (!real) {
    +      if (str[0] === 'i') {
    +        // i => Complex(0, 1)
    +        return #{::Kernel.Complex(0, 1)};
    +      }
    +      if (str[0] === '-' && str[1] === 'i') {
    +        // -i => Complex(0, -1)
    +        return #{::Kernel.Complex(0, -1)};
    +      }
    +      if (str[0] === '+' && str[1] === 'i') {
    +        // +i => Complex(0, 1)
    +        return #{::Kernel.Complex(0, 1)};
    +      }
    +      // anything => Complex(0, 0)
    +      return #{::Kernel.Complex(0, 0)};
    +    }
    +
    +    imag = cutNumber();
    +    if (!imag) {
    +      if (str[0] === 'i') {
    +        // 3i => Complex(0, 3)
    +        return #{::Kernel.Complex(0, `real`)};
    +      } else {
    +        // 3 => Complex(3, 0)
    +        return #{::Kernel.Complex(`real`, 0)};
    +      }
    +    } else {
    +      // 3+2i => Complex(3, 2)
    +      return #{::Kernel.Complex(`real`, `imag`)};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .polar(r, theta = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 15
    +
    +def self.polar(r, theta = 0)
    +  unless ::Numeric === r && r.real? && ::Numeric === theta && theta.real?
    +    ::Kernel.raise ::TypeError, 'not a real'
    +  end
    +
    +  new(r * ::Math.cos(theta), r * ::Math.sin(theta))
    +end
    +
    +
    + +
    +

    + + .rect(real, imag = 0) ⇒ Object + + + + Also known as: + rectangular + + + + +

    + + + + +
    +
    +
    +
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 7
    +
    +def self.rect(real, imag = 0)
    +  unless ::Numeric === real && real.real? && ::Numeric === imag && imag.real?
    +    ::Kernel.raise ::TypeError, 'not a real'
    +  end
    +
    +  new(real, imag)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 75
    +
    +def *(other)
    +  if ::Complex === other
    +    ::Kernel.Complex(@real * other.real - @imag * other.imag,
    +      @real * other.imag + @imag * other.real,
    +    )
    +  elsif ::Numeric === other && other.real?
    +    ::Kernel.Complex(@real * other, @imag * other)
    +  else
    +    __coerced__ :*, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 102
    +
    +def **(other)
    +  if other == 0
    +    return ::Complex.new(1, 0)
    +  end
    +
    +  if ::Complex === other
    +    r, theta = polar
    +    ore      = other.real
    +    oim      = other.imag
    +    nr       = ::Math.exp(ore * ::Math.log(r) - oim * theta)
    +    ntheta   = theta * ore + oim * ::Math.log(r)
    +
    +    ::Complex.polar(nr, ntheta)
    +  elsif ::Integer === other
    +    if other > 0
    +      x = self
    +      z = x
    +      n = other - 1
    +
    +      while n != 0
    +        div, mod = n.divmod(2)
    +        while mod == 0
    +          x = ::Kernel.Complex(x.real * x.real - x.imag * x.imag, 2 * x.real * x.imag)
    +          n = div
    +          div, mod = n.divmod(2)
    +        end
    +
    +        z *= x
    +        n -= 1
    +      end
    +
    +      z
    +    else
    +      (::Rational.new(1, 1) / self)**-other
    +    end
    +  elsif ::Float === other || ::Rational === other
    +    r, theta = polar
    +
    +    ::Complex.polar(r**other, theta * other)
    +  else
    +    __coerced__ :**, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 55
    +
    +def +(other)
    +  if ::Complex === other
    +    ::Kernel.Complex(@real + other.real, @imag + other.imag)
    +  elsif ::Numeric === other && other.real?
    +    ::Kernel.Complex(@real + other, @imag)
    +  else
    +    __coerced__ :+, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 65
    +
    +def -(other)
    +  if ::Complex === other
    +    ::Kernel.Complex(@real - other.real, @imag - other.imag)
    +  elsif ::Numeric === other && other.real?
    +    ::Kernel.Complex(@real - other, @imag)
    +  else
    +    __coerced__ :-, other
    +  end
    +end
    +
    +
    + +
    +

    + + #-@Object + + + + + +

    + + + + +
    +
    +
    +
    +51
    +52
    +53
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 51
    +
    +def -@
    +  ::Kernel.Complex(-@real, -@imag)
    +end
    +
    +
    + +
    +

    + + #/(other) ⇒ Object + + + + Also known as: + divide, quo + + + + +

    + + + + +
    +
    +
    +
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 87
    +
    +def /(other)
    +  if ::Complex === other
    +    if (::Number === @real && @real.nan?) || (::Number === @imag && @imag.nan?) ||
    +       (::Number === other.real && other.real.nan?) || (::Number === other.imag && other.imag.nan?)
    +      ::Complex.new(::Float::NAN, ::Float::NAN)
    +    else
    +      self * other.conj / other.abs2
    +    end
    +  elsif ::Numeric === other && other.real?
    +    ::Kernel.Complex(@real.quo(other), @imag.quo(other))
    +  else
    +    __coerced__ :/, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 41
    +
    +def ==(other)
    +  if ::Complex === other
    +    @real == other.real && @imag == other.imag
    +  elsif ::Numeric === other && other.real?
    +    @real == other && @imag == 0
    +  else
    +    other == self
    +  end
    +end
    +
    +
    + +
    +

    + + #absObject + + + + Also known as: + magnitude + + + + +

    + + + + +
    +
    +
    +
    +146
    +147
    +148
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 146
    +
    +def abs
    +  ::Math.hypot(@real, @imag)
    +end
    +
    +
    + +
    +

    + + #abs2Object + + + + + +

    + + + + +
    +
    +
    +
    +150
    +151
    +152
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 150
    +
    +def abs2
    +  @real * @real + @imag * @imag
    +end
    +
    +
    + +
    +

    + + #angleObject + + + + Also known as: + arg + + + + +

    + + + + +
    +
    +
    +
    +154
    +155
    +156
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 154
    +
    +def angle
    +  ::Math.atan2(@imag, @real)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 31
    +
    +def coerce(other)
    +  if ::Complex === other
    +    [other, self]
    +  elsif ::Numeric === other && other.real?
    +    [::Complex.new(other, 0), self]
    +  else
    +    ::Kernel.raise ::TypeError, "#{other.class} can't be coerced into Complex"
    +  end
    +end
    +
    +
    + +
    +

    + + #conjObject + + + + Also known as: + conjugate + + + + +

    + + + + +
    +
    +
    +
    +158
    +159
    +160
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 158
    +
    +def conj
    +  ::Kernel.Complex(@real, -@imag)
    +end
    +
    +
    + +
    +

    + + #denominatorObject + + + + + +

    + + + + +
    +
    +
    +
    +162
    +163
    +164
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 162
    +
    +def denominator
    +  @real.denominator.lcm(@imag.denominator)
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +166
    +167
    +168
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 166
    +
    +def eql?(other)
    +  Complex === other && @real.class == @imag.class && self == other
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 170
    +
    +def fdiv(other)
    +  unless ::Numeric === other
    +    ::Kernel.raise ::TypeError, "#{other.class} can't be coerced into Complex"
    +  end
    +
    +  self / other
    +end
    +
    +
    + +
    +

    + + #finite?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +178
    +179
    +180
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 178
    +
    +def finite?
    +  @real.finite? && @imag.finite?
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +182
    +183
    +184
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 182
    +
    +def hash
    +  [::Complex, @real, @imag].hash
    +end
    +
    +
    + +
    +

    + + #infinite?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +186
    +187
    +188
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 186
    +
    +def infinite?
    +  @real.infinite? || @imag.infinite?
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +190
    +191
    +192
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 190
    +
    +def inspect
    +  "(#{self})"
    +end
    +
    +
    + +
    +

    + + #numeratorObject + + + + + +

    + + + + +
    +
    +
    +
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 194
    +
    +def numerator
    +  d = denominator
    +
    +  ::Kernel.Complex(@real.numerator * (d / @real.denominator),
    +    @imag.numerator * (d / @imag.denominator),
    +  )
    +end
    +
    +
    + +
    +

    + + #polarObject + + + + + +

    + + + + +
    +
    +
    +
    +202
    +203
    +204
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 202
    +
    +def polar
    +  [abs, arg]
    +end
    +
    +
    + +
    +

    + + #rationalize(eps = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 206
    +
    +def rationalize(eps = undefined)
    +  %x{
    +    if (arguments.length > 1) {
    +      #{::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arguments.length`} for 0..1)"};
    +    }
    +  }
    +
    +  if @imag != 0
    +    ::Kernel.raise ::RangeError, "can't convert #{self} into Rational"
    +  end
    +
    +  real.rationalize(eps)
    +end
    +
    +
    + +
    +

    + + #real?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +220
    +221
    +222
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 220
    +
    +def real?
    +  false
    +end
    +
    +
    + +
    +

    + + #rectObject + + + + Also known as: + rectangular + + + + +

    + + + + +
    +
    +
    +
    +224
    +225
    +226
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 224
    +
    +def rect
    +  [@real, @imag]
    +end
    +
    +
    + +
    +

    + + #to_fObject + + + + + +

    + + + + +
    +
    +
    +
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 228
    +
    +def to_f
    +  unless @imag == 0
    +    ::Kernel.raise ::RangeError, "can't convert #{self} into Float"
    +  end
    +
    +  @real.to_f
    +end
    +
    +
    + +
    +

    + + #to_iObject + + + + + +

    + + + + +
    +
    +
    +
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 236
    +
    +def to_i
    +  unless @imag == 0
    +    ::Kernel.raise ::RangeError, "can't convert #{self} into Integer"
    +  end
    +
    +  @real.to_i
    +end
    +
    +
    + +
    +

    + + #to_rObject + + + + + +

    + + + + +
    +
    +
    +
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 244
    +
    +def to_r
    +  unless @imag == 0
    +    ::Kernel.raise ::RangeError, "can't convert #{self} into Rational"
    +  end
    +
    +  @real.to_r
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +
    +
    # File 'opal/opal/corelib/complex.rb', line 252
    +
    +def to_s
    +  result = @real.inspect
    +
    +  result +=
    +    if (::Number === @imag && @imag.nan?) || @imag.positive? || @imag.zero?
    +      '+'
    +    else
    +      '-'
    +    end
    +
    +  result += @imag.abs.inspect
    +
    +  if ::Number === @imag && (@imag.nan? || @imag.infinite?)
    +    result += '*'
    +  end
    +
    +  result + 'i'
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Dir.html b/docs/api/v1.8.2/corelib/Dir.html new file mode 100644 index 00000000..8802d58d --- /dev/null +++ b/docs/api/v1.8.2/corelib/Dir.html @@ -0,0 +1,320 @@ + + + + + + + Class: Dir + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Dir + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/dir.rb
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

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

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .chdir(dir) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +
    +
    # File 'opal/opal/corelib/dir.rb', line 5
    +
    +def chdir(dir)
    +  prev_cwd = `Opal.current_dir`
    +  `Opal.current_dir = #{dir}`
    +  yield
    +ensure
    +  `Opal.current_dir = #{prev_cwd}`
    +end
    +
    +
    + +
    +

    + + .homeObject + + + + + +

    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +
    +
    # File 'opal/opal/corelib/dir.rb', line 17
    +
    +def home
    +  ::ENV['HOME'] || '.'
    +end
    +
    +
    + +
    +

    + + .pwdObject + + + + Also known as: + getwd + + + + +

    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/dir.rb', line 13
    +
    +def pwd
    +  `Opal.current_dir || '.'`
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/EOFError.html b/docs/api/v1.8.2/corelib/EOFError.html new file mode 100644 index 00000000..aa391a38 --- /dev/null +++ b/docs/api/v1.8.2/corelib/EOFError.html @@ -0,0 +1,158 @@ + + + + + + + Exception: EOFError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: EOFError + + + +

    +
    + +
    +
    Inherits:
    +
    + IOError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Encoding.html b/docs/api/v1.8.2/corelib/Encoding.html new file mode 100644 index 00000000..5794c897 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Encoding.html @@ -0,0 +1,1195 @@ + + + + + + + Class: Encoding + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Encoding + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/string/encoding.rb
    +
    + +
    + +

    Defined Under Namespace

    +

    + + + + + Classes: UndefinedConversionError + + +

    + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #default_external ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute default_external.

      +
      + +
    • + + +
    • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute name.

      +
      + +
    • + + +
    • + + + #names ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute names.

      +
      + +
    • + + +
    + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(name, names, ascii, dummy) ⇒ Encoding + + + + + +

    +
    +

    Returns a new instance of Encoding.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +35
    +36
    +37
    +38
    +39
    +40
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 35
    +
    +def initialize(name, names, ascii, dummy)
    +  @name  = name
    +  @names = names
    +  @ascii = ascii
    +  @dummy = dummy
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #default_externalObject + + + + + +

    +
    +

    Returns the value of attribute default_external.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +31
    +32
    +33
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 31
    +
    +def default_external
    +  @default_external
    +end
    +
    +
    + + + +
    +

    + + #nameObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute name.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +33
    +34
    +35
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 33
    +
    +def name
    +  @name
    +end
    +
    +
    + + + +
    +

    + + #namesObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute names.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +33
    +34
    +35
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 33
    +
    +def names
    +  @names
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .find(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +26
    +27
    +28
    +29
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 26
    +
    +def self.find(name)
    +  return default_external if name == :default_external
    +  `return Opal.find_encoding(name)`
    +end
    +
    +
    + +
    +

    + + .register(name, options = {}, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 6
    +
    +def self.register(name, options = {}, &block)
    +  names = [name] + (options[:aliases] || [])
    +  ascii = options[:ascii] || false
    +  dummy = options[:dummy] || false
    +
    +  if options[:inherits]
    +    encoding = options[:inherits].clone
    +    encoding.initialize(name, names, ascii, dummy)
    +  else
    +    encoding = new(name, names, ascii, dummy)
    +  end
    +  encoding.instance_eval(&block) if block_given?
    +
    +  register = `Opal.encodings`
    +  names.each do |encoding_name|
    +    const_set encoding_name.tr('-', '_'), encoding
    +    register.JS[encoding_name] = encoding
    +  end
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #ascii_compatible?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 42
    +
    +def ascii_compatible?
    +  @ascii
    +end
    +
    +
    + +
    +

    + + #binary?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 50
    +
    +def binary?
    +  false
    +end
    +
    +
    + +
    +

    + + #bytesizeObject + + + + + +

    + + + + +
    +
    +
    +
    +102
    +103
    +104
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 102
    +
    +def bytesize(*)
    +  ::Kernel.raise ::NotImplementedError
    +end
    +
    +
    + +
    +

    + + #charsize(string) ⇒ Object + + + + + +

    +
    +

    methods to implement per encoding

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 63
    +
    +def charsize(string)
    +  %x{
    +    var len = 0;
    +    for (var i = 0, length = string.length; i < length; i++) {
    +      var charcode = string.charCodeAt(i);
    +      if (!(charcode >= 0xD800 && charcode <= 0xDBFF)) {
    +        len++;
    +      }
    +    }
    +    return len;
    +  }
    +end
    +
    +
    + +
    +

    + + #dummy?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 46
    +
    +def dummy?
    +  @dummy
    +end
    +
    +
    + +
    +

    + + #each_byteObject + + + + + +

    + + + + +
    +
    +
    +
    +98
    +99
    +100
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 98
    +
    +def each_byte(*)
    +  ::Kernel.raise ::NotImplementedError
    +end
    +
    +
    + +
    +

    + + #each_char(string, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 76
    +
    +def each_char(string, &block)
    +  %x{
    +    var low_surrogate = "";
    +    for (var i = 0, length = string.length; i < length; i++) {
    +      var charcode = string.charCodeAt(i);
    +      var chr = string.charAt(i);
    +      if (charcode >= 0xDC00 && charcode <= 0xDFFF) {
    +        low_surrogate = chr;
    +        continue;
    +      }
    +      else if (charcode >= 0xD800 && charcode <= 0xDBFF) {
    +        chr = low_surrogate + chr;
    +      }
    +      if (string.encoding.name != "UTF-8") {
    +        chr = new String(chr);
    +        chr.encoding = string.encoding;
    +      }
    +      Opal.yield1(block, chr);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +58
    +59
    +60
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 58
    +
    +def inspect
    +  "#<Encoding:#{@name}#{' (dummy)' if @dummy}>"
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 54
    +
    +def to_s
    +  @name
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Encoding/UndefinedConversionError.html b/docs/api/v1.8.2/corelib/Encoding/UndefinedConversionError.html new file mode 100644 index 00000000..cb81317a --- /dev/null +++ b/docs/api/v1.8.2/corelib/Encoding/UndefinedConversionError.html @@ -0,0 +1,158 @@ + + + + + + + Exception: Encoding::UndefinedConversionError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: Encoding::UndefinedConversionError + + + +

    +
    + +
    +
    Inherits:
    +
    + EncodingError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/string/encoding.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/EncodingError.html b/docs/api/v1.8.2/corelib/EncodingError.html new file mode 100644 index 00000000..c584962a --- /dev/null +++ b/docs/api/v1.8.2/corelib/EncodingError.html @@ -0,0 +1,156 @@ + + + + + + + Exception: EncodingError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: EncodingError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/string/encoding.rb
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerable.html b/docs/api/v1.8.2/corelib/Enumerable.html new file mode 100644 index 00000000..96d9df0e --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerable.html @@ -0,0 +1,5155 @@ + + + + + + + Module: Enumerable + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Enumerable + + + +

    +
    + + + + + + + + + +
    +
    Included in:
    +
    Array, Enumerator, Enumerator::Generator, Hash, ObjectSpace.self::WeakMap, Range, Set, Struct
    +
    + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerable.rb
    +
    + +
    + +

    Overview

    +
    +

    helpers: truthy, coerce_to, yield1, yieldX, deny_frozen_access +backtick_javascript: true

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

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Instance Method Details

    + + +
    +

    + + #all?(pattern = undefined, &block) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 19
    +
    +def all?(pattern = undefined, &block)
    +  if `pattern !== undefined`
    +    each do |*value|
    +      comparable = `comparableForPattern(value)`
    +
    +      return false unless pattern.public_send(:===, *comparable)
    +    end
    +  elsif block_given?
    +    each do |*value|
    +      unless yield(*value)
    +        return false
    +      end
    +    end
    +  else
    +    each do |*value|
    +      unless ::Opal.destructure(value)
    +        return false
    +      end
    +    end
    +  end
    +
    +  true
    +end
    +
    +
    + +
    +

    + + #any?(pattern = undefined, &block) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 43
    +
    +def any?(pattern = undefined, &block)
    +  if `pattern !== undefined`
    +    each do |*value|
    +      comparable = `comparableForPattern(value)`
    +
    +      return true if pattern.public_send(:===, *comparable)
    +    end
    +  elsif block_given?
    +    each do |*value|
    +      if yield(*value)
    +        return true
    +      end
    +    end
    +  else
    +    each do |*value|
    +      if ::Opal.destructure(value)
    +        return true
    +      end
    +    end
    +  end
    +
    +  false
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 67
    +
    +def chunk(&block)
    +  return to_enum(:chunk) { enumerator_size } unless block_given?
    +
    +  ::Enumerator.new do |yielder|
    +    %x{
    +      var previous = nil, accumulate = [];
    +
    +      function releaseAccumulate() {
    +        if (accumulate.length > 0) {
    +          #{yielder.yield(`previous`, `accumulate`)}
    +        }
    +      }
    +
    +      self.$each.$$p = function(value) {
    +        var key = $yield1(block, value);
    +
    +        if (key === nil) {
    +          releaseAccumulate();
    +          accumulate = [];
    +          previous = nil;
    +        } else {
    +          if (previous === nil || previous === key) {
    +            accumulate.push(value);
    +          } else {
    +            releaseAccumulate();
    +            accumulate = [value];
    +          }
    +
    +          previous = key;
    +        }
    +      }
    +
    +      self.$each();
    +
    +      releaseAccumulate();
    +    }
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +106
    +107
    +108
    +109
    +110
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 106
    +
    +def chunk_while(&block)
    +  ::Kernel.raise ::ArgumentError, 'no block given' unless block_given?
    +
    +  slice_when { |before, after| !(yield before, after) }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 112
    +
    +def collect(&block)
    +  return enum_for(:collect) { enumerator_size } unless block_given?
    +
    +  %x{
    +    var result = [];
    +
    +    self.$each.$$p = function() {
    +      var value = $yieldX(block, arguments);
    +
    +      result.push(value);
    +    };
    +
    +    self.$each();
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +130
    +131
    +132
    +133
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 130
    +
    +def collect_concat(&block)
    +  return enum_for(:collect_concat) { enumerator_size } unless block_given?
    +  map(&block).flatten(1)
    +end
    +
    +
    + +
    +

    + + #compactObject + + + + + +

    + + + + +
    +
    +
    +
    +135
    +136
    +137
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 135
    +
    +def compact
    +  to_a.compact
    +end
    +
    +
    + +
    +

    + + #count(object = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 139
    +
    +def count(object = undefined, &block)
    +  result = 0
    +
    +  %x{
    +    if (object != null && block !== nil) {
    +      #{warn('warning: given block not used')}
    +    }
    +  }
    +
    +  if `object != null`
    +    block = ::Kernel.proc do |*args|
    +      ::Opal.destructure(args) == object
    +    end
    +  elsif block.nil?
    +    block = ::Kernel.proc { true }
    +  end
    +
    +  each do |*args|
    +    `result++` if `$yieldX(block, args)`
    +  end
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #cycle(n = nil, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 163
    +
    +def cycle(n = nil, &block)
    +  unless block_given?
    +    return enum_for(:cycle, n) do
    +      if n.nil?
    +        respond_to?(:size) ? ::Float::INFINITY : nil
    +      else
    +        n = ::Opal.coerce_to!(n, ::Integer, :to_int)
    +        n > 0 ? enumerator_size * n : 0
    +      end
    +    end
    +  end
    +
    +  unless n.nil?
    +    n = ::Opal.coerce_to! n, ::Integer, :to_int
    +
    +    return if `n <= 0`
    +  end
    +
    +  %x{
    +    var all = [], i, length, value;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      all.push(param);
    +    }
    +
    +    self.$each();
    +
    +    if (all.length === 0) {
    +      return nil;
    +    }
    +
    +    if (n === nil) {
    +      while (true) {
    +        for (i = 0, length = all.length; i < length; i++) {
    +          value = $yield1(block, all[i]);
    +        }
    +      }
    +    }
    +    else {
    +      while (n > 1) {
    +        for (i = 0, length = all.length; i < length; i++) {
    +          value = $yield1(block, all[i]);
    +        }
    +
    +        n--;
    +      }
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 216
    +
    +def detect(ifnone = undefined, &block)
    +  return enum_for :detect, ifnone unless block_given?
    +
    +  each do |*args|
    +    value = ::Opal.destructure(args)
    +    if yield(value)
    +      return value
    +    end
    +  end
    +
    +  %x{
    +    if (ifnone !== undefined) {
    +      if (typeof(ifnone) === 'function') {
    +        return ifnone();
    +      } else {
    +        return ifnone;
    +      }
    +    }
    +  }
    +
    +  nil
    +end
    +
    +
    + +
    +

    + + #drop(number) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 239
    +
    +def drop(number)
    +  number = `$coerce_to(number, #{::Integer}, 'to_int')`
    +
    +  if `number < 0`
    +    ::Kernel.raise ::ArgumentError, 'attempt to drop negative size'
    +  end
    +
    +  %x{
    +    var result  = [],
    +        current = 0;
    +
    +    self.$each.$$p = function() {
    +      if (number <= current) {
    +        result.push(#{::Opal.destructure(`arguments`)});
    +      }
    +
    +      current++;
    +    };
    +
    +    self.$each()
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 264
    +
    +def drop_while(&block)
    +  return enum_for :drop_while unless block_given?
    +
    +  %x{
    +    var result   = [],
    +        dropping = true;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)};
    +
    +      if (dropping) {
    +        var value = $yield1(block, param);
    +
    +        if (!$truthy(value)) {
    +          dropping = false;
    +          result.push(param);
    +        }
    +      }
    +      else {
    +        result.push(param);
    +      }
    +    };
    +
    +    self.$each();
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #each_cons(n, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 293
    +
    +def each_cons(n, &block)
    +  if `arguments.length != 1`
    +    ::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arguments.length`} for 1)"
    +  end
    +
    +  n = ::Opal.try_convert n, ::Integer, :to_int
    +
    +  if `n <= 0`
    +    ::Kernel.raise ::ArgumentError, 'invalid size'
    +  end
    +
    +  unless block_given?
    +    return enum_for(:each_cons, n) do
    +      enum_size = enumerator_size
    +      if enum_size.nil?
    +        nil
    +      elsif enum_size == 0 || enum_size < n
    +        0
    +      else
    +        enum_size - n + 1
    +      end
    +    end
    +  end
    +
    +  %x{
    +    var buffer = [];
    +
    +    self.$each.$$p = function() {
    +      var element = #{::Opal.destructure(`arguments`)};
    +      buffer.push(element);
    +      if (buffer.length > n) {
    +        buffer.shift();
    +      }
    +      if (buffer.length == n) {
    +        $yield1(block, buffer.slice(0, n));
    +      }
    +    }
    +
    +    self.$each();
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #each_entry(*data, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 337
    +
    +def each_entry(*data, &block)
    +  unless block_given?
    +    return to_enum(:each_entry, *data) { enumerator_size }
    +  end
    +
    +  %x{
    +    self.$each.$$p = function() {
    +      var item = #{::Opal.destructure(`arguments`)};
    +
    +      $yield1(block, item);
    +    }
    +
    +    self.$each.apply(self, data);
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #each_slice(n, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +386
    +387
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 355
    +
    +def each_slice(n, &block)
    +  n = `$coerce_to(#{n}, #{::Integer}, 'to_int')`
    +
    +  if `n <= 0`
    +    ::Kernel.raise ::ArgumentError, 'invalid slice size'
    +  end
    +
    +  return enum_for(:each_slice, n) { respond_to?(:size) ? (size / n).ceil : nil } unless block_given?
    +
    +  %x{
    +    var slice = []
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)};
    +
    +      slice.push(param);
    +
    +      if (slice.length === n) {
    +        $yield1(block, slice);
    +        slice = [];
    +      }
    +    };
    +
    +    self.$each();
    +
    +    // our "last" group, if smaller than n then won't have been yielded
    +    if (slice.length > 0) {
    +      $yield1(block, slice);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #each_with_index(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 389
    +
    +def each_with_index(*args, &block)
    +  return enum_for(:each_with_index, *args) { enumerator_size } unless block_given?
    +
    +  %x{
    +    var index = 0;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)};
    +
    +      block(param, index);
    +
    +      index++;
    +    };
    +
    +    self.$each.apply(self, args);
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #each_with_object(object, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 409
    +
    +def each_with_object(object, &block)
    +  return enum_for(:each_with_object, object) { enumerator_size } unless block_given?
    +
    +  %x{
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)};
    +
    +      block(param, object);
    +    };
    +
    +    self.$each();
    +  }
    +
    +  object
    +end
    +
    +
    + +
    +

    + + #entries(*args) ⇒ Object + + + + Also known as: + to_a + + + + +

    + + + + +
    +
    +
    +
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 425
    +
    +def entries(*args)
    +  %x{
    +    var result = [];
    +
    +    self.$each.$$p = function() {
    +      result.push(#{::Opal.destructure(`arguments`)});
    +    };
    +
    +    self.$each.apply(self, args);
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #enumerator_sizeObject + + + + + +

    + + + + +
    +
    +
    +
    +654
    +655
    +656
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 654
    +
    +def enumerator_size
    +  respond_to?(:size) ? size : nil
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +439
    +440
    +441
    +442
    +443
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 439
    +
    +def filter_map(&block)
    +  return enum_for(:filter_map) { enumerator_size } unless block_given?
    +
    +  map(&block).select(&:itself)
    +end
    +
    +
    + +
    +

    + + #find_all(&block) ⇒ Object + + + + Also known as: + filter, select + + + + +

    + + + + +
    +
    +
    +
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    +457
    +458
    +459
    +460
    +461
    +462
    +463
    +464
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 445
    +
    +def find_all(&block)
    +  return enum_for(:find_all) { enumerator_size } unless block_given?
    +
    +  %x{
    +    var result = [];
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      if ($truthy(value)) {
    +        result.push(param);
    +      }
    +    };
    +
    +    self.$each();
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #find_index(object = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +466
    +467
    +468
    +469
    +470
    +471
    +472
    +473
    +474
    +475
    +476
    +477
    +478
    +479
    +480
    +481
    +482
    +483
    +484
    +485
    +486
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 466
    +
    +def find_index(object = undefined, &block)
    +  return enum_for :find_index if `object === undefined && block === nil`
    +
    +  %x{
    +    if (object != null && block !== nil) {
    +      #{warn('warning: given block not used')}
    +    }
    +  }
    +
    +  index = 0
    +
    +  if `object != null`
    +    each do |*value|
    +      if ::Opal.destructure(value) == object
    +        return index
    +      end
    +
    +      `index += 1`
    +    end
    +  else
    +    each do |*value|
    +      if yield(*value)
    +        return index
    +      end
    +
    +      `index += 1`
    +    end
    +  end
    +
    +  nil
    +end
    +
    +
    + +
    +

    + + #first(number = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +526
    +527
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 498
    +
    +def first(number = undefined)
    +  if `number === undefined`
    +    each do |value|
    +      return value
    +    end
    +  else
    +    result = []
    +    number = `$coerce_to(number, #{::Integer}, 'to_int')`
    +
    +    if `number < 0`
    +      ::Kernel.raise ::ArgumentError, 'attempt to take negative size'
    +    end
    +
    +    if `number == 0`
    +      return []
    +    end
    +
    +    current = 0
    +
    +    each do |*args|
    +      `result.push(#{::Opal.destructure(args)})`
    +
    +      if `number <= ++current`
    +        return result
    +      end
    +    end
    +
    +    result
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 529
    +
    +def grep(pattern, &block)
    +  result = []
    +
    +  each do |*value|
    +    cmp = `comparableForPattern(value)`
    +    next unless pattern.__send__(:===, *cmp)
    +    if block_given?
    +      value = [value] if value.length > 1
    +      value = yield(*value)
    +    elsif value.length <= 1
    +      value = value[0]
    +    end
    +
    +    result.push(value)
    +  end
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #grep_v(pattern, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +548
    +549
    +550
    +551
    +552
    +553
    +554
    +555
    +556
    +557
    +558
    +559
    +560
    +561
    +562
    +563
    +564
    +565
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 548
    +
    +def grep_v(pattern, &block)
    +  result = []
    +
    +  each do |*value|
    +    cmp = `comparableForPattern(value)`
    +    next if pattern.__send__(:===, *cmp)
    +    if block_given?
    +      value = [value] if value.length > 1
    +      value = yield(*value)
    +    elsif value.length <= 1
    +      value = value[0]
    +    end
    +
    +    result.push(value)
    +  end
    +
    +  result
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +567
    +568
    +569
    +570
    +571
    +572
    +573
    +574
    +575
    +576
    +577
    +578
    +579
    +580
    +581
    +582
    +583
    +584
    +585
    +586
    +587
    +588
    +589
    +590
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 567
    +
    +def group_by(&block)
    +  return enum_for(:group_by) { enumerator_size } unless block_given?
    +
    +  hash = {}
    +
    +  %x{
    +    var result;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      #{(hash[`value`] ||= []) << `param`};
    +    }
    +
    +    self.$each();
    +
    +    if (result !== undefined) {
    +      return result;
    +    }
    +  }
    +
    +  hash
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +592
    +593
    +594
    +595
    +596
    +597
    +598
    +599
    +600
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 592
    +
    +def include?(obj)
    +  each do |*args|
    +    if ::Opal.destructure(args) == obj
    +      return true
    +    end
    +  end
    +
    +  false
    +end
    +
    +
    + +
    +

    + + #inject(object = undefined, sym = undefined, &block) ⇒ Object + + + + Also known as: + reduce + + + + +

    + + + + +
    +
    +
    +
    +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
    +637
    +638
    +639
    +640
    +641
    +642
    +643
    +644
    +645
    +646
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 602
    +
    +def inject(object = undefined, sym = undefined, &block)
    +  %x{
    +    var result = object;
    +
    +    if (block !== nil && sym === undefined) {
    +      self.$each.$$p = function() {
    +        var value = #{::Opal.destructure(`arguments`)};
    +
    +        if (result === undefined) {
    +          result = value;
    +          return;
    +        }
    +
    +        value = $yieldX(block, [result, value]);
    +
    +        result = value;
    +      };
    +    }
    +    else {
    +      if (sym === undefined) {
    +        if (!#{::Symbol === object}) {
    +          #{::Kernel.raise ::TypeError, "#{object.inspect} is not a Symbol"};
    +        }
    +
    +        sym    = object;
    +        result = undefined;
    +      }
    +
    +      self.$each.$$p = function() {
    +        var value = #{::Opal.destructure(`arguments`)};
    +
    +        if (result === undefined) {
    +          result = value;
    +          return;
    +        }
    +
    +        result = #{`result`.__send__ sym, `value`};
    +      };
    +    }
    +
    +    self.$each();
    +
    +    return result == undefined ? nil : result;
    +  }
    +end
    +
    +
    + +
    +

    + + #lazyObject + + + + + +

    + + + + +
    +
    +
    +
    +648
    +649
    +650
    +651
    +652
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 648
    +
    +def lazy
    +  ::Enumerator::Lazy.new(self, enumerator_size) do |enum, *args|
    +    enum.yield(*args)
    +  end
    +end
    +
    +
    + +
    +

    + + #max(n = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +688
    +689
    +690
    +691
    +692
    +693
    +694
    +695
    +696
    +697
    +698
    +699
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 658
    +
    +def max(n = undefined, &block)
    +  %x{
    +    if (n === undefined || n === nil) {
    +      var result, value;
    +
    +      self.$each.$$p = function() {
    +        var item = #{::Opal.destructure(`arguments`)};
    +
    +        if (result === undefined) {
    +          result = item;
    +          return;
    +        }
    +
    +        if (block !== nil) {
    +          value = $yieldX(block, [item, result]);
    +        } else {
    +          value = #{`item` <=> `result`};
    +        }
    +
    +        if (value === nil) {
    +          #{::Kernel.raise ::ArgumentError, 'comparison failed'};
    +        }
    +
    +        if (value > 0) {
    +          result = item;
    +        }
    +      }
    +
    +      self.$each();
    +
    +      if (result === undefined) {
    +        return nil;
    +      } else {
    +        return result;
    +      }
    +    }
    +
    +    n = $coerce_to(n, #{::Integer}, 'to_int');
    +  }
    +
    +  sort(&block).reverse.first(n)
    +end
    +
    +
    + +
    +

    + + #max_by(n = nil, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 701
    +
    +def max_by(n = nil, &block)
    +  return enum_for(:max_by, n) { enumerator_size } unless block
    +
    +  unless n.nil?
    +    return sort_by(&block).reverse.take n
    +  end
    +
    +  %x{
    +    var result,
    +        by;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      if (result === undefined) {
    +        result = param;
    +        by     = value;
    +        return;
    +      }
    +
    +      if (#{`value` <=> `by`} > 0) {
    +        result = param
    +        by     = value;
    +      }
    +    };
    +
    +    self.$each();
    +
    +    return result === undefined ? nil : result;
    +  }
    +end
    +
    +
    + +
    +

    + + #min(n = nil, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +734
    +735
    +736
    +737
    +738
    +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
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +776
    +777
    +778
    +779
    +780
    +781
    +782
    +783
    +784
    +785
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 734
    +
    +def min(n = nil, &block)
    +  unless n.nil?
    +    if block_given?
    +      return sort { |a, b| yield a, b }.take n
    +    else
    +      return sort.take n
    +    end
    +  end
    +
    +  %x{
    +    var result;
    +
    +    if (block !== nil) {
    +      self.$each.$$p = function() {
    +        var param = #{::Opal.destructure(`arguments`)};
    +
    +        if (result === undefined) {
    +          result = param;
    +          return;
    +        }
    +
    +        var value = block(param, result);
    +
    +        if (value === nil) {
    +          #{::Kernel.raise ::ArgumentError, 'comparison failed'};
    +        }
    +
    +        if (value < 0) {
    +          result = param;
    +        }
    +      };
    +    }
    +    else {
    +      self.$each.$$p = function() {
    +        var param = #{::Opal.destructure(`arguments`)};
    +
    +        if (result === undefined) {
    +          result = param;
    +          return;
    +        }
    +
    +        if (#{::Opal.compare(`param`, `result`)} < 0) {
    +          result = param;
    +        }
    +      };
    +    }
    +
    +    self.$each();
    +
    +    return result === undefined ? nil : result;
    +  }
    +end
    +
    +
    + +
    +

    + + #min_by(n = nil, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 787
    +
    +def min_by(n = nil, &block)
    +  return enum_for(:min_by, n) { enumerator_size } unless block
    +
    +  unless n.nil?
    +    return sort_by(&block).take n
    +  end
    +
    +  %x{
    +    var result,
    +        by;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      if (result === undefined) {
    +        result = param;
    +        by     = value;
    +        return;
    +      }
    +
    +      if (#{`value` <=> `by`} < 0) {
    +        result = param
    +        by     = value;
    +      }
    +    };
    +
    +    self.$each();
    +
    +    return result === undefined ? nil : result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 820
    +
    +def minmax(&block)
    +  block ||= ::Kernel.proc { |a, b| a <=> b }
    +
    +  %x{
    +    var min = nil, max = nil, first_time = true;
    +
    +    self.$each.$$p = function() {
    +      var element = #{::Opal.destructure(`arguments`)};
    +      if (first_time) {
    +        min = max = element;
    +        first_time = false;
    +      } else {
    +        var min_cmp = #{block.call(`min`, `element`)};
    +
    +        if (min_cmp === nil) {
    +          #{::Kernel.raise ::ArgumentError, 'comparison failed'}
    +        } else if (min_cmp > 0) {
    +          min = element;
    +        }
    +
    +        var max_cmp = #{block.call(`max`, `element`)};
    +
    +        if (max_cmp === nil) {
    +          #{::Kernel.raise ::ArgumentError, 'comparison failed'}
    +        } else if (max_cmp < 0) {
    +          max = element;
    +        }
    +      }
    +    }
    +
    +    self.$each();
    +
    +    return [min, max];
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 856
    +
    +def minmax_by(&block)
    +  return enum_for(:minmax_by) { enumerator_size } unless block
    +
    +  %x{
    +    var min_result = nil,
    +        max_result = nil,
    +        min_by,
    +        max_by;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      if ((min_by === undefined) || #{`value` <=> `min_by`} < 0) {
    +        min_result = param;
    +        min_by     = value;
    +      }
    +
    +      if ((max_by === undefined) || #{`value` <=> `max_by`} > 0) {
    +        max_result = param;
    +        max_by     = value;
    +      }
    +    };
    +
    +    self.$each();
    +
    +    return [min_result, max_result];
    +  }
    +end
    +
    +
    + +
    +

    + + #none?(pattern = undefined, &block) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +886
    +887
    +888
    +889
    +890
    +891
    +892
    +893
    +894
    +895
    +896
    +897
    +898
    +899
    +900
    +901
    +902
    +903
    +904
    +905
    +906
    +907
    +908
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 886
    +
    +def none?(pattern = undefined, &block)
    +  if `pattern !== undefined`
    +    each do |*value|
    +      comparable = `comparableForPattern(value)`
    +
    +      return false if pattern.public_send(:===, *comparable)
    +    end
    +  elsif block_given?
    +    each do |*value|
    +      if yield(*value)
    +        return false
    +      end
    +    end
    +  else
    +    each do |*value|
    +      item = ::Opal.destructure(value)
    +
    +      return false if item
    +    end
    +  end
    +
    +  true
    +end
    +
    +
    + +
    +

    + + #one?(pattern = undefined, &block) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 910
    +
    +def one?(pattern = undefined, &block)
    +  count = 0
    +
    +  if `pattern !== undefined`
    +    each do |*value|
    +      comparable = `comparableForPattern(value)`
    +
    +      if pattern.public_send(:===, *comparable)
    +        count += 1
    +        return false if count > 1
    +      end
    +    end
    +  elsif block_given?
    +    each do |*value|
    +      next unless yield(*value)
    +      count += 1
    +
    +      return false if count > 1
    +    end
    +  else
    +    each do |*value|
    +      next unless ::Opal.destructure(value)
    +      count += 1
    +
    +      return false if count > 1
    +    end
    +  end
    +
    +  count == 1
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +941
    +942
    +943
    +944
    +945
    +946
    +947
    +948
    +949
    +950
    +951
    +952
    +953
    +954
    +955
    +956
    +957
    +958
    +959
    +960
    +961
    +962
    +963
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 941
    +
    +def partition(&block)
    +  return enum_for(:partition) { enumerator_size } unless block_given?
    +
    +  %x{
    +    var truthy = [], falsy = [], result;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      if ($truthy(value)) {
    +        truthy.push(param);
    +      }
    +      else {
    +        falsy.push(param);
    +      }
    +    };
    +
    +    self.$each();
    +
    +    return [truthy, falsy];
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +965
    +966
    +967
    +968
    +969
    +970
    +971
    +972
    +973
    +974
    +975
    +976
    +977
    +978
    +979
    +980
    +981
    +982
    +983
    +984
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 965
    +
    +def reject(&block)
    +  return enum_for(:reject) { enumerator_size } unless block_given?
    +
    +  %x{
    +    var result = [];
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = $yield1(block, param);
    +
    +      if (!$truthy(value)) {
    +        result.push(param);
    +      }
    +    };
    +
    +    self.$each();
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +986
    +987
    +988
    +989
    +990
    +991
    +992
    +993
    +994
    +995
    +996
    +997
    +998
    +999
    +1000
    +1001
    +1002
    +1003
    +1004
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 986
    +
    +def reverse_each(&block)
    +  return enum_for(:reverse_each) { enumerator_size } unless block_given?
    +
    +  %x{
    +    var result = [];
    +
    +    self.$each.$$p = function() {
    +      result.push(arguments);
    +    };
    +
    +    self.$each();
    +
    +    for (var i = result.length - 1; i >= 0; i--) {
    +      $yieldX(block, result[i]);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #slice_after(pattern = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1070
    +1071
    +1072
    +1073
    +1074
    +1075
    +1076
    +1077
    +1078
    +1079
    +1080
    +1081
    +1082
    +1083
    +1084
    +1085
    +1086
    +1087
    +1088
    +1089
    +1090
    +1091
    +1092
    +1093
    +1094
    +1095
    +1096
    +1097
    +1098
    +1099
    +1100
    +1101
    +1102
    +1103
    +1104
    +1105
    +1106
    +1107
    +1108
    +1109
    +1110
    +1111
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1070
    +
    +def slice_after(pattern = undefined, &block)
    +  if `pattern === undefined && block === nil`
    +    ::Kernel.raise ::ArgumentError, 'both pattern and block are given'
    +  end
    +
    +  if `pattern !== undefined && block !== nil || arguments.length > 1`
    +    ::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arguments.length`} expected 1)"
    +  end
    +
    +  if `pattern !== undefined`
    +    block = ::Kernel.proc { |e| pattern === e }
    +  end
    +
    +  ::Enumerator.new do |yielder|
    +    %x{
    +      var accumulate;
    +
    +      self.$each.$$p = function() {
    +        var element = #{::Opal.destructure(`arguments`)},
    +            end_chunk = $yield1(block, element);
    +
    +        if (accumulate == null) {
    +          accumulate = [];
    +        }
    +
    +        if ($truthy(end_chunk)) {
    +          accumulate.push(element);
    +          #{yielder.yield(`accumulate`)};
    +          accumulate = null;
    +        } else {
    +          accumulate.push(element)
    +        }
    +      }
    +
    +      self.$each();
    +
    +      if (accumulate != null) {
    +        #{yielder.yield(`accumulate`)};
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    +

    + + #slice_before(pattern = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1006
    +1007
    +1008
    +1009
    +1010
    +1011
    +1012
    +1013
    +1014
    +1015
    +1016
    +1017
    +1018
    +1019
    +1020
    +1021
    +1022
    +1023
    +1024
    +1025
    +1026
    +1027
    +1028
    +1029
    +1030
    +1031
    +1032
    +1033
    +1034
    +1035
    +1036
    +1037
    +1038
    +1039
    +1040
    +1041
    +1042
    +1043
    +1044
    +1045
    +1046
    +1047
    +1048
    +1049
    +1050
    +1051
    +1052
    +1053
    +1054
    +1055
    +1056
    +1057
    +1058
    +1059
    +1060
    +1061
    +1062
    +1063
    +1064
    +1065
    +1066
    +1067
    +1068
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1006
    +
    +def slice_before(pattern = undefined, &block)
    +  if `pattern === undefined && block === nil`
    +    ::Kernel.raise ::ArgumentError, 'both pattern and block are given'
    +  end
    +
    +  if `pattern !== undefined && block !== nil || arguments.length > 1`
    +    ::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arguments.length`} expected 1)"
    +  end
    +
    +  ::Enumerator.new do |e|
    +    %x{
    +      var slice = [];
    +
    +      if (block !== nil) {
    +        if (pattern === undefined) {
    +          self.$each.$$p = function() {
    +            var param = #{::Opal.destructure(`arguments`)},
    +                value = $yield1(block, param);
    +
    +            if ($truthy(value) && slice.length > 0) {
    +              #{e << `slice`};
    +              slice = [];
    +            }
    +
    +            slice.push(param);
    +          };
    +        }
    +        else {
    +          self.$each.$$p = function() {
    +            var param = #{::Opal.destructure(`arguments`)},
    +                value = block(param, #{pattern.dup});
    +
    +            if ($truthy(value) && slice.length > 0) {
    +              #{e << `slice`};
    +              slice = [];
    +            }
    +
    +            slice.push(param);
    +          };
    +        }
    +      }
    +      else {
    +        self.$each.$$p = function() {
    +          var param = #{::Opal.destructure(`arguments`)},
    +              value = #{pattern === `param`};
    +
    +          if ($truthy(value) && slice.length > 0) {
    +            #{e << `slice`};
    +            slice = [];
    +          }
    +
    +          slice.push(param);
    +        };
    +      }
    +
    +      self.$each();
    +
    +      if (slice.length > 0) {
    +        #{e << `slice`};
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1113
    +1114
    +1115
    +1116
    +1117
    +1118
    +1119
    +1120
    +1121
    +1122
    +1123
    +1124
    +1125
    +1126
    +1127
    +1128
    +1129
    +1130
    +1131
    +1132
    +1133
    +1134
    +1135
    +1136
    +1137
    +1138
    +1139
    +1140
    +1141
    +1142
    +1143
    +1144
    +1145
    +1146
    +1147
    +1148
    +1149
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1113
    +
    +def slice_when(&block)
    +  ::Kernel.raise ::ArgumentError, 'wrong number of arguments (0 for 1)' unless block_given?
    +
    +  ::Enumerator.new do |yielder|
    +    %x{
    +      var slice = nil, last_after = nil;
    +
    +      self.$each_cons.$$p = function() {
    +        var params = #{::Opal.destructure(`arguments`)},
    +            before = params[0],
    +            after = params[1],
    +            match = $yieldX(block, [before, after]);
    +
    +        last_after = after;
    +
    +        if (slice === nil) {
    +          slice = [];
    +        }
    +
    +        if ($truthy(match)) {
    +          slice.push(before);
    +          #{yielder.yield(`slice`)};
    +          slice = [];
    +        } else {
    +          slice.push(before);
    +        }
    +      }
    +
    +      self.$each_cons(2);
    +
    +      if (slice !== nil) {
    +        slice.push(last_after);
    +        #{yielder.yield(`slice`)};
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1151
    +1152
    +1153
    +1154
    +1155
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1151
    +
    +def sort(&block)
    +  ary = to_a
    +  block = ->(a, b) { a <=> b } unless block_given?
    +  ary.sort(&block)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1157
    +1158
    +1159
    +1160
    +1161
    +1162
    +1163
    +1164
    +1165
    +1166
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1157
    +
    +def sort_by(&block)
    +  return enum_for(:sort_by) { enumerator_size } unless block_given?
    +
    +  dup = map do
    +    arg = ::Opal.destructure(`arguments`)
    +    [yield(arg), arg]
    +  end
    +  dup.sort! { |a, b| `a[0]` <=> `b[0]` }
    +  dup.map! { |i| `i[1]` }
    +end
    +
    +
    + +
    +

    + + #sum(initial = 0) ⇒ Object + + + + + +

    +
    +

    This method implements the Kahan summation algorithm if it is possible to apply one.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +1169
    +1170
    +1171
    +1172
    +1173
    +1174
    +1175
    +1176
    +1177
    +1178
    +1179
    +1180
    +1181
    +1182
    +1183
    +1184
    +1185
    +1186
    +1187
    +1188
    +1189
    +1190
    +1191
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1169
    +
    +def sum(initial = 0)
    +  result = initial
    +  compensation = 0
    +
    +  each do |*args|
    +    item = if block_given?
    +             yield(*args)
    +           else
    +             ::Opal.destructure(args)
    +           end
    +
    +    if ![::Float::INFINITY, -::Float::INFINITY].include?(item) && item.respond_to?(:-)
    +      y = item - compensation
    +      t = result + y
    +      compensation = (t - result) - y
    +      result = t
    +    else
    +      result += item
    +    end
    +  end
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #take(num) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1193
    +1194
    +1195
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1193
    +
    +def take(num)
    +  first(num)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1197
    +1198
    +1199
    +1200
    +1201
    +1202
    +1203
    +1204
    +1205
    +1206
    +1207
    +1208
    +1209
    +1210
    +1211
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1197
    +
    +def take_while(&block)
    +  return enum_for :take_while unless block
    +
    +  result = []
    +
    +  each do |*args|
    +    value = ::Opal.destructure(args)
    +
    +    unless yield(value)
    +      return result
    +    end
    +
    +    `result.push(value)`
    +  end
    +end
    +
    +
    + +
    +

    + + #tally(hash = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1233
    +1234
    +1235
    +1236
    +1237
    +1238
    +1239
    +1240
    +1241
    +1242
    +1243
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1233
    +
    +def tally(hash = undefined)
    +  `if (hash && hash !== nil) { $deny_frozen_access(hash); }`
    +
    +  out = group_by(&:itself).transform_values(&:count)
    +  if hash
    +    out.each { |k, v| hash[k] = hash.fetch(k, 0) + v }
    +    hash
    +  else
    +    out
    +  end
    +end
    +
    +
    + +
    +

    + + #to_h(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1245
    +
    +def to_h(*args, &block)
    +  return map(&block).to_h(*args) if block_given?
    +
    +  %x{
    +    var hash = #{{}};
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)};
    +      var ary = #{::Opal.coerce_to?(`param`, ::Array, :to_ary)}, key, val;
    +      if (!ary.$$is_array) {
    +        #{::Kernel.raise ::TypeError, "wrong element type #{`param`.class} (expected array)"}
    +      }
    +      if (ary.length !== 2) {
    +        #{::Kernel.raise ::ArgumentError, "element has wrong array length (expected 2, was #{`ary`.length})"}
    +      }
    +      key = ary[0];
    +      val = ary[1];
    +
    +      Opal.hash_put(hash, key, val);
    +    };
    +
    +    self.$each.apply(self, args);
    +
    +    return hash;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_set(klass = Set, *args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1272
    +1273
    +1274
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1272
    +
    +def to_set(klass = Set, *args, &block)
    +  klass.new(self, *args, &block)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +1213
    +1214
    +1215
    +1216
    +1217
    +1218
    +1219
    +1220
    +1221
    +1222
    +1223
    +1224
    +1225
    +1226
    +1227
    +1228
    +1229
    +1230
    +1231
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1213
    +
    +def uniq(&block)
    +  hash = {}
    +
    +  each do |*args|
    +    value = ::Opal.destructure(args)
    +
    +    produced = if block_given?
    +                 yield(value)
    +               else
    +                 value
    +               end
    +
    +    unless hash.key?(produced)
    +      hash[produced] = value
    +    end
    +  end
    +
    +  hash.values
    +end
    +
    +
    + +
    +

    + + #zip(*others, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1276
    +1277
    +1278
    +
    +
    # File 'opal/opal/corelib/enumerable.rb', line 1276
    +
    +def zip(*others, &block)
    +  to_a.zip(*others)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerator.html b/docs/api/v1.8.2/corelib/Enumerator.html new file mode 100644 index 00000000..29e51815 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerator.html @@ -0,0 +1,1106 @@ + + + + + + + Class: Enumerator + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Enumerator + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerator/lazy.rb,
    + opal/opal/corelib/enumerator.rb,
    opal/opal/corelib/enumerator/chain.rb,
    opal/opal/corelib/enumerator/yielder.rb,
    opal/opal/corelib/enumerator/generator.rb,
    opal/opal/corelib/enumerator/arithmetic_sequence.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    self::ArithmeticSequence, self::Chain, self::Lazy

    +
    +

    Defined Under Namespace

    +

    + + + + + Classes: Generator, Yielder + + +

    + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #any?, #chunk, #chunk_while, #collect, #collect_concat, #compact, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #first, #grep, #grep_v, #group_by, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_h, #to_set, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(&block) ⇒ Enumerator + + + + + +

    +
    +

    Returns a new instance of Enumerator.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 25
    +
    +def initialize(*, &block)
    +  `$deny_frozen_access(self)`
    +
    +  @cursor = 0
    +  if block
    +    @object = Generator.new(&block)
    +    @method = :each
    +    @args   = []
    +    @size   = `arguments[0] || nil`
    +
    +    if @size && !@size.respond_to?(:call)
    +      @size = `$coerce_to(#{@size}, #{::Integer}, 'to_int')`
    +    end
    +  else
    +    @object = `arguments[0]`
    +    @method = `arguments[1] || "each"`
    +    @args   = `$slice(arguments, 2)`
    +    @size   = nil
    +  end
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .for(object, method = :each, *args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 11
    +
    +def self.for(object, method = :each, *args, &block)
    +  %x{
    +    var obj = #{allocate};
    +
    +    obj.object = object;
    +    obj.size   = block;
    +    obj.method = method;
    +    obj.args   = args;
    +    obj.cursor = 0;
    +
    +    return obj;
    +  }
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +124
    +125
    +126
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 124
    +
    +def +(other)
    +  ::Enumerator::Chain.new(self, other)
    +end
    +
    +
    + +
    +

    + + #each(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 46
    +
    +def each(*args, &block)
    +  return self if block.nil? && args.empty?
    +
    +  args = @args + args
    +
    +  return self.class.new(@object, @method, *args) if block.nil?
    +
    +  @object.__send__(@method, *args, &block)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +85
    +86
    +87
    +88
    +89
    +90
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 85
    +
    +def each_with_index(&block)
    +  return enum_for(:each_with_index) { size } unless block_given?
    +
    +  super
    +  @object
    +end
    +
    +
    + +
    +

    + + #feed(arg) ⇒ Object + + + + + +

    +
    + + +
    +
    +
    + +

    Raises:

    + + +
    + + + + +
    +
    +
    +
    +120
    +121
    +122
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 120
    +
    +def feed(arg)
    +  raise NotImplementedError, "Opal doesn't support Enumerator#feed"
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 128
    +
    +def inspect
    +  result = "#<#{self.class}: #{@object.inspect}:#{@method}"
    +
    +  if @args.any?
    +    result += "(#{@args.inspect[::Range.new(1, -2)]})"
    +  end
    +
    +  result + '>'
    +end
    +
    +
    + +
    +

    + + #nextObject + + + + + +

    + + + + +
    +
    +
    +
    +115
    +116
    +117
    +118
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 115
    +
    +def next
    +  values = next_values
    +  values.length <= 1 ? values[0] : values
    +end
    +
    +
    + +
    +

    + + #next_valuesObject + + + + + +

    + + + + +
    +
    +
    +
    +109
    +110
    +111
    +112
    +113
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 109
    +
    +def next_values
    +  out = peek_values
    +  @cursor += 1
    +  out
    +end
    +
    +
    + +
    +

    + + #peekObject + + + + + +

    + + + + +
    +
    +
    +
    +104
    +105
    +106
    +107
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 104
    +
    +def peek
    +  values = peek_values
    +  values.length <= 1 ? values[0] : values
    +end
    +
    +
    + +
    +

    + + #peek_valuesObject + + + + + +

    + + + + +
    +
    +
    +
    +98
    +99
    +100
    +101
    +102
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 98
    +
    +def peek_values
    +  @values ||= map { |*i| i }
    +  ::Kernel.raise ::StopIteration, 'iteration reached an end' if @cursor >= @values.length
    +  @values[@cursor]
    +end
    +
    +
    + +
    +

    + + #rewindObject + + + + + +

    + + + + +
    +
    +
    +
    +92
    +93
    +94
    +95
    +96
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 92
    +
    +def rewind
    +  @cursor = 0
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #sizeObject + + + + + +

    + + + + +
    +
    +
    +
    +56
    +57
    +58
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 56
    +
    +def size
    +  @size.respond_to?(:call) ? @size.call(*@args) : @size
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +
    +
    # File 'opal/opal/corelib/enumerator.rb', line 60
    +
    +def with_index(offset = 0, &block)
    +  offset = if offset
    +             `$coerce_to(offset, #{::Integer}, 'to_int')`
    +           else
    +             0
    +           end
    +
    +  return enum_for(:with_index, offset) { size } unless block
    +
    +  %x{
    +    var result, index = offset;
    +
    +    self.$each.$$p = function() {
    +      var param = #{::Opal.destructure(`arguments`)},
    +          value = block(param, index);
    +
    +      index++;
    +
    +      return value;
    +    }
    +
    +    return self.$each();
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerator.self/ArithmeticSequence.html b/docs/api/v1.8.2/corelib/Enumerator.self/ArithmeticSequence.html new file mode 100644 index 00000000..478071dd --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerator.self/ArithmeticSequence.html @@ -0,0 +1,1208 @@ + + + + + + + Class: Enumerator.self::ArithmeticSequence + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Enumerator.self::ArithmeticSequence + + + +

    +
    + +
    +
    Inherits:
    +
    + Enumerator + +
      +
    • Object
    • + + + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerator/arithmetic_sequence.rb
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #step ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute step.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(range, step = undefined, creation_method = :step) ⇒ ArithmeticSequence + + + + + +

    +
    +

    Returns a new instance of ArithmeticSequence.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 10
    +
    +def initialize(range, step = undefined, creation_method = :step)
    +  @creation_method = creation_method
    +  if range.is_a? ::Array
    +    @step_arg1, @step_arg2, @topfx, @bypfx = *range
    +    @receiver_num = step
    +    @step = 1
    +
    +    @range = if @step_arg2
    +               @step = @step_arg2
    +               (@receiver_num..@step_arg1)
    +             elsif @step_arg1
    +               (@receiver_num..@step_arg1)
    +             else
    +               (@receiver_num..nil)
    +             end
    +  else
    +    @skipped_arg = true unless step
    +    @range, @step = range, step || 1
    +  end
    +
    +  @object = self
    +
    +  ::Kernel.raise ArgumentError, "step can't be 0" if @step == 0
    +  unless @step.respond_to? :to_int
    +    ::Kernel.raise ArgumentError, "no implicit conversion of #{@step.class} " \
    +                                  'into Integer'
    +  end
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #stepObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute step.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +39
    +40
    +41
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 39
    +
    +def step
    +  @step
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + ===, eql? + + + + +

    + + + + +
    +
    +
    +
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 147
    +
    +def ==(other)
    +  self.class == other.class &&
    +    self.begin == other.begin &&
    +    self.end == other.end &&
    +    step == other.step &&
    +    exclude_end? == other.exclude_end?
    +end
    +
    +
    + +
    +

    + + #_greater_than_begin?(val) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 64
    +
    +def _greater_than_begin?(val)
    +  begin_ = self.begin || -`inf`
    +  if step > 0
    +    val > begin_
    +  else
    +    val < begin_
    +  end
    +end
    +
    +
    + +
    +

    + + #_lesser_than_end?(val) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 54
    +
    +def _lesser_than_end?(val)
    +  end_ = self.end || `inf`
    +  if step > 0
    +    exclude_end? ? val < end_ : val <= end_
    +  else
    +    exclude_end? ? val > end_ : val >= end_
    +  end
    +end
    +
    +
    + +
    +

    + + #beginObject + + + + + +

    + + + + +
    +
    +
    +
    +41
    +42
    +43
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 41
    +
    +def begin
    +  @range.begin
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 89
    +
    +def each(&block)
    +  return self unless block_given?
    +
    +  case self.begin
    +  when nil
    +    ::Kernel.raise TypeError, "nil can't be coerced into Integer"
    +  end
    +
    +  iter = self.begin || -`inf`
    +
    +  while _lesser_than_end?(iter)
    +    yield iter
    +    iter += step
    +  end
    +  self
    +end
    +
    +
    + +
    +

    + + #endObject + + + + + +

    + + + + +
    +
    +
    +
    +45
    +46
    +47
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 45
    +
    +def end
    +  @range.end
    +end
    +
    +
    + +
    +

    + + #exclude_end?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +49
    +50
    +51
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 49
    +
    +def exclude_end?
    +  @range.exclude_end?
    +end
    +
    +
    + +
    +

    + + #first(count = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 73
    +
    +def first(count = undefined)
    +  iter = self.begin || -`inf`
    +
    +  return _lesser_than_end?(iter) ? iter : nil unless count
    +
    +  out = []
    +
    +  while _lesser_than_end?(iter) && count > 0
    +    out << iter
    +    iter += step
    +    count -= 1
    +  end
    +
    +  out
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +155
    +156
    +157
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 155
    +
    +def hash
    +  [ArithmeticSequence, self.begin, self.end, step, exclude_end?].hash
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 159
    +
    +def inspect
    +  if @receiver_num
    +    args = if @step_arg2
    +             "(#{@topfx}#{@step_arg1.inspect}, #{@bypfx}#{@step_arg2.inspect})"
    +           elsif @step_arg1
    +             "(#{@topfx}#{@step_arg1.inspect})"
    +           end
    +
    +    "(#{@receiver_num.inspect}.#{@creation_method}#{args})"
    +  else
    +    args = unless @skipped_arg
    +             "(#{@step})"
    +           end
    +    "((#{@range.inspect}).#{@creation_method}#{args})"
    +  end
    +end
    +
    +
    + +
    +

    + + #last(count = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 106
    +
    +def last(count = undefined)
    +  case self.end
    +  when `inf`, -`inf`
    +    ::Kernel.raise ::FloatDomainError, self.end
    +  when nil
    +    ::Kernel.raise ::RangeError, 'cannot get the last element of endless arithmetic sequence'
    +  end
    +
    +  iter = self.end - ((self.end - self.begin) % step)
    +  iter -= step unless _lesser_than_end?(iter)
    +
    +  return _greater_than_begin?(iter) ? iter : nil unless count
    +
    +  out = []
    +
    +  while _greater_than_begin?(iter) && count > 0
    +    out << iter
    +    iter -= step
    +    count -= 1
    +  end
    +
    +  out.reverse
    +end
    +
    +
    + +
    +

    + + #sizeObject + + + + + +

    + + + + +
    +
    +
    +
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +
    +
    # File 'opal/opal/corelib/enumerator/arithmetic_sequence.rb', line 130
    +
    +def size
    +  step_sign = step > 0 ? 1 : -1
    +
    +  if !_lesser_than_end?(self.begin)
    +    0
    +  elsif [-`inf`, `inf`].include?(step)
    +    1
    +  elsif [-`inf` * step_sign, nil].include?(self.begin) ||
    +        [`inf` * step_sign, nil].include?(self.end)
    +    `inf`
    +  else
    +    iter = self.end - ((self.end - self.begin) % step)
    +    iter -= step unless _lesser_than_end?(iter)
    +    ((iter - self.begin) / step).abs.to_i + 1
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerator.self/Chain.html b/docs/api/v1.8.2/corelib/Enumerator.self/Chain.html new file mode 100644 index 00000000..4d46dcb1 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerator.self/Chain.html @@ -0,0 +1,462 @@ + + + + + + + Class: Enumerator.self::Chain + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Enumerator.self::Chain + + + +

    +
    + +
    +
    Inherits:
    +
    + Enumerator + +
      +
    • Object
    • + + + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerator/chain.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + +
    +

    Constructor Details

    + +
    +

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

    +
    +

    Returns a new instance of Chain.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +
    +
    # File 'opal/opal/corelib/enumerator/chain.rb', line 6
    +
    +def initialize(*enums)
    +  `$deny_frozen_access(self)`
    +
    +  @enums = enums
    +  @iterated = []
    +  @object = self
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #each(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/enumerator/chain.rb', line 14
    +
    +def each(*args, &block)
    +  return to_enum(:each, *args) { size } unless block_given?
    +
    +  @enums.each do |enum|
    +    @iterated << enum
    +    enum.each(*args, &block)
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +43
    +44
    +45
    +
    +
    # File 'opal/opal/corelib/enumerator/chain.rb', line 43
    +
    +def inspect
    +  "#<Enumerator::Chain: #{@enums.inspect}>"
    +end
    +
    +
    + +
    +

    + + #rewindObject + + + + + +

    + + + + +
    +
    +
    +
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +
    +
    # File 'opal/opal/corelib/enumerator/chain.rb', line 35
    +
    +def rewind
    +  @iterated.reverse_each do |enum|
    +    enum.rewind if enum.respond_to? :rewind
    +  end
    +  @iterated = []
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +
    +
    # File 'opal/opal/corelib/enumerator/chain.rb', line 25
    +
    +def size(*args)
    +  accum = 0
    +  @enums.each do |enum|
    +    size = enum.size(*args)
    +    return size if [nil, ::Float::INFINITY].include? size
    +    accum += size
    +  end
    +  accum
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerator.self/Lazy.html b/docs/api/v1.8.2/corelib/Enumerator.self/Lazy.html new file mode 100644 index 00000000..b6827bfe --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerator.self/Lazy.html @@ -0,0 +1,1277 @@ + + + + + + + Class: Enumerator.self::Lazy + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Enumerator.self::Lazy + + + +

    +
    + +
    +
    Inherits:
    +
    + Enumerator + +
      +
    • Object
    • + + + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerator/lazy.rb
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(object, size = nil, &block) ⇒ Lazy + + + + + +

    +
    +

    Returns a new instance of Lazy.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 14
    +
    +def initialize(object, size = nil, &block)
    +  `$deny_frozen_access(self)`
    +
    +  unless block_given?
    +    ::Kernel.raise ::ArgumentError, 'tried to call lazy new without a block'
    +  end
    +
    +  @enumerator = object
    +
    +  super size do |yielder, *each_args|
    +    object.each(*each_args) do |*args|
    +      %x{
    +        args.unshift(#{yielder});
    +
    +        $yieldX(block, args);
    +      }
    +    end
    +  rescue StopLazyError
    +    nil
    +  end
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .for(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +11
    +12
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 8
    +
    +def self.for(object, *)
    +  lazy = super
    +  `lazy.enumerator = object`
    +  lazy
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 40
    +
    +def collect(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to call lazy map without a block'
    +  end
    +
    +  Lazy.new(self, enumerator_size) do |enum, *args|
    +    %x{
    +      var value = $yieldX(block, args);
    +
    +      #{enum.yield `value`};
    +    }
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 54
    +
    +def collect_concat(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to call lazy map without a block'
    +  end
    +
    +  Lazy.new(self, nil) do |enum, *args|
    +    %x{
    +      var value = $yieldX(block, args);
    +
    +      if (#{`value`.respond_to? :force} && #{`value`.respond_to? :each}) {
    +        #{`value`.each { |v| enum.yield v }}
    +      }
    +      else {
    +        var array = #{::Opal.try_convert `value`, ::Array, :to_ary};
    +
    +        if (array === nil) {
    +          #{enum.yield `value`};
    +        }
    +        else {
    +          #{`value`.each { |v| enum.yield v }};
    +        }
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    +

    + + #drop(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 80
    +
    +def drop(n)
    +  n = `$coerce_to(#{n}, #{::Integer}, 'to_int')`
    +
    +  if n < 0
    +    ::Kernel.raise ::ArgumentError, 'attempt to drop negative size'
    +  end
    +
    +  current_size = enumerator_size
    +  set_size     = if ::Integer === current_size
    +                   n < current_size ? n : current_size
    +                 else
    +                   current_size
    +                 end
    +
    +  dropped = 0
    +  Lazy.new(self, set_size) do |enum, *args|
    +    if dropped < n
    +      dropped += 1
    +    else
    +      enum.yield(*args)
    +    end
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 104
    +
    +def drop_while(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to call lazy drop_while without a block'
    +  end
    +
    +  succeeding = true
    +  Lazy.new(self, nil) do |enum, *args|
    +    if succeeding
    +      %x{
    +        var value = $yieldX(block, args);
    +
    +        if (!$truthy(value)) {
    +          succeeding = false;
    +
    +          #{enum.yield(*args)};
    +        }
    +      }
    +    else
    +      enum.yield(*args)
    +    end
    +  end
    +end
    +
    +
    + +
    +

    + + #enum_for(method = :each, *args, &block) ⇒ Object + + + + Also known as: + to_enum + + + + +

    + + + + +
    +
    +
    +
    +127
    +128
    +129
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 127
    +
    +def enum_for(method = :each, *args, &block)
    +  self.class.for(self, method, *args, &block)
    +end
    +
    +
    + +
    +

    + + #find_all(&block) ⇒ Object + + + + Also known as: + filter, select + + + + +

    + + + + +
    +
    +
    +
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 131
    +
    +def find_all(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to call lazy select without a block'
    +  end
    +
    +  Lazy.new(self, nil) do |enum, *args|
    +    %x{
    +      var value = $yieldX(block, args);
    +
    +      if ($truthy(value)) {
    +        #{enum.yield(*args)};
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 147
    +
    +def grep(pattern, &block)
    +  if block
    +    Lazy.new(self, nil) do |enum, *args|
    +      %x{
    +        var param = #{::Opal.destructure(args)},
    +            value = #{pattern === `param`};
    +
    +        if ($truthy(value)) {
    +          value = $yield1(block, param);
    +
    +          #{enum.yield `$yield1(block, param)`};
    +        }
    +      }
    +    end
    +  else
    +    Lazy.new(self, nil) do |enum, *args|
    +      %x{
    +        var param = #{::Opal.destructure(args)},
    +            value = #{pattern === `param`};
    +
    +        if ($truthy(value)) {
    +          #{enum.yield `param`};
    +        }
    +      }
    +    end
    +  end
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +235
    +236
    +237
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 235
    +
    +def inspect
    +  "#<#{self.class}: #{@enumerator.inspect}>"
    +end
    +
    +
    + +
    +

    + + #lazyObject + + + + + +

    + + + + +
    +
    +
    +
    +36
    +37
    +38
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 36
    +
    +def lazy
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 175
    +
    +def reject(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to call lazy reject without a block'
    +  end
    +
    +  Lazy.new(self, nil) do |enum, *args|
    +    %x{
    +      var value = $yieldX(block, args);
    +
    +      if (!$truthy(value)) {
    +        #{enum.yield(*args)};
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    +

    + + #take(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 191
    +
    +def take(n)
    +  n = `$coerce_to(#{n}, #{::Integer}, 'to_int')`
    +
    +  if n < 0
    +    ::Kernel.raise ::ArgumentError, 'attempt to take negative size'
    +  end
    +
    +  current_size = enumerator_size
    +  set_size     = if ::Integer === current_size
    +                   n < current_size ? n : current_size
    +                 else
    +                   current_size
    +                 end
    +
    +  taken = 0
    +  Lazy.new(self, set_size) do |enum, *args|
    +    if taken < n
    +      enum.yield(*args)
    +      taken += 1
    +    else
    +      ::Kernel.raise StopLazyError
    +    end
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +
    +
    # File 'opal/opal/corelib/enumerator/lazy.rb', line 216
    +
    +def take_while(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to call lazy take_while without a block'
    +  end
    +
    +  Lazy.new(self, nil) do |enum, *args|
    +    %x{
    +      var value = $yieldX(block, args);
    +
    +      if ($truthy(value)) {
    +        #{enum.yield(*args)};
    +      }
    +      else {
    +        #{::Kernel.raise StopLazyError};
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerator.self/Lazy.self/StopLazyError.html b/docs/api/v1.8.2/corelib/Enumerator.self/Lazy.self/StopLazyError.html new file mode 100644 index 00000000..1ef3bb4a --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerator.self/Lazy.self/StopLazyError.html @@ -0,0 +1,142 @@ + + + + + + + Exception: Enumerator.self::Lazy.self::StopLazyError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: Enumerator.self::Lazy.self::StopLazyError + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerator/lazy.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerator/Generator.html b/docs/api/v1.8.2/corelib/Enumerator/Generator.html new file mode 100644 index 00000000..ae6f1c05 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerator/Generator.html @@ -0,0 +1,321 @@ + + + + + + + Class: Enumerator::Generator + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Enumerator::Generator + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerator/generator.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #any?, #chunk, #chunk_while, #collect, #collect_concat, #compact, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #first, #grep, #grep_v, #group_by, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_h, #to_set, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(&block) ⇒ Generator + + + + + +

    +
    +

    Returns a new instance of Generator.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +
    +
    # File 'opal/opal/corelib/enumerator/generator.rb', line 8
    +
    +def initialize(&block)
    +  `$deny_frozen_access(self)`
    +
    +  ::Kernel.raise ::LocalJumpError, 'no block given' unless block
    +
    +  @block = block
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #each(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/enumerator/generator.rb', line 16
    +
    +def each(*args, &block)
    +  yielder = Yielder.new(&block)
    +
    +  %x{
    +    try {
    +      args.unshift(#{yielder});
    +
    +      Opal.yieldX(#{@block}, args);
    +    }
    +    catch (e) {
    +      if (e && e.$thrower_type == "breaker") {
    +        return e.$v;
    +      }
    +      else {
    +        throw e;
    +      }
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Enumerator/Yielder.html b/docs/api/v1.8.2/corelib/Enumerator/Yielder.html new file mode 100644 index 00000000..282ba3e8 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Enumerator/Yielder.html @@ -0,0 +1,395 @@ + + + + + + + Class: Enumerator::Yielder + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Enumerator::Yielder + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/enumerator/yielder.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(&block) ⇒ Yielder + + + + + +

    +
    +

    Returns a new instance of Yielder.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +5
    +6
    +7
    +8
    +9
    +10
    +
    +
    # File 'opal/opal/corelib/enumerator/yielder.rb', line 5
    +
    +def initialize(&block)
    +  @block = block
    +  # rubocop:disable Lint/Void
    +  self
    +  # rubocop:enable Lint/Void
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #<<(value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +24
    +25
    +26
    +27
    +28
    +
    +
    # File 'opal/opal/corelib/enumerator/yielder.rb', line 24
    +
    +def <<(value)
    +  self.yield(value)
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #to_procObject + + + + + +

    + + + + +
    +
    +
    +
    +30
    +31
    +32
    +33
    +34
    +
    +
    # File 'opal/opal/corelib/enumerator/yielder.rb', line 30
    +
    +def to_proc
    +  proc do |*values|
    +    self.yield(*values)
    +  end
    +end
    +
    +
    + +
    +

    + + #yield(*values) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +
    +
    # File 'opal/opal/corelib/enumerator/yielder.rb', line 12
    +
    +def yield(*values)
    +  %x{
    +    var value = Opal.yieldX(#{@block}, values);
    +
    +    if (value && value.$thrower_type == "break") {
    +      throw value;
    +    }
    +
    +    return value;
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Errno.html b/docs/api/v1.8.2/corelib/Errno.html new file mode 100644 index 00000000..70fb1243 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Errno.html @@ -0,0 +1,117 @@ + + + + + + + Module: Errno + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Errno + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error/errno.rb
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

    + + +
    +
    +
    + + +
    + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Exception.html b/docs/api/v1.8.2/corelib/Exception.html new file mode 100644 index 00000000..92a4811f --- /dev/null +++ b/docs/api/v1.8.2/corelib/Exception.html @@ -0,0 +1,1120 @@ + + + + + + + Exception: Exception + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: Exception + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

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

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

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

    +
    +

    Returns a new instance of Exception.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +36
    +37
    +38
    +39
    +
    +
    # File 'opal/opal/corelib/error.rb', line 36
    +
    +def initialize(*args)
    +  # using self.message aka @message to retain compatibility with native exception's message property
    +  `self.message = (args.length > 0) ? args[0] : nil`
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .exception(*args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +32
    +33
    +34
    +
    +
    # File 'opal/opal/corelib/error.rb', line 32
    +
    +def self.exception(*args)
    +  new(*args)
    +end
    +
    +
    + +
    +

    + + .new(*args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +
    +
    # File 'opal/opal/corelib/error.rb', line 9
    +
    +def self.new(*args)
    +  %x{
    +    var message   = (args.length > 0) ? args[0] : nil;
    +    var error     = new self.$$constructor(message);
    +    error.name    = self.$$name;
    +    error.message = message;
    +    error.cause   = #{$!};
    +    Opal.send(error, error.$initialize, args);
    +
    +    // Error.captureStackTrace() will use .name and .toString to build the
    +    // first line of the stack trace so it must be called after the error
    +    // has been initialized.
    +    // https://nodejs.org/dist/latest-v6.x/docs/api/errors.html
    +    if (Opal.config.enable_stack_trace && Error.captureStackTrace) {
    +      // Passing Kernel.raise will cut the stack trace from that point above
    +      Error.captureStackTrace(error, stack_trace_limit);
    +    }
    +
    +    return error;
    +  }
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #backtraceObject + + + + + +

    + + + + +
    +
    +
    +
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +
    +
    # File 'opal/opal/corelib/error.rb', line 82
    +
    +def backtrace
    +  %x{
    +    if (self.backtrace) {
    +      // nil is a valid backtrace
    +      return self.backtrace;
    +    }
    +
    +    var backtrace = self.stack;
    +
    +    if (typeof(backtrace) !== 'undefined' && backtrace.$$is_string) {
    +      return self.backtrace = correct_backtrace(backtrace.split("\n"));
    +    }
    +    else if (backtrace) {
    +      return self.backtrace = correct_backtrace(backtrace);
    +    }
    +
    +    return [];
    +  }
    +end
    +
    +
    + +
    +

    + + #backtrace_locationsObject + + + + + +

    + + + + +
    +
    +
    +
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +
    +
    # File 'opal/opal/corelib/error.rb', line 102
    +
    +def backtrace_locations
    +  %x{
    +    if (self.backtrace_locations) return self.backtrace_locations;
    +    self.backtrace_locations = #{backtrace&.map do |loc|
    +      ::Thread::Backtrace::Location.new(loc)
    +    end}
    +    return self.backtrace_locations;
    +  }
    +end
    +
    +
    + +
    +

    + + #causeObject + + + + + +

    + + + + +
    +
    +
    +
    +112
    +113
    +114
    +
    +
    # File 'opal/opal/corelib/error.rb', line 112
    +
    +def cause
    +  `self.cause || nil`
    +end
    +
    +
    + +
    +

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

    +
    +

    Those instance variables are not enumerable.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +
    +
    # File 'opal/opal/corelib/error.rb', line 42
    +
    +def copy_instance_variables(other)
    +  super
    +  %x{
    +    self.message = other.message;
    +    self.cause = other.cause;
    +    self.stack = other.stack;
    +  }
    +end
    +
    +
    + +
    +

    + + #exception(str = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +
    +
    # File 'opal/opal/corelib/error.rb', line 116
    +
    +def exception(str = nil)
    +  %x{
    +    if (str === nil || self === str) {
    +      return self;
    +    }
    +
    +    var cloned = #{clone};
    +    cloned.message = str;
    +    if (self.backtrace) cloned.backtrace = self.backtrace.$dup();
    +    cloned.stack = self.stack;
    +    cloned.cause = self.cause;
    +    return cloned;
    +  }
    +end
    +
    +
    + +
    +

    + + #full_message(kwargs = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/error.rb', line 136
    +
    +def full_message(kwargs = nil)
    +  unless defined? Hash
    +    # We are dealing with an unfully loaded Opal library, so we should
    +    # do with as little as we can.
    +
    +    return "#{@message}\n#{`self.stack`}"
    +  end
    +
    +  kwargs = { highlight: $stderr.tty?, order: :top }.merge(kwargs || {})
    +  highlight, order = kwargs[:highlight], kwargs[:order]
    +
    +  ::Kernel.raise ::ArgumentError, "expected true or false as highlight: #{highlight}" unless [true, false].include? highlight
    +  ::Kernel.raise ::ArgumentError, "expected :top or :bottom as order: #{order}" unless %i[top bottom].include? order
    +
    +  if highlight
    +    bold_underline = "\e[1;4m"
    +    bold = "\e[1m"
    +    reset = "\e[m"
    +  else
    +    bold_underline = bold = reset = ''
    +  end
    +
    +  bt = backtrace.dup
    +  bt = caller if !bt || bt.empty?
    +  first = bt.shift
    +
    +  msg = "#{first}: "
    +  msg += "#{bold}#{to_s} (#{bold_underline}#{self.class}#{reset}#{bold})#{reset}\n"
    +
    +  msg += bt.map { |loc| "\tfrom #{loc}\n" }.join
    +
    +  msg += cause.full_message(highlight: highlight) if cause
    +
    +  if order == :bottom
    +    msg = msg.split("\n").reverse.join("\n")
    +    msg = "#{bold}Traceback#{reset} (most recent call last):\n" + msg
    +  end
    +
    +  msg
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +177
    +178
    +179
    +180
    +
    +
    # File 'opal/opal/corelib/error.rb', line 177
    +
    +def inspect
    +  as_str = to_s
    +  as_str.empty? ? self.class.to_s : "#<#{self.class.to_s}: #{to_s}>"
    +end
    +
    +
    + +
    +

    + + #messageObject + + + + + +

    +
    +

    not using alias message to_s because you need to be able to override to_s and have message use overridden method, won't work with alias

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +132
    +133
    +134
    +
    +
    # File 'opal/opal/corelib/error.rb', line 132
    +
    +def message
    +  to_s
    +end
    +
    +
    + +
    +

    + + #set_backtrace(backtrace) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/error.rb', line 182
    +
    +def set_backtrace(backtrace)
    +  %x{
    +    var valid = true, i, ii;
    +
    +    if (backtrace === nil) {
    +      self.backtrace = nil;
    +      self.stack = '';
    +    } else if (backtrace.$$is_string) {
    +      self.backtrace = [backtrace];
    +      self.stack = '  from ' + backtrace;
    +    } else {
    +      if (backtrace.$$is_array) {
    +        for (i = 0, ii = backtrace.length; i < ii; i++) {
    +          if (!backtrace[i].$$is_string) {
    +            valid = false;
    +            break;
    +          }
    +        }
    +      } else {
    +        valid = false;
    +      }
    +
    +      if (valid === false) {
    +        #{::Kernel.raise ::TypeError, 'backtrace must be Array of String'}
    +      }
    +
    +      self.backtrace = backtrace;
    +      self.stack = #{`backtrace`.map { |i| '  from ' + i }}.join("\n");
    +    }
    +
    +    return backtrace;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +216
    +217
    +218
    +219
    +
    +
    # File 'opal/opal/corelib/error.rb', line 216
    +
    +def to_s
    +  # using self.message aka @message to retain compatibility with native exception's message property
    +  (@message && @message.to_s) || self.class.to_s
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/FalseClass.html b/docs/api/v1.8.2/corelib/FalseClass.html new file mode 100644 index 00000000..ae4ea6b7 --- /dev/null +++ b/docs/api/v1.8.2/corelib/FalseClass.html @@ -0,0 +1,146 @@ + + + + + + + Class: FalseClass + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: FalseClass + + + +

    +
    + +
    +
    Inherits:
    +
    + Boolean + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/boolean.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Boolean

    +

    #!, #&, #==, #^, #__id__, #__marshal__, allocate, #clone, #dup, #method_missing, #respond_to_missing?, #singleton_class, #to_s, #|

    +
    +

    Dynamic Method Handling

    +

    + This class handles dynamic methods through the method_missing method + + in the class Boolean + +

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/FiberError.html b/docs/api/v1.8.2/corelib/FiberError.html new file mode 100644 index 00000000..b1546718 --- /dev/null +++ b/docs/api/v1.8.2/corelib/FiberError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: FiberError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: FiberError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/File.html b/docs/api/v1.8.2/corelib/File.html new file mode 100644 index 00000000..e4a71d39 --- /dev/null +++ b/docs/api/v1.8.2/corelib/File.html @@ -0,0 +1,1042 @@ + + + + + + + Class: File + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: File + + + +

    +
    + +
    +
    Inherits:
    +
    + IO + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/file.rb
    +
    + +
    + +

    Overview

    +
    +

    helpers: truthy +backtick_javascript: true

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    Separator = + +
    +
    SEPARATOR = '/'
    + +
    ALT_SEPARATOR = + +
    +
    nil
    + +
    PATH_SEPARATOR = + +
    +
    ':'
    + +
    FNM_SYSCASE = +
    +
    +

    Assuming case insenstive filesystem

    + + +
    +
    +
    + + +
    +
    +
    0
    + +
    + + + + + + + +

    Instance Attribute Summary

    + +

    Attributes inherited from IO

    +

    #eof, #read_proc, #sync, #tty, #write_proc

    + + + +

    + Class Method Summary + collapse +

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

    Methods inherited from IO

    +

    #<<, #check_readable, #check_writable, #close, #close_read, #close_write, #closed?, #closed_read?, #closed_write?, #each, #each_byte, #each_char, #fileno, #flush, #getbyte, #getc, #gets, #initialize, #print, #puts, #read, #readbyte, #readchar, #readline, #readlines, #readpartial, #sysread, #sysread_noraise, #tty?, #write

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from IO

    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .absolute_path(path, basedir = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +62
    +
    +
    # File 'opal/opal/corelib/file.rb', line 13
    +
    +def absolute_path(path, basedir = nil)
    +  sep = SEPARATOR
    +  sep_chars = `$sep_chars()`
    +  new_parts = []
    +
    +  path = path.respond_to?(:to_path) ? path.to_path : path
    +  path = ::Opal.coerce_to!(`path`, ::String, :to_str)
    +
    +  basedir ||= ::Dir.pwd
    +  path_abs    = `path.substr(0, sep.length) === sep || windows_root_rx.test(path)`
    +  basedir_abs = `basedir.substr(0, sep.length) === sep || windows_root_rx.test(basedir)`
    +
    +  if path_abs
    +    parts       = path.split(/[#{sep_chars}]/)
    +    leading_sep = `windows_root_rx.test(path) ? '' : #{path.sub(/^([#{sep_chars}]+).*$/, '\1')}`
    +    abs         = true
    +  else
    +    parts       = basedir.split(/[#{sep_chars}]/) + path.split(/[#{sep_chars}]/)
    +    leading_sep = `windows_root_rx.test(basedir) ? '' : #{basedir.sub(/^([#{sep_chars}]+).*$/, '\1')}`
    +    abs         = basedir_abs
    +  end
    +
    +  %x{
    +    var part;
    +    for (var i = 0, ii = parts.length; i < ii; i++) {
    +      part = parts[i];
    +
    +      if (
    +        (part === nil) ||
    +        (part === ''  && ((new_parts.length === 0) || abs)) ||
    +        (part === '.' && ((new_parts.length === 0) || abs))
    +      ) {
    +        continue;
    +      }
    +      if (part === '..') {
    +        new_parts.pop();
    +      } else {
    +        new_parts.push(part);
    +      }
    +    }
    +
    +    if (!abs && parts[0] !== '.') {
    +      #{new_parts.unshift '.'}
    +    }
    +  }
    +
    +  new_path = new_parts.join(sep)
    +  new_path = leading_sep + new_path if abs
    +  new_path
    +end
    +
    +
    + +
    +

    + + .basename(name, suffix = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/file.rb', line 132
    +
    +def basename(name, suffix = nil)
    +  sep_chars = `$sep_chars()`
    +  name = `$coerce_to_path(name)`
    +  %x{
    +    if (name.length == 0) {
    +      return name;
    +    }
    +
    +    if (suffix !== nil) {
    +      suffix = #{::Opal.coerce_to!(suffix, ::String, :to_str)}
    +    } else {
    +      suffix = null;
    +    }
    +
    +    name = name.replace(new RegExp(#{"(.)[#{sep_chars}]*$"}), '$1');
    +    name = name.replace(new RegExp(#{"^(?:.*[#{sep_chars}])?([^#{sep_chars}]+)$"}), '$1');
    +
    +    if (suffix === ".*") {
    +      name = name.replace(/\.[^\.]+$/, '');
    +    } else if(suffix !== null) {
    +      suffix = Opal.escape_regexp(suffix);
    +      name = name.replace(new RegExp(#{"#{suffix}$"}), '');
    +    }
    +
    +    return name;
    +  }
    +end
    +
    +
    + +
    +

    + + .directory?(path) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +
    +
    # File 'opal/opal/corelib/file.rb', line 173
    +
    +def directory?(path)
    +  files = []
    +  %x{
    +    for (var key in Opal.modules) {
    +      #{files}.push(key)
    +    }
    +  }
    +  path = path.gsub(/(^.#{SEPARATOR}+|#{SEPARATOR}+$)/)
    +  file = files.find { |f| f =~ /^#{path}/ }
    +  file
    +end
    +
    +
    + +
    +

    + + .dirname(path, level = 1) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/file.rb', line 103
    +
    +def dirname(path, level = 1)
    +  return path if level == 0
    +  ::Kernel.raise ::ArgumentError, "level can't be negative" if level < 0
    +
    +  sep_chars = `$sep_chars()`
    +  path = `$coerce_to_path(path)`
    +  %x{
    +    var absolute = path.match(new RegExp(#{"^[#{sep_chars}]"})), out;
    +
    +    path = path.replace(new RegExp(#{"[#{sep_chars}]+$"}), ''); // remove trailing separators
    +    path = path.replace(new RegExp(#{"[^#{sep_chars}]+$"}), ''); // remove trailing basename
    +    path = path.replace(new RegExp(#{"[#{sep_chars}]+$"}), ''); // remove final trailing separators
    +
    +    if (path === '') {
    +      out = absolute ? '/' : '.';
    +    }
    +    else {
    +      out = path;
    +    }
    +
    +    if (level == 1) {
    +      return out;
    +    }
    +    else {
    +      return #{dirname(`out`, level - 1)}
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .exist?(path) ⇒ Boolean + + + + Also known as: + exists? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +169
    +170
    +171
    +
    +
    # File 'opal/opal/corelib/file.rb', line 169
    +
    +def exist?(path)
    +  `Opal.modules[#{path}] != null`
    +end
    +
    +
    + +
    +

    + + .expand_path(path, basedir = nil) ⇒ Object + + + + Also known as: + realpath + + + + +

    + + + + +
    +
    +
    +
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +
    +
    # File 'opal/opal/corelib/file.rb', line 64
    +
    +def expand_path(path, basedir = nil)
    +  sep = SEPARATOR
    +  sep_chars = `$sep_chars()`
    +  if `path[0] === '~' || (basedir && basedir[0] === '~')`
    +    home = Dir.home
    +    ::Kernel.raise(::ArgumentError, "couldn't find HOME environment -- expanding `~'") unless home
    +    leading_sep = `windows_root_rx.test(home) ? '' : #{home.sub(/^([#{sep_chars}]+).*$/, '\1')}`
    +    ::Kernel.raise(::ArgumentError, 'non-absolute home') unless home.start_with?(leading_sep)
    +
    +    home            += sep
    +    home_path_regexp = /^\~(?:#{sep}|$)/
    +    path             = path.sub(home_path_regexp, home)
    +    basedir          = basedir.sub(home_path_regexp, home) if basedir
    +  end
    +  absolute_path(path, basedir)
    +end
    +
    +
    + +
    +

    + + .extname(path) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +
    +
    # File 'opal/opal/corelib/file.rb', line 160
    +
    +def extname(path)
    +  `path = $coerce_to_path(path)`
    +  filename = basename(path)
    +  return '' if filename.empty?
    +  last_dot_idx = filename[1..-1].rindex('.')
    +  # extension name must contains at least one character .(something)
    +  last_dot_idx.nil? || last_dot_idx + 1 == filename.length - 1 ? '' : filename[(last_dot_idx + 1)..-1]
    +end
    +
    +
    + +
    +

    + + .join(*paths) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/file.rb', line 185
    +
    +def join(*paths)
    +  if paths.empty?
    +    return ''
    +  end
    +  result = ''
    +  paths = paths.flatten.each_with_index.map do |item, index|
    +    if index == 0 && item.empty?
    +      SEPARATOR
    +    elsif paths.length == index + 1 && item.empty?
    +      SEPARATOR
    +    else
    +      item
    +    end
    +  end
    +  paths = paths.reject(&:empty?)
    +  paths.each_with_index do |item, index|
    +    next_item = paths[index + 1]
    +    if next_item.nil?
    +      result = "#{result}#{item}"
    +    else
    +      if item.end_with?(SEPARATOR) && next_item.start_with?(SEPARATOR)
    +        item = item.sub(/#{SEPARATOR}+$/, '')
    +      end
    +      result = if item.end_with?(SEPARATOR) || next_item.start_with?(SEPARATOR)
    +                 "#{result}#{item}"
    +               else
    +                 "#{result}#{item}#{SEPARATOR}"
    +               end
    +    end
    +  end
    +  result
    +end
    +
    +
    + +
    +

    + + .split(path) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +218
    +219
    +220
    +
    +
    # File 'opal/opal/corelib/file.rb', line 218
    +
    +def split(path)
    +  path.split(SEPARATOR)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Float.html b/docs/api/v1.8.2/corelib/Float.html new file mode 100644 index 00000000..28525bf6 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Float.html @@ -0,0 +1,341 @@ + + + + + + + Class: Float + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Float + + + +

    +
    + +
    +
    Inherits:
    +
    + Numeric + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/marshal/write_buffer.rb,
    + opal/opal/corelib/number.rb
    +
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Numeric

    +

    #%, #+@, #-@, #<=>, #__coerced__, #abs, #abs2, #angle, #ceil, #clone, #coerce, #conj, #denominator, #div, #divmod, #dup, #fdiv, #finite?, #floor, #i, #imag, #infinite?, #integer?, #negative?, #nonzero?, #numerator, #polar, #positive?, #quo, #real, #real?, #rect, #round, #step, #to_c, #to_int, #truncate, #zero?

    + + + + + + + + + +

    Methods included from Comparable

    +

    #<, #<=, #==, #>, #>=, #between?, #clamp

    + + +
    +

    Class Method Details

    + + +
    +

    + + .===(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +954
    +955
    +956
    +
    +
    # File 'opal/opal/corelib/number.rb', line 954
    +
    +def ===(other)
    +  `!!other.$$is_number`
    +end
    +
    +
    + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +948
    +949
    +950
    +
    +
    # File 'opal/opal/corelib/number.rb', line 948
    +
    +def allocate
    +  ::Kernel.raise ::TypeError, "allocator undefined for #{name}"
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +32
    +33
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 32
    +
    +def __marshal__(buffer)
    +  buffer.save_link(self)
    +  buffer.append('f')
    +  buffer.write_float(self)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/FloatDomainError.html b/docs/api/v1.8.2/corelib/FloatDomainError.html new file mode 100644 index 00000000..a59ec000 --- /dev/null +++ b/docs/api/v1.8.2/corelib/FloatDomainError.html @@ -0,0 +1,158 @@ + + + + + + + Exception: FloatDomainError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: FloatDomainError + + + +

    +
    + +
    +
    Inherits:
    +
    + RangeError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/FrozenError.html b/docs/api/v1.8.2/corelib/FrozenError.html new file mode 100644 index 00000000..bdb6fb28 --- /dev/null +++ b/docs/api/v1.8.2/corelib/FrozenError.html @@ -0,0 +1,316 @@ + + + + + + + Exception: FrozenError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: FrozenError + + + +

    +
    + +
    +
    Inherits:
    +
    + RuntimeError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #receiver ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute receiver.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(message, receiver: nil) ⇒ FrozenError + + + + + +

    +
    +

    Returns a new instance of FrozenError.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +264
    +265
    +266
    +267
    +
    +
    # File 'opal/opal/corelib/error.rb', line 264
    +
    +def initialize(message, receiver: nil)
    +  super message
    +  @receiver = receiver
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #receiverObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute receiver.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +262
    +263
    +264
    +
    +
    # File 'opal/opal/corelib/error.rb', line 262
    +
    +def receiver
    +  @receiver
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/GC.html b/docs/api/v1.8.2/corelib/GC.html new file mode 100644 index 00000000..7b1d0be6 --- /dev/null +++ b/docs/api/v1.8.2/corelib/GC.html @@ -0,0 +1,190 @@ + + + + + + + Class: GC + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: GC + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/process/base.rb
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .startObject + + + + + +

    + + + + +
    +
    +
    +
    +7
    +8
    +
    +
    # File 'opal/opal/corelib/process/base.rb', line 7
    +
    +def self.start
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Hash.html b/docs/api/v1.8.2/corelib/Hash.html new file mode 100644 index 00000000..26c6edbc --- /dev/null +++ b/docs/api/v1.8.2/corelib/Hash.html @@ -0,0 +1,5244 @@ + + + + + + + Class: Hash + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Hash + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/hash.rb,
    + opal/opal/corelib/marshal/write_buffer.rb,
    opal/opal/corelib/pattern_matching/base.rb
    +
    +
    + +
    + +

    Overview

    +
    +
    + +

    Internal properties:

    + +
      +
    • $$keys [Map] optional Map of key arrays, used when objects are used as keys
    • +
    • $$proc [Proc,null,nil] the default proc used for missing keys
    • +
    • key-array [JS::Map] an element of a array that holds objects used as keys, { key_hash => [objects...] }
    • +
    + + +
    +
    +
    + + +
    + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #any?, #chunk, #chunk_while, #collect, #collect_concat, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #first, #grep, #grep_v, #group_by, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reverse_each, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_set, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(defaults = undefined, &block) ⇒ Hash + + + + + +

    +
    +

    Returns a new instance of Hash.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 81
    +
    +def initialize(defaults = undefined, &block)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    if (defaults !== undefined && block !== nil) {
    +      #{::Kernel.raise ::ArgumentError, 'wrong number of arguments (1 for 0)'}
    +    }
    +    self.$$none = (defaults === undefined ? nil : defaults);
    +    self.$$proc = block;
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .[](*argv) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +62
    +63
    +64
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 18
    +
    +def self.[](*argv)
    +  %x{
    +    var hash, argc = argv.length, arg, i;
    +
    +    if (argc === 1) {
    +      hash = #{::Opal.coerce_to?(argv[0], ::Hash, :to_hash)};
    +      if (hash !== nil) {
    +        return #{allocate.merge!(`hash`)};
    +      }
    +
    +      argv = #{::Opal.coerce_to?(argv[0], ::Array, :to_ary)};
    +      if (argv === nil) {
    +        #{::Kernel.raise ::ArgumentError, 'odd number of arguments for Hash'};
    +      }
    +
    +      argc = argv.length;
    +      hash = #{allocate};
    +
    +      for (i = 0; i < argc; i++) {
    +        arg = argv[i];
    +        if (!arg.$$is_array)
    +          #{::Kernel.raise ::ArgumentError, "invalid element #{`arg`.inspect} for Hash"};
    +        if (arg.length === 1) {
    +          hash.$store(arg[0], nil);
    +        } else if (arg.length === 2) {
    +          hash.$store(arg[0], arg[1]);
    +        } else {
    +          #{::Kernel.raise ::ArgumentError, "invalid number of elements (#{`arg.length`} for #{`arg`.inspect}), must be 1..2"};
    +        }
    +      }
    +
    +      return hash;
    +    }
    +
    +    if (argc % 2 !== 0) {
    +      #{::Kernel.raise ::ArgumentError, 'odd number of arguments for Hash'}
    +    }
    +
    +    hash = #{allocate};
    +
    +    for (i = 0; i < argc; i += 2) {
    +      hash.$store(argv[i], argv[i + 1]);
    +    }
    +
    +    return hash;
    +  }
    +end
    +
    +
    + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 66
    +
    +def self.allocate
    +  %x{
    +    var hash = new self.$$constructor();
    +
    +    hash.$$none = nil;
    +    hash.$$proc = nil;
    +
    +    return hash;
    +  }
    +end
    +
    +
    + +
    +

    + + .try_convert(obj) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +77
    +78
    +79
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 77
    +
    +def self.try_convert(obj)
    +  ::Opal.coerce_to?(obj, ::Hash, :to_hash)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +156
    +157
    +158
    +159
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 156
    +
    +def <(other)
    +  other = ::Opal.coerce_to!(other, ::Hash, :to_hash)
    +  other > self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +161
    +162
    +163
    +164
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 161
    +
    +def <=(other)
    +  other = ::Opal.coerce_to!(other, ::Hash, :to_hash)
    +  other >= self
    +end
    +
    +
    + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + eql? + + + + +

    + + + + +
    +
    +
    +
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 95
    +
    +def ==(other)
    +  %x{
    +    if (self === other) {
    +      return true;
    +    }
    +
    +    if (!other.$$is_hash) {
    +      return false;
    +    }
    +
    +    if (self.size !== other.size) {
    +      return false;
    +    }
    +
    +    return $hash_each(self, true, function(key, value) {
    +      var other_value = $hash_get(other, key);
    +      if (other_value === undefined || !value['$eql?'](other_value)) {
    +        return [true, false];
    +      }
    +      return [false, true];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 144
    +
    +def >(other)
    +  other = ::Opal.coerce_to!(other, ::Hash, :to_hash)
    +
    +  %x{
    +    if (self.size <= other.size) {
    +      return false;
    +    }
    +  }
    +
    +  self >= other
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 119
    +
    +def >=(other)
    +  other = ::Opal.coerce_to!(other, ::Hash, :to_hash)
    +
    +  %x{
    +    if (self.size < other.size) {
    +      return false;
    +    }
    +  }
    +
    +  result = true
    +
    +  other.each do |other_key, other_val|
    +    val = fetch(other_key, `null`)
    +
    +    %x{
    +      if (val == null || val !== other_val) {
    +        result = false;
    +        return;
    +      }
    +    }
    +  end
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #[](key) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 166
    +
    +def [](key)
    +  %x{
    +    var value = $hash_get(self, key);
    +
    +    if (value !== undefined) {
    +      return value;
    +    }
    +
    +    return self.$default(key);
    +  }
    +end
    +
    +
    + +
    +

    + + #[]=(key, value) ⇒ Object + + + + Also known as: + store + + + + +

    + + + + +
    +
    +
    +
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 178
    +
    +def []=(key, value)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    $hash_put(self, key, value);
    +    return value;
    +  }
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 63
    +
    +def __marshal__(buffer)
    +  if default_proc
    +    ::Kernel.raise ::TypeError, "can't dump hash with default proc"
    +  end
    +
    +  buffer.save_link(self)
    +  buffer.write_ivars_prefix(self)
    +  buffer.write_extends(self)
    +  buffer.write_user_class(Hash, self)
    +  if default
    +    buffer.append('}')
    +    buffer.write_hash(self)
    +    buffer.write(default)
    +  else
    +    buffer.append('{')
    +    buffer.write_hash(self)
    +  end
    +  buffer.write_ivars_suffix(self)
    +end
    +
    +
    + +
    +

    + + #assoc(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 187
    +
    +def assoc(object)
    +  %x{
    +    return $hash_each(self, nil, function(key, value) {
    +      if (#{`key` == object}) {
    +        return [true, [key, value]];
    +      }
    +      return [false, nil];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #clearObject + + + + + +

    + + + + +
    +
    +
    +
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 198
    +
    +def clear
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    self.clear();
    +    if (self.$$keys)
    +      self.$$keys.clear();
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #cloneObject + + + + + +

    + + + + +
    +
    +
    +
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 210
    +
    +def clone
    +  %x{
    +    var hash = self.$class().$new();
    +    $hash_clone(self, hash);
    +    return self["$frozen?"]() ? hash.$freeze() : hash;
    +  }
    +end
    +
    +
    + +
    +

    + + #compactObject + + + + + +

    + + + + +
    +
    +
    +
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 218
    +
    +def compact
    +  %x{
    +    var hash = new Map();
    +
    +    return $hash_each(self, hash, function(key, value) {
    +      if (value !== nil) {
    +        $hash_put(hash, key, value);
    +      }
    +      return [false, hash];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #compact!Object + + + + + +

    + + + + +
    +
    +
    +
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 231
    +
    +def compact!
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var result = nil;
    +
    +    return $hash_each(self, result, function(key, value) {
    +      if (value === nil) {
    +        $hash_delete(self, key);
    +        result = self;
    +      }
    +      return [false, result];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #compare_by_identityObject + + + + + +

    + + + + +
    +
    +
    +
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 247
    +
    +def compare_by_identity
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    if (!self.$$by_identity) {
    +      self.$$by_identity = true;
    +
    +      if (self.size !== 0)
    +        Opal.hash_rehash(self);
    +    }
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #compare_by_identity?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +262
    +263
    +264
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 262
    +
    +def compare_by_identity?
    +  `self.$$by_identity === true`
    +end
    +
    +
    + +
    +

    + + #deconstruct_keys(_) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +
    +
    # File 'opal/opal/corelib/pattern_matching/base.rb', line 8
    +
    +def deconstruct_keys(_)
    +  self
    +end
    +
    +
    + +
    +

    + + #default(key = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 266
    +
    +def default(key = undefined)
    +  %x{
    +    if (key !== undefined && self.$$proc !== nil && self.$$proc !== undefined) {
    +      return self.$$proc.$call(self, key);
    +    }
    +    if (self.$$none === undefined) {
    +      return nil;
    +    }
    +    return self.$$none;
    +  }
    +end
    +
    +
    + +
    +

    + + #default=(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 278
    +
    +def default=(object)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    self.$$proc = nil;
    +    self.$$none = object;
    +
    +    return object;
    +  }
    +end
    +
    +
    + +
    +

    + + #default_procObject + + + + + +

    + + + + +
    +
    +
    +
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 289
    +
    +def default_proc
    +  %x{
    +    if (self.$$proc !== undefined) {
    +      return self.$$proc;
    +    }
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

    + + #default_proc=(default_proc) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 298
    +
    +def default_proc=(default_proc)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var proc = default_proc;
    +
    +    if (proc !== nil) {
    +      proc = #{::Opal.coerce_to!(`proc`, ::Proc, :to_proc)};
    +
    +      if (#{`proc`.lambda?} && #{`proc`.arity.abs} !== 2) {
    +        #{::Kernel.raise ::TypeError, 'default_proc takes two arguments'};
    +      }
    +    }
    +
    +    self.$$none = nil;
    +    self.$$proc = proc;
    +
    +    return default_proc;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 319
    +
    +def delete(key, &block)
    +  %x{
    +    $deny_frozen_access(self);
    +    var value = $hash_delete(self, key);
    +
    +    if (value !== undefined) {
    +      return value;
    +    }
    +
    +    if (block !== nil) {
    +      return #{yield key};
    +    }
    +
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 336
    +
    +def delete_if(&block)
    +  return enum_for(:delete_if) { size } unless block
    +
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    return $hash_each(self, self, function(key, value) {
    +      var obj = block(key, value);
    +
    +      if (obj !== false && obj !== nil) {
    +        $hash_delete(self, key);
    +      }
    +      return [false, self];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #dig(key, *keys) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 353
    +
    +def dig(key, *keys)
    +  item = self[key]
    +
    +  %x{
    +    if (item === nil || keys.length === 0) {
    +      return item;
    +    }
    +  }
    +
    +  unless item.respond_to?(:dig)
    +    ::Kernel.raise ::TypeError, "#{item.class} does not have #dig method"
    +  end
    +
    +  item.dig(*keys)
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +369
    +370
    +371
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 369
    +
    +def dup
    +  `$hash_clone(self, self.$class().$new())`
    +end
    +
    +
    + +
    +

    + + #each(&block) ⇒ Object + + + + Also known as: + each_pair + + + + +

    + + + + +
    +
    +
    +
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 373
    +
    +def each(&block)
    +  return enum_for(:each) { size } unless block
    +
    +  %x{
    +    return $hash_each(self, self, function(key, value) {
    +      $yield1(block, [key, value]);
    +      return [false, self];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 384
    +
    +def each_key(&block)
    +  return enum_for(:each_key) { size } unless block
    +
    +  %x{
    +    return $hash_each(self, self, function(key, value) {
    +      block(key);
    +      return [false, self];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 395
    +
    +def each_value(&block)
    +  return enum_for(:each_value) { size } unless block
    +
    +  %x{
    +    return $hash_each(self, self, function(key, value) {
    +      block(value);
    +      return [false, self];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #empty?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +406
    +407
    +408
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 406
    +
    +def empty?
    +  `self.size === 0`
    +end
    +
    +
    + +
    +

    + + #except(*keys) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +410
    +411
    +412
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 410
    +
    +def except(*keys)
    +  dup.except!(*keys)
    +end
    +
    +
    + +
    +

    + + #except!(*keys) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +414
    +415
    +416
    +417
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 414
    +
    +def except!(*keys)
    +  keys.each { |key| delete(key) }
    +  self
    +end
    +
    +
    + +
    +

    + + #fetch(key, defaults = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 419
    +
    +def fetch(key, defaults = undefined, &block)
    +  %x{
    +    var value = $hash_get(self, key);
    +
    +    if (value !== undefined) {
    +      return value;
    +    }
    +
    +    if (block !== nil) {
    +      return block(key);
    +    }
    +
    +    if (defaults !== undefined) {
    +      return defaults;
    +    }
    +  }
    +
    +  ::Kernel.raise ::KeyError.new("key not found: #{key.inspect}", key: key, receiver: self)
    +end
    +
    +
    + +
    +

    + + #fetch_values(*keys, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +439
    +440
    +441
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 439
    +
    +def fetch_values(*keys, &block)
    +  keys.map { |key| fetch(key, &block) }
    +end
    +
    +
    + +
    +

    + + #flatten(level = 1) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    +457
    +458
    +459
    +460
    +461
    +462
    +463
    +464
    +465
    +466
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 443
    +
    +def flatten(level = 1)
    +  level = ::Opal.coerce_to!(level, ::Integer, :to_int)
    +
    +  %x{
    +    var result = [];
    +
    +    return $hash_each(self, result, function(key, value) {
    +      result.push(key);
    +
    +      if (value.$$is_array) {
    +        if (level === 1) {
    +          result.push(value);
    +          return [false, result];
    +        }
    +
    +        result = result.concat(#{`value`.flatten(`level - 2`)});
    +        return [false, result];
    +      }
    +
    +      result.push(value);
    +      return [false, result];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #freezeObject + + + + + +

    + + + + +
    +
    +
    +
    +468
    +469
    +470
    +471
    +472
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 468
    +
    +def freeze
    +  return self if frozen?
    +
    +  `$freeze(self)`
    +end
    +
    +
    + +
    +

    + + #has_key?(key) ⇒ Boolean + + + + Also known as: + include?, key?, member? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +474
    +475
    +476
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 474
    +
    +def has_key?(key)
    +  `$hash_get(self, key) !== undefined`
    +end
    +
    +
    + +
    +

    + + #has_value?(value) ⇒ Boolean + + + + Also known as: + value? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +478
    +479
    +480
    +481
    +482
    +483
    +484
    +485
    +486
    +487
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 478
    +
    +def has_value?(value)
    +  %x{
    +    return $hash_each(self, false, function(key, val) {
    +      if (#{`val` == value}) {
    +        return [true, true];
    +      }
    +      return [false, false];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +491
    +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
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 491
    +
    +def hash
    +  %x{
    +    var top = ($hash_ids === undefined),
    +        hash_id = self.$object_id(),
    +        result = $opal32_init(),
    +        key, item, i,
    +        size = self.size, ary = new Int32Array(size);
    +
    +    result = $opal32_add(result, 0x4);
    +    result = $opal32_add(result, size);
    +
    +    if (top) {
    +      $hash_ids = Object.create(null);
    +    }
    +    else if ($hash_ids[hash_id]) {
    +      return $opal32_add(result, 0x01010101);
    +    }
    +
    +    try {
    +      for (key in $hash_ids) {
    +        item = $hash_ids[key];
    +        if (#{eql?(`item`)}) {
    +          return $opal32_add(result, 0x01010101);
    +        }
    +      }
    +
    +      $hash_ids[hash_id] = self;
    +      i = 0
    +
    +      $hash_each(self, false, function(key, value) {
    +        ary[i] = [0x70414952, key, value].$hash();
    +        i++;
    +        return [false, false];
    +      });
    +
    +      ary = ary.sort();
    +
    +      for (i = 0; i < ary.length; i++) {
    +        result = $opal32_add(result, ary[i]);
    +      }
    +
    +      return result;
    +    } finally {
    +      if (top) {
    +        $hash_ids = undefined;
    +      }
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #index(object) ⇒ Object + + + + Also known as: + key + + + + +

    + + + + +
    +
    +
    +
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +548
    +549
    +550
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 541
    +
    +def index(object)
    +  %x{
    +    return $hash_each(self, nil, function(key, value) {
    +      if (#{`value` == object}) {
    +        return [true, key];
    +      }
    +      return [false, nil];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #indexes(*args) ⇒ Object + + + + Also known as: + indices, values_at + + + + +

    + + + + +
    +
    +
    +
    +552
    +553
    +554
    +555
    +556
    +557
    +558
    +559
    +560
    +561
    +562
    +563
    +564
    +565
    +566
    +567
    +568
    +569
    +570
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 552
    +
    +def indexes(*args)
    +  %x{
    +    var result = [];
    +
    +    for (var i = 0, length = args.length, key, value; i < length; i++) {
    +      key = args[i];
    +      value = $hash_get(self, key);
    +
    +      if (value === undefined) {
    +        result.push(#{default});
    +        continue;
    +      }
    +
    +      result.push(value);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + Also known as: + to_s + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 574
    +
    +def inspect
    +  %x{
    +    var top = (inspect_ids === undefined),
    +        hash_id = self.$object_id(),
    +        result = [];
    +  }
    +
    +  begin
    +    %x{
    +      if (top) {
    +        inspect_ids = {};
    +      }
    +
    +      if (inspect_ids.hasOwnProperty(hash_id)) {
    +        return '{...}';
    +      }
    +
    +      inspect_ids[hash_id] = true;
    +
    +      $hash_each(self, false, function(key, value) {
    +        value = #{Opal.inspect(`value`)}
    +        key = #{Opal.inspect(`key`)}
    +
    +        result.push(key + '=>' + value);
    +        return [false, false];
    +      })
    +
    +      return '{' + result.join(', ') + '}';
    +    }
    +    nil
    +  ensure
    +    `if (top) inspect_ids = undefined`
    +  end
    +end
    +
    +
    + +
    +

    + + #invertObject + + + + + +

    + + + + +
    +
    +
    +
    +609
    +610
    +611
    +612
    +613
    +614
    +615
    +616
    +617
    +618
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 609
    +
    +def invert
    +  %x{
    +    var hash = new Map();
    +
    +    return $hash_each(self, hash, function(key, value) {
    +      $hash_put(hash, value, key);
    +      return [false, hash];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +620
    +621
    +622
    +623
    +624
    +625
    +626
    +627
    +628
    +629
    +630
    +631
    +632
    +633
    +634
    +635
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 620
    +
    +def keep_if(&block)
    +  return enum_for(:keep_if) { size } unless block
    +
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    return $hash_each(self, self, function(key, value) {
    +      var obj = block(key, value);
    +
    +      if (obj === false || obj === nil) {
    +        $hash_delete(self, key);
    +      }
    +      return [false, self];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #keysObject + + + + + +

    + + + + +
    +
    +
    +
    +637
    +638
    +639
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 637
    +
    +def keys
    +  `Array.from(self.keys())`
    +end
    +
    +
    + +
    +

    + + #lengthObject + + + + Also known as: + size + + + + +

    + + + + +
    +
    +
    +
    +641
    +642
    +643
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 641
    +
    +def length
    +  `self.size`
    +end
    +
    +
    + +
    +

    + + #merge(*others, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +645
    +646
    +647
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 645
    +
    +def merge(*others, &block)
    +  dup.merge!(*others, &block)
    +end
    +
    +
    + +
    +

    + + #merge!(*others, &block) ⇒ Object + + + + Also known as: + update + + + + +

    + + + + +
    +
    +
    +
    +649
    +650
    +651
    +652
    +653
    +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
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 649
    +
    +def merge!(*others, &block)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var i, j, other;
    +    for (i = 0; i < others.length; ++i) {
    +      other = #{::Opal.coerce_to!(`others[i]`, ::Hash, :to_hash)};
    +
    +      if (block === nil) {
    +        $hash_each(other, false, function(key, value) {
    +          $hash_put(self, key, value);
    +          return [false, false];
    +        });
    +      } else {
    +        $hash_each(other, false, function(key, value) {
    +          var val = $hash_get(self, key);
    +
    +          if (val === undefined) {
    +            $hash_put(self, key, value);
    +            return [false, false];
    +          }
    +
    +          $hash_put(self, key, block(key, val, value));
    +          return [false, false];
    +        });
    +      }
    +    }
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #rassoc(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +681
    +682
    +683
    +684
    +685
    +686
    +687
    +688
    +689
    +690
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 681
    +
    +def rassoc(object)
    +  %x{
    +    return $hash_each(self, nil, function(key, value) {
    +      if (#{`value` == object}) {
    +        return [true, [key, value]];
    +      }
    +      return [false, nil];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #rehashObject + + + + + +

    + + + + +
    +
    +
    +
    +692
    +693
    +694
    +695
    +696
    +697
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 692
    +
    +def rehash
    +  %x{
    +    $deny_frozen_access(self);
    +    return Opal.hash_rehash(self);
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +699
    +700
    +701
    +702
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +714
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 699
    +
    +def reject(&block)
    +  return enum_for(:reject) { size } unless block
    +
    +  %x{
    +    var hash = new Map();
    +
    +    return $hash_each(self, hash, function(key, value) {
    +      var obj = block(key, value);
    +
    +      if (obj === false || obj === nil) {
    +        $hash_put(hash, key, value);
    +      }
    +      return [false, hash]
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +716
    +717
    +718
    +719
    +720
    +721
    +722
    +723
    +724
    +725
    +726
    +727
    +728
    +729
    +730
    +731
    +732
    +733
    +734
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 716
    +
    +def reject!(&block)
    +  return enum_for(:reject!) { size } unless block
    +
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var result = nil;
    +
    +    return $hash_each(self, result, function(key, value) {
    +      var obj = block(key, value);
    +
    +      if (obj !== false && obj !== nil) {
    +        $hash_delete(self, key);
    +        result = self;
    +      }
    +      return [false, result];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +736
    +737
    +738
    +739
    +740
    +741
    +742
    +743
    +744
    +745
    +746
    +747
    +748
    +749
    +750
    +751
    +752
    +753
    +754
    +755
    +756
    +757
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 736
    +
    +def replace(other)
    +  `$deny_frozen_access(self);`
    +
    +  other = ::Opal.coerce_to!(other, ::Hash, :to_hash)
    +
    +  %x{
    +    self.$clear();
    +
    +    $hash_each(other, false, function(key, value) {
    +      $hash_put(self, key, value);
    +      return [false, false];
    +    });
    +  }
    +
    +  if other.default_proc
    +    self.default_proc = other.default_proc
    +  else
    +    self.default = other.default
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +759
    +760
    +761
    +762
    +763
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 759
    +
    +def select(&block)
    +  return enum_for(:select) { size } unless block
    +
    +  %x{
    +    var hash = new Map();
    +
    +    return $hash_each(self, hash, function(key, value) {
    +      var obj = block(key, value);
    +
    +      if (obj !== false && obj !== nil) {
    +        $hash_put(hash, key, value);
    +      }
    +      return [false, hash];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +776
    +777
    +778
    +779
    +780
    +781
    +782
    +783
    +784
    +785
    +786
    +787
    +788
    +789
    +790
    +791
    +792
    +793
    +794
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 776
    +
    +def select!(&block)
    +  return enum_for(:select!) { size } unless block
    +
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var result = nil;
    +
    +    return $hash_each(self, result, function(key, value) {
    +      var obj = block(key, value);
    +
    +      if (obj === false || obj === nil) {
    +        $hash_delete(self, key);
    +        result = self;
    +      }
    +      return [false, result];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #shiftObject + + + + + +

    + + + + +
    +
    +
    +
    +796
    +797
    +798
    +799
    +800
    +801
    +802
    +803
    +804
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 796
    +
    +def shift
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    return $hash_each(self, nil, function(key, value) {
    +      return [true, [key, $hash_delete(self, key)]];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #slice(*keys) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +806
    +807
    +808
    +809
    +810
    +811
    +812
    +813
    +814
    +815
    +816
    +817
    +818
    +819
    +820
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 806
    +
    +def slice(*keys)
    +  %x{
    +    var result = new Map();
    +
    +    for (var i = 0, length = keys.length; i < length; i++) {
    +      var key = keys[i], value = $hash_get(self, key);
    +
    +      if (value !== undefined) {
    +        $hash_put(result, key, value);
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + + +

    + + + + +
    +
    +
    +
    +822
    +823
    +824
    +825
    +826
    +827
    +828
    +829
    +830
    +831
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 822
    +
    +def to_a
    +  %x{
    +    var result = [];
    +
    +    return $hash_each(self, result, function(key, value) {
    +      result.push([key, value]);
    +      return [false, result];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +833
    +834
    +835
    +836
    +837
    +838
    +839
    +840
    +841
    +842
    +843
    +844
    +845
    +846
    +847
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 833
    +
    +def to_h(&block)
    +  return map(&block).to_h if block_given?
    +
    +  %x{
    +    if (self.$$class === Opal.Hash) {
    +      return self;
    +    }
    +
    +    var hash = new Map();
    +
    +    $hash_clone(self, hash);
    +
    +    return hash;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_hashObject + + + + + +

    + + + + +
    +
    +
    +
    +849
    +850
    +851
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 849
    +
    +def to_hash
    +  self
    +end
    +
    +
    + +
    +

    + + #to_procObject + + + + + +

    + + + + +
    +
    +
    +
    +853
    +854
    +855
    +856
    +857
    +858
    +859
    +860
    +861
    +862
    +863
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 853
    +
    +def to_proc
    +  proc do |key = undefined|
    +    %x{
    +      if (key == null) {
    +        #{::Kernel.raise ::ArgumentError, 'no key given'}
    +      }
    +    }
    +
    +    self[key]
    +  end
    +end
    +
    +
    + +
    +

    + + #transform_keys(keys_hash = nil, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +865
    +866
    +867
    +868
    +869
    +870
    +871
    +872
    +873
    +874
    +875
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +883
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 865
    +
    +def transform_keys(keys_hash = nil, &block)
    +  return enum_for(:transform_keys) { size } if !block && !keys_hash
    +
    +  %x{
    +    var result = new Map();
    +
    +    return $hash_each(self, result, function(key, value) {
    +      var new_key;
    +      if (keys_hash !== nil)
    +        new_key = $hash_get(keys_hash, key);
    +      if (new_key === undefined && block && block !== nil)
    +        new_key = block(key);
    +      if (new_key === undefined)
    +        new_key = key // key not modified
    +      $hash_put(result, new_key, value);
    +      return [false, result];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #transform_keys!(keys_hash = nil, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +885
    +886
    +887
    +888
    +889
    +890
    +891
    +892
    +893
    +894
    +895
    +896
    +897
    +898
    +899
    +900
    +901
    +902
    +903
    +904
    +905
    +906
    +907
    +908
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 885
    +
    +def transform_keys!(keys_hash = nil, &block)
    +  return enum_for(:transform_keys!) { size } if !block && !keys_hash
    +
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var modified_keys = new Map();
    +
    +    return $hash_each(self, self, function(key, value) {
    +      var new_key;
    +      if (keys_hash !== nil)
    +        new_key = $hash_get(keys_hash, key);
    +      if (new_key === undefined && block && block !== nil)
    +        new_key = block(key);
    +      if (new_key === undefined)
    +        return [false, self]; // key not modified
    +      if (!$hash_get(modified_keys, key))
    +        $hash_delete(self, key);
    +      $hash_put(self, new_key, value);
    +      $hash_put(modified_keys, new_key, true)
    +      return [false, self];
    +    });
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +910
    +911
    +912
    +913
    +914
    +915
    +916
    +917
    +918
    +919
    +920
    +921
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 910
    +
    +def transform_values(&block)
    +  return enum_for(:transform_values) { size } unless block
    +
    +  %x{
    +    var result = new Map();
    +
    +    return $hash_each(self, result, function(key, value) {
    +      $hash_put(result, key, block(value));
    +      return [false, result];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #transform_values!(&block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +923
    +924
    +925
    +926
    +927
    +928
    +929
    +930
    +931
    +932
    +933
    +934
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 923
    +
    +def transform_values!(&block)
    +  return enum_for(:transform_values!) { size } unless block
    +
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    return $hash_each(self, self, function(key, value) {
    +      $hash_put(self, key, block(value));
    +      return [false, self];
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #valuesObject + + + + + +

    + + + + +
    +
    +
    +
    +936
    +937
    +938
    +
    +
    # File 'opal/opal/corelib/hash.rb', line 936
    +
    +def values
    +  `Array.from(self.values())`
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/IO.html b/docs/api/v1.8.2/corelib/IO.html new file mode 100644 index 00000000..c5547c55 --- /dev/null +++ b/docs/api/v1.8.2/corelib/IO.html @@ -0,0 +1,2535 @@ + + + + + + + Class: IO + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: IO + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/io.rb
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    File

    +
    + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #eof ⇒ Object + + + + (also: #eof?) + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute eof.

      +
      + +
    • + + +
    • + + + #read_proc ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute read_proc.

      +
      + +
    • + + +
    • + + + #sync ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute sync.

      +
      + +
    • + + +
    • + + + #tty ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute tty.

      +
      + +
    • + + +
    • + + + #write_proc ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute write_proc.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(fd, flags = 'r') ⇒ IO + + + + + +

    +
    +

    Returns a new instance of IO.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +
    +
    # File 'opal/opal/corelib/io.rb', line 17
    +
    +def initialize(fd, flags = 'r')
    +  @fd = fd
    +  @flags = flags
    +  @eof = false
    +
    +  if flags.include?('r') && !flags.match?(/[wa+]/)
    +    @closed = :write
    +  elsif flags.match?(/[wa]/) && !flags.match?(/[r+]/)
    +    @closed = :read
    +  end
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #eofObject (readonly) + + + + Also known as: + eof? + + + + +

    +
    +

    Returns the value of attribute eof.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/io.rb', line 13
    +
    +def eof
    +  @eof
    +end
    +
    +
    + + + +
    +

    + + #read_procObject + + + + + +

    +
    +

    Returns the value of attribute read_proc.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/io.rb', line 15
    +
    +def read_proc
    +  @read_proc
    +end
    +
    +
    + + + +
    +

    + + #syncObject + + + + + +

    +
    +

    Returns the value of attribute sync.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/io.rb', line 15
    +
    +def sync
    +  @sync
    +end
    +
    +
    + + + +
    +

    + + #ttyObject + + + + + +

    +
    +

    Returns the value of attribute tty.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/io.rb', line 15
    +
    +def tty
    +  @tty
    +end
    +
    +
    + + + +
    +

    + + #write_procObject + + + + + +

    +
    +

    Returns the value of attribute write_proc.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/io.rb', line 15
    +
    +def write_proc
    +  @write_proc
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #<<(string) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +49
    +
    +
    # File 'opal/opal/corelib/io.rb', line 46
    +
    +def <<(string)
    +  write(string)
    +  self
    +end
    +
    +
    + +
    +

    + + #check_readableObject + + + + + +

    + + + + +
    +
    +
    +
    +295
    +296
    +297
    +298
    +299
    +
    +
    # File 'opal/opal/corelib/io.rb', line 295
    +
    +def check_readable
    +  if closed_read?
    +    ::Kernel.raise ::IOError, 'not opened for reading'
    +  end
    +end
    +
    +
    + +
    +

    + + #check_writableObject + + + + + +

    + + + + +
    +
    +
    +
    +288
    +289
    +290
    +291
    +292
    +
    +
    # File 'opal/opal/corelib/io.rb', line 288
    +
    +def check_writable
    +  if closed_write?
    +    ::Kernel.raise ::IOError, 'not opened for writing'
    +  end
    +end
    +
    +
    + +
    +

    + + #closeObject + + + + + +

    +
    +

    Closedness

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +255
    +256
    +257
    +
    +
    # File 'opal/opal/corelib/io.rb', line 255
    +
    +def close
    +  @closed = :both
    +end
    +
    +
    + +
    +

    + + #close_readObject + + + + + +

    + + + + +
    +
    +
    +
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +
    +
    # File 'opal/opal/corelib/io.rb', line 259
    +
    +def close_read
    +  if @closed == :write
    +    @closed = :both
    +  else
    +    @closed = :read
    +  end
    +end
    +
    +
    + +
    +

    + + #close_writeObject + + + + + +

    + + + + +
    +
    +
    +
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +
    +
    # File 'opal/opal/corelib/io.rb', line 267
    +
    +def close_write
    +  if @closed == :read
    +    @closed = :both
    +  else
    +    @closed = :write
    +  end
    +end
    +
    +
    + +
    +

    + + #closed?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +275
    +276
    +277
    +
    +
    # File 'opal/opal/corelib/io.rb', line 275
    +
    +def closed?
    +  @closed == :both
    +end
    +
    +
    + +
    +

    + + #closed_read?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +279
    +280
    +281
    +
    +
    # File 'opal/opal/corelib/io.rb', line 279
    +
    +def closed_read?
    +  @closed == :read || @closed == :both
    +end
    +
    +
    + +
    +

    + + #closed_write?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +283
    +284
    +285
    +
    +
    # File 'opal/opal/corelib/io.rb', line 283
    +
    +def closed_write?
    +  @closed == :write || @closed == :both
    +end
    +
    +
    + +
    +

    + + #each(sep = $/, *args, &block) ⇒ Object + + + + Also known as: + each_line + + + + +

    + + + + +
    +
    +
    +
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +
    +
    # File 'opal/opal/corelib/io.rb', line 223
    +
    +def each(sep = $/, *args, &block)
    +  return enum_for :each, sep, *args unless block_given?
    +
    +  while (s = gets(sep, *args))
    +    yield(s)
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +
    +
    # File 'opal/opal/corelib/io.rb', line 233
    +
    +def each_byte(&block)
    +  return enum_for :each_byte unless block_given?
    +
    +  while (s = getbyte)
    +    yield(s)
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +
    +
    # File 'opal/opal/corelib/io.rb', line 243
    +
    +def each_char(&block)
    +  return enum_for :each_char unless block_given?
    +
    +  while (s = getc)
    +    yield(s)
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #filenoObject + + + + + +

    + + + + +
    +
    +
    +
    +29
    +30
    +31
    +
    +
    # File 'opal/opal/corelib/io.rb', line 29
    +
    +def fileno
    +  @fd
    +end
    +
    +
    + +
    +

    + + #flushObject + + + + + +

    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/io.rb', line 42
    +
    +def flush
    +  # noop
    +end
    +
    +
    + +
    +

    + + #getbyteObject + + + + + +

    + + + + +
    +
    +
    +
    +107
    +108
    +109
    +
    +
    # File 'opal/opal/corelib/io.rb', line 107
    +
    +def getbyte
    +  getc&.ord
    +end
    +
    +
    + +
    +

    + + #getcObject + + + + + +

    +
    +

    Reading

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +
    +
    # File 'opal/opal/corelib/io.rb', line 89
    +
    +def getc
    +  @read_buffer ||= ''
    +  parts = ''
    +
    +  # Will execure at most twice - one time reading from a buffer
    +  # second time executing read proc
    +  begin
    +    @read_buffer += parts
    +    if @read_buffer != ''
    +      ret = @read_buffer[0]
    +      @read_buffer = @read_buffer[1..-1]
    +      return ret
    +    end
    +  end while parts = sysread_noraise(1)
    +
    +  nil
    +end
    +
    +
    + +
    +

    + + #gets(sep = false, limit = nil, opts = {}) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +
    +
    # File 'opal/opal/corelib/io.rb', line 123
    +
    +def gets(sep = false, limit = nil, opts = {})
    +  if `sep.$$is_number` && !limit
    +    sep, limit, opts = false, sep, limit
    +  end
    +  if `sep.$$is_hash` && !limit && opts == {}
    +    sep, limit, opts = false, nil, sep
    +  elsif `limit.$$is_hash` && opts == {}
    +    sep, limit, opts = sep, nil, limit
    +  end
    +
    +  orig_sep = sep
    +
    +  sep = $/ if sep == false
    +  sep = /\r?\n\r?\n/ if sep == ''
    +  sep ||= ''
    +  sep = sep.to_str unless orig_sep == ''
    +
    +  # Try to deduce length of a regexp
    +  seplen = orig_sep == '' ? 2 : sep.length
    +
    +  sep = / / if sep == ' ' # WTF is this, String#split(" ") matches all whitespaces???
    +
    +  @read_buffer ||= ''
    +  data = ''
    +  ret = nil
    +
    +  begin
    +    @read_buffer += data
    +    if sep != '' && (`sep.$$is_regexp` ? @read_buffer.match?(sep) : @read_buffer.include?(sep))
    +      orig_buffer = @read_buffer
    +      ret, @read_buffer = @read_buffer.split(sep, 2)
    +      ret += orig_buffer[ret.length, seplen] if ret != orig_buffer
    +      break
    +    end
    +  end while data = sysread_noraise(sep == '' ? 65_536 : 1)
    +
    +  unless ret
    +    ret, @read_buffer = (@read_buffer || ''), ''
    +    ret = nil if ret == ''
    +  end
    +
    +  if ret
    +    if limit
    +      ret = ret[0...limit]
    +      @read_buffer = ret[limit..-1] + @read_buffer
    +    end
    +    ret = ret.sub(/\r?\n\z/, '') if opts[:chomp]
    +    ret = ret.sub(/\A[\r\n]+/, '') if orig_sep == ''
    +  end
    +
    +  $_ = ret if orig_sep == false
    +  ret
    +end
    +
    +
    + +
    + + + + + +
    +
    +
    +
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +
    +
    # File 'opal/opal/corelib/io.rb', line 51
    +
    +def print(*args)
    +  %x{
    +    for (var i = 0, ii = args.length; i < ii; i++) {
    +      args[i] = #{::Kernel.String(`args[i]`)}
    +    }
    +    self.$write(args.join(#{$,}));
    +  }
    +  nil
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/io.rb', line 61
    +
    +def puts(*args)
    +  %x{
    +    var line
    +    if (args.length === 0) {
    +      #{write "\n"};
    +      return nil;
    +    } else {
    +      for (var i = 0, ii = args.length; i < ii; i++) {
    +        if (args[i].$$is_array){
    +          var ary = #{`args[i]`.flatten}
    +          if (ary.length > 0) #{puts(*`ary`)}
    +        } else {
    +          if (args[i].$$is_string) {
    +            line = args[i].valueOf();
    +          } else {
    +            line = #{::Kernel.String(`args[i]`)};
    +          }
    +          if (!line.endsWith("\n")) line += "\n"
    +          #{write `line`}
    +        }
    +      }
    +    }
    +  }
    +  nil
    +end
    +
    +
    + +
    +

    + + #read(integer = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +
    +
    # File 'opal/opal/corelib/io.rb', line 200
    +
    +def read(integer = nil)
    +  @read_buffer ||= ''
    +  parts = ''
    +  ret = nil
    +
    +  begin
    +    @read_buffer += parts
    +    if integer && @read_buffer.length > integer
    +      ret, @read_buffer = @read_buffer[0...integer], @read_buffer[integer..-1]
    +      return ret
    +    end
    +  end while parts = sysread_noraise(integer || 65_536)
    +
    +  ret, @read_buffer = @read_buffer, ''
    +  ret
    +end
    +
    +
    + +
    +

    + + #readbyteObject + + + + + +

    + + + + +
    +
    +
    +
    +111
    +112
    +113
    +
    +
    # File 'opal/opal/corelib/io.rb', line 111
    +
    +def readbyte
    +  readchar.ord
    +end
    +
    +
    + +
    +

    + + #readcharObject + + + + + +

    + + + + +
    +
    +
    +
    +115
    +116
    +117
    +
    +
    # File 'opal/opal/corelib/io.rb', line 115
    +
    +def readchar
    +  getc || ::Kernel.raise(::EOFError, 'end of file reached')
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +119
    +120
    +121
    +
    +
    # File 'opal/opal/corelib/io.rb', line 119
    +
    +def readline(*args)
    +  gets(*args) || ::Kernel.raise(::EOFError, 'end of file reached')
    +end
    +
    +
    + +
    +

    + + #readlines(separator = $/) ⇒ Object + + + + + +

    +
    +

    Eaches

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +219
    +220
    +221
    +
    +
    # File 'opal/opal/corelib/io.rb', line 219
    +
    +def readlines(separator = $/)
    +  each_line(separator).to_a
    +end
    +
    +
    + +
    +

    + + #readpartial(integer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +
    +
    # File 'opal/opal/corelib/io.rb', line 192
    +
    +def readpartial(integer)
    +  @read_buffer ||= ''
    +  part = sysread(integer)
    +  ret, @read_buffer = @read_buffer + (part || ''), ''
    +  ret = nil if ret == ''
    +  ret
    +end
    +
    +
    + +
    +

    + + #sysread(integer) ⇒ Object + + + + + +

    +
    +

    This method is to be overloaded, or read_proc can be changed

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +178
    +179
    +180
    +181
    +182
    +183
    +
    +
    # File 'opal/opal/corelib/io.rb', line 178
    +
    +def sysread(integer)
    +  `self.read_proc(integer)` || begin
    +    @eof = true
    +    ::Kernel.raise ::EOFError, 'end of file reached'
    +  end
    +end
    +
    +
    + +
    +

    + + #sysread_noraise(integer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +186
    +187
    +188
    +189
    +190
    +
    +
    # File 'opal/opal/corelib/io.rb', line 186
    +
    +def sysread_noraise(integer)
    +  sysread(integer)
    +rescue ::EOFError
    +  nil
    +end
    +
    +
    + +
    +

    + + #tty?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +33
    +34
    +35
    +
    +
    # File 'opal/opal/corelib/io.rb', line 33
    +
    +def tty?
    +  `self.tty == true`
    +end
    +
    +
    + +
    +

    + + #write(string) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +37
    +38
    +39
    +40
    +
    +
    # File 'opal/opal/corelib/io.rb', line 37
    +
    +def write(string)
    +  `self.write_proc(string)`
    +  string.size
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/IOError.html b/docs/api/v1.8.2/corelib/IOError.html new file mode 100644 index 00000000..8e6d9be6 --- /dev/null +++ b/docs/api/v1.8.2/corelib/IOError.html @@ -0,0 +1,154 @@ + + + + + + + Exception: IOError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: IOError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    EOFError

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/IndexError.html b/docs/api/v1.8.2/corelib/IndexError.html new file mode 100644 index 00000000..5372cbd1 --- /dev/null +++ b/docs/api/v1.8.2/corelib/IndexError.html @@ -0,0 +1,154 @@ + + + + + + + Exception: IndexError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: IndexError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    KeyError, StopIteration

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Integer.html b/docs/api/v1.8.2/corelib/Integer.html new file mode 100644 index 00000000..29129e3f --- /dev/null +++ b/docs/api/v1.8.2/corelib/Integer.html @@ -0,0 +1,415 @@ + + + + + + + Class: Integer + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Integer + + + +

    +
    + +
    +
    Inherits:
    +
    + Numeric + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/number.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Numeric

    +

    #%, #+@, #-@, #<=>, #__coerced__, #abs, #abs2, #angle, #ceil, #clone, #coerce, #conj, #denominator, #div, #divmod, #dup, #fdiv, #finite?, #floor, #i, #imag, #infinite?, #integer?, #negative?, #nonzero?, #numerator, #polar, #positive?, #quo, #real, #real?, #rect, #round, #step, #to_c, #to_int, #truncate, #zero?

    + + + + + + + + + +

    Methods included from Comparable

    +

    #<, #<=, #==, #>, #>=, #between?, #clamp

    + + +
    +

    Class Method Details

    + + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +918
    +919
    +920
    +
    +
    # File 'opal/opal/corelib/number.rb', line 918
    +
    +def allocate
    +  ::Kernel.raise ::TypeError, "allocator undefined for #{name}"
    +end
    +
    +
    + +
    +

    + + .sqrt(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +924
    +925
    +926
    +927
    +928
    +929
    +930
    +931
    +932
    +933
    +
    +
    # File 'opal/opal/corelib/number.rb', line 924
    +
    +def sqrt(n)
    +  n = ::Opal.coerce_to!(n, ::Integer, :to_int)
    +  %x{
    +    if (n < 0) {
    +      #{::Kernel.raise ::Math::DomainError, 'Numerical argument is out of domain - "isqrt"'}
    +    }
    +
    +    return parseInt(Math.sqrt(n), 10);
    +  }
    +end
    +
    +
    + +
    +

    + + .try_convert(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +935
    +936
    +937
    +
    +
    # File 'opal/opal/corelib/number.rb', line 935
    +
    +def try_convert(object)
    +  Opal.coerce_to?(object, self, :to_int)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 20
    +
    +def __marshal__(buffer)
    +  if self >= -0x40000000 && self < 0x40000000
    +    buffer.append('i')
    +    buffer.write_fixnum(self)
    +  else
    +    buffer.append('l')
    +    buffer.write_bignum(self)
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Interrupt.html b/docs/api/v1.8.2/corelib/Interrupt.html new file mode 100644 index 00000000..242f36cd --- /dev/null +++ b/docs/api/v1.8.2/corelib/Interrupt.html @@ -0,0 +1,150 @@ + + + + + + + Exception: Interrupt + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: Interrupt + + + +

    +
    + +
    +
    Inherits:
    +
    + SignalException + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/JS.html b/docs/api/v1.8.2/corelib/JS.html new file mode 100644 index 00000000..1772ca48 --- /dev/null +++ b/docs/api/v1.8.2/corelib/JS.html @@ -0,0 +1,117 @@ + + + + + + + Module: JS + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: JS + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +

    Defined Under Namespace

    +

    + + + + + Classes: Error + + +

    + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Kernel.html b/docs/api/v1.8.2/corelib/Kernel.html new file mode 100644 index 00000000..1eee7056 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Kernel.html @@ -0,0 +1,6748 @@ + + + + + + + Module: Kernel + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Kernel + + + +

    +
    + + + + + + + + + +
    +
    Included in:
    +
    Object
    +
    + + + +
    +
    Defined in:
    +
    opal/opal/corelib/kernel.rb,
    + opal/opal/corelib/binding.rb,
    opal/opal/corelib/unsupported.rb,
    opal/opal/corelib/unsupported.rb,
    opal/opal/corelib/unsupported.rb,
    opal/opal/corelib/complex/base.rb,
    opal/opal/corelib/kernel/format.rb,
    opal/opal/corelib/rational/base.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    helpers: coerce_to +backtick_javascript: true

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

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Instance Method Details

    + + +
    +

    + + #!~(obj) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +10
    +11
    +12
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 10
    +
    +def !~(obj)
    +  !(self =~ obj)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 18
    +
    +def <=>(other)
    +  %x{
    +    // set guard for infinite recursion
    +    self.$$comparable = true;
    +
    +    var x = #{self == other};
    +
    +    if (x && x !== nil) {
    +      return 0;
    +    }
    +
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +14
    +15
    +16
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 14
    +
    +def ===(other)
    +  object_id == other.object_id || self == other
    +end
    +
    +
    + +
    +

    + + #=~(obj) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 6
    +
    +def =~(obj)
    +  false
    +end
    +
    +
    + +
    +

    + + #Array(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 65
    +
    +def Array(object)
    +  %x{
    +    var coerced;
    +
    +    if (object === nil) {
    +      return [];
    +    }
    +
    +    if (object.$$is_array) {
    +      return object;
    +    }
    +
    +    coerced = #{::Opal.coerce_to?(object, ::Array, :to_ary)};
    +    if (coerced !== nil) { return coerced; }
    +
    +    coerced = #{::Opal.coerce_to?(object, ::Array, :to_a)};
    +    if (coerced !== nil) { return coerced; }
    +
    +    return [object];
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +87
    +88
    +89
    +90
    +91
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 87
    +
    +def at_exit(&block)
    +  $__at_exit__ ||= []
    +  $__at_exit__ << block
    +  block
    +end
    +
    +
    + +
    +

    + + #bindingObject + + + + + +

    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/binding.rb', line 50
    +
    +def binding
    +  ::Kernel.raise "Opal doesn't support dynamic calls to binding"
    +end
    +
    +
    + +
    +

    + + #caller(start = 1, length = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 93
    +
    +def caller(start = 1, length = nil)
    +  %x{
    +    var stack, result;
    +
    +    stack = new Error().$backtrace();
    +    result = [];
    +
    +    for (var i = #{start} + 1, ii = stack.length; i < ii; i++) {
    +      if (!stack[i].match(/runtime\.js/)) {
    +        result.push(stack[i]);
    +      }
    +    }
    +    if (length != nil) result = result.slice(0, length);
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +110
    +111
    +112
    +113
    +114
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 110
    +
    +def caller_locations(*args)
    +  caller(*args).map do |loc|
    +    ::Thread::Backtrace::Location.new(loc)
    +  end
    +end
    +
    +
    + +
    +

    + + #catch(tag = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +824
    +825
    +826
    +827
    +828
    +829
    +830
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 824
    +
    +def catch(tag = nil)
    +  tag ||= ::Object.new
    +  yield(tag)
    +rescue ::UncaughtThrowError => e
    +  return e.value if e.tag == tag
    +  ::Kernel.raise
    +end
    +
    +
    + +
    +

    + + #classObject + + + + + +

    + + + + +
    +
    +
    +
    +116
    +117
    +118
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 116
    +
    +def class
    +  `self.$$class`
    +end
    +
    +
    + +
    +

    + + #clone(freeze: nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 164
    +
    +def clone(freeze: nil)
    +  unless freeze.nil? || freeze == true || freeze == false
    +    raise ArgumentError, "unexpected value for freeze: #{freeze.class}"
    +  end
    +
    +  copy = self.class.allocate
    +
    +  copy.copy_instance_variables(self)
    +  copy.copy_singleton_methods(self)
    +  copy.initialize_clone(self, freeze: freeze)
    +
    +  if freeze == true || (freeze.nil? && frozen?)
    +    copy.freeze
    +  end
    +
    +  copy
    +end
    +
    +
    + +
    +

    + + #Complex(real, imag = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +
    +
    # File 'opal/opal/corelib/complex/base.rb', line 2
    +
    +def Complex(real, imag = nil)
    +  if imag
    +    Complex.new(real, imag)
    +  else
    +    Complex.new(real, 0)
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 120
    +
    +def copy_instance_variables(other)
    +  %x{
    +    var keys = Object.keys(other), i, ii, name;
    +    for (i = 0, ii = keys.length; i < ii; i++) {
    +      name = keys[i];
    +      if (name.charAt(0) !== '$' && other.hasOwnProperty(name)) {
    +        self[name] = other[name];
    +      }
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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 'opal/opal/corelib/kernel.rb', line 132
    +
    +def copy_singleton_methods(other)
    +  %x{
    +    var i, name, names, length;
    +
    +    if (other.hasOwnProperty('$$meta') && other.$$meta !== null) {
    +      var other_singleton_class = Opal.get_singleton_class(other);
    +      var self_singleton_class = Opal.get_singleton_class(self);
    +      names = Object.getOwnPropertyNames(other_singleton_class.$$prototype);
    +
    +      for (i = 0, length = names.length; i < length; i++) {
    +        name = names[i];
    +        if (Opal.is_method(name)) {
    +          self_singleton_class.$$prototype[name] = other_singleton_class.$$prototype[name];
    +        }
    +      }
    +
    +      self_singleton_class.$$const = Object.assign({}, other_singleton_class.$$const);
    +      Object.setPrototypeOf(
    +        self_singleton_class.$$prototype,
    +        Object.getPrototypeOf(other_singleton_class.$$prototype)
    +      );
    +    }
    +
    +    for (i = 0, names = Object.getOwnPropertyNames(other), length = names.length; i < length; i++) {
    +      name = names[i];
    +      if (name.charAt(0) === '$' && name.charAt(1) !== '$' && other.hasOwnProperty(name)) {
    +        self[name] = other[name];
    +      }
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #define_singleton_method(name, method = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +187
    +188
    +189
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 187
    +
    +def define_singleton_method(name, method = undefined, &block)
    +  singleton_class.define_method(name, method, &block)
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 191
    +
    +def dup
    +  copy = self.class.allocate
    +
    +  copy.copy_instance_variables(self)
    +  copy.initialize_dup(self)
    +
    +  copy
    +end
    +
    +
    + +
    +

    + + #enum_for(method = :each, *args, &block) ⇒ Object + + + + Also known as: + to_enum + + + + +

    + + + + +
    +
    +
    +
    +204
    +205
    +206
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 204
    +
    +def enum_for(method = :each, *args, &block)
    +  ::Enumerator.for(self, method, *args, &block)
    +end
    +
    +
    + +
    +

    + + #equal?(other) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +208
    +209
    +210
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 208
    +
    +def equal?(other)
    +  `self === other`
    +end
    +
    +
    + +
    +

    + + #evalObject + + + + + +

    + + + + +
    +
    +
    +
    +105
    +106
    +107
    +108
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 105
    +
    +def eval(*)
    +  ::Kernel.raise ::NotImplementedError, "To use Kernel#eval, you must first require 'opal-parser'. "\
    +                                        "See https://github.com/opal/opal/blob/#{RUBY_ENGINE_VERSION}/docs/opal_parser.md for details."
    +end
    +
    +
    + +
    +

    + + #exit(status = true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 212
    +
    +def exit(status = true)
    +  $__at_exit__ ||= []
    +
    +  until $__at_exit__.empty?
    +    block = $__at_exit__.pop
    +    block.call
    +  end
    +
    +  %x{
    +    if (status.$$is_boolean) {
    +      status = status ? 0 : 1;
    +    } else {
    +      status = $coerce_to(status, #{::Integer}, 'to_int')
    +    }
    +
    +    Opal.exit(status);
    +  }
    +  nil
    +end
    +
    +
    + +
    +

    + + #extend(*mods) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 232
    +
    +def extend(*mods)
    +  %x{
    +    if (mods.length == 0) {
    +      #{raise ::ArgumentError, 'wrong number of arguments (given 0, expected 1+)'}
    +    }
    +
    +    $deny_frozen_access(self);
    +
    +    var singleton = #{singleton_class};
    +
    +    for (var i = mods.length - 1; i >= 0; i--) {
    +      var mod = mods[i];
    +
    +      if (!mod.$$is_module) {
    +        #{::Kernel.raise ::TypeError, "wrong argument type #{`mod`.class} (expected Module)"};
    +      }
    +
    +      #{`mod`.append_features `singleton`};
    +      #{`mod`.extend_object self};
    +      #{`mod`.extended self};
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #Float(value, exception: true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +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
    +552
    +553
    +554
    +555
    +556
    +557
    +558
    +559
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 518
    +
    +def Float(value, exception: true)
    +  %x{
    +    var str;
    +
    +    exception = $truthy(#{exception});
    +
    +    if (value === nil) {
    +      if (exception) {
    +        #{::Kernel.raise ::TypeError, "can't convert nil into Float"}
    +      } else {
    +        return nil;
    +      }
    +    }
    +
    +    if (value.$$is_string) {
    +      str = value.toString();
    +
    +      str = str.replace(/(\d)_(?=\d)/g, '$1');
    +
    +      //Special case for hex strings only:
    +      if (/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(str)) {
    +        return #{::Kernel.Integer(`str`)};
    +      }
    +
    +      if (!/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(str)) {
    +        if (exception) {
    +          #{::Kernel.raise ::ArgumentError, "invalid value for Float(): \"#{value}\""}
    +        } else {
    +          return nil;
    +        }
    +      }
    +
    +      return parseFloat(str);
    +    }
    +
    +    if (exception) {
    +      return #{::Opal.coerce_to!(value, ::Float, :to_f)};
    +    } else {
    +      return $coerce_to(value, #{::Float}, 'to_f');
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #format(format_string, *args) ⇒ Object + + + + Also known as: + sprintf + + + + +

    + + + + +
    +
    +
    +
    +5
    +6
    +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
    +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
    +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
    +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
    +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
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +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
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +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
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +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
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +
    +
    # File 'opal/opal/corelib/kernel/format.rb', line 5
    +
    +def format(format_string, *args)
    +  if args.length == 1 && args[0].respond_to?(:to_ary)
    +    ary = ::Opal.coerce_to?(args[0], ::Array, :to_ary)
    +    args = ary.to_a unless ary.nil?
    +  end
    +
    +  %x{
    +    var result = '',
    +        //used for slicing:
    +        begin_slice = 0,
    +        end_slice,
    +        //used for iterating over the format string:
    +        i,
    +        len = format_string.length,
    +        //used for processing field values:
    +        arg,
    +        str,
    +        //used for processing %g and %G fields:
    +        exponent,
    +        //used for keeping track of width and precision:
    +        width,
    +        precision,
    +        //used for holding temporary values:
    +        tmp_num,
    +        //used for processing %{} and %<> fileds:
    +        hash_parameter_key,
    +        closing_brace_char,
    +        //used for processing %b, %B, %o, %x, and %X fields:
    +        base_number,
    +        base_prefix,
    +        base_neg_zero_regex,
    +        base_neg_zero_digit,
    +        //used for processing arguments:
    +        next_arg,
    +        seq_arg_num = 1,
    +        pos_arg_num = 0,
    +        //used for keeping track of flags:
    +        flags,
    +        FNONE  = 0,
    +        FSHARP = 1,
    +        FMINUS = 2,
    +        FPLUS  = 4,
    +        FZERO  = 8,
    +        FSPACE = 16,
    +        FWIDTH = 32,
    +        FPREC  = 64,
    +        FPREC0 = 128;
    +
    +    function CHECK_FOR_FLAGS() {
    +      if (flags&FWIDTH) { #{::Kernel.raise ::ArgumentError, 'flag after width'} }
    +      if (flags&FPREC0) { #{::Kernel.raise ::ArgumentError, 'flag after precision'} }
    +    }
    +
    +    function CHECK_FOR_WIDTH() {
    +      if (flags&FWIDTH) { #{::Kernel.raise ::ArgumentError, 'width given twice'} }
    +      if (flags&FPREC0) { #{::Kernel.raise ::ArgumentError, 'width after precision'} }
    +    }
    +
    +    function GET_NTH_ARG(num) {
    +      if (num >= args.length) { #{::Kernel.raise ::ArgumentError, 'too few arguments'} }
    +      return args[num];
    +    }
    +
    +    function GET_NEXT_ARG() {
    +      switch (pos_arg_num) {
    +      case -1: #{::Kernel.raise ::ArgumentError, "unnumbered(#{`seq_arg_num`}) mixed with numbered"} // raise
    +      case -2: #{::Kernel.raise ::ArgumentError, "unnumbered(#{`seq_arg_num`}) mixed with named"} // raise
    +      }
    +      pos_arg_num = seq_arg_num++;
    +      return GET_NTH_ARG(pos_arg_num - 1);
    +    }
    +
    +    function GET_POS_ARG(num) {
    +      if (pos_arg_num > 0) {
    +        #{::Kernel.raise ::ArgumentError, "numbered(#{`num`}) after unnumbered(#{`pos_arg_num`})"}
    +      }
    +      if (pos_arg_num === -2) {
    +        #{::Kernel.raise ::ArgumentError, "numbered(#{`num`}) after named"}
    +      }
    +      if (num < 1) {
    +        #{::Kernel.raise ::ArgumentError, "invalid index - #{`num`}$"}
    +      }
    +      pos_arg_num = -1;
    +      return GET_NTH_ARG(num - 1);
    +    }
    +
    +    function GET_ARG() {
    +      return (next_arg === undefined ? GET_NEXT_ARG() : next_arg);
    +    }
    +
    +    function READ_NUM(label) {
    +      var num, str = '';
    +      for (;; i++) {
    +        if (i === len) {
    +          #{::Kernel.raise ::ArgumentError, 'malformed format string - %*[0-9]'}
    +        }
    +        if (format_string.charCodeAt(i) < 48 || format_string.charCodeAt(i) > 57) {
    +          i--;
    +          num = parseInt(str, 10) || 0;
    +          if (num > 2147483647) {
    +            #{::Kernel.raise ::ArgumentError, "#{`label`} too big"}
    +          }
    +          return num;
    +        }
    +        str += format_string.charAt(i);
    +      }
    +    }
    +
    +    function READ_NUM_AFTER_ASTER(label) {
    +      var arg, num = READ_NUM(label);
    +      if (format_string.charAt(i + 1) === '$') {
    +        i++;
    +        arg = GET_POS_ARG(num);
    +      } else {
    +        arg = GET_NEXT_ARG();
    +      }
    +      return #{`arg`.to_int};
    +    }
    +
    +    for (i = format_string.indexOf('%'); i !== -1; i = format_string.indexOf('%', i)) {
    +      str = undefined;
    +
    +      flags = FNONE;
    +      width = -1;
    +      precision = -1;
    +      next_arg = undefined;
    +
    +      end_slice = i;
    +
    +      i++;
    +
    +      switch (format_string.charAt(i)) {
    +      case '%':
    +        begin_slice = i;
    +        // no-break
    +      case '':
    +      case '\n':
    +      case '\0':
    +        i++;
    +        continue;
    +      }
    +
    +      format_sequence: for (; i < len; i++) {
    +        switch (format_string.charAt(i)) {
    +
    +        case ' ':
    +          CHECK_FOR_FLAGS();
    +          flags |= FSPACE;
    +          continue format_sequence;
    +
    +        case '#':
    +          CHECK_FOR_FLAGS();
    +          flags |= FSHARP;
    +          continue format_sequence;
    +
    +        case '+':
    +          CHECK_FOR_FLAGS();
    +          flags |= FPLUS;
    +          continue format_sequence;
    +
    +        case '-':
    +          CHECK_FOR_FLAGS();
    +          flags |= FMINUS;
    +          continue format_sequence;
    +
    +        case '0':
    +          CHECK_FOR_FLAGS();
    +          flags |= FZERO;
    +          continue format_sequence;
    +
    +        case '1':
    +        case '2':
    +        case '3':
    +        case '4':
    +        case '5':
    +        case '6':
    +        case '7':
    +        case '8':
    +        case '9':
    +          tmp_num = READ_NUM('width');
    +          if (format_string.charAt(i + 1) === '$') {
    +            if (i + 2 === len) {
    +              str = '%';
    +              i++;
    +              break format_sequence;
    +            }
    +            if (next_arg !== undefined) {
    +              #{::Kernel.raise ::ArgumentError, "value given twice - %#{`tmp_num`}$"}
    +            }
    +            next_arg = GET_POS_ARG(tmp_num);
    +            i++;
    +          } else {
    +            CHECK_FOR_WIDTH();
    +            flags |= FWIDTH;
    +            width = tmp_num;
    +          }
    +          continue format_sequence;
    +
    +        case '<':
    +        case '\{':
    +          closing_brace_char = (format_string.charAt(i) === '<' ? '>' : '\}');
    +          hash_parameter_key = '';
    +
    +          i++;
    +
    +          for (;; i++) {
    +            if (i === len) {
    +              #{::Kernel.raise ::ArgumentError, 'malformed name - unmatched parenthesis'}
    +            }
    +            if (format_string.charAt(i) === closing_brace_char) {
    +
    +              if (pos_arg_num > 0) {
    +                #{::Kernel.raise ::ArgumentError, "named #{`hash_parameter_key`} after unnumbered(#{`pos_arg_num`})"}
    +              }
    +              if (pos_arg_num === -1) {
    +                #{::Kernel.raise ::ArgumentError, "named #{`hash_parameter_key`} after numbered"}
    +              }
    +              pos_arg_num = -2;
    +
    +              if (args[0] === undefined || !args[0].$$is_hash) {
    +                #{::Kernel.raise ::ArgumentError, 'one hash required'}
    +              }
    +
    +              next_arg = #{`args[0]`.fetch(`hash_parameter_key`)};
    +
    +              if (closing_brace_char === '>') {
    +                continue format_sequence;
    +              } else {
    +                str = next_arg.toString();
    +                if (precision !== -1) { str = str.slice(0, precision); }
    +                if (flags&FMINUS) {
    +                  while (str.length < width) { str = str + ' '; }
    +                } else {
    +                  while (str.length < width) { str = ' ' + str; }
    +                }
    +                break format_sequence;
    +              }
    +            }
    +            hash_parameter_key += format_string.charAt(i);
    +          }
    +          // raise
    +
    +        case '*':
    +          i++;
    +          CHECK_FOR_WIDTH();
    +          flags |= FWIDTH;
    +          width = READ_NUM_AFTER_ASTER('width');
    +          if (width < 0) {
    +            flags |= FMINUS;
    +            width = -width;
    +          }
    +          continue format_sequence;
    +
    +        case '.':
    +          if (flags&FPREC0) {
    +            #{::Kernel.raise ::ArgumentError, 'precision given twice'}
    +          }
    +          flags |= FPREC|FPREC0;
    +          precision = 0;
    +          i++;
    +          if (format_string.charAt(i) === '*') {
    +            i++;
    +            precision = READ_NUM_AFTER_ASTER('precision');
    +            if (precision < 0) {
    +              flags &= ~FPREC;
    +            }
    +            continue format_sequence;
    +          }
    +          precision = READ_NUM('precision');
    +          continue format_sequence;
    +
    +        case 'd':
    +        case 'i':
    +        case 'u':
    +          arg = #{::Kernel.Integer(`GET_ARG()`)};
    +          if (arg >= 0) {
    +            str = arg.toString();
    +            while (str.length < precision) { str = '0' + str; }
    +            if (flags&FMINUS) {
    +              if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +              while (str.length < width) { str = str + ' '; }
    +            } else {
    +              if (flags&FZERO && precision === -1) {
    +                while (str.length < width - ((flags&FPLUS || flags&FSPACE) ? 1 : 0)) { str = '0' + str; }
    +                if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +              } else {
    +                if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +                while (str.length < width) { str = ' ' + str; }
    +              }
    +            }
    +          } else {
    +            str = (-arg).toString();
    +            while (str.length < precision) { str = '0' + str; }
    +            if (flags&FMINUS) {
    +              str = '-' + str;
    +              while (str.length < width) { str = str + ' '; }
    +            } else {
    +              if (flags&FZERO && precision === -1) {
    +                while (str.length < width - 1) { str = '0' + str; }
    +                str = '-' + str;
    +              } else {
    +                str = '-' + str;
    +                while (str.length < width) { str = ' ' + str; }
    +              }
    +            }
    +          }
    +          break format_sequence;
    +
    +        case 'b':
    +        case 'B':
    +        case 'o':
    +        case 'x':
    +        case 'X':
    +          switch (format_string.charAt(i)) {
    +          case 'b':
    +          case 'B':
    +            base_number = 2;
    +            base_prefix = '0b';
    +            base_neg_zero_regex = /^1+/;
    +            base_neg_zero_digit = '1';
    +            break;
    +          case 'o':
    +            base_number = 8;
    +            base_prefix = '0';
    +            base_neg_zero_regex = /^3?7+/;
    +            base_neg_zero_digit = '7';
    +            break;
    +          case 'x':
    +          case 'X':
    +            base_number = 16;
    +            base_prefix = '0x';
    +            base_neg_zero_regex = /^f+/;
    +            base_neg_zero_digit = 'f';
    +            break;
    +          }
    +          arg = #{::Kernel.Integer(`GET_ARG()`)};
    +          if (arg >= 0) {
    +            str = arg.toString(base_number);
    +            while (str.length < precision) { str = '0' + str; }
    +            if (flags&FMINUS) {
    +              if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +              if (flags&FSHARP && arg !== 0) { str = base_prefix + str; }
    +              while (str.length < width) { str = str + ' '; }
    +            } else {
    +              if (flags&FZERO && precision === -1) {
    +                while (str.length < width - ((flags&FPLUS || flags&FSPACE) ? 1 : 0) - ((flags&FSHARP && arg !== 0) ? base_prefix.length : 0)) { str = '0' + str; }
    +                if (flags&FSHARP && arg !== 0) { str = base_prefix + str; }
    +                if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +              } else {
    +                if (flags&FSHARP && arg !== 0) { str = base_prefix + str; }
    +                if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +                while (str.length < width) { str = ' ' + str; }
    +              }
    +            }
    +          } else {
    +            if (flags&FPLUS || flags&FSPACE) {
    +              str = (-arg).toString(base_number);
    +              while (str.length < precision) { str = '0' + str; }
    +              if (flags&FMINUS) {
    +                if (flags&FSHARP) { str = base_prefix + str; }
    +                str = '-' + str;
    +                while (str.length < width) { str = str + ' '; }
    +              } else {
    +                if (flags&FZERO && precision === -1) {
    +                  while (str.length < width - 1 - (flags&FSHARP ? 2 : 0)) { str = '0' + str; }
    +                  if (flags&FSHARP) { str = base_prefix + str; }
    +                  str = '-' + str;
    +                } else {
    +                  if (flags&FSHARP) { str = base_prefix + str; }
    +                  str = '-' + str;
    +                  while (str.length < width) { str = ' ' + str; }
    +                }
    +              }
    +            } else {
    +              str = (arg >>> 0).toString(base_number).replace(base_neg_zero_regex, base_neg_zero_digit);
    +              while (str.length < precision - 2) { str = base_neg_zero_digit + str; }
    +              if (flags&FMINUS) {
    +                str = '..' + str;
    +                if (flags&FSHARP) { str = base_prefix + str; }
    +                while (str.length < width) { str = str + ' '; }
    +              } else {
    +                if (flags&FZERO && precision === -1) {
    +                  while (str.length < width - 2 - (flags&FSHARP ? base_prefix.length : 0)) { str = base_neg_zero_digit + str; }
    +                  str = '..' + str;
    +                  if (flags&FSHARP) { str = base_prefix + str; }
    +                } else {
    +                  str = '..' + str;
    +                  if (flags&FSHARP) { str = base_prefix + str; }
    +                  while (str.length < width) { str = ' ' + str; }
    +                }
    +              }
    +            }
    +          }
    +          if (format_string.charAt(i) === format_string.charAt(i).toUpperCase()) {
    +            str = str.toUpperCase();
    +          }
    +          break format_sequence;
    +
    +        case 'f':
    +        case 'e':
    +        case 'E':
    +        case 'g':
    +        case 'G':
    +          arg = #{::Kernel.Float(`GET_ARG()`)};
    +          if (arg >= 0 || isNaN(arg)) {
    +            if (arg === Infinity) {
    +              str = 'Inf';
    +            } else {
    +              switch (format_string.charAt(i)) {
    +              case 'f':
    +                str = arg.toFixed(precision === -1 ? 6 : precision);
    +                break;
    +              case 'e':
    +              case 'E':
    +                str = arg.toExponential(precision === -1 ? 6 : precision);
    +                break;
    +              case 'g':
    +              case 'G':
    +                str = arg.toExponential();
    +                exponent = parseInt(str.split('e')[1], 10);
    +                if (!(exponent < -4 || exponent >= (precision === -1 ? 6 : precision))) {
    +                  str = arg.toPrecision(precision === -1 ? (flags&FSHARP ? 6 : undefined) : precision);
    +                }
    +                break;
    +              }
    +            }
    +            if (flags&FMINUS) {
    +              if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +              while (str.length < width) { str = str + ' '; }
    +            } else {
    +              if (flags&FZERO && arg !== Infinity && !isNaN(arg)) {
    +                while (str.length < width - ((flags&FPLUS || flags&FSPACE) ? 1 : 0)) { str = '0' + str; }
    +                if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +              } else {
    +                if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; }
    +                while (str.length < width) { str = ' ' + str; }
    +              }
    +            }
    +          } else {
    +            if (arg === -Infinity) {
    +              str = 'Inf';
    +            } else {
    +              switch (format_string.charAt(i)) {
    +              case 'f':
    +                str = (-arg).toFixed(precision === -1 ? 6 : precision);
    +                break;
    +              case 'e':
    +              case 'E':
    +                str = (-arg).toExponential(precision === -1 ? 6 : precision);
    +                break;
    +              case 'g':
    +              case 'G':
    +                str = (-arg).toExponential();
    +                exponent = parseInt(str.split('e')[1], 10);
    +                if (!(exponent < -4 || exponent >= (precision === -1 ? 6 : precision))) {
    +                  str = (-arg).toPrecision(precision === -1 ? (flags&FSHARP ? 6 : undefined) : precision);
    +                }
    +                break;
    +              }
    +            }
    +            if (flags&FMINUS) {
    +              str = '-' + str;
    +              while (str.length < width) { str = str + ' '; }
    +            } else {
    +              if (flags&FZERO && arg !== -Infinity) {
    +                while (str.length < width - 1) { str = '0' + str; }
    +                str = '-' + str;
    +              } else {
    +                str = '-' + str;
    +                while (str.length < width) { str = ' ' + str; }
    +              }
    +            }
    +          }
    +          if (format_string.charAt(i) === format_string.charAt(i).toUpperCase() && arg !== Infinity && arg !== -Infinity && !isNaN(arg)) {
    +            str = str.toUpperCase();
    +          }
    +          str = str.replace(/([eE][-+]?)([0-9])$/, '$10$2');
    +          break format_sequence;
    +
    +        case 'a':
    +        case 'A':
    +          // Not implemented because there are no specs for this field type.
    +          #{::Kernel.raise ::NotImplementedError, '`A` and `a` format field types are not implemented in Opal yet'}
    +          // raise
    +
    +        case 'c':
    +          arg = GET_ARG();
    +          if (#{`arg`.respond_to?(:to_ary)}) { arg = #{`arg`.to_ary}[0]; }
    +          if (#{`arg`.respond_to?(:to_str)}) {
    +            str = #{`arg`.to_str};
    +          } else {
    +            str = String.fromCharCode($coerce_to(arg, #{::Integer}, 'to_int'));
    +          }
    +          if (str.length !== 1) {
    +            #{::Kernel.raise ::ArgumentError, '%c requires a character'}
    +          }
    +          if (flags&FMINUS) {
    +            while (str.length < width) { str = str + ' '; }
    +          } else {
    +            while (str.length < width) { str = ' ' + str; }
    +          }
    +          break format_sequence;
    +
    +        case 'p':
    +          str = #{`GET_ARG()`.inspect};
    +          if (precision !== -1) { str = str.slice(0, precision); }
    +          if (flags&FMINUS) {
    +            while (str.length < width) { str = str + ' '; }
    +          } else {
    +            while (str.length < width) { str = ' ' + str; }
    +          }
    +          break format_sequence;
    +
    +        case 's':
    +          str = #{`GET_ARG()`.to_s};
    +          if (precision !== -1) { str = str.slice(0, precision); }
    +          if (flags&FMINUS) {
    +            while (str.length < width) { str = str + ' '; }
    +          } else {
    +            while (str.length < width) { str = ' ' + str; }
    +          }
    +          break format_sequence;
    +
    +        default:
    +          #{::Kernel.raise ::ArgumentError, "malformed format string - %#{`format_string.charAt(i)`}"}
    +        }
    +      }
    +
    +      if (str === undefined) {
    +        #{::Kernel.raise ::ArgumentError, 'malformed format string - %'}
    +      }
    +
    +      result += format_string.slice(begin_slice, end_slice) + str;
    +      begin_slice = i + 1;
    +    }
    +
    +    if (#{$DEBUG} && pos_arg_num >= 0 && seq_arg_num < args.length) {
    +      #{::Kernel.raise ::ArgumentError, 'too many arguments for format string'}
    +    }
    +
    +    return result + format_string.slice(begin_slice);
    +  }
    +end
    +
    +
    + +
    +

    + + #freezeObject + + + + + +

    + + + + +
    +
    +
    +
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 258
    +
    +def freeze
    +  return self if frozen?
    +
    +  %x{
    +    if (typeof(self) === "object") {
    +      $freeze_props(self);
    +      return $freeze(self);
    +    }
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #frozen?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 270
    +
    +def frozen?
    +  %x{
    +    switch (typeof(self)) {
    +    case "string":
    +    case "symbol":
    +    case "number":
    +    case "boolean":
    +      return true;
    +    case "object":
    +      return (self.$$frozen || false);
    +    default:
    +      return false;
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +286
    +287
    +288
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 286
    +
    +def gets(*args)
    +  $stdin.gets(*args)
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +290
    +291
    +292
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 290
    +
    +def hash
    +  __id__
    +end
    +
    +
    + +
    +

    + + #Hash(arg) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +561
    +562
    +563
    +564
    +565
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 561
    +
    +def Hash(arg)
    +  return {} if arg.nil? || arg == []
    +  return arg if ::Hash === arg
    +  ::Opal.coerce_to!(arg, ::Hash, :to_hash)
    +end
    +
    +
    + +
    +

    + + #initialize_clone(other, freeze: nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +182
    +183
    +184
    +185
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 182
    +
    +def initialize_clone(other, freeze: nil)
    +  initialize_copy(other)
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +294
    +295
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 294
    +
    +def initialize_copy(other)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +200
    +201
    +202
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 200
    +
    +def initialize_dup(other)
    +  initialize_copy(other)
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 299
    +
    +def inspect
    +  ivs = ''
    +  id = __id__
    +  if `inspect_stack`.include? id
    +    ivs = ' ...'
    +  else
    +    `inspect_stack` << id
    +    pushed = true
    +    instance_variables.each do |i|
    +      ivar = instance_variable_get(i)
    +      inspect = Opal.inspect(ivar)
    +      ivs += " #{i}=#{inspect}"
    +    end
    +  end
    +  "#<#{self.class}:0x#{id.to_s(16)}#{ivs}>"
    +rescue => e
    +  "#<#{self.class}:0x#{id.to_s(16)}>"
    +ensure
    +  `inspect_stack`.pop if pushed
    +end
    +
    +
    + +
    +

    + + #instance_of?(klass) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 320
    +
    +def instance_of?(klass)
    +  %x{
    +    if (!klass.$$is_class && !klass.$$is_module) {
    +      #{::Kernel.raise ::TypeError, 'class or module required'};
    +    }
    +
    +    return self.$$class === klass;
    +  }
    +end
    +
    +
    + +
    +

    + + #instance_variable_defined?(name) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +330
    +331
    +332
    +333
    +334
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 330
    +
    +def instance_variable_defined?(name)
    +  name = ::Opal.instance_variable_name!(name)
    +
    +  `Opal.hasOwnProperty.call(self, name.substr(1))`
    +end
    +
    +
    + +
    +

    + + #instance_variable_get(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 336
    +
    +def instance_variable_get(name)
    +  name = ::Opal.instance_variable_name!(name)
    +
    +  %x{
    +    var ivar = self[Opal.ivar(name.substr(1))];
    +
    +    return ivar == null ? nil : ivar;
    +  }
    +end
    +
    +
    + +
    +

    + + #instance_variable_set(name, value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 346
    +
    +def instance_variable_set(name, value)
    +  `$deny_frozen_access(self)`
    +
    +  name = ::Opal.instance_variable_name!(name)
    +
    +  `self[Opal.ivar(name.substr(1))] = value`
    +end
    +
    +
    + +
    +

    + + #instance_variablesObject + + + + + +

    + + + + +
    +
    +
    +
    +370
    +371
    +372
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 370
    +
    +def instance_variables
    +  %x{
    +    var result = [], name;
    +
    +    $each_ivar(self, function(name) {
    +      if (name.substr(-1) === '$') {
    +        name = name.slice(0, name.length - 1);
    +      }
    +      result.push('@' + name);
    +    });
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #Integer(value, base = undefined, exception: true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +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
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 385
    +
    +def Integer(value, base = undefined, exception: true)
    +  %x{
    +    var i, str, base_digits;
    +
    +    exception = $truthy(#{exception});
    +
    +    if (!value.$$is_string) {
    +      if (base !== undefined) {
    +        if (exception) {
    +          #{::Kernel.raise ::ArgumentError, 'base specified for non string value'}
    +        } else {
    +          return nil;
    +        }
    +      }
    +      if (value === nil) {
    +        if (exception) {
    +          #{::Kernel.raise ::TypeError, "can't convert nil into Integer"}
    +        } else {
    +          return nil;
    +        }
    +      }
    +      if (value.$$is_number) {
    +        if (value === Infinity || value === -Infinity || isNaN(value)) {
    +          if (exception) {
    +            #{::Kernel.raise ::FloatDomainError, value}
    +          } else {
    +            return nil;
    +          }
    +        }
    +        return Math.floor(value);
    +      }
    +      if (#{value.respond_to?(:to_int)}) {
    +        i = #{value.to_int};
    +        if (Opal.is_a(i, #{::Integer})) {
    +          return i;
    +        }
    +      }
    +      if (#{value.respond_to?(:to_i)}) {
    +        i = #{value.to_i};
    +        if (Opal.is_a(i, #{::Integer})) {
    +          return i;
    +        }
    +      }
    +
    +      if (exception) {
    +        #{::Kernel.raise ::TypeError, "can't convert #{value.class} into Integer"}
    +      } else {
    +        return nil;
    +      }
    +    }
    +
    +    if (value === "0") {
    +      return 0;
    +    }
    +
    +    if (base === undefined) {
    +      base = 0;
    +    } else {
    +      base = $coerce_to(base, #{::Integer}, 'to_int');
    +      if (base === 1 || base < 0 || base > 36) {
    +        if (exception) {
    +          #{::Kernel.raise ::ArgumentError, "invalid radix #{base}"}
    +        } else {
    +          return nil;
    +        }
    +      }
    +    }
    +
    +    str = value.toLowerCase();
    +
    +    str = str.replace(/(\d)_(?=\d)/g, '$1');
    +
    +    str = str.replace(/^(\s*[+-]?)(0[bodx]?)/, function (_, head, flag) {
    +      switch (flag) {
    +      case '0b':
    +        if (base === 0 || base === 2) {
    +          base = 2;
    +          return head;
    +        }
    +        // no-break
    +      case '0':
    +      case '0o':
    +        if (base === 0 || base === 8) {
    +          base = 8;
    +          return head;
    +        }
    +        // no-break
    +      case '0d':
    +        if (base === 0 || base === 10) {
    +          base = 10;
    +          return head;
    +        }
    +        // no-break
    +      case '0x':
    +        if (base === 0 || base === 16) {
    +          base = 16;
    +          return head;
    +        }
    +        // no-break
    +      }
    +      if (exception) {
    +        #{::Kernel.raise ::ArgumentError, "invalid value for Integer(): \"#{value}\""}
    +      } else {
    +        return nil;
    +      }
    +    });
    +
    +    base = (base === 0 ? 10 : base);
    +
    +    base_digits = '0-' + (base <= 10 ? base - 1 : '9a-' + String.fromCharCode(97 + (base - 11)));
    +
    +    if (!(new RegExp('^\\s*[+-]?[' + base_digits + ']+\\s*$')).test(str)) {
    +      if (exception) {
    +        #{::Kernel.raise ::ArgumentError, "invalid value for Integer(): \"#{value}\""}
    +      } else {
    +        return nil;
    +      }
    +    }
    +
    +    i = parseInt(str, base);
    +
    +    if (isNaN(i)) {
    +      if (exception) {
    +        #{::Kernel.raise ::ArgumentError, "invalid value for Integer(): \"#{value}\""}
    +      } else {
    +        return nil;
    +      }
    +    }
    +
    +    return i;
    +  }
    +end
    +
    +
    + +
    +

    + + #is_a?(klass) ⇒ Boolean + + + + Also known as: + kind_of? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +567
    +568
    +569
    +570
    +571
    +572
    +573
    +574
    +575
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 567
    +
    +def is_a?(klass)
    +  %x{
    +    if (!klass.$$is_class && !klass.$$is_module) {
    +      #{::Kernel.raise ::TypeError, 'class or module required'};
    +    }
    +
    +    return Opal.is_a(self, klass);
    +  }
    +end
    +
    +
    + +
    +

    + + #itselfObject + + + + + +

    + + + + +
    +
    +
    +
    +577
    +578
    +579
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 577
    +
    +def itself
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +581
    +582
    +583
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 581
    +
    +def lambda(&block)
    +  `Opal.lambda(block)`
    +end
    +
    +
    + +
    +

    + + #load(file) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +585
    +586
    +587
    +588
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 585
    +
    +def load(file)
    +  file = ::Opal.coerce_to!(file, ::String, :to_str)
    +  `Opal.load(#{file})`
    +end
    +
    +
    + +
    +

    + + #loopObject + + + + + +

    + + + + +
    +
    +
    +
    +590
    +591
    +592
    +593
    +594
    +595
    +596
    +597
    +598
    +599
    +600
    +601
    +602
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 590
    +
    +def loop
    +  return enum_for(:loop) { ::Float::INFINITY } unless block_given?
    +
    +  while true
    +    begin
    +      yield
    +    rescue ::StopIteration => e
    +      return e.result
    +    end
    +  end
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #method(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 33
    +
    +def method(name)
    +  %x{
    +    var meth = self[$jsid(name)];
    +
    +    if (!meth || meth.$$stub) {
    +      #{::Kernel.raise ::NameError.new("undefined method `#{name}' for class `#{self.class}'", name)};
    +    }
    +
    +    return #{::Method.new(self, `meth.$$owner || #{self.class}`, `meth`, name)};
    +  }
    +end
    +
    +
    + +
    +

    + + #methods(all = true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 45
    +
    +def methods(all = true)
    +  %x{
    +    if ($truthy(#{all})) {
    +      return Opal.methods(self);
    +    } else {
    +      return Opal.own_methods(self);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #nil?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +604
    +605
    +606
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 604
    +
    +def nil?
    +  false
    +end
    +
    +
    + +
    +

    + + #open(*args, &block) ⇒ Object + + + + + +

    +
    +

    basic implementation of open, delegate to File.open

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +837
    +838
    +839
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 837
    +
    +def open(*args, &block)
    +  ::File.open(*args, &block)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +630
    +631
    +632
    +633
    +634
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 630
    +
    +def p(*args)
    +  args.each { |obj| $stdout.puts obj.inspect }
    +
    +  args.length <= 1 ? args[0] : args
    +end
    +
    +
    + +
    + + + + + +
    +
    +
    +
    +636
    +637
    +638
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 636
    +
    +def print(*strs)
    +  $stdout.print(*strs)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +608
    +609
    +610
    +611
    +612
    +613
    +614
    +615
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 608
    +
    +def printf(*args)
    +  return if args.empty?
    +
    +  io = `args[0].$$is_string` ? $stdout : args.shift
    +  io.write format(*args)
    +
    +  nil
    +end
    +
    +
    + +
    +

    + + #private_methods(*methods) ⇒ Object + + + + Also known as: + protected_methods, private_instance_methods, protected_instance_methods + + + + +

    + + + + +
    +
    +
    +
    +95
    +96
    +97
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 95
    +
    +def private_methods(*methods)
    +  []
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +617
    +618
    +619
    +620
    +621
    +622
    +623
    +624
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 617
    +
    +def proc(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to create Proc object without a block'
    +  end
    +
    +  `block.$$is_lambda = false`
    +  block
    +end
    +
    +
    + +
    +

    + + #public_methods(all = true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 55
    +
    +def public_methods(all = true)
    +  %x{
    +    if ($truthy(#{all})) {
    +      return Opal.methods(self);
    +    } else {
    +      return Opal.receiver_methods(self);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #puts(*strs) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +626
    +627
    +628
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 626
    +
    +def puts(*strs)
    +  $stdout.puts(*strs)
    +end
    +
    +
    + +
    +

    + + #raise(exception = undefined, string = nil, backtrace = nil) ⇒ Object + + + + Also known as: + fail + + + + +

    + + + + +
    +
    +
    +
    +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
    +688
    +689
    +690
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 656
    +
    +def raise(exception = undefined, string = nil, backtrace = nil)
    +  %x{
    +    if (exception == null && #{$!} !== nil) {
    +      throw #{$!};
    +    }
    +    if (exception == null) {
    +      exception = #{::RuntimeError.new ''};
    +    }
    +    else if ($respond_to(exception, '$to_str')) {
    +      exception = #{::RuntimeError.new exception.to_str};
    +    }
    +    // using respond_to? and not an undefined check to avoid method_missing matching as true
    +    else if (exception.$$is_class && $respond_to(exception, '$exception')) {
    +      exception = #{exception.exception string};
    +    }
    +    else if (exception.$$is_exception) {
    +      // exception is fine
    +    }
    +    else {
    +      exception = #{::TypeError.new 'exception class/object expected'};
    +    }
    +
    +    if (backtrace !== nil) {
    +      exception.$set_backtrace(backtrace);
    +    }
    +
    +    if (#{$!} !== nil) {
    +      Opal.exceptions.push(#{$!});
    +    }
    +
    +    #{$!} = exception;
    +
    +    throw exception;
    +  }
    +end
    +
    +
    + +
    +

    + + #rand(max = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +692
    +693
    +694
    +695
    +696
    +697
    +698
    +699
    +700
    +701
    +702
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 692
    +
    +def rand(max = undefined)
    +  %x{
    +    if (max === undefined) {
    +      return #{::Random::DEFAULT.rand};
    +    }
    +
    +    if (max.$$is_number) {
    +      if (max < 0) {
    +        max = Math.abs(max);
    +      }
    +
    +      if (max % 1 !== 0) {
    +        max = max.$to_i();
    +      }
    +
    +      if (max === 0) {
    +        max = undefined;
    +      }
    +    }
    +  }
    +  ::Random::DEFAULT.rand(max)
    +end
    +
    +
    + +
    +

    + + #Rational(numerator, denominator = 1) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +2
    +3
    +4
    +
    +
    # File 'opal/opal/corelib/rational/base.rb', line 2
    +
    +def Rational(numerator, denominator = 1)
    +  ::Rational.convert(numerator, denominator)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +640
    +641
    +642
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 640
    +
    +def readline(*args)
    +  $stdin.readline(*args)
    +end
    +
    +
    + +
    +

    + + #remove_instance_variable(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 354
    +
    +def remove_instance_variable(name)
    +  name = ::Opal.instance_variable_name!(name)
    +
    +  %x{
    +    var key = Opal.ivar(name.substr(1)),
    +        val;
    +    if (self.hasOwnProperty(key)) {
    +      val = self[key];
    +      delete self[key];
    +      return val;
    +    }
    +  }
    +
    +  ::Kernel.raise ::NameError, "instance variable #{name} not defined"
    +end
    +
    +
    + +
    +

    + + #require(file) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +737
    +738
    +739
    +740
    +741
    +742
    +743
    +744
    +745
    +746
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 737
    +
    +def require(file)
    +  %x{
    +    // As Object.require refers to Kernel.require once Kernel has been loaded the String
    +    // class may not be available yet, the coercion requires both  String and Array to be loaded.
    +    if (typeof #{file} !== 'string' && Opal.String && Opal.Array) {
    +      #{file = ::Opal.coerce_to!(file, ::String, :to_str) }
    +    }
    +    return Opal.require(#{file})
    +  }
    +end
    +
    +
    + +
    +

    + + #require_relative(file) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +748
    +749
    +750
    +751
    +752
    +753
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 748
    +
    +def require_relative(file)
    +  ::Opal.try_convert!(file, ::String, :to_str)
    +  file = ::File.expand_path ::File.join(`Opal.current_file`, '..', file)
    +
    +  `Opal.require(#{file})`
    +end
    +
    +
    + +
    +

    + + #require_tree(path, autoload: false) ⇒ Object + + + + + +

    +
    +

    path should be the full path to be found in registered modules (Opal.modules)

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +756
    +757
    +758
    +759
    +760
    +761
    +762
    +763
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 756
    +
    +def require_tree(path, autoload: false)
    +  %x{
    +    var result = [];
    +
    +    path = #{::File.expand_path(path)}
    +    path = Opal.normalize(path);
    +    if (path === '.') path = '';
    +    for (var name in Opal.modules) {
    +      if (#{`name`.start_with?(path)}) {
    +        if(!#{autoload}) {
    +          result.push([name, Opal.require(name)]);
    +        } else {
    +          result.push([name, true]); // do nothing, delegated to a autoloading
    +        }
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #respond_to?(name, include_all = false) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +715
    +716
    +717
    +718
    +719
    +720
    +721
    +722
    +723
    +724
    +725
    +726
    +727
    +728
    +729
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 715
    +
    +def respond_to?(name, include_all = false)
    +  %x{
    +    var body = self[$jsid(name)];
    +
    +    if (typeof(body) === "function" && !body.$$stub) {
    +      return true;
    +    }
    +
    +    if (self['$respond_to_missing?'].$$pristine === true) {
    +      return false;
    +    } else {
    +      return #{respond_to_missing?(name, include_all)};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #respond_to_missing?(method_name, include_all = false) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +731
    +732
    +733
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 731
    +
    +def respond_to_missing?(method_name, include_all = false)
    +  false
    +end
    +
    +
    + +
    +

    + + #singleton_classObject + + + + + +

    + + + + +
    +
    +
    +
    +777
    +778
    +779
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 777
    +
    +def singleton_class
    +  `Opal.get_singleton_class(self)`
    +end
    +
    +
    + +
    +

    + + #sleep(seconds = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +781
    +782
    +783
    +784
    +785
    +786
    +787
    +788
    +789
    +790
    +791
    +792
    +793
    +794
    +795
    +796
    +797
    +798
    +799
    +800
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 781
    +
    +def sleep(seconds = nil)
    +  %x{
    +    if (seconds === nil) {
    +      #{::Kernel.raise ::TypeError, "can't convert NilClass into time interval"}
    +    }
    +    if (!seconds.$$is_number) {
    +      #{::Kernel.raise ::TypeError, "can't convert #{seconds.class} into time interval"}
    +    }
    +    if (seconds < 0) {
    +      #{::Kernel.raise ::ArgumentError, 'time interval must be positive'}
    +    }
    +    var get_time = Opal.global.performance ?
    +      function() {return performance.now()} :
    +      function() {return new Date()}
    +
    +    var t = get_time();
    +    while (get_time() - t <= seconds * 1000);
    +    return Math.round(seconds);
    +  }
    +end
    +
    +
    + +
    +

    + + #srand(seed = Random.new_seed) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +802
    +803
    +804
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 802
    +
    +def srand(seed = Random.new_seed)
    +  ::Random.srand(seed)
    +end
    +
    +
    + +
    +

    + + #String(str) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +806
    +807
    +808
    +809
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 806
    +
    +def String(str)
    +  ::Opal.coerce_to?(str, ::String, :to_str) ||
    +    ::Opal.coerce_to!(str, ::String, :to_s)
    +end
    +
    +
    + +
    +

    + + #taintObject + + + + + +

    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +49
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 46
    +
    +def taint
    +  `handle_unsupported_feature(ERROR)`
    +  self
    +end
    +
    +
    + +
    +

    + + #tainted?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +56
    +57
    +58
    +59
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 56
    +
    +def tainted?
    +  `handle_unsupported_feature(ERROR)`
    +  false
    +end
    +
    +
    + +
    +

    + + #tap {|_self| ... } ⇒ Object + + + + + +

    +
    + + +
    +
    +
    + +

    Yields:

    +
      + +
    • + + + (_self) + + + +
    • + +
    +

    Yield Parameters:

    +
      + +
    • + + _self + + + (Kernel) + + + + — +

      the object that the method was called on

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +811
    +812
    +813
    +814
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 811
    +
    +def tap(&block)
    +  yield self
    +  self
    +end
    +
    +
    + +
    +

    + + #throw(tag, obj = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +832
    +833
    +834
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 832
    +
    +def throw(tag, obj = nil)
    +  ::Kernel.raise ::UncaughtThrowError.new(tag, obj)
    +end
    +
    +
    + +
    +

    + + #to_procObject + + + + + +

    + + + + +
    +
    +
    +
    +816
    +817
    +818
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 816
    +
    +def to_proc
    +  self
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +820
    +821
    +822
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 820
    +
    +def to_s
    +  "#<#{self.class}:0x#{__id__.to_s(16)}>"
    +end
    +
    +
    + +
    +

    + + #untaintObject + + + + + +

    + + + + +
    +
    +
    +
    +51
    +52
    +53
    +54
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 51
    +
    +def untaint
    +  `handle_unsupported_feature(ERROR)`
    +  self
    +end
    +
    +
    + +
    +

    + + #warn(*strs, uplevel: nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +644
    +645
    +646
    +647
    +648
    +649
    +650
    +651
    +652
    +653
    +654
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 644
    +
    +def warn(*strs, uplevel: nil)
    +  if uplevel
    +    uplevel = ::Opal.coerce_to!(uplevel, ::Integer, :to_str)
    +    ::Kernel.raise ::ArgumentError, "negative level (#{uplevel})" if uplevel < 0
    +    location = caller(uplevel + 1, 1).first&.split(':in `')&.first
    +    location = "#{location}: " if location
    +    strs = strs.map { |s| "#{location}warning: #{s}" }
    +  end
    +
    +  $stderr.puts(*strs) unless $VERBOSE.nil? || strs.empty?
    +end
    +
    +
    + +
    +

    + + #yield_self {|_self| ... } ⇒ Object + + + + Also known as: + then + + + + +

    +
    + + +
    +
    +
    + +

    Yields:

    +
      + +
    • + + + (_self) + + + +
    • + +
    +

    Yield Parameters:

    +
      + +
    • + + _self + + + (Kernel) + + + + — +

      the object that the method was called on

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +841
    +842
    +843
    +844
    +
    +
    # File 'opal/opal/corelib/kernel.rb', line 841
    +
    +def yield_self
    +  return enum_for(:yield_self) { 1 } unless block_given?
    +  yield self
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/KeyError.html b/docs/api/v1.8.2/corelib/KeyError.html new file mode 100644 index 00000000..894d9d56 --- /dev/null +++ b/docs/api/v1.8.2/corelib/KeyError.html @@ -0,0 +1,348 @@ + + + + + + + Exception: KeyError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: KeyError + + + +

    +
    + +
    +
    Inherits:
    +
    + IndexError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(message, receiver: nil, key: nil) ⇒ KeyError + + + + + +

    +
    +

    Returns a new instance of KeyError.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +304
    +305
    +306
    +307
    +308
    +
    +
    # File 'opal/opal/corelib/error.rb', line 304
    +
    +def initialize(message, receiver: nil, key: nil)
    +  super(message)
    +  @receiver = receiver
    +  @key = key
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #keyObject + + + + + +

    + + + + +
    +
    +
    +
    +314
    +315
    +316
    +
    +
    # File 'opal/opal/corelib/error.rb', line 314
    +
    +def key
    +  @key || ::Kernel.raise(::ArgumentError, 'no key is available')
    +end
    +
    +
    + +
    +

    + + #receiverObject + + + + + +

    + + + + +
    +
    +
    +
    +310
    +311
    +312
    +
    +
    # File 'opal/opal/corelib/error.rb', line 310
    +
    +def receiver
    +  @receiver || ::Kernel.raise(::ArgumentError, 'no receiver is available')
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/LoadError.html b/docs/api/v1.8.2/corelib/LoadError.html new file mode 100644 index 00000000..942d4803 --- /dev/null +++ b/docs/api/v1.8.2/corelib/LoadError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: LoadError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: LoadError + + + +

    +
    + +
    +
    Inherits:
    +
    + ScriptError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/LocalJumpError.html b/docs/api/v1.8.2/corelib/LocalJumpError.html new file mode 100644 index 00000000..33e017a5 --- /dev/null +++ b/docs/api/v1.8.2/corelib/LocalJumpError.html @@ -0,0 +1,380 @@ + + + + + + + Exception: LocalJumpError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: LocalJumpError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #exit_value ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute exit_value.

      +
      + +
    • + + +
    • + + + #reason ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute reason.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(message, exit_value = nil, reason = :noreason) ⇒ LocalJumpError + + + + + +

    +
    +

    Returns a new instance of LocalJumpError.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +322
    +323
    +324
    +325
    +326
    +
    +
    # File 'opal/opal/corelib/error.rb', line 322
    +
    +def initialize(message, exit_value = nil, reason = :noreason)
    +  super message
    +  @exit_value = exit_value
    +  @reason = reason
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #exit_valueObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute exit_value.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +320
    +321
    +322
    +
    +
    # File 'opal/opal/corelib/error.rb', line 320
    +
    +def exit_value
    +  @exit_value
    +end
    +
    +
    + + + +
    +

    + + #reasonObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute reason.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +320
    +321
    +322
    +
    +
    # File 'opal/opal/corelib/error.rb', line 320
    +
    +def reason
    +  @reason
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Marshal.html b/docs/api/v1.8.2/corelib/Marshal.html new file mode 100644 index 00000000..7de3db9c --- /dev/null +++ b/docs/api/v1.8.2/corelib/Marshal.html @@ -0,0 +1,268 @@ + + + + + + + Module: Marshal + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Marshal + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/marshal/read_buffer.rb,
    + opal/opal/corelib/marshal.rb,
    opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + +

    Overview

    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    MAJOR_VERSION = + +
    +
    4
    + +
    MINOR_VERSION = + +
    +
    8
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .dump(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +9
    +10
    +11
    +
    +
    # File 'opal/opal/corelib/marshal.rb', line 9
    +
    +def dump(object)
    +  self::WriteBuffer.new(object).write
    +end
    +
    +
    + +
    +

    + + .load(marshaled) ⇒ Object + + + + Also known as: + restore + + + + +

    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/marshal.rb', line 13
    +
    +def load(marshaled)
    +  self::ReadBuffer.new(marshaled).read
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Marshal.self/ReadBuffer.html b/docs/api/v1.8.2/corelib/Marshal.self/ReadBuffer.html new file mode 100644 index 00000000..9d61bd48 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Marshal.self/ReadBuffer.html @@ -0,0 +1,2857 @@ + + + + + + + Class: Marshal.self::ReadBuffer + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Marshal.self::ReadBuffer + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/marshal/read_buffer.rb
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #buffer ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute buffer.

      +
      + +
    • + + +
    • + + + #index ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute index.

      +
      + +
    • + + +
    • + + + #object_cache ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute object_cache.

      +
      + +
    • + + +
    • + + + #symbols_cache ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute symbols_cache.

      +
      + +
    • + + +
    • + + + #version ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute version.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(input) ⇒ ReadBuffer + + + + + +

    +
    +

    Returns a new instance of ReadBuffer.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 25
    +
    +def initialize(input)
    +  @buffer = `stringToBytes(#{input.to_s})`
    +  @index = 0
    +  major = read_byte
    +  minor = read_byte
    +  if major != MAJOR_VERSION || minor != MINOR_VERSION
    +    ::Kernel.raise ::TypeError, "incompatible marshal file format (can't be read)"
    +  end
    +  @version = "#{major}.#{minor}"
    +  @object_cache = []
    +  @symbols_cache = []
    +  @ivars = []
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #bufferObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute buffer.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 23
    +
    +def buffer
    +  @buffer
    +end
    +
    +
    + + + +
    +

    + + #indexObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute index.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 23
    +
    +def index
    +  @index
    +end
    +
    +
    + + + +
    +

    + + #object_cacheObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute object_cache.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 23
    +
    +def object_cache
    +  @object_cache
    +end
    +
    +
    + + + +
    +

    + + #symbols_cacheObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute symbols_cache.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 23
    +
    +def symbols_cache
    +  @symbols_cache
    +end
    +
    +
    + + + +
    +

    + + #versionObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute version.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 23
    +
    +def version
    +  @version
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #lengthObject + + + + + +

    + + + + +
    +
    +
    +
    +39
    +40
    +41
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 39
    +
    +def length
    +  @buffer.length
    +end
    +
    +
    + +
    +

    + + #read(cache: true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 43
    +
    +def read(cache: true)
    +  code = read_char
    +  # The first character indicates the type of the object
    +  case code
    +  when '0'
    +    nil
    +  when 'T'
    +    true
    +  when 'F'
    +    false
    +  when 'i'
    +    read_fixnum
    +  when 'f'
    +    read_float
    +  when 'l'
    +    read_bignum
    +  when '"'
    +    read_string
    +  when ':'
    +    read_symbol
    +  when ';'
    +    read_cached_symbol
    +  when '['
    +    read_array
    +  when '{'
    +    read_hash
    +  when '}'
    +    read_hashdef
    +  when '/'
    +    read_regexp
    +  when 'S'
    +    read_struct
    +  when 'c'
    +    read_class
    +  when 'm'
    +    read_module
    +  when 'o'
    +    read_object
    +  when '@'
    +    read_cached_object
    +  when 'e'
    +    read_extended_object
    +  when 'I'
    +    read_primitive_with_ivars
    +  when 'C'
    +    read_user_class
    +  when 'u'
    +    read_user_defined
    +  when 'U'
    +    read_user_marshal
    +  when 'M'
    +    ::Kernel.raise ::NotImplementedError, 'ModuleOld type cannot be demarshaled yet' # read_module_old
    +  when 'd'
    +    ::Kernel.raise ::NotImplementedError, 'Data type cannot be demarshaled'
    +  else
    +    ::Kernel.raise ::ArgumentError, 'dump format error'
    +  end
    +end
    +
    +
    + +
    +

    + + #read_arrayObject + + + + + +

    +
    +

    Reads and returns an array from an input stream

    + +

    is encoded as + '[', 3, 100, 200, 300

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    [100, 200, 300]
    + +
    + + +
    + + + + +
    +
    +
    +
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 245
    +
    +def read_array
    +  result = []
    +  @object_cache << result
    +  length = read_fixnum
    +  %x{
    +    if (length > 0) {
    +      while (result.length < length) {
    +        result.push(#{read});
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #read_bignumObject + + + + + +

    +
    +

    Reads and returns Bignum from an input stream

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 174
    +
    +def read_bignum
    +  sign = read_char == '-' ? -1 : 1
    +  size = read_fixnum * 2
    +  result = 0
    +  (0...size).each do |exp|
    +    result += read_char.ord * 2**(exp * 8)
    +  end
    +  result = result.to_i * sign
    +  @object_cache << result
    +  result
    +end
    +
    +
    + +
    +

    + + #read_byteObject + + + + + +

    + + + + +
    +
    +
    +
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 102
    +
    +def read_byte
    +  if @index >= length
    +    ::Kernel.raise ::ArgumentError, 'marshal data too short'
    +  end
    +  result = @buffer[@index]
    +  @index += 1
    +  result
    +end
    +
    +
    + +
    +

    + + #read_cached_objectObject + + + + + +

    +
    +

    Reads an object that was cached previously by its link

    + +

    is encoded as + [obj1, @1, obj2, @2, obj3, @3]

    + +

    NOTE: array itself is cached as @0, that's why obj1 is cached a @1, obj2 is @2, etc.

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    obj1 = Object.new
    +obj2 = Object.new
    +obj3 = Object.new
    +[obj1, obj1, obj2, obj2, obj3, obj3]
    + +
    + + +
    + + + + +
    +
    +
    +
    +423
    +424
    +425
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 423
    +
    +def read_cached_object
    +  object_cache[read_fixnum]
    +end
    +
    +
    + +
    +

    + + #read_cached_symbolObject + + + + + +

    +
    +

    Reads a symbol that was previously cache by its link

    + +

    Is encoded as + '[', 6, :a, @0, :b, @1, :c, @2

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    [:a, :a, :b, :b, :c, :c]
    + +
    + + +
    + + + + +
    +
    +
    +
    +234
    +235
    +236
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 234
    +
    +def read_cached_symbol
    +  symbols_cache[read_fixnum]
    +end
    +
    +
    + +
    +

    + + #read_charObject + + + + + +

    + + + + +
    +
    +
    +
    +111
    +112
    +113
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 111
    +
    +def read_char
    +  `String.fromCharCode(#{read_byte})`
    +end
    +
    +
    + +
    +

    + + #read_classObject + + + + + +

    +
    +

    Reads and returns a Class from an input stream

    + +

    is encoded as + 'c', 'String'

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    String
    + +
    + + +
    + + + + +
    +
    +
    +
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 347
    +
    +def read_class
    +  klass_name = read_string(cache: false)
    +  result = safe_const_get(klass_name)
    +  unless result.class == ::Class
    +    ::Kernel.raise ::ArgumentError, "#{klass_name} does not refer to a Class"
    +  end
    +  @object_cache << result
    +  result
    +end
    +
    +
    + +
    +

    + + #read_extended_objectObject + + + + + +

    +
    +

    Reads an object that was dynamically extended before marshaling like

    + +

    is encoded as + 'e', :M2, :M1, obj

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    M1 = Module.new
    +M2 = Module.new
    +obj = Object.new
    +obj.extend(M1)
    +obj.extend(M2)
    +obj
    + +
    + + +
    + + + + +
    +
    +
    +
    +439
    +440
    +441
    +442
    +443
    +444
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 439
    +
    +def read_extended_object
    +  mod = safe_const_get(read)
    +  object = read
    +  object.extend(mod)
    +  object
    +end
    +
    +
    + +
    +

    + + #read_fixnumObject + + + + + +

    +
    +

    Reads and returns a fixnum from an input stream

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 117
    +
    +def read_fixnum
    +  %x{
    +    var x, i, c = (#{read_byte} ^ 128) - 128;
    +    if (c === 0) {
    +      return 0;
    +    }
    +
    +    if (c > 0) {
    +      if (4 < c && c < 128) {
    +        return c - 5;
    +      }
    +      x = 0;
    +      for (i = 0; i < c; i++) {
    +        x |= (#{read_byte} << (8*i));
    +      }
    +    } else {
    +      if (-129 < c && c < -4) {
    +        return c + 5;
    +      }
    +
    +      c = -c;
    +      x = -1;
    +
    +      for (i = 0; i < c; i++) {
    +        x &= ~(0xff << (8*i));
    +        x |= (#{read_byte} << (8*i));
    +      }
    +    }
    +
    +    return x;
    +  }
    +end
    +
    +
    + +
    +

    + + #read_floatObject + + + + + +

    +
    +

    Reads and returns Float from an input stream

    + +

    Is encoded as + 'f', '123.456'

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    123.456
    + +
    + + +
    + + + + +
    +
    +
    +
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 157
    +
    +def read_float
    +  s = read_string(cache: false)
    +  result = if s == 'nan'
    +             0.0 / 0
    +           elsif s == 'inf'
    +             1.0 / 0
    +           elsif s == '-inf'
    +             -1.0 / 0
    +           else
    +             s.to_f
    +           end
    +  @object_cache << result
    +  result
    +end
    +
    +
    + +
    +

    + + #read_hash(cache: true) ⇒ Object + + + + + +

    +
    +

    Reads and returns a hash from an input stream +Sometimes hash shouldn't be cached using +an internal object cache, for a:

    + +
      +
    • hash of instance variables
    • +
    • hash of struct attributes
    • +
    + +

    is encoded as + '{', 2, 100, 200, 300, 400

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    {100 => 200, 300 => 400}
    + +
    + + +
    + + + + +
    +
    +
    +
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 271
    +
    +def read_hash(cache: true)
    +  result = {}
    +
    +  if cache
    +    @object_cache << result
    +  end
    +
    +  length = read_fixnum
    +  %x{
    +    if (length > 0) {
    +      var key, value, i;
    +      for (i = 0; i < #{length}; i++) {
    +        key = #{read};
    +        value = #{read};
    +        #{result[`key`] = `value`};
    +      }
    +    }
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #read_hashdefObject + + + + + +

    +
    +

    Reads and returns a hash with default value

    + +

    is encoded as + '}', 1, 100, 200, :default

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    Hash.new(:default).merge(100 => 200)
    + +
    + + +
    + + + + +
    +
    +
    +
    +299
    +300
    +301
    +302
    +303
    +304
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 299
    +
    +def read_hashdef
    +  hash = read_hash
    +  default_value = read
    +  hash.default = default_value
    +  hash
    +end
    +
    +
    + +
    +

    + + #read_moduleObject + + + + + +

    +
    +

    Reads and returns a Module from an input stream

    + +

    is encoded as + 'm', 'Kernel'

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    Kernel
    + +
    + + +
    + + + + +
    +
    +
    +
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +372
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 364
    +
    +def read_module
    +  mod_name = read_string(cache: false)
    +  result = safe_const_get(mod_name)
    +  unless result.class == ::Module
    +    ::Kernel.raise ::ArgumentError, "#{mod_name} does not refer to a Module"
    +  end
    +  @object_cache << result
    +  result
    +end
    +
    +
    + +
    +

    + + #read_objectObject + + + + + +

    +
    +

    Reads and returns an abstract object from an input stream

    + +

    is encoded as + 'o', :Object, => 100

    + +

    The only exception is a Range class (and its subclasses) +For some reason in MRI isntances of this class have instance variables

    + +
      +
    • begin
    • +
    • end
    • +
    • excl +without '@' perfix.
    • +
    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    obj = Object.new
    +obj.instance_variable_set(:@ivar, 100)
    +obj
    + +
    + + +
    + + + + +
    +
    +
    +
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 390
    +
    +def read_object
    +  klass_name = read(cache: false)
    +  klass = safe_const_get(klass_name)
    +
    +  object = klass.allocate
    +  @object_cache << object
    +
    +  ivars = read_hash(cache: false)
    +  ivars.each do |name, value|
    +    if name[0] == '@'
    +      object.instance_variable_set(name, value)
    +    else
    +      # MRI allows an object to have ivars that do not start from '@'
    +      # https://github.com/ruby/ruby/blob/ab3a40c1031ff3a0535f6bcf26de40de37dbb1db/range.c#L1225
    +      `object[name] = value`
    +    end
    +  end
    +
    +  object
    +end
    +
    +
    + +
    +

    + + #read_primitive_with_ivarsObject + + + + + +

    +
    +

    Reads a primitive object with instance variables +(classes that have their own marshalling rules, like Array/Hash/Regexp/etc)

    + +

    is encoded as + 'I', [100, 200, 300], => value

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    arr = [100, 200, 300]
    +arr.instance_variable_set(:@ivar, :value)
    +arr
    + +
    + + +
    + + + + +
    +
    +
    +
    +456
    +457
    +458
    +459
    +460
    +461
    +462
    +463
    +464
    +465
    +466
    +467
    +468
    +469
    +470
    +471
    +472
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 456
    +
    +def read_primitive_with_ivars
    +  object = read
    +
    +  primitive_ivars = read_hash(cache: false)
    +
    +  if primitive_ivars.any? && object.is_a?(String)
    +    object = `new String(object)`
    +  end
    +
    +  primitive_ivars.each do |name, value|
    +    if name != 'E'
    +      object.instance_variable_set(name, value)
    +    end
    +  end
    +
    +  object
    +end
    +
    +
    + +
    +

    + + #read_regexpObject + + + + + +

    +
    +

    Reads and returns Regexp from an input stream

    + +

    is encoded as + '/', 'regexp', r.options.chr

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    r = /regexp/mix
    + +
    + + +
    + + + + +
    +
    +
    +
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 313
    +
    +def read_regexp
    +  string = read_string(cache: false)
    +  options = read_byte
    +
    +  result = ::Regexp.new(string, options)
    +  @object_cache << result
    +  result
    +end
    +
    +
    + +
    +

    + + #read_string(cache: true) ⇒ Object + + + + + +

    +
    +

    Reads and returns a string from an input stream +Sometimes string shouldn't be cached using +an internal object cache, for a:

    + +
      +
    • class/module name
    • +
    • string representation of float
    • +
    • string representation of regexp
    • +
    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 193
    +
    +def read_string(cache: true)
    +  length = read_fixnum
    +  %x{
    +    var i, result = '';
    +
    +    for (i = 0; i < length; i++) {
    +      result += #{read_char};
    +    }
    +
    +    if (cache) {
    +      self.object_cache.push(result);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #read_structObject + + + + + +

    +
    +

    Reads and returns a Struct from an input stream

    + +

    is encoded as + 'S', :Point, => 100, :y => 200

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    Point = Struct.new(:x, :y)
    +Point.new(100, 200)
    + +
    + + +
    + + + + +
    +
    +
    +
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 330
    +
    +def read_struct
    +  klass_name = read(cache: false)
    +  klass = safe_const_get(klass_name)
    +  attributes = read_hash(cache: false)
    +  args = attributes.values_at(*klass.members)
    +  result = klass.new(*args)
    +  @object_cache << result
    +  result
    +end
    +
    +
    + +
    +

    + + #read_symbolObject + + + + + +

    +
    +

    Reads and returns a symbol from an input stream

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 212
    +
    +def read_symbol
    +  length = read_fixnum
    +  %x{
    +    var i, result = '';
    +
    +    for (i = 0; i < length; i++) {
    +      result += #{read_char};
    +    }
    +
    +    self.symbols_cache.push(result);
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #read_user_classObject + + + + + +

    +
    +

    Reads and User Class (instance of String/Regexp/Array/Hash subclass)

    + +

    is encoded as + 'C', :UserArray, [100, 200, 300]

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    UserArray = Class.new(Array)
    +UserArray[100, 200, 300]
    + +
    + + +
    + + + + +
    +
    +
    +
    +482
    +483
    +484
    +485
    +486
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 482
    +
    +def read_user_class
    +  klass_name = read(cache: false)
    +  klass = safe_const_get(klass_name)
    +  value = read(cache: false)
    +
    +  result = if klass < Hash
    +             klass[value]
    +           else
    +             klass.new(value)
    +           end
    +
    +  @object_cache << result
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #read_user_definedObject + + + + + +

    +
    +

    Reads a 'User Defined' object that has '_dump/self._load' methods

    + +

    is encoded as + 'u', :UserDefined, '_dumped'

    + +

    To load it back UserDefined._load' must be used.

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    class UserDefined
    +  def _dump(level)
    +    '_dumped'
    +  end
    +end
    +
    +UserDefined.new
    + +
    + + +
    + + + + +
    +
    +
    +
    +513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +522
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 513
    +
    +def read_user_defined
    +  klass_name = read(cache: false)
    +  klass = safe_const_get(klass_name)
    +  data = read_string(cache: false)
    +  result = klass._load(data)
    +
    +  @object_cache << result
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #read_user_marshalObject + + + + + +

    +
    +

    Reads a 'User Marshal' object that has 'marshal_dump/marshal_load' methods

    + +

    is encoded as + 'U', :UserMarshal, [100, 200]

    + +

    To load it back UserMarshal.allocate and UserMarshal#marshal_load must be called

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    class UserMarshal < Struct.new(:a, :b)
    +  def marshal_dump
    +    [a, b]
    +  end
    +
    +  def marshal_load(data)
    +    self.a, self.b = data
    +  end
    +end
    +
    +UserMarshal.new(100, 200)
    + +
    + + +
    + + + + +
    +
    +
    +
    +543
    +544
    +545
    +546
    +547
    +548
    +549
    +550
    +551
    +552
    +553
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 543
    +
    +def read_user_marshal
    +  klass_name = read(cache: false)
    +  klass = safe_const_get(klass_name)
    +
    +  result = klass.allocate
    +  @object_cache << result
    +
    +  data = read(cache: false)
    +  result.marshal_load(data)
    +  result
    +end
    +
    +
    + +
    +

    + + #safe_const_get(const_name) ⇒ Object + + + + + +

    +
    +

    Returns a constant by passed const_name, + re-raises Marshal-specific error when it's missing

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +558
    +559
    +560
    +561
    +562
    +
    +
    # File 'opal/opal/corelib/marshal/read_buffer.rb', line 558
    +
    +def safe_const_get(const_name)
    +  ::Object.const_get(const_name)
    +rescue ::NameError
    +  ::Kernel.raise ::ArgumentError, "undefined class/module #{const_name}"
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Marshal.self/WriteBuffer.html b/docs/api/v1.8.2/corelib/Marshal.self/WriteBuffer.html new file mode 100644 index 00000000..c47de498 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Marshal.self/WriteBuffer.html @@ -0,0 +1,1697 @@ + + + + + + + Class: Marshal.self::WriteBuffer + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Marshal.self::WriteBuffer + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/marshal/write_buffer.rb
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #buffer ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute buffer.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(object) ⇒ WriteBuffer + + + + + +

    +
    +

    Returns a new instance of WriteBuffer.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 195
    +
    +def initialize(object)
    +  @object = object
    +  @buffer = ''
    +  @cache = []
    +  @extends = ::Hash.new { |h, k| h[k] = [] }
    +  append(version)
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #bufferObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute buffer.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +185
    +186
    +187
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 185
    +
    +def buffer
    +  @buffer
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #append(s) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +411
    +412
    +413
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 411
    +
    +def append(s)
    +  `#{@buffer} += #{s}`
    +end
    +
    +
    + +
    +

    + + #append_symbol(sym) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +288
    +289
    +290
    +291
    +292
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 288
    +
    +def append_symbol(sym)
    +  append(':')
    +  write_fixnum(sym.length)
    +  append(sym)
    +end
    +
    +
    + +
    + + + + + +
    +
    +
    +
    +375
    +376
    +377
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 375
    +
    +def save_link(object)
    +  @cache << object.object_id
    +end
    +
    +
    + +
    +

    + + #versionObject + + + + + +

    + + + + +
    +
    +
    +
    +415
    +416
    +417
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 415
    +
    +def version
    +  `String.fromCharCode(#{MAJOR_VERSION}, #{MINOR_VERSION})`
    +end
    +
    +
    + +
    +

    + + #write(object = @object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 203
    +
    +def write(object = @object)
    +  if idx = @cache.index(object.object_id)
    +    write_object_link(idx)
    +  elsif object.respond_to?(:marshal_dump)
    +    write_usr_marshal(object)
    +  elsif object.respond_to?(:_dump)
    +    write_userdef(object)
    +  else
    +    case object
    +    when nil, true, false, ::Proc, ::Method, ::MatchData, ::Range, ::Struct,
    +         ::Array, ::Class, ::Module, ::Hash, ::Regexp
    +      object.__marshal__(self)
    +    when ::Integer
    +      ::Integer.instance_method(:__marshal__).bind(object).call(self)
    +    when ::Float
    +      ::Float.instance_method(:__marshal__).bind(object).call(self)
    +    when ::String
    +      ::String.instance_method(:__marshal__).bind(object).call(self)
    +    else
    +      ::BasicObject.instance_method(:__marshal__).bind(object).call(self)
    +    end
    +  end
    +
    +  `binaryString(#{@buffer})`
    +end
    +
    +
    + +
    +

    + + #write_array(a) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +294
    +295
    +296
    +297
    +298
    +299
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 294
    +
    +def write_array(a)
    +  write_fixnum(a.length)
    +  a.each do |item|
    +    write(item)
    +  end
    +end
    +
    +
    + +
    +

    + + #write_bignum(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 263
    +
    +def write_bignum(n)
    +  sign = n > 0 ? '+' : '-'
    +  append(sign)
    +
    +  num = n > 0 ? n : -n
    +
    +  arr = []
    +  while num > 0
    +    arr << (num & 0xffff)
    +    num = (num / 0x10000).floor
    +  end
    +
    +  write_fixnum(arr.size)
    +
    +  arr.each do |x|
    +    append(`String.fromCharCode(x & 0xff)`)
    +    append(`String.fromCharCode(#{(x / 0x100).floor})`)
    +  end
    +end
    +
    +
    + +
    +

    + + #write_class(klass) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +314
    +315
    +316
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 314
    +
    +def write_class(klass)
    +  write_string(klass.name)
    +end
    +
    +
    + +
    +

    + + #write_extends(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 351
    +
    +def write_extends(object)
    +  singleton_mods = object.singleton_class.ancestors.reject { |mod| mod.is_a?(Class) }
    +  class_mods = object.class.ancestors.reject { |mod| mod.is_a?(Class) }
    +  own_mods = singleton_mods - class_mods
    +  unless own_mods.empty?
    +    own_mods.each do |mod|
    +      append('e')
    +      append_symbol(mod.name)
    +    end
    +  end
    +end
    +
    +
    + +
    +

    + + #write_fixnum(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 229
    +
    +def write_fixnum(n)
    +  %x{
    +    var s;
    +
    +    if (n == 0) {
    +      s = String.fromCharCode(n);
    +    } else if (n > 0 && n < 123) {
    +      s = String.fromCharCode(n + 5);
    +    } else if (n < 0 && n > -124) {
    +      s = String.fromCharCode(256 + n - 5);
    +    } else {
    +      s = "";
    +      var cnt = 0;
    +      for (var i = 0; i < 4; i++) {
    +        var b = n & 255;
    +        s += String.fromCharCode(b);
    +        n >>= 8
    +        cnt += 1;
    +        if (n === 0 || n === -1) {
    +          break;
    +        }
    +      }
    +      var l_byte;
    +      if (n < 0) {
    +        l_byte = 256 - cnt;
    +      } else {
    +        l_byte = cnt;
    +      }
    +      s = String.fromCharCode(l_byte) + s;
    +    }
    +    #{append(`s`)}
    +  }
    +end
    +
    +
    + +
    +

    + + #write_float(f) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 327
    +
    +def write_float(f)
    +  if f.equal?(::Float::INFINITY)
    +    write_string('inf')
    +  elsif f.equal?(-::Float::INFINITY)
    +    write_string('-inf')
    +  elsif f.equal?(::Float::NAN)
    +    write_string('nan')
    +  else
    +    write_string(f.to_s)
    +  end
    +end
    +
    +
    + +
    +

    + + #write_hash(h) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 301
    +
    +def write_hash(h)
    +  write_fixnum(h.length)
    +  h.each do |key, value|
    +    write(key)
    +    write(value)
    +  end
    +end
    +
    +
    + +
    +

    + + #write_ivars_prefix(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +405
    +406
    +407
    +408
    +409
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 405
    +
    +def write_ivars_prefix(object)
    +  unless object.instance_variables.empty?
    +    append('I')
    +  end
    +end
    +
    +
    + +
    +

    + + #write_ivars_suffix(object, force = false) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 339
    +
    +def write_ivars_suffix(object, force = false)
    +  if object.instance_variables.empty? && !force
    +    return
    +  end
    +
    +  write_fixnum(object.instance_variables.length)
    +  object.instance_variables.each do |ivar_name|
    +    append_symbol(ivar_name)
    +    write(object.instance_variable_get(ivar_name))
    +  end
    +end
    +
    +
    + +
    +

    + + #write_module(mod) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +318
    +319
    +320
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 318
    +
    +def write_module(mod)
    +  write_string(mod.name)
    +end
    +
    +
    + +
    +

    + + #write_object(obj) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +309
    +310
    +311
    +312
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 309
    +
    +def write_object(obj)
    +  append_symbol(obj.class.name)
    +  write_ivars_suffix(obj, true)
    +end
    +
    +
    + +
    + + + + + +
    +
    +
    +
    +370
    +371
    +372
    +373
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 370
    +
    +def write_object_link(idx)
    +  append('@')
    +  write_fixnum(idx)
    +end
    +
    +
    + +
    +

    + + #write_regexp(regexp) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +322
    +323
    +324
    +325
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 322
    +
    +def write_regexp(regexp)
    +  write_string(regexp.to_s)
    +  append(`String.fromCharCode(#{regexp.options})`)
    +end
    +
    +
    + +
    +

    + + #write_string(s) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +283
    +284
    +285
    +286
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 283
    +
    +def write_string(s)
    +  write_fixnum(s.length)
    +  append(s)
    +end
    +
    +
    + +
    +

    + + #write_user_class(klass, object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +363
    +364
    +365
    +366
    +367
    +368
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 363
    +
    +def write_user_class(klass, object)
    +  unless object.class.equal?(klass)
    +    append('C')
    +    append_symbol(object.class.name)
    +  end
    +end
    +
    +
    + +
    +

    + + #write_userdef(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 392
    +
    +def write_userdef(object)
    +  value = object._dump(0)
    +
    +  unless value.is_a?(::String)
    +    ::Kernel.raise ::TypeError, '_dump() must return string'
    +  end
    +
    +  write_ivars_prefix(value)
    +  append('u')
    +  append_symbol(object.class.name)
    +  write_string(value)
    +end
    +
    +
    + +
    +

    + + #write_usr_marshal(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 379
    +
    +def write_usr_marshal(object)
    +  value = object.marshal_dump
    +  klass = object.class
    +  append('U')
    +  namespace = `#{klass}.$$base_module`
    +  if namespace.equal?(::Object)
    +    append_symbol(`#{klass}.$$name`)
    +  else
    +    append_symbol(namespace.name + '::' + `#{klass}.$$name`)
    +  end
    +  write(value)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/MatchData.html b/docs/api/v1.8.2/corelib/MatchData.html new file mode 100644 index 00000000..e4527f00 --- /dev/null +++ b/docs/api/v1.8.2/corelib/MatchData.html @@ -0,0 +1,1543 @@ + + + + + + + Class: MatchData + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: MatchData + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/marshal/write_buffer.rb,
    + opal/opal/corelib/regexp.rb
    +
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #post_match ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute post_match.

      +
      + +
    • + + +
    • + + + #pre_match ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute pre_match.

      +
      + +
    • + + +
    • + + + #regexp ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute regexp.

      +
      + +
    • + + +
    • + + + #string ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute string.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(regexp, match_groups, no_matchdata: false) ⇒ MatchData + + + + + +

    +
    +

    Returns a new instance of MatchData.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 315
    +
    +def initialize(regexp, match_groups, no_matchdata: false)
    +  $~          = self unless no_matchdata
    +  @regexp     = regexp
    +  @begin      = `match_groups.index`
    +  @string     = `match_groups.input`
    +  @pre_match  = `match_groups.input.slice(0, match_groups.index)`
    +  @post_match = `match_groups.input.slice(match_groups.index + match_groups[0].length)`
    +  @matches    = []
    +
    +  %x{
    +    for (var i = 0, length = match_groups.length; i < length; i++) {
    +      var group = match_groups[i];
    +
    +      if (group == null) {
    +        #{@matches}.push(nil);
    +      }
    +      else {
    +        #{@matches}.push(group);
    +      }
    +    }
    +  }
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #post_matchObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute post_match.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +313
    +314
    +315
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 313
    +
    +def post_match
    +  @post_match
    +end
    +
    +
    + + + +
    +

    + + #pre_matchObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute pre_match.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +313
    +314
    +315
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 313
    +
    +def pre_match
    +  @pre_match
    +end
    +
    +
    + + + +
    +

    + + #regexpObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute regexp.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +313
    +314
    +315
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 313
    +
    +def regexp
    +  @regexp
    +end
    +
    +
    + + + +
    +

    + + #stringObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute string.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +313
    +314
    +315
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 313
    +
    +def string
    +  @string
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + eql? + + + + +

    + + + + +
    +
    +
    +
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 373
    +
    +def ==(other)
    +  return false unless ::MatchData === other
    +
    +  `self.string == other.string` &&
    +    `self.regexp.toString() == other.regexp.toString()` &&
    +    `self.pre_match == other.pre_match` &&
    +    `self.post_match == other.post_match` &&
    +    `self.begin == other.begin`
    +end
    +
    +
    + +
    +

    + + #[](*args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 350
    +
    +def [](*args)
    +  %x{
    +    if (args[0].$$is_string) {
    +      if (#{!regexp.names.include?(args[0])}) {
    +        #{::Kernel.raise ::IndexError, "undefined group name reference: #{args[0]}"}
    +      }
    +      return #{named_captures[args[0]]}
    +    }
    +    else {
    +      return #{@matches[*args]}
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +109
    +110
    +111
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 109
    +
    +def __marshal__(buffer)
    +  ::Kernel.raise ::TypeError, "no _dump_data is defined for class #{self.class}"
    +end
    +
    +
    + +
    +

    + + #begin(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 383
    +
    +def begin(n)
    +  %x{
    +    if (n !== 0) {
    +      #{::Kernel.raise ::ArgumentError, 'MatchData#begin only supports 0th element'}
    +    }
    +    return self.begin;
    +  }
    +end
    +
    +
    + +
    +

    + + #capturesObject + + + + + +

    + + + + +
    +
    +
    +
    +401
    +402
    +403
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 401
    +
    +def captures
    +  `#{@matches}.slice(1)`
    +end
    +
    +
    + +
    +

    + + #end(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 392
    +
    +def end(n)
    +  %x{
    +    if (n !== 0) {
    +      #{::Kernel.raise ::ArgumentError, 'MatchData#end only supports 0th element'}
    +    }
    +    return self.begin + self.matches[n].length;
    +  }
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 416
    +
    +def inspect
    +  %x{
    +    var str = "#<MatchData " + #{`#{@matches}[0]`.inspect};
    +
    +    if (#{regexp.names.empty?}) {
    +      for (var i = 1, length = #{@matches}.length; i < length; i++) {
    +        str += " " + i + ":" + #{`#{@matches}[i]`.inspect};
    +      }
    +    }
    +    else {
    +      #{ named_captures.each do |k, v|
    +           %x{
    +             str += " " + #{k} + ":" + #{v.inspect}
    +           }
    +         end }
    +    }
    +
    +    return str + ">";
    +  }
    +end
    +
    +
    + +
    +

    + + #lengthObject + + + + Also known as: + size + + + + +

    + + + + +
    +
    +
    +
    +437
    +438
    +439
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 437
    +
    +def length
    +  `#{@matches}.length`
    +end
    +
    +
    + +
    +

    + + #match(idx) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 338
    +
    +def match(idx)
    +  if (match = self[idx])
    +    match
    +  elsif idx.is_a?(Integer) && idx >= length
    +    ::Kernel.raise ::IndexError, "index #{idx} out of matches"
    +  end
    +end
    +
    +
    + +
    +

    + + #match_length(idx) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +346
    +347
    +348
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 346
    +
    +def match_length(idx)
    +  match(idx)&.length
    +end
    +
    +
    + +
    +

    + + #named_capturesObject + + + + + +

    + + + + +
    +
    +
    +
    +405
    +406
    +407
    +408
    +409
    +410
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 405
    +
    +def named_captures
    +  matches = captures
    +  regexp.named_captures.transform_values do |i|
    +    matches[i.last - 1]
    +  end
    +end
    +
    +
    + +
    +

    + + #namesObject + + + + + +

    + + + + +
    +
    +
    +
    +412
    +413
    +414
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 412
    +
    +def names
    +  regexp.names
    +end
    +
    +
    + +
    +

    + + #offset(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 364
    +
    +def offset(n)
    +  %x{
    +    if (n !== 0) {
    +      #{::Kernel.raise ::ArgumentError, 'MatchData#offset only supports 0th element'}
    +    }
    +    return [self.begin, self.begin + self.matches[n].length];
    +  }
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + + +

    + + + + +
    +
    +
    +
    +441
    +442
    +443
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 441
    +
    +def to_a
    +  @matches
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +445
    +446
    +447
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 445
    +
    +def to_s
    +  `#{@matches}[0]`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 449
    +
    +def values_at(*args)
    +  %x{
    +    var i, a, index, values = [];
    +
    +    for (i = 0; i < args.length; i++) {
    +
    +      if (args[i].$$is_range) {
    +        a = #{`args[i]`.to_a};
    +        a.unshift(i, 1);
    +        Array.prototype.splice.apply(args, a);
    +      }
    +
    +      index = #{::Opal.coerce_to!(`args[i]`, ::Integer, :to_int)};
    +
    +      if (index < 0) {
    +        index += #{@matches}.length;
    +        if (index < 0) {
    +          values.push(nil);
    +          continue;
    +        }
    +      }
    +
    +      values.push(#{@matches}[index]);
    +    }
    +
    +    return values;
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Math.html b/docs/api/v1.8.2/corelib/Math.html new file mode 100644 index 00000000..618c6852 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Math.html @@ -0,0 +1,1133 @@ + + + + + + + Module: Math + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Math + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/math.rb
    +
    + +
    + +

    Overview

    +
    +

    helpers: type_error +backtick_javascript: true

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

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .atan2(y, x) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +105
    +106
    +107
    +
    +
    # File 'opal/opal/corelib/math.rb', line 105
    +
    +def atan2(y, x)
    +  ::Math.checked :atan2, ::Math.float!(y), ::Math.float!(x)
    +end
    +
    +
    + +
    +

    + + .checked(method, *args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +
    +
    # File 'opal/opal/corelib/math.rb', line 10
    +
    +def self.checked(method, *args)
    +  %x{
    +    if (isNaN(args[0]) || (args.length == 2 && isNaN(args[1]))) {
    +      return NaN;
    +    }
    +
    +    var result = Math[method].apply(null, args);
    +
    +    if (isNaN(result)) {
    +      #{::Kernel.raise DomainError, "Numerical argument is out of domain - \"#{method}\""};
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + .float!(value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +26
    +27
    +28
    +29
    +30
    +
    +
    # File 'opal/opal/corelib/math.rb', line 26
    +
    +def self.float!(value)
    +  ::Kernel.Float(value)
    +rescue ::ArgumentError
    +  ::Kernel.raise `$type_error(value, #{::Float})`
    +end
    +
    +
    + +
    +

    + + .frexp(x) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +
    +
    # File 'opal/opal/corelib/math.rb', line 113
    +
    +def frexp(x)
    +  x = Math.float!(x)
    +
    +  %x{
    +    if (isNaN(x)) {
    +      return [NaN, 0];
    +    }
    +
    +    var ex   = Math.floor(Math.log(Math.abs(x)) / Math.log(2)) + 1,
    +        frac = x / Math.pow(2, ex);
    +
    +    return [frac, ex];
    +  }
    +end
    +
    +
    + +
    +

    + + .gamma(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +181
    +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
    +
    +
    # File 'opal/opal/corelib/math.rb', line 128
    +
    +def gamma(n)
    +  n = Math.float!(n)
    +
    +  %x{
    +    var i, t, x, value, result, twoN, threeN, fourN, fiveN;
    +
    +    var G = 4.7421875;
    +
    +    var P = [
    +       0.99999999999999709182,
    +       57.156235665862923517,
    +      -59.597960355475491248,
    +       14.136097974741747174,
    +      -0.49191381609762019978,
    +       0.33994649984811888699e-4,
    +       0.46523628927048575665e-4,
    +      -0.98374475304879564677e-4,
    +       0.15808870322491248884e-3,
    +      -0.21026444172410488319e-3,
    +       0.21743961811521264320e-3,
    +      -0.16431810653676389022e-3,
    +       0.84418223983852743293e-4,
    +      -0.26190838401581408670e-4,
    +       0.36899182659531622704e-5
    +    ];
    +
    +
    +    if (isNaN(n)) {
    +      return NaN;
    +    }
    +
    +    if (n === 0 && 1 / n < 0) {
    +      return -Infinity;
    +    }
    +
    +    if (n === -1 || n === -Infinity) {
    +      #{::Kernel.raise DomainError, 'Numerical argument is out of domain - "gamma"'};
    +    }
    +
    +    if (#{Integer === n}) {
    +      if (n <= 0) {
    +        return isFinite(n) ? Infinity : NaN;
    +      }
    +
    +      if (n > 171) {
    +        return Infinity;
    +      }
    +
    +      value  = n - 2;
    +      result = n - 1;
    +
    +      while (value > 1) {
    +        result *= value;
    +        value--;
    +      }
    +
    +      if (result == 0) {
    +        result = 1;
    +      }
    +
    +      return result;
    +    }
    +
    +    if (n < 0.5) {
    +      return Math.PI / (Math.sin(Math.PI * n) * #{::Math.gamma(1 - n)});
    +    }
    +
    +    if (n >= 171.35) {
    +      return Infinity;
    +    }
    +
    +    if (n > 85.0) {
    +      twoN   = n * n;
    +      threeN = twoN * n;
    +      fourN  = threeN * n;
    +      fiveN  = fourN * n;
    +
    +      return Math.sqrt(2 * Math.PI / n) * Math.pow((n / Math.E), n) *
    +        (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) -
    +        571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) +
    +        5246819 / (75246796800 * fiveN * n));
    +    }
    +
    +    n -= 1;
    +    x  = P[0];
    +
    +    for (i = 1; i < P.length; ++i) {
    +      x += P[i] / (n + i);
    +    }
    +
    +    t = n + G + 0.5;
    +
    +    return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x;
    +  }
    +end
    +
    +
    + +
    +

    + + .hypot(x, y) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +109
    +110
    +111
    +
    +
    # File 'opal/opal/corelib/math.rb', line 109
    +
    +def hypot(x, y)
    +  ::Math.checked :hypot, ::Math.float!(x), ::Math.float!(y)
    +end
    +
    +
    + +
    +

    + + .integer!(value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +32
    +33
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/math.rb', line 32
    +
    +def self.integer!(value)
    +  ::Kernel.Integer(value)
    +rescue ::ArgumentError
    +  ::Kernel.raise `$type_error(value, #{::Integer})`
    +end
    +
    +
    + +
    +

    + + .ldexp(mantissa, exponent) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +
    +
    # File 'opal/opal/corelib/math.rb', line 224
    +
    +def ldexp(mantissa, exponent)
    +  mantissa = Math.float!(mantissa)
    +  exponent = Math.integer!(exponent)
    +
    +  %x{
    +    if (isNaN(exponent)) {
    +      #{::Kernel.raise ::RangeError, 'float NaN out of range of integer'};
    +    }
    +
    +    return mantissa * Math.pow(2, exponent);
    +  }
    +end
    +
    +
    + +
    +

    + + .lgamma(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +
    +
    # File 'opal/opal/corelib/math.rb', line 237
    +
    +def lgamma(n)
    +  %x{
    +    if (n == -1) {
    +      return [Infinity, 1];
    +    }
    +    else {
    +      return [Math.log(Math.abs(#{::Math.gamma(n)})), #{::Math.gamma(n)} < 0 ? -1 : 1];
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .log(x, base = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +
    +
    # File 'opal/opal/corelib/math.rb', line 248
    +
    +def log(x, base = undefined)
    +  if ::String === x
    +    ::Kernel.raise `$type_error(x, #{::Float})`
    +  end
    +
    +  if `base == null`
    +    ::Math.checked :log, ::Math.float!(x)
    +  else
    +    if ::String === base
    +      ::Kernel.raise `$type_error(base, #{::Float})`
    +    end
    +
    +    ::Math.checked(:log, ::Math.float!(x)) / ::Math.checked(:log, ::Math.float!(base))
    +  end
    +end
    +
    +
    + +
    +

    + + .log10(x) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +
    +
    # File 'opal/opal/corelib/math.rb', line 264
    +
    +def log10(x)
    +  if ::String === x
    +    ::Kernel.raise `$type_error(x, #{::Float})`
    +  end
    +
    +  ::Math.checked :log10, ::Math.float!(x)
    +end
    +
    +
    + +
    +

    + + .log2(x) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +
    +
    # File 'opal/opal/corelib/math.rb', line 272
    +
    +def log2(x)
    +  if ::String === x
    +    ::Kernel.raise `$type_error(x, #{::Float})`
    +  end
    +
    +  ::Math.checked :log2, ::Math.float!(x)
    +end
    +
    +
    + +
    +

    + + .tan(x) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +
    +
    # File 'opal/opal/corelib/math.rb', line 280
    +
    +def tan(x)
    +  x = ::Math.float!(x)
    +
    +  if x.infinite?
    +    return ::Float::NAN
    +  end
    +
    +  ::Math.checked :tan, ::Math.float!(x)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Method.html b/docs/api/v1.8.2/corelib/Method.html new file mode 100644 index 00000000..62dcf034 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Method.html @@ -0,0 +1,1099 @@ + + + + + + + Class: Method + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Method + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/method.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

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

    Instance Attribute Summary collapse

    +
      + +
    • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute name.

      +
      + +
    • + + +
    • + + + #owner ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute owner.

      +
      + +
    • + + +
    • + + + #receiver ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute receiver.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(receiver, owner, method, name) ⇒ Method + + + + + +

    +
    +

    Returns a new instance of Method.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +9
    +10
    +11
    +
    +
    # File 'opal/opal/corelib/method.rb', line 6
    +
    +def initialize(receiver, owner, method, name)
    +  @receiver = receiver
    +  @owner    = owner
    +  @name     = name
    +  @method   = method
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #nameObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute name.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +4
    +5
    +6
    +
    +
    # File 'opal/opal/corelib/method.rb', line 4
    +
    +def name
    +  @name
    +end
    +
    +
    + + + +
    +

    + + #ownerObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute owner.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +4
    +5
    +6
    +
    +
    # File 'opal/opal/corelib/method.rb', line 4
    +
    +def owner
    +  @owner
    +end
    +
    +
    + + + +
    +

    + + #receiverObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute receiver.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +4
    +5
    +6
    +
    +
    # File 'opal/opal/corelib/method.rb', line 4
    +
    +def receiver
    +  @receiver
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +45
    +46
    +47
    +
    +
    # File 'opal/opal/corelib/method.rb', line 45
    +
    +def <<(other)
    +  @method << other
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +41
    +42
    +43
    +
    +
    # File 'opal/opal/corelib/method.rb', line 41
    +
    +def >>(other)
    +  @method >> other
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +103
    +104
    +105
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 103
    +
    +def __marshal__(buffer)
    +  ::Kernel.raise ::TypeError, "no _dump_data is defined for class #{self.class}"
    +end
    +
    +
    + +
    +

    + + #arityObject + + + + + +

    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/method.rb', line 13
    +
    +def arity
    +  @method.arity
    +end
    +
    +
    + +
    +

    + + #call(*args, &block) ⇒ Object + + + + Also known as: + [], === + + + + +

    + + + + +
    +
    +
    +
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +
    +
    # File 'opal/opal/corelib/method.rb', line 29
    +
    +def call(*args, &block)
    +  %x{
    +    #{@method}.$$p = block;
    +
    +    return #{@method}.apply(#{@receiver}, args);
    +  }
    +end
    +
    +
    + +
    +

    + + #commentsObject + + + + + +

    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +
    +
    # File 'opal/opal/corelib/method.rb', line 25
    +
    +def comments
    +  `#{@method}.$$comments` || []
    +end
    +
    +
    + +
    +

    + + #curry(arity = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +37
    +38
    +39
    +
    +
    # File 'opal/opal/corelib/method.rb', line 37
    +
    +def curry(arity = undefined)
    +  @method.curry(arity)
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +64
    +65
    +66
    +
    +
    # File 'opal/opal/corelib/method.rb', line 64
    +
    +def inspect
    +  "#<#{self.class}: #{@receiver.class}##{@name} (defined in #{@owner} in #{source_location.join(':')})>"
    +end
    +
    +
    + +
    +

    + + #parametersObject + + + + + +

    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +
    +
    # File 'opal/opal/corelib/method.rb', line 17
    +
    +def parameters
    +  `#{@method}.$$parameters`
    +end
    +
    +
    + +
    +

    + + #source_locationObject + + + + + +

    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/method.rb', line 21
    +
    +def source_location
    +  `#{@method}.$$source_location` || ['(eval)', 0]
    +end
    +
    +
    + +
    +

    + + #to_procObject + + + + + +

    + + + + +
    +
    +
    +
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +
    +
    # File 'opal/opal/corelib/method.rb', line 53
    +
    +def to_proc
    +  %x{
    +    var proc = self.$call.bind(self);
    +    proc.$$unbound = #{@method};
    +    proc.$$is_lambda = true;
    +    proc.$$arity = #{@method}.$$arity == null ? #{@method}.length : #{@method}.$$arity;
    +    proc.$$parameters = #{@method}.$$parameters;
    +    return proc;
    +  }
    +end
    +
    +
    + +
    +

    + + #unbindObject + + + + + +

    + + + + +
    +
    +
    +
    +49
    +50
    +51
    +
    +
    # File 'opal/opal/corelib/method.rb', line 49
    +
    +def unbind
    +  ::UnboundMethod.new(@receiver.class, @owner, @method, @name)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Module.html b/docs/api/v1.8.2/corelib/Module.html new file mode 100644 index 00000000..d0398323 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Module.html @@ -0,0 +1,5203 @@ + + + + + + + Class: Module + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Module + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/module.rb,
    + opal/opal/corelib/unsupported.rb,
    opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    helpers: truthy, coerce_to, const_set, Object, return_ivar, assign_ivar, ivar, deny_frozen_access, freeze, prop, jsid, each_ivar +backtick_javascript: true

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    Refinement

    +
    + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(&block) ⇒ Module + + + + + +

    +
    +

    Returns a new instance of Module.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +30
    +31
    +32
    +
    +
    # File 'opal/opal/corelib/module.rb', line 30
    +
    +def initialize(&block)
    +  module_eval(&block) if block_given?
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +
    +
    # File 'opal/opal/corelib/module.rb', line 21
    +
    +def self.allocate
    +  %x{
    +    var module = Opal.allocate_module(nil, function(){});
    +    // Link the prototype of Module subclasses
    +    if (self !== Opal.Module) Object.setPrototypeOf(module, self.$$prototype);
    +    return module;
    +  }
    +end
    +
    +
    + +
    +

    + + .constants(inherit = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +
    +
    # File 'opal/opal/corelib/module.rb', line 294
    +
    +def self.constants(inherit = undefined)
    +  %x{
    +    if (inherit == null) {
    +      var nesting = (self.$$nesting || []).concat($Object),
    +          constant, constants = {},
    +          i, ii;
    +
    +      for(i = 0, ii = nesting.length; i < ii; i++) {
    +        for (constant in nesting[i].$$const) {
    +          constants[constant] = true;
    +        }
    +      }
    +      return Object.keys(constants);
    +    } else {
    +      return Opal.constants(self, inherit)
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .nestingObject + + + + + +

    + + + + +
    +
    +
    +
    +313
    +314
    +315
    +
    +
    # File 'opal/opal/corelib/module.rb', line 313
    +
    +def self.nesting
    +  `self.$$nesting || []`
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +
    +
    # File 'opal/opal/corelib/module.rb', line 40
    +
    +def <(other)
    +  unless ::Module === other
    +    ::Kernel.raise ::TypeError, 'compared with non class/module'
    +  end
    +
    +  # class cannot be a descendant of itself
    +  %x{
    +    var working = self,
    +        ancestors,
    +        i, length;
    +
    +    if (working === other) {
    +      return false;
    +    }
    +
    +    for (i = 0, ancestors = Opal.ancestors(self), length = ancestors.length; i < length; i++) {
    +      if (ancestors[i] === other) {
    +        return true;
    +      }
    +    }
    +
    +    for (i = 0, ancestors = Opal.ancestors(other), length = ancestors.length; i < length; i++) {
    +      if (ancestors[i] === self) {
    +        return false;
    +      }
    +    }
    +
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +71
    +72
    +73
    +
    +
    # File 'opal/opal/corelib/module.rb', line 71
    +
    +def <=(other)
    +  equal?(other) || self < other
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +
    +
    # File 'opal/opal/corelib/module.rb', line 87
    +
    +def <=>(other)
    +  %x{
    +    if (self === other) {
    +      return 0;
    +    }
    +  }
    +
    +  unless ::Module === other
    +    return nil
    +  end
    +
    +  lt = self < other
    +  return nil if lt.nil?
    +  lt ? -1 : 1
    +end
    +
    +
    + +
    +

    + + #===(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +34
    +35
    +36
    +37
    +38
    +
    +
    # File 'opal/opal/corelib/module.rb', line 34
    +
    +def ===(object)
    +  return false if `object == null`
    +
    +  `Opal.is_a(object, self)`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +
    +
    # File 'opal/opal/corelib/module.rb', line 75
    +
    +def >(other)
    +  unless ::Module === other
    +    ::Kernel.raise ::TypeError, 'compared with non class/module'
    +  end
    +
    +  other < self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +83
    +84
    +85
    +
    +
    # File 'opal/opal/corelib/module.rb', line 83
    +
    +def >=(other)
    +  equal?(other) || self > other
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 115
    +
    +def __marshal__(buffer)
    +  unless name
    +    ::Kernel.raise ::TypeError, "can't dump anonymous module"
    +  end
    +
    +  buffer.save_link(self)
    +  buffer.append('m')
    +  buffer.write_module(self)
    +end
    +
    +
    + +
    +

    + + #alias_method(newname, oldname) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +
    +
    # File 'opal/opal/corelib/module.rb', line 103
    +
    +def alias_method(newname, oldname)
    +  `$deny_frozen_access(self)`
    +
    +  newname = `$coerce_to(newname, #{::String}, 'to_str')`
    +  oldname = `$coerce_to(oldname, #{::String}, 'to_str')`
    +  `Opal.alias(self, newname, oldname)`
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #alias_native(mid, jsid = mid) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +
    +
    # File 'opal/opal/corelib/module.rb', line 113
    +
    +def alias_native(mid, jsid = mid)
    +  `$deny_frozen_access(self)`
    +
    +  `Opal.alias_native(self, mid, jsid)`
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #ancestorsObject + + + + + +

    + + + + +
    +
    +
    +
    +121
    +122
    +123
    +
    +
    # File 'opal/opal/corelib/module.rb', line 121
    +
    +def ancestors
    +  `Opal.ancestors(self)`
    +end
    +
    +
    + +
    +

    + + #append_features(includer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +125
    +126
    +127
    +128
    +129
    +130
    +
    +
    # File 'opal/opal/corelib/module.rb', line 125
    +
    +def append_features(includer)
    +  `$deny_frozen_access(includer)`
    +
    +  `Opal.append_features(self, includer)`
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +
    +
    # File 'opal/opal/corelib/module.rb', line 137
    +
    +def attr(*args)
    +  %x{
    +    if (args.length == 2 && (args[1] === true || args[1] === false)) {
    +      #{warn 'optional boolean argument is obsoleted', uplevel: 1}
    +
    +      args[1] ? #{attr_accessor(`args[0]`)} : #{attr_reader(`args[0]`)};
    +      return nil;
    +    }
    +  }
    +
    +  attr_reader(*args)
    +end
    +
    +
    + +
    +

    + + #attr_accessor(*names) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +132
    +133
    +134
    +135
    +
    +
    # File 'opal/opal/corelib/module.rb', line 132
    +
    +def attr_accessor(*names)
    +  attr_reader(*names)
    +  attr_writer(*names)
    +end
    +
    +
    + +
    +

    + + #attr_reader(*names) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/module.rb', line 150
    +
    +def attr_reader(*names)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var proto = self.$$prototype;
    +
    +    for (var i = names.length - 1; i >= 0; i--) {
    +      var name = names[i],
    +          id   = $jsid(name),
    +          ivar = $ivar(name);
    +
    +      var body = $return_ivar(ivar);
    +
    +      // initialize the instance variable as nil
    +      Opal.prop(proto, ivar, nil);
    +
    +      body.$$parameters = [];
    +      body.$$arity = 0;
    +
    +      Opal.defn(self, id, body);
    +    }
    +  }
    +
    +  nil
    +end
    +
    +
    + +
    +

    + + #attr_writer(*names) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +
    +
    # File 'opal/opal/corelib/module.rb', line 176
    +
    +def attr_writer(*names)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    var proto = self.$$prototype;
    +
    +    for (var i = names.length - 1; i >= 0; i--) {
    +      var name = names[i],
    +          id   = $jsid(name + '='),
    +          ivar = $ivar(name);
    +
    +      var body = $assign_ivar(ivar)
    +
    +      body.$$parameters = [['req']];
    +      body.$$arity = 1;
    +
    +      // initialize the instance variable as nil
    +      Opal.prop(proto, ivar, nil);
    +
    +      Opal.defn(self, id, body);
    +    }
    +  }
    +
    +  nil
    +end
    +
    +
    + +
    +

    + + #autoload(const, path) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/module.rb', line 202
    +
    +def autoload(const, path)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    if (!#{Opal.const_name?(const)}) {
    +      #{::Kernel.raise ::NameError, "autoload must be constant name: #{const}"}
    +    }
    +
    +    if (path == "") {
    +      #{::Kernel.raise ::ArgumentError, 'empty file name'}
    +    }
    +
    +    if (!self.$$const.hasOwnProperty(#{const})) {
    +      if (!self.$$autoload) {
    +        self.$$autoload = {};
    +      }
    +      Opal.const_cache_version++;
    +      self.$$autoload[#{const}] = { path: #{path}, loaded: false, required: false, success: false, exception: false };
    +
    +      if (self.$const_added && !self.$const_added.$$pristine) {
    +        self.$const_added(#{const});
    +      }
    +    }
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

    + + #autoload?(const) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +
    +
    # File 'opal/opal/corelib/module.rb', line 229
    +
    +def autoload?(const)
    +  %x{
    +    if (self.$$autoload && self.$$autoload[#{const}] && !self.$$autoload[#{const}].required && !self.$$autoload[#{const}].success) {
    +      return self.$$autoload[#{const}].path;
    +    }
    +
    +    var ancestors = self.$ancestors();
    +
    +    for (var i = 0, length = ancestors.length; i < length; i++) {
    +      if (ancestors[i].$$autoload && ancestors[i].$$autoload[#{const}] && !ancestors[i].$$autoload[#{const}].required && !ancestors[i].$$autoload[#{const}].success) {
    +        return ancestors[i].$$autoload[#{const}].path;
    +      }
    +    }
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

    + + #class_variable_defined?(name) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +264
    +265
    +266
    +267
    +268
    +
    +
    # File 'opal/opal/corelib/module.rb', line 264
    +
    +def class_variable_defined?(name)
    +  name = ::Opal.class_variable_name!(name)
    +
    +  `Opal.class_variables(self).hasOwnProperty(name)`
    +end
    +
    +
    + +
    +

    + + #class_variable_get(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +250
    +251
    +252
    +253
    +254
    +
    +
    # File 'opal/opal/corelib/module.rb', line 250
    +
    +def class_variable_get(name)
    +  name = ::Opal.class_variable_name!(name)
    +
    +  `Opal.class_variable_get(self, name, false)`
    +end
    +
    +
    + +
    +

    + + #class_variable_set(name, value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +
    +
    # File 'opal/opal/corelib/module.rb', line 256
    +
    +def class_variable_set(name, value)
    +  `$deny_frozen_access(self)`
    +
    +  name = ::Opal.class_variable_name!(name)
    +
    +  `Opal.class_variable_set(self, name, value)`
    +end
    +
    +
    + +
    +

    + + #class_variablesObject + + + + + +

    + + + + +
    +
    +
    +
    +246
    +247
    +248
    +
    +
    # File 'opal/opal/corelib/module.rb', line 246
    +
    +def class_variables
    +  `Object.keys(Opal.class_variables(self))`
    +end
    +
    +
    + +
    +

    + + #const_added(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +270
    +271
    +
    +
    # File 'opal/opal/corelib/module.rb', line 270
    +
    +def const_added(name)
    +end
    +
    +
    + +
    +

    + + #const_defined?(name, inherit = true) ⇒ Boolean + + + + + +

    +
    +

    check for constant within current scope +if inherit is true or self is Object, will also check ancestors

    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +
    +
    # File 'opal/opal/corelib/module.rb', line 319
    +
    +def const_defined?(name, inherit = true)
    +  name = Opal.const_name!(name)
    +
    +  ::Kernel.raise ::NameError.new("wrong constant name #{name}", name) unless name =~ ::Opal::CONST_NAME_REGEXP
    +
    +  %x{
    +    var module, modules = [self], module_constants, i, ii;
    +
    +    // Add up ancestors if inherit is true
    +    if (inherit) {
    +      modules = modules.concat(Opal.ancestors(self));
    +
    +      // Add Object's ancestors if it's a module – modules have no ancestors otherwise
    +      if (self.$$is_module) {
    +        modules = modules.concat([$Object]).concat(Opal.ancestors($Object));
    +      }
    +    }
    +
    +    for (i = 0, ii = modules.length; i < ii; i++) {
    +      module = modules[i];
    +      if (module.$$const[#{name}] != null) { return true; }
    +      if (
    +        module.$$autoload &&
    +        module.$$autoload[#{name}] &&
    +        !module.$$autoload[#{name}].required &&
    +        !module.$$autoload[#{name}].success
    +      ) {
    +        return true;
    +      }
    +    }
    +
    +    return false;
    +  }
    +end
    +
    +
    + +
    +

    + + #const_get(name, inherit = true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +372
    +373
    +374
    +375
    +376
    +
    +
    # File 'opal/opal/corelib/module.rb', line 354
    +
    +def const_get(name, inherit = true)
    +  name = Opal.const_name!(name)
    +
    +  %x{
    +    if (name.indexOf('::') === 0 && name !== '::'){
    +      name = name.slice(2);
    +    }
    +  }
    +
    +  if `name.indexOf('::') != -1 && name != '::'`
    +    return name.split('::').inject(self) { |o, c| o.const_get(c) }
    +  end
    +
    +  ::Kernel.raise ::NameError.new("wrong constant name #{name}", name) unless name =~ ::Opal::CONST_NAME_REGEXP
    +
    +  %x{
    +    if (inherit) {
    +      return Opal.$$([self], name);
    +    } else {
    +      return Opal.const_get_local(self, name);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #const_missing(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +378
    +379
    +380
    +381
    +382
    +
    +
    # File 'opal/opal/corelib/module.rb', line 378
    +
    +def const_missing(name)
    +  full_const_name = self == ::Object ? name : "#{self}::#{name}"
    +
    +  ::Kernel.raise ::NameError.new("uninitialized constant #{full_const_name}", name)
    +end
    +
    +
    + +
    +

    + + #const_set(name, value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +
    +
    # File 'opal/opal/corelib/module.rb', line 384
    +
    +def const_set(name, value)
    +  `$deny_frozen_access(self)`
    +
    +  name = ::Opal.const_name!(name)
    +
    +  if name !~ ::Opal::CONST_NAME_REGEXP || name.start_with?('::')
    +    ::Kernel.raise ::NameError.new("wrong constant name #{name}", name)
    +  end
    +
    +  `$const_set(self, name, value)`
    +
    +  value
    +end
    +
    +
    + +
    +

    + + #constants(inherit = true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +290
    +291
    +292
    +
    +
    # File 'opal/opal/corelib/module.rb', line 290
    +
    +def constants(inherit = true)
    +  `Opal.constants(self, inherit)`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +803
    +804
    +805
    +806
    +807
    +808
    +809
    +
    +
    # File 'opal/opal/corelib/module.rb', line 803
    +
    +def copy_class_variables(other)
    +  %x{
    +    for (var name in other.$$cvars) {
    +      self.$$cvars[name] = other.$$cvars[name];
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +811
    +812
    +813
    +814
    +815
    +816
    +817
    +818
    +819
    +
    +
    # File 'opal/opal/corelib/module.rb', line 811
    +
    +def copy_constants(other)
    +  %x{
    +    var name, other_constants = other.$$const;
    +
    +    for (name in other_constants) {
    +      $const_set(self, name, other_constants[name]);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #define_method(name, method = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    +457
    +458
    +459
    +460
    +461
    +462
    +463
    +464
    +465
    +
    +
    # File 'opal/opal/corelib/module.rb', line 401
    +
    +def define_method(name, method = undefined, &block)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    if (method === undefined && block === nil)
    +      #{::Kernel.raise ::ArgumentError, 'tried to create a Proc object without a block'}
    +
    +    name = ensure_symbol_or_string(name);
    +  }
    +
    +  if `method !== undefined`
    +    block = case method
    +            when ::Proc
    +              method
    +
    +            when ::Method
    +              `#{method.to_proc}.$$unbound`
    +
    +            when ::UnboundMethod
    +              `Opal.wrap_method_body(method.$$method)`
    +
    +            else
    +              ::Kernel.raise ::TypeError, "wrong argument type #{method.class} (expected Proc/Method/UnboundMethod)"
    +            end
    +
    +    if `!method.$$is_proc`
    +      owner = method.owner
    +      if `owner.$$is_class` && !(self <= owner) # rubocop:disable Style/InverseMethods
    +        message = `owner.$$is_singleton` ? "can't bind singleton method to a different class" : "bind argument must be a subclass of #{owner}"
    +        ::Kernel.raise ::TypeError, message
    +      end
    +    end
    +  end
    +
    +  %x{
    +    if (typeof(Proxy) !== 'undefined') {
    +      var meta = Object.create(null)
    +
    +      block.$$proxy_target = block
    +      block = new Proxy(block, {
    +        apply: function(target, self, args) {
    +          var old_name = target.$$jsid, old_lambda = target.$$is_lambda;
    +          target.$$jsid = name;
    +          target.$$is_lambda = true;
    +          try {
    +            return target.apply(self, args);
    +          } catch(e) {
    +            if (e === target.$$brk || e === target.$$ret) return e.$v;
    +            throw e;
    +          } finally {
    +            target.$$jsid = old_name;
    +            target.$$is_lambda = old_lambda;
    +          }
    +        }
    +      })
    +    }
    +
    +    block.$$jsid        = name;
    +    block.$$s           = null;
    +    block.$$def         = block;
    +    block.$$define_meth = true;
    +
    +    return Opal.defn(self, $jsid(name), block);
    +  }
    +end
    +
    +
    + +
    +

    + + #extend_object(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +565
    +566
    +567
    +568
    +
    +
    # File 'opal/opal/corelib/module.rb', line 565
    +
    +def extend_object(object)
    +  `$deny_frozen_access(object)`
    +  nil
    +end
    +
    +
    + +
    +

    + + #extended(mod) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +562
    +563
    +
    +
    # File 'opal/opal/corelib/module.rb', line 562
    +
    +def extended(mod)
    +end
    +
    +
    + +
    +

    + + #freezeObject + + + + + +

    + + + + +
    +
    +
    +
    +467
    +468
    +469
    +470
    +471
    +472
    +473
    +474
    +475
    +476
    +477
    +478
    +
    +
    # File 'opal/opal/corelib/module.rb', line 467
    +
    +def freeze
    +  # Specialized version of freeze, because the $$base_module property needs to be
    +  # accessible despite the frozen status
    +
    +  return self if frozen?
    +
    +  %x{
    +    if (!self.hasOwnProperty('$$base_module')) { $prop(self, '$$base_module', null); }
    +
    +    return $freeze(self);
    +  }
    +end
    +
    +
    + +
    +

    + + #include(*mods) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +508
    +509
    +510
    +511
    +512
    +
    +
    # File 'opal/opal/corelib/module.rb', line 497
    +
    +def include(*mods)
    +  %x{
    +    for (var i = mods.length - 1; i >= 0; i--) {
    +      var mod = mods[i];
    +
    +      if (!mod.$$is_module) {
    +        #{::Kernel.raise ::TypeError, "wrong argument type #{`mod`.class} (expected Module)"};
    +      }
    +
    +      #{`mod`.append_features self};
    +      #{`mod`.included self};
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #include?(mod) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +
    +
    # File 'opal/opal/corelib/module.rb', line 518
    +
    +def include?(mod)
    +  %x{
    +    if (!mod.$$is_module) {
    +      #{::Kernel.raise ::TypeError, "wrong argument type #{`mod`.class} (expected Module)"};
    +    }
    +
    +    var i, ii, mod2, ancestors = Opal.ancestors(self);
    +
    +    for (i = 0, ii = ancestors.length; i < ii; i++) {
    +      mod2 = ancestors[i];
    +      if (mod2 === mod && mod2 !== self) {
    +        return true;
    +      }
    +    }
    +
    +    return false;
    +  }
    +end
    +
    +
    + +
    +

    + + #included(mod) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +559
    +560
    +
    +
    # File 'opal/opal/corelib/module.rb', line 559
    +
    +def included(mod)
    +end
    +
    +
    + +
    +

    + + #included_modulesObject + + + + + +

    + + + + +
    +
    +
    +
    +514
    +515
    +516
    +
    +
    # File 'opal/opal/corelib/module.rb', line 514
    +
    +def included_modules
    +  `Opal.included_modules(self)`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +786
    +787
    +788
    +789
    +790
    +791
    +792
    +793
    +794
    +795
    +
    +
    # File 'opal/opal/corelib/module.rb', line 786
    +
    +def initialize_copy(other)
    +  %x{
    +    copyInstanceMethods(other, self);
    +    copyIncludedModules(other, self);
    +    copyPrependedModules(other, self);
    +    self.$$cloned_from = other.$$cloned_from.concat(other);
    +  }
    +  copy_class_variables(other)
    +  copy_constants(other)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +797
    +798
    +799
    +800
    +801
    +
    +
    # File 'opal/opal/corelib/module.rb', line 797
    +
    +def initialize_dup(other)
    +  super
    +  # Unlike other classes, Module's singleton methods are copied on Object#dup.
    +  copy_singleton_methods(other)
    +end
    +
    +
    + +
    +

    + + #instance_method(name) ⇒ Object + + + + Also known as: + public_instance_method + + + + +

    + + + + +
    +
    +
    +
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +
    +
    # File 'opal/opal/corelib/module.rb', line 537
    +
    +def instance_method(name)
    +  %x{
    +    var meth = self.$$prototype[$jsid(name)];
    +
    +    if (!meth || meth.$$stub) {
    +      #{::Kernel.raise ::NameError.new("undefined method `#{name}' for class `#{self.name}'", name)};
    +    }
    +
    +    return #{::UnboundMethod.new(self, `meth.$$owner || #{self}`, `meth`, name)};
    +  }
    +end
    +
    +
    + +
    +

    + + #instance_methods(include_super = true) ⇒ Object + + + + Also known as: + public_instance_methods + + + + +

    + + + + +
    +
    +
    +
    +549
    +550
    +551
    +552
    +553
    +554
    +555
    +556
    +557
    +
    +
    # File 'opal/opal/corelib/module.rb', line 549
    +
    +def instance_methods(include_super = true)
    +  %x{
    +    if ($truthy(#{include_super})) {
    +      return Opal.instance_methods(self);
    +    } else {
    +      return Opal.own_instance_methods(self);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #instance_variablesObject + + + + + +

    + + + + +
    +
    +
    +
    +742
    +743
    +744
    +745
    +746
    +747
    +748
    +749
    +750
    +751
    +752
    +753
    +754
    +755
    +
    +
    # File 'opal/opal/corelib/module.rb', line 742
    +
    +def instance_variables
    +  consts = constants
    +  %x{
    +    var result = [];
    +
    +    $each_ivar(self, function(name) {
    +      if (name !== 'constructor' && !#{consts.include?(`name`)}) {
    +        result.push('@' + name);
    +      }
    +    });
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #method_addedObject + + + + + +

    + + + + +
    +
    +
    +
    +570
    +571
    +
    +
    # File 'opal/opal/corelib/module.rb', line 570
    +
    +def method_added(*)
    +end
    +
    +
    + +
    +

    + + #method_defined?(method) ⇒ Boolean + + + + Also known as: + public_method_defined? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +623
    +624
    +625
    +626
    +627
    +628
    +
    +
    # File 'opal/opal/corelib/module.rb', line 623
    +
    +def method_defined?(method)
    +  %x{
    +    var body = self.$$prototype[$jsid(method)];
    +    return (!!body) && !body.$$stub;
    +  }
    +end
    +
    +
    + +
    +

    + + #method_removedObject + + + + + +

    + + + + +
    +
    +
    +
    +573
    +574
    +
    +
    # File 'opal/opal/corelib/module.rb', line 573
    +
    +def method_removed(*)
    +end
    +
    +
    + +
    +

    + + #method_undefinedObject + + + + + +

    + + + + +
    +
    +
    +
    +576
    +577
    +
    +
    # File 'opal/opal/corelib/module.rb', line 576
    +
    +def method_undefined(*)
    +end
    +
    +
    + +
    +

    + + #module_eval(*args, &block) ⇒ Object + + + + Also known as: + class_eval + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/module.rb', line 579
    +
    +def module_eval(*args, &block)
    +  if block.nil? && `!!Opal.compile`
    +    ::Kernel.raise ::ArgumentError, 'wrong number of arguments (0 for 1..3)' unless (1..3).cover? args.size
    +
    +    string, file, _lineno = *args
    +    default_eval_options = { file: (file || '(eval)'), eval: true }
    +    compiling_options = __OPAL_COMPILER_CONFIG__.merge(default_eval_options)
    +    compiled = ::Opal.compile string, compiling_options
    +    block = ::Kernel.proc do
    +      %x{new Function("Opal,self", "return " + compiled)(Opal, self)}
    +    end
    +  elsif args.any?
    +    ::Kernel.raise ::ArgumentError, "wrong number of arguments (#{args.size} for 0)" \
    +                                    "\n\n  NOTE:If you want to enable passing a String argument please add \"require 'opal-parser'\" to your script\n"
    +  end
    +
    +  %x{
    +    var old = block.$$s,
    +        result;
    +
    +    block.$$s = null;
    +    result = block.apply(self, [self]);
    +    block.$$s = old;
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #module_exec(*args, &block) ⇒ Object + + + + Also known as: + class_exec + + + + +

    + + + + +
    +
    +
    +
    +607
    +608
    +609
    +610
    +611
    +612
    +613
    +614
    +615
    +616
    +617
    +618
    +619
    +620
    +621
    +
    +
    # File 'opal/opal/corelib/module.rb', line 607
    +
    +def module_exec(*args, &block)
    +  %x{
    +    if (block === nil) {
    +      #{::Kernel.raise ::LocalJumpError, 'no block given'}
    +    }
    +
    +    var block_self = block.$$s, result;
    +
    +    block.$$s = null;
    +    result = block.apply(self, args);
    +    block.$$s = block_self;
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #module_function(*methods) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +638
    +639
    +640
    +641
    +642
    +643
    +644
    +645
    +646
    +647
    +648
    +649
    +650
    +651
    +
    +
    # File 'opal/opal/corelib/module.rb', line 630
    +
    +def module_function(*methods)
    +  %x{
    +    $deny_frozen_access(self);
    +
    +    if (methods.length === 0) {
    +      self.$$module_function = true;
    +      return nil;
    +    }
    +    else {
    +      for (var i = 0, length = methods.length; i < length; i++) {
    +        var meth = methods[i],
    +            id   = $jsid(meth),
    +            func = self.$$prototype[id];
    +
    +        Opal.defs(self, id, func);
    +      }
    +      return methods.length === 1 ? methods[0] : methods;
    +    }
    +
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #nameObject + + + + + +

    + + + + +
    +
    +
    +
    +653
    +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
    +
    +
    # File 'opal/opal/corelib/module.rb', line 653
    +
    +def name
    +  %x{
    +    if (self.$$full_name) {
    +      return self.$$full_name;
    +    }
    +
    +    var result = [], base = self;
    +
    +    while (base) {
    +      // Give up if any of the ancestors is unnamed
    +      if (base.$$name === nil || base.$$name == null) return nil;
    +
    +      result.unshift(base.$$name);
    +
    +      base = base.$$base_module;
    +
    +      if (base === $Object) {
    +        break;
    +      }
    +    }
    +
    +    if (result.length === 0) {
    +      return nil;
    +    }
    +
    +    return self.$$full_name = result.join('::');
    +  }
    +end
    +
    +
    + +
    +

    + + #prepend(*mods) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +682
    +683
    +684
    +685
    +686
    +687
    +688
    +689
    +690
    +691
    +692
    +693
    +694
    +695
    +696
    +697
    +698
    +699
    +700
    +701
    +
    +
    # File 'opal/opal/corelib/module.rb', line 682
    +
    +def prepend(*mods)
    +  %x{
    +    if (mods.length === 0) {
    +      #{::Kernel.raise ::ArgumentError, 'wrong number of arguments (given 0, expected 1+)'}
    +    }
    +
    +    for (var i = mods.length - 1; i >= 0; i--) {
    +      var mod = mods[i];
    +
    +      if (!mod.$$is_module) {
    +        #{::Kernel.raise ::TypeError, "wrong argument type #{`mod`.class} (expected Module)"};
    +      }
    +
    +      #{`mod`.prepend_features self};
    +      #{`mod`.prepended self};
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #prepend_features(prepender) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +714
    +
    +
    # File 'opal/opal/corelib/module.rb', line 703
    +
    +def prepend_features(prepender)
    +  %x{
    +    $deny_frozen_access(prepender);
    +
    +    if (!self.$$is_module) {
    +      #{::Kernel.raise ::TypeError, "wrong argument type #{self.class} (expected Module)"};
    +    }
    +
    +    Opal.prepend_features(self, prepender)
    +  }
    +  self
    +end
    +
    +
    + +
    +

    + + #prepended(mod) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +716
    +717
    +
    +
    # File 'opal/opal/corelib/module.rb', line 716
    +
    +def prepended(mod)
    +end
    +
    +
    + +
    +

    + + #private_class_method(*methods) ⇒ Object + + + + Also known as: + public_class_method + + + + +

    + + + + +
    +
    +
    +
    +73
    +74
    +75
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 73
    +
    +def private_class_method(*methods)
    +  `return (methods.length === 1) ? methods[0] : methods`
    +end
    +
    +
    + +
    +

    + + #private_constantObject + + + + + +

    + + + + +
    +
    +
    +
    +81
    +82
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 81
    +
    +def private_constant(*)
    +end
    +
    +
    + +
    +

    + + #private_method_defined?(obj) ⇒ Boolean + + + + Also known as: + protected_method_defined? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +77
    +78
    +79
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 77
    +
    +def private_method_defined?(obj)
    +  false
    +end
    +
    +
    + +
    +

    + + #public(*methods) ⇒ Object + + + + Also known as: + nesting, private, protected + + + + +

    + + + + +
    +
    +
    +
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +
    +
    # File 'opal/opal/corelib/unsupported.rb', line 63
    +
    +def public(*methods)
    +  %x{
    +    if (methods.length === 0) {
    +      self.$$module_function = false;
    +      return nil;
    +    }
    +    return (methods.length === 1) ? methods[0] : methods;
    +  }
    +end
    +
    +
    + +
    +

    + + #public_constant(const_name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +398
    +399
    +
    +
    # File 'opal/opal/corelib/module.rb', line 398
    +
    +def public_constant(const_name)
    +end
    +
    +
    + +
    +

    + + #refine(klass, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +821
    +822
    +823
    +824
    +825
    +826
    +827
    +828
    +829
    +830
    +831
    +832
    +833
    +834
    +835
    +836
    +837
    +838
    +839
    +
    +
    # File 'opal/opal/corelib/module.rb', line 821
    +
    +def refine(klass, &block)
    +  refinement_module, m, klass_id = self, nil, nil
    +  %x{
    +    klass_id = Opal.id(klass);
    +    if (typeof self.$$refine_modules === "undefined") {
    +      self.$$refine_modules = Object.create(null);
    +    }
    +    if (typeof self.$$refine_modules[klass_id] === "undefined") {
    +      m = self.$$refine_modules[klass_id] = #{::Refinement.new};
    +    }
    +    else {
    +      m = self.$$refine_modules[klass_id];
    +    }
    +    m.refinement_module = refinement_module
    +    m.refined_class = klass
    +  }
    +  m.class_exec(&block)
    +  m
    +end
    +
    +
    + +
    +

    + + #refinementsObject + + + + + +

    + + + + +
    +
    +
    +
    +841
    +842
    +843
    +844
    +845
    +846
    +847
    +848
    +849
    +850
    +
    +
    # File 'opal/opal/corelib/module.rb', line 841
    +
    +def refinements
    +  %x{
    +    var refine_modules = self.$$refine_modules, hash = #{{}};;
    +    if (typeof refine_modules === "undefined") return hash;
    +    for (var id in refine_modules) {
    +      hash['$[]='](refine_modules[id].refined_class, refine_modules[id]);
    +    }
    +    return hash;
    +  }
    +end
    +
    +
    + +
    +

    + + #remove_class_variable(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +
    +
    # File 'opal/opal/corelib/module.rb', line 274
    +
    +def remove_class_variable(name)
    +  `$deny_frozen_access(self)`
    +
    +  name = ::Opal.class_variable_name!(name)
    +
    +  %x{
    +    if (Opal.hasOwnProperty.call(self.$$cvars, name)) {
    +      var value = self.$$cvars[name];
    +      delete self.$$cvars[name];
    +      return value;
    +    } else {
    +      #{::Kernel.raise ::NameError, "cannot remove #{name} for #{self}"}
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #remove_const(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +719
    +720
    +721
    +722
    +723
    +
    +
    # File 'opal/opal/corelib/module.rb', line 719
    +
    +def remove_const(name)
    +  `$deny_frozen_access(self)`
    +
    +  `Opal.const_remove(self, name)`
    +end
    +
    +
    + +
    +

    + + #remove_method(*names) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +480
    +481
    +482
    +483
    +484
    +485
    +486
    +487
    +488
    +489
    +490
    +491
    +
    +
    # File 'opal/opal/corelib/module.rb', line 480
    +
    +def remove_method(*names)
    +  %x{
    +    for (var i = 0; i < names.length; i++) {
    +      var name = ensure_symbol_or_string(names[i]);
    +      $deny_frozen_access(self);
    +
    +      Opal.rdef(self, "$" + name);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #singleton_class?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +493
    +494
    +495
    +
    +
    # File 'opal/opal/corelib/module.rb', line 493
    +
    +def singleton_class?
    +  `!!self.$$is_singleton`
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + Also known as: + inspect + + + + +

    + + + + +
    +
    +
    +
    +725
    +726
    +727
    +
    +
    # File 'opal/opal/corelib/module.rb', line 725
    +
    +def to_s
    +  `Opal.Module.$name.call(self)` || "#<#{`self.$$is_module ? 'Module' : 'Class'`}:0x#{__id__.to_s(16)}>"
    +end
    +
    +
    + +
    +

    + + #undef_method(*names) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +729
    +730
    +731
    +732
    +733
    +734
    +735
    +736
    +737
    +738
    +739
    +740
    +
    +
    # File 'opal/opal/corelib/module.rb', line 729
    +
    +def undef_method(*names)
    +  %x{
    +    for (var i = 0; i < names.length; i++) {
    +      var name = ensure_symbol_or_string(names[i]);
    +      $deny_frozen_access(self);
    +
    +      Opal.udef(self, "$" + name);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #using(mod) ⇒ Object + + + + + +

    +
    +

    Compiler overrides this method

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +853
    +854
    +855
    +
    +
    # File 'opal/opal/corelib/module.rb', line 853
    +
    +def using(mod)
    +  ::Kernel.raise 'Module#using is not permitted in methods'
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/NameError.html b/docs/api/v1.8.2/corelib/NameError.html new file mode 100644 index 00000000..8963d2ab --- /dev/null +++ b/docs/api/v1.8.2/corelib/NameError.html @@ -0,0 +1,312 @@ + + + + + + + Exception: NameError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: NameError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    NoMethodError

    +
    + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute name.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(message, name = nil) ⇒ NameError + + + + + +

    +
    +

    Returns a new instance of NameError.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +284
    +285
    +286
    +287
    +
    +
    # File 'opal/opal/corelib/error.rb', line 284
    +
    +def initialize(message, name = nil)
    +  super message
    +  @name = name
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #nameObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute name.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +282
    +283
    +284
    +
    +
    # File 'opal/opal/corelib/error.rb', line 282
    +
    +def name
    +  @name
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/NilClass.html b/docs/api/v1.8.2/corelib/NilClass.html new file mode 100644 index 00000000..4f40ecd7 --- /dev/null +++ b/docs/api/v1.8.2/corelib/NilClass.html @@ -0,0 +1,1237 @@ + + + + + + + Class: NilClass + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: NilClass + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/nil.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

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

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +7
    +8
    +9
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 7
    +
    +def allocate
    +  ::Kernel.raise ::TypeError, "allocator undefined for #{name}"
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #!Object + + + + + +

    + + + + +
    +
    +
    +
    +14
    +15
    +16
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 14
    +
    +def !
    +  true
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +18
    +19
    +20
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 18
    +
    +def &(other)
    +  false
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +30
    +31
    +32
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 30
    +
    +def ==(other)
    +  `other === nil`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +26
    +27
    +28
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 26
    +
    +def ^(other)
    +  `other !== false && other !== nil`
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +4
    +5
    +6
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 4
    +
    +def __marshal__(buffer)
    +  buffer.append('0')
    +end
    +
    +
    + +
    +

    + + #clone(freeze: true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +38
    +39
    +40
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 38
    +
    +def clone(freeze: true)
    +  nil
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 34
    +
    +def dup
    +  nil
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 42
    +
    +def inspect
    +  'nil'
    +end
    +
    +
    + +
    +

    + + #instance_variablesObject + + + + + +

    + + + + +
    +
    +
    +
    +83
    +84
    +85
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 83
    +
    +def instance_variables
    +  []
    +end
    +
    +
    + +
    +

    + + #nil?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 46
    +
    +def nil?
    +  true
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +74
    +75
    +76
    +77
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 74
    +
    +def rationalize(*args)
    +  ::Kernel.raise ::ArgumentError if args.length > 1
    +  ::Kernel.Rational(0, 1)
    +end
    +
    +
    + +
    +

    + + #singleton_classObject + + + + + +

    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 50
    +
    +def singleton_class
    +  ::NilClass
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + + +

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 54
    +
    +def to_a
    +  []
    +end
    +
    +
    + +
    +

    + + #to_cObject + + + + + +

    + + + + +
    +
    +
    +
    +70
    +71
    +72
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 70
    +
    +def to_c
    +  ::Complex.new(0, 0)
    +end
    +
    +
    + +
    +

    + + #to_hObject + + + + + +

    + + + + +
    +
    +
    +
    +58
    +59
    +60
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 58
    +
    +def to_h
    +  `new Map()`
    +end
    +
    +
    + +
    +

    + + #to_iObject + + + + Also known as: + to_f + + + + +

    + + + + +
    +
    +
    +
    +62
    +63
    +64
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 62
    +
    +def to_i
    +  0
    +end
    +
    +
    + +
    +

    + + #to_rObject + + + + + +

    + + + + +
    +
    +
    +
    +79
    +80
    +81
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 79
    +
    +def to_r
    +  ::Kernel.Rational(0, 1)
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +66
    +67
    +68
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 66
    +
    +def to_s
    +  ''
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +22
    +23
    +24
    +
    +
    # File 'opal/opal/corelib/nil.rb', line 22
    +
    +def |(other)
    +  `other !== false && other !== nil`
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/NoMatchingPatternError.html b/docs/api/v1.8.2/corelib/NoMatchingPatternError.html new file mode 100644 index 00000000..f0889d2b --- /dev/null +++ b/docs/api/v1.8.2/corelib/NoMatchingPatternError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: NoMatchingPatternError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: NoMatchingPatternError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/pattern_matching/base.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/NoMemoryError.html b/docs/api/v1.8.2/corelib/NoMemoryError.html new file mode 100644 index 00000000..5d56a7f8 --- /dev/null +++ b/docs/api/v1.8.2/corelib/NoMemoryError.html @@ -0,0 +1,142 @@ + + + + + + + Exception: NoMemoryError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: NoMemoryError + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/NoMethodError.html b/docs/api/v1.8.2/corelib/NoMethodError.html new file mode 100644 index 00000000..febb53c4 --- /dev/null +++ b/docs/api/v1.8.2/corelib/NoMethodError.html @@ -0,0 +1,321 @@ + + + + + + + Exception: NoMethodError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: NoMethodError + + + +

    +
    + +
    +
    Inherits:
    +
    + NameError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + + + + + +

    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, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(message, name = nil, args = []) ⇒ NoMethodError + + + + + +

    +
    +

    Returns a new instance of NoMethodError.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +293
    +294
    +295
    +296
    +
    +
    # File 'opal/opal/corelib/error.rb', line 293
    +
    +def initialize(message, name = nil, args = [])
    +  super message, name
    +  @args = args
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #argsObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute args.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +291
    +292
    +293
    +
    +
    # File 'opal/opal/corelib/error.rb', line 291
    +
    +def args
    +  @args
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/NotImplementedError.html b/docs/api/v1.8.2/corelib/NotImplementedError.html new file mode 100644 index 00000000..434cc9ac --- /dev/null +++ b/docs/api/v1.8.2/corelib/NotImplementedError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: NotImplementedError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: NotImplementedError + + + +

    +
    + +
    +
    Inherits:
    +
    + ScriptError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Number.html b/docs/api/v1.8.2/corelib/Number.html new file mode 100644 index 00000000..7083e9e3 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Number.html @@ -0,0 +1,5494 @@ + + + + + + + Class: Number + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Number + + + +

    +
    + +
    +
    Inherits:
    +
    + Numeric + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/number.rb
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Numeric

    +

    #__coerced__, #clone, #conj, #div, #dup, #i, #imag, #polar, #real, #real?, #rect, #step, #to_c

    + + + + + + + + + +

    Methods included from Comparable

    +

    #between?, #clamp

    + + +
    +

    Class Method Details

    + + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/number.rb', line 13
    +
    +def allocate
    +  ::Kernel.raise ::TypeError, "allocator undefined for #{name}"
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #%(other) ⇒ Object + + + + Also known as: + modulo + + + + +

    + + + + +
    +
    +
    +
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +
    +
    # File 'opal/opal/corelib/number.rb', line 113
    +
    +def %(other)
    +  %x{
    +    if (other.$$is_number) {
    +      if (other == -Infinity) {
    +        return other;
    +      }
    +      else if (other == 0) {
    +        #{::Kernel.raise ::ZeroDivisionError, 'divided by 0'};
    +      }
    +      else if (other < 0 || self < 0) {
    +        return (self % other + other) % other;
    +      }
    +      else {
    +        return self % other;
    +      }
    +    }
    +    else {
    +      return #{__coerced__ :%, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +
    +
    # File 'opal/opal/corelib/number.rb', line 135
    +
    +def &(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self & other;
    +    }
    +    else {
    +      return #{__coerced__ :&, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +
    +
    # File 'opal/opal/corelib/number.rb', line 91
    +
    +def *(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self * other;
    +    }
    +    else {
    +      return #{__coerced__ :*, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +
    +
    # File 'opal/opal/corelib/number.rb', line 279
    +
    +def **(other)
    +  if ::Integer === other
    +    if !(::Integer === self) || other > 0
    +      `Math.pow(self, other)`
    +    else
    +      ::Rational.new(self, 1)**other
    +    end
    +  elsif self < 0 && (::Float === other || ::Rational === other)
    +    ::Complex.new(self, 0)**other.to_f
    +  elsif `other.$$is_number != null`
    +    `Math.pow(self, other)`
    +  else
    +    __coerced__ :**, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +
    +
    # File 'opal/opal/corelib/number.rb', line 69
    +
    +def +(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self + other;
    +    }
    +    else {
    +      return #{__coerced__ :+, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #+@Object + + + + + +

    + + + + +
    +
    +
    +
    +267
    +268
    +269
    +
    +
    # File 'opal/opal/corelib/number.rb', line 267
    +
    +def +@
    +  `+self`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +
    +
    # File 'opal/opal/corelib/number.rb', line 80
    +
    +def -(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self - other;
    +    }
    +    else {
    +      return #{__coerced__ :-, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #-@Object + + + + + +

    + + + + +
    +
    +
    +
    +271
    +272
    +273
    +
    +
    # File 'opal/opal/corelib/number.rb', line 271
    +
    +def -@
    +  `-self`
    +end
    +
    +
    + +
    +

    + + #/(other) ⇒ Object + + + + Also known as: + fdiv + + + + +

    + + + + +
    +
    +
    +
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +
    +
    # File 'opal/opal/corelib/number.rb', line 102
    +
    +def /(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self / other;
    +    }
    +    else {
    +      return #{__coerced__ :/, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +
    +
    # File 'opal/opal/corelib/number.rb', line 168
    +
    +def <(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self < other;
    +    }
    +    else {
    +      return #{__coerced__ :<, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #<<(count) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +241
    +242
    +243
    +244
    +245
    +
    +
    # File 'opal/opal/corelib/number.rb', line 241
    +
    +def <<(count)
    +  count = ::Opal.coerce_to! count, ::Integer, :to_int
    +
    +  `#{count} > 0 ? self << #{count} : self >> -#{count}`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +
    +
    # File 'opal/opal/corelib/number.rb', line 179
    +
    +def <=(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self <= other;
    +    }
    +    else {
    +      return #{__coerced__ :<=, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +235
    +236
    +237
    +238
    +239
    +
    +
    # File 'opal/opal/corelib/number.rb', line 235
    +
    +def <=>(other)
    +  `spaceship_operator(self, other)`
    +rescue ::ArgumentError
    +  nil
    +end
    +
    +
    + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + ===, eql? + + + + +

    + + + + +
    +
    +
    +
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +
    +
    # File 'opal/opal/corelib/number.rb', line 295
    +
    +def ==(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self.valueOf() === other.valueOf();
    +    }
    +    else if (#{other.respond_to? :==}) {
    +      return #{other == self};
    +    }
    +    else {
    +      return false;
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +
    +
    # File 'opal/opal/corelib/number.rb', line 190
    +
    +def >(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self > other;
    +    }
    +    else {
    +      return #{__coerced__ :>, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +
    +
    # File 'opal/opal/corelib/number.rb', line 201
    +
    +def >=(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self >= other;
    +    }
    +    else {
    +      return #{__coerced__ :>=, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #>>(count) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +247
    +248
    +249
    +250
    +251
    +
    +
    # File 'opal/opal/corelib/number.rb', line 247
    +
    +def >>(count)
    +  count = ::Opal.coerce_to! count, ::Integer, :to_int
    +
    +  `#{count} > 0 ? self >> #{count} : self << -#{count}`
    +end
    +
    +
    + +
    +

    + + #[](bit) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +
    +
    # File 'opal/opal/corelib/number.rb', line 253
    +
    +def [](bit)
    +  bit = ::Opal.coerce_to! bit, ::Integer, :to_int
    +
    +  %x{
    +    if (#{bit} < 0) {
    +      return 0;
    +    }
    +    if (#{bit} >= 32) {
    +      return #{ self } < 0 ? 1 : 0;
    +    }
    +    return (self >> #{bit}) & 1;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +
    +
    # File 'opal/opal/corelib/number.rb', line 157
    +
    +def ^(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self ^ other;
    +    }
    +    else {
    +      return #{__coerced__ :^, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #__id__Object + + + + Also known as: + object_id + + + + +

    + + + + +
    +
    +
    +
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +
    +
    # File 'opal/opal/corelib/number.rb', line 40
    +
    +def __id__
    +  %x{
    +    // Binary-safe integers
    +    if (self|0 === self) {
    +      return (self * 2) + 1;
    +    }
    +    else {
    +      if (number_id_map.has(self)) {
    +        return number_id_map.get(self);
    +      }
    +      var id = Opal.uid();
    +      number_id_map.set(self, id);
    +      return id;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #absObject + + + + Also known as: + magnitude + + + + +

    + + + + +
    +
    +
    +
    +311
    +312
    +313
    +
    +
    # File 'opal/opal/corelib/number.rb', line 311
    +
    +def abs
    +  `Math.abs(self)`
    +end
    +
    +
    + +
    +

    + + #abs2Object + + + + + +

    + + + + +
    +
    +
    +
    +315
    +316
    +317
    +
    +
    # File 'opal/opal/corelib/number.rb', line 315
    +
    +def abs2
    +  `Math.abs(self * self)`
    +end
    +
    +
    + +
    +

    + + #allbits?(mask) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +319
    +320
    +321
    +322
    +
    +
    # File 'opal/opal/corelib/number.rb', line 319
    +
    +def allbits?(mask)
    +  mask = ::Opal.coerce_to! mask, ::Integer, :to_int
    +  `(self & mask) == mask`
    +end
    +
    +
    + +
    +

    + + #angleObject + + + + Also known as: + arg, phase + + + + +

    + + + + +
    +
    +
    +
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +
    +
    # File 'opal/opal/corelib/number.rb', line 329
    +
    +def angle
    +  return self if nan?
    +
    +  %x{
    +    if (self == 0) {
    +      if (1 / self > 0) {
    +        return 0;
    +      }
    +      else {
    +        return Math.PI;
    +      }
    +    }
    +    else if (self < 0) {
    +      return Math.PI;
    +    }
    +    else {
    +      return 0;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #anybits?(mask) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +324
    +325
    +326
    +327
    +
    +
    # File 'opal/opal/corelib/number.rb', line 324
    +
    +def anybits?(mask)
    +  mask = ::Opal.coerce_to! mask, ::Integer, :to_int
    +  `(self & mask) !== 0`
    +end
    +
    +
    + +
    +

    + + #bit_lengthObject + + + + + +

    + + + + +
    +
    +
    +
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +
    +
    # File 'opal/opal/corelib/number.rb', line 350
    +
    +def bit_length
    +  unless ::Integer === self
    +    ::Kernel.raise ::NoMethodError.new("undefined method `bit_length` for #{self}:Float", 'bit_length')
    +  end
    +
    +  %x{
    +    if (self === 0 || self === -1) {
    +      return 0;
    +    }
    +
    +    var result = 0,
    +        value  = self < 0 ? ~self : self;
    +
    +    while (value != 0) {
    +      result   += 1;
    +      value  >>>= 1;
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #ceil(ndigits = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +372
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +
    +
    # File 'opal/opal/corelib/number.rb', line 372
    +
    +def ceil(ndigits = 0)
    +  %x{
    +    var f = #{to_f};
    +
    +    if (f % 1 === 0 && ndigits >= 0) {
    +      return f;
    +    }
    +
    +    var factor = Math.pow(10, ndigits),
    +        result = Math.ceil(f * factor) / factor;
    +
    +    if (f % 1 === 0) {
    +      result = Math.round(result);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #chr(encoding = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +391
    +392
    +393
    +
    +
    # File 'opal/opal/corelib/number.rb', line 391
    +
    +def chr(encoding = undefined)
    +  `Opal.enc(String.fromCharCode(self), encoding || "BINARY")`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +
    +
    # File 'opal/opal/corelib/number.rb', line 20
    +
    +def coerce(other)
    +  %x{
    +    if (other === nil) {
    +      #{::Kernel.raise ::TypeError, "can't convert #{other.class} into Float"};
    +    }
    +    else if (other.$$is_string) {
    +      return [#{::Kernel.Float(other)}, self];
    +    }
    +    else if (#{other.respond_to?(:to_f)}) {
    +      return [#{::Opal.coerce_to!(other, ::Float, :to_f)}, self];
    +    }
    +    else if (other.$$is_number) {
    +      return [other, self];
    +    }
    +    else {
    +      #{::Kernel.raise ::TypeError, "can't convert #{other.class} into Float"};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #denominatorObject + + + + + +

    + + + + +
    +
    +
    +
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +
    +
    # File 'opal/opal/corelib/number.rb', line 395
    +
    +def denominator
    +  if nan? || infinite?
    +    1
    +  else
    +    super
    +  end
    +end
    +
    +
    + +
    +

    + + #digits(base = 10) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +764
    +765
    +766
    +
    +
    # File 'opal/opal/corelib/number.rb', line 739
    +
    +def digits(base = 10)
    +  if self < 0
    +    ::Kernel.raise ::Math::DomainError, 'out of domain'
    +  end
    +
    +  base = ::Opal.coerce_to! base, ::Integer, :to_int
    +
    +  if base < 2
    +    ::Kernel.raise ::ArgumentError, "invalid radix #{base}"
    +  end
    +
    +  %x{
    +    if (self != parseInt(self)) #{::Kernel.raise ::NoMethodError, "undefined method `digits' for #{inspect}"}
    +
    +    var value = self, result = [];
    +
    +    if (self == 0) {
    +      return [0];
    +    }
    +
    +    while (value != 0) {
    +      result.push(value % base);
    +      value = parseInt(value / base, 10);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +776
    +
    +
    # File 'opal/opal/corelib/number.rb', line 768
    +
    +def divmod(other)
    +  if nan? || other.nan?
    +    ::Kernel.raise ::FloatDomainError, 'NaN'
    +  elsif infinite?
    +    ::Kernel.raise ::FloatDomainError, 'Infinity'
    +  else
    +    super
    +  end
    +end
    +
    +
    + +
    +

    + + #downto(stop, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +
    +
    # File 'opal/opal/corelib/number.rb', line 403
    +
    +def downto(stop, &block)
    +  unless block_given?
    +    return enum_for(:downto, stop) do
    +      ::Kernel.raise ::ArgumentError, "comparison of #{self.class} with #{stop.class} failed" unless ::Numeric === stop
    +      stop > self ? 0 : self - stop + 1
    +    end
    +  end
    +
    +  %x{
    +    if (!stop.$$is_number) {
    +      #{::Kernel.raise ::ArgumentError, "comparison of #{self.class} with #{stop.class} failed"}
    +    }
    +    for (var i = self; i >= stop; i--) {
    +      block(i);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #equal?(other) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +423
    +424
    +425
    +
    +
    # File 'opal/opal/corelib/number.rb', line 423
    +
    +def equal?(other)
    +  self == other || `isNaN(self) && isNaN(other)`
    +end
    +
    +
    + +
    +

    + + #even?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +427
    +428
    +429
    +
    +
    # File 'opal/opal/corelib/number.rb', line 427
    +
    +def even?
    +  `self % 2 === 0`
    +end
    +
    +
    + +
    +

    + + #finite?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +811
    +812
    +813
    +
    +
    # File 'opal/opal/corelib/number.rb', line 811
    +
    +def finite?
    +  `self != Infinity && self != -Infinity && !isNaN(self)`
    +end
    +
    +
    + +
    +

    + + #floor(ndigits = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +
    +
    # File 'opal/opal/corelib/number.rb', line 431
    +
    +def floor(ndigits = 0)
    +  %x{
    +    var f = #{to_f};
    +
    +    if (f % 1 === 0 && ndigits >= 0) {
    +      return f;
    +    }
    +
    +    var factor = Math.pow(10, ndigits),
    +        result = Math.floor(f * factor) / factor;
    +
    +    if (f % 1 === 0) {
    +      result = Math.round(result);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    +457
    +458
    +459
    +460
    +461
    +462
    +463
    +464
    +465
    +466
    +467
    +468
    +
    +
    # File 'opal/opal/corelib/number.rb', line 450
    +
    +def gcd(other)
    +  unless ::Integer === other
    +    ::Kernel.raise ::TypeError, 'not an integer'
    +  end
    +
    +  %x{
    +    var min = Math.abs(self),
    +        max = Math.abs(other);
    +
    +    while (min > 0) {
    +      var tmp = min;
    +
    +      min = max % min;
    +      max = tmp;
    +    }
    +
    +    return max;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +470
    +471
    +472
    +
    +
    # File 'opal/opal/corelib/number.rb', line 470
    +
    +def gcdlcm(other)
    +  [gcd(other), lcm(other)]
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +
    +
    # File 'opal/opal/corelib/number.rb', line 57
    +
    +def hash
    +  %x{
    +    // Binary-safe integers
    +    if (self|0 === self) {
    +      return #{__id__}
    +    }
    +    else {
    +      return self.toString().$hash();
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #infinite?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +815
    +816
    +817
    +818
    +819
    +820
    +821
    +822
    +823
    +824
    +825
    +826
    +827
    +
    +
    # File 'opal/opal/corelib/number.rb', line 815
    +
    +def infinite?
    +  %x{
    +    if (self == Infinity) {
    +      return +1;
    +    }
    +    else if (self == -Infinity) {
    +      return -1;
    +    }
    +    else {
    +      return nil;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #instance_of?(klass) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +486
    +487
    +488
    +489
    +490
    +491
    +492
    +
    +
    # File 'opal/opal/corelib/number.rb', line 486
    +
    +def instance_of?(klass)
    +  return true if klass == ::Integer && ::Integer === self
    +  return true if klass == ::Integer && ::Integer === self
    +  return true if klass == ::Float && ::Float === self
    +
    +  super
    +end
    +
    +
    + +
    +

    + + #integer?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +474
    +475
    +476
    +
    +
    # File 'opal/opal/corelib/number.rb', line 474
    +
    +def integer?
    +  `self % 1 === 0`
    +end
    +
    +
    + +
    +

    + + #is_a?(klass) ⇒ Boolean + + + + Also known as: + kind_of? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +478
    +479
    +480
    +481
    +482
    +483
    +484
    +
    +
    # File 'opal/opal/corelib/number.rb', line 478
    +
    +def is_a?(klass)
    +  return true if klass == ::Integer && ::Integer === self
    +  return true if klass == ::Integer && ::Integer === self
    +  return true if klass == ::Float && ::Float === self
    +
    +  super
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +
    +
    # File 'opal/opal/corelib/number.rb', line 494
    +
    +def lcm(other)
    +  unless ::Integer === other
    +    ::Kernel.raise ::TypeError, 'not an integer'
    +  end
    +
    +  %x{
    +    if (self == 0 || other == 0) {
    +      return 0;
    +    }
    +    else {
    +      return Math.abs(self * other / #{gcd(other)});
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #nan?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +807
    +808
    +809
    +
    +
    # File 'opal/opal/corelib/number.rb', line 807
    +
    +def nan?
    +  `isNaN(self)`
    +end
    +
    +
    + +
    +

    + + #negative?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +833
    +834
    +835
    +
    +
    # File 'opal/opal/corelib/number.rb', line 833
    +
    +def negative?
    +  `self == -Infinity || 1 / self < 0`
    +end
    +
    +
    + +
    +

    + + #nextObject + + + + Also known as: + succ + + + + +

    + + + + +
    +
    +
    +
    +509
    +510
    +511
    +
    +
    # File 'opal/opal/corelib/number.rb', line 509
    +
    +def next
    +  `self + 1`
    +end
    +
    +
    + +
    +

    + + #next_floatObject + + + + + +

    + + + + +
    +
    +
    +
    +875
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +883
    +884
    +885
    +
    +
    # File 'opal/opal/corelib/number.rb', line 875
    +
    +def next_float
    +  return ::Float::INFINITY if self == ::Float::INFINITY
    +  return ::Float::NAN if nan?
    +
    +  if self >= 0
    +    # Math.abs() is needed to handle -0.0
    +    `incrementNumberBit(Math.abs(self))`
    +  else
    +    `decrementNumberBit(self)`
    +  end
    +end
    +
    +
    + +
    +

    + + #nobits?(mask) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +513
    +514
    +515
    +516
    +
    +
    # File 'opal/opal/corelib/number.rb', line 513
    +
    +def nobits?(mask)
    +  mask = ::Opal.coerce_to! mask, ::Integer, :to_int
    +  `(self & mask) == 0`
    +end
    +
    +
    + +
    +

    + + #nonzero?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +518
    +519
    +520
    +
    +
    # File 'opal/opal/corelib/number.rb', line 518
    +
    +def nonzero?
    +  `self == 0 ? nil : self`
    +end
    +
    +
    + +
    +

    + + #numeratorObject + + + + + +

    + + + + +
    +
    +
    +
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +
    +
    # File 'opal/opal/corelib/number.rb', line 522
    +
    +def numerator
    +  if nan? || infinite?
    +    self
    +  else
    +    super
    +  end
    +end
    +
    +
    + +
    +

    + + #odd?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +530
    +531
    +532
    +
    +
    # File 'opal/opal/corelib/number.rb', line 530
    +
    +def odd?
    +  `self % 2 !== 0`
    +end
    +
    +
    + +
    +

    + + #ordObject + + + + + +

    + + + + +
    +
    +
    +
    +534
    +535
    +536
    +
    +
    # File 'opal/opal/corelib/number.rb', line 534
    +
    +def ord
    +  self
    +end
    +
    +
    + +
    +

    + + #positive?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +829
    +830
    +831
    +
    +
    # File 'opal/opal/corelib/number.rb', line 829
    +
    +def positive?
    +  `self != 0 && (self == Infinity || 1 / self > 0)`
    +end
    +
    +
    + +
    +

    + + #pow(b, m = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +548
    +549
    +550
    +551
    +552
    +553
    +554
    +555
    +556
    +557
    +558
    +559
    +560
    +561
    +562
    +563
    +564
    +565
    +566
    +
    +
    # File 'opal/opal/corelib/number.rb', line 538
    +
    +def pow(b, m = undefined)
    +  %x{
    +    if (self == 0) {
    +      #{::Kernel.raise ::ZeroDivisionError, 'divided by 0'}
    +    }
    +
    +    if (m === undefined) {
    +      return #{self**b};
    +    } else {
    +      if (!(#{::Integer === b})) {
    +        #{::Kernel.raise ::TypeError, 'Integer#pow() 2nd argument not allowed unless a 1st argument is integer'}
    +      }
    +
    +      if (b < 0) {
    +        #{::Kernel.raise ::TypeError, 'Integer#pow() 1st argument cannot be negative when 2nd argument specified'}
    +      }
    +
    +      if (!(#{::Integer === m})) {
    +        #{::Kernel.raise ::TypeError, 'Integer#pow() 2nd argument not allowed unless all arguments are integers'}
    +      }
    +
    +      if (m === 0) {
    +        #{::Kernel.raise ::ZeroDivisionError, 'divided by 0'}
    +      }
    +
    +      return #{(self**b) % m}
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #predObject + + + + + +

    + + + + +
    +
    +
    +
    +568
    +569
    +570
    +
    +
    # File 'opal/opal/corelib/number.rb', line 568
    +
    +def pred
    +  `self - 1`
    +end
    +
    +
    + +
    +

    + + #prev_floatObject + + + + + +

    + + + + +
    +
    +
    +
    +887
    +888
    +889
    +890
    +891
    +892
    +893
    +894
    +895
    +896
    +
    +
    # File 'opal/opal/corelib/number.rb', line 887
    +
    +def prev_float
    +  return -::Float::INFINITY if self == -::Float::INFINITY
    +  return ::Float::NAN if nan?
    +
    +  if self > 0
    +    `decrementNumberBit(self)`
    +  else
    +    `-incrementNumberBit(Math.abs(self))`
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +572
    +573
    +574
    +575
    +576
    +577
    +578
    +
    +
    # File 'opal/opal/corelib/number.rb', line 572
    +
    +def quo(other)
    +  if ::Integer === self
    +    super
    +  else
    +    self / other
    +  end
    +end
    +
    +
    + +
    +

    + + #rationalize(eps = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +580
    +581
    +582
    +583
    +584
    +585
    +586
    +587
    +588
    +589
    +590
    +591
    +592
    +593
    +594
    +595
    +596
    +597
    +598
    +599
    +600
    +601
    +602
    +
    +
    # File 'opal/opal/corelib/number.rb', line 580
    +
    +def rationalize(eps = undefined)
    +  %x{
    +    if (arguments.length > 1) {
    +      #{::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arguments.length`} for 0..1)"};
    +    }
    +  }
    +
    +  if ::Integer === self
    +    ::Rational.new(self, 1)
    +  elsif infinite?
    +    ::Kernel.raise ::FloatDomainError, 'Infinity'
    +  elsif nan?
    +    ::Kernel.raise ::FloatDomainError, 'NaN'
    +  elsif `eps == null`
    +    f, n  = ::Math.frexp self
    +    f     = ::Math.ldexp(f, ::Float::MANT_DIG).to_i
    +    n    -= ::Float::MANT_DIG
    +
    +    ::Rational.new(2 * f, 1 << (1 - n)).rationalize(::Rational.new(1, 1 << (1 - n)))
    +  else
    +    to_r.rationalize(eps)
    +  end
    +end
    +
    +
    + +
    +

    + + #remainder(y) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +604
    +605
    +606
    +
    +
    # File 'opal/opal/corelib/number.rb', line 604
    +
    +def remainder(y)
    +  self - y * (self / y).truncate
    +end
    +
    +
    + +
    +

    + + #round(ndigits = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +637
    +638
    +639
    +640
    +641
    +642
    +643
    +644
    +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
    +671
    +
    +
    # File 'opal/opal/corelib/number.rb', line 608
    +
    +def round(ndigits = undefined)
    +  if ::Integer === self
    +    if `ndigits == null`
    +      return self
    +    end
    +
    +    if ::Float === ndigits && ndigits.infinite?
    +      ::Kernel.raise ::RangeError, 'Infinity'
    +    end
    +
    +    ndigits = ::Opal.coerce_to!(ndigits, ::Integer, :to_int)
    +
    +    if ndigits < ::Integer::MIN
    +      ::Kernel.raise ::RangeError, 'out of bounds'
    +    end
    +
    +    if `ndigits >= 0`
    +      return self
    +    end
    +
    +    ndigits = -ndigits
    +
    +    %x{
    +      if (0.415241 * ndigits - 0.125 > #{size}) {
    +        return 0;
    +      }
    +
    +      var f = Math.pow(10, ndigits),
    +          x = Math.floor((Math.abs(self) + f / 2) / f) * f;
    +
    +      return self < 0 ? -x : x;
    +    }
    +  else
    +    if nan? && `ndigits == null`
    +      ::Kernel.raise ::FloatDomainError, 'NaN'
    +    end
    +
    +    ndigits = ::Opal.coerce_to!(`ndigits || 0`, ::Integer, :to_int)
    +
    +    if ndigits <= 0
    +      if nan?
    +        ::Kernel.raise ::RangeError, 'NaN'
    +      elsif infinite?
    +        ::Kernel.raise ::FloatDomainError, 'Infinity'
    +      end
    +    elsif ndigits == 0
    +      return `Math.round(self)`
    +    elsif nan? || infinite?
    +      return self
    +    end
    +
    +    _, exp = ::Math.frexp(self)
    +
    +    if ndigits >= (::Float::DIG + 2) - (exp > 0 ? exp / 4 : exp / 3 - 1)
    +      return self
    +    end
    +
    +    if ndigits < -(exp > 0 ? exp / 3 + 1 : exp / 4)
    +      return 0
    +    end
    +
    +    `Math.round(self * Math.pow(10, ndigits)) / Math.pow(10, ndigits)`
    +  end
    +end
    +
    +
    + +
    +

    + + #sizeObject + + + + + +

    +
    +

    Since bitwise operations are 32 bit, declare it to be so.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +803
    +804
    +805
    +
    +
    # File 'opal/opal/corelib/number.rb', line 803
    +
    +def size
    +  4
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +673
    +674
    +675
    +676
    +677
    +678
    +679
    +680
    +681
    +682
    +683
    +
    +
    # File 'opal/opal/corelib/number.rb', line 673
    +
    +def times(&block)
    +  return enum_for(:times) { self } unless block
    +
    +  %x{
    +    for (var i = 0; i < self; i++) {
    +      block(i);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #to_fObject + + + + + +

    + + + + +
    +
    +
    +
    +685
    +686
    +687
    +
    +
    # File 'opal/opal/corelib/number.rb', line 685
    +
    +def to_f
    +  self
    +end
    +
    +
    + +
    +

    + + #to_iObject + + + + Also known as: + to_int + + + + +

    + + + + +
    +
    +
    +
    +689
    +690
    +691
    +
    +
    # File 'opal/opal/corelib/number.rb', line 689
    +
    +def to_i
    +  `self < 0 ? Math.ceil(self) : Math.floor(self)`
    +end
    +
    +
    + +
    +

    + + #to_rObject + + + + + +

    + + + + +
    +
    +
    +
    +693
    +694
    +695
    +696
    +697
    +698
    +699
    +700
    +701
    +702
    +703
    +
    +
    # File 'opal/opal/corelib/number.rb', line 693
    +
    +def to_r
    +  if ::Integer === self
    +    ::Rational.new(self, 1)
    +  else
    +    f, e  = ::Math.frexp(self)
    +    f     = ::Math.ldexp(f, ::Float::MANT_DIG).to_i
    +    e    -= ::Float::MANT_DIG
    +
    +    (f * (::Float::RADIX**e)).to_r
    +  end
    +end
    +
    +
    + +
    +

    + + #to_s(base = 10) ⇒ Object + + + + Also known as: + inspect + + + + +

    + + + + +
    +
    +
    +
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +714
    +715
    +716
    +717
    +718
    +
    +
    # File 'opal/opal/corelib/number.rb', line 705
    +
    +def to_s(base = 10)
    +  base = ::Opal.coerce_to! base, ::Integer, :to_int
    +
    +  if base < 2 || base > 36
    +    ::Kernel.raise ::ArgumentError, "invalid radix #{base}"
    +  end
    +
    +  # Don't lose the negative zero
    +  if self == 0 && `1/self === -Infinity`
    +    return '-0.0'
    +  end
    +
    +  `self.toString(base)`
    +end
    +
    +
    + +
    +

    + + #truncate(ndigits = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +720
    +721
    +722
    +723
    +724
    +725
    +726
    +727
    +728
    +729
    +730
    +731
    +732
    +733
    +734
    +735
    +736
    +737
    +
    +
    # File 'opal/opal/corelib/number.rb', line 720
    +
    +def truncate(ndigits = 0)
    +  %x{
    +    var f = #{to_f};
    +
    +    if (f % 1 === 0 && ndigits >= 0) {
    +      return f;
    +    }
    +
    +    var factor = Math.pow(10, ndigits),
    +        result = parseInt(f * factor, 10) / factor;
    +
    +    if (f % 1 === 0) {
    +      result = Math.round(result);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #upto(stop, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +778
    +779
    +780
    +781
    +782
    +783
    +784
    +785
    +786
    +787
    +788
    +789
    +790
    +791
    +792
    +793
    +794
    +795
    +796
    +
    +
    # File 'opal/opal/corelib/number.rb', line 778
    +
    +def upto(stop, &block)
    +  unless block_given?
    +    return enum_for(:upto, stop) do
    +      ::Kernel.raise ::ArgumentError, "comparison of #{self.class} with #{stop.class} failed" unless ::Numeric === stop
    +      stop < self ? 0 : stop - self + 1
    +    end
    +  end
    +
    +  %x{
    +    if (!stop.$$is_number) {
    +      #{::Kernel.raise ::ArgumentError, "comparison of #{self.class} with #{stop.class} failed"}
    +    }
    +    for (var i = self; i <= stop; i++) {
    +      block(i);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #zero?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +798
    +799
    +800
    +
    +
    # File 'opal/opal/corelib/number.rb', line 798
    +
    +def zero?
    +  `self == 0`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +
    +
    # File 'opal/opal/corelib/number.rb', line 146
    +
    +def |(other)
    +  %x{
    +    if (other.$$is_number) {
    +      return self | other;
    +    }
    +    else {
    +      return #{__coerced__ :|, other};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #~Object + + + + + +

    + + + + +
    +
    +
    +
    +275
    +276
    +277
    +
    +
    # File 'opal/opal/corelib/number.rb', line 275
    +
    +def ~
    +  `~self`
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Numeric.html b/docs/api/v1.8.2/corelib/Numeric.html new file mode 100644 index 00000000..0572d767 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Numeric.html @@ -0,0 +1,2712 @@ + + + + + + + Class: Numeric + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Numeric + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Comparable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/numeric.rb
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    Complex, Float, Integer, Number, Rational

    +
    + + + + + + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Comparable

    +

    #<, #<=, #==, #>, #>=, #between?, #clamp

    + + +
    +

    Instance Method Details

    + + +
    +

    + + #%(other) ⇒ Object + + + + Also known as: + modulo + + + + +

    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 46
    +
    +def %(other)
    +  self - other * div(other)
    +end
    +
    +
    + +
    +

    + + #+@Object + + + + + +

    + + + + +
    +
    +
    +
    +38
    +39
    +40
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 38
    +
    +def +@
    +  self
    +end
    +
    +
    + +
    +

    + + #-@Object + + + + + +

    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 42
    +
    +def -@
    +  0 - self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 30
    +
    +def <=>(other)
    +  if equal? other
    +    return 0
    +  end
    +
    +  nil
    +end
    +
    +
    + +
    +

    + + #__coerced__(method, other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 16
    +
    +def __coerced__(method, other)
    +  if other.respond_to?(:coerce)
    +    a, b = other.coerce(self)
    +    a.__send__ method, b
    +  else
    +    case method
    +    when :+, :-, :*, :/, :%, :&, :|, :^, :**
    +      ::Kernel.raise ::TypeError, "#{other.class} can't be coerced into Numeric"
    +    when :>, :>=, :<, :<=, :<=>
    +      ::Kernel.raise ::ArgumentError, "comparison of #{self.class} with #{other.class} failed"
    +    end
    +  end
    +end
    +
    +
    + +
    +

    + + #absObject + + + + Also known as: + magnitude + + + + +

    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 50
    +
    +def abs
    +  self < 0 ? -self : self
    +end
    +
    +
    + +
    +

    + + #abs2Object + + + + + +

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 54
    +
    +def abs2
    +  self * self
    +end
    +
    +
    + +
    +

    + + #angleObject + + + + Also known as: + arg + + + + +

    + + + + +
    +
    +
    +
    +58
    +59
    +60
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 58
    +
    +def angle
    +  self < 0 ? ::Math::PI : 0
    +end
    +
    +
    + +
    +

    + + #ceil(ndigits = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +62
    +63
    +64
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 62
    +
    +def ceil(ndigits = 0)
    +  to_f.ceil(ndigits)
    +end
    +
    +
    + +
    +

    + + #clone(freeze: true) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +330
    +331
    +332
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 330
    +
    +def clone(freeze: true)
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 8
    +
    +def coerce(other)
    +  if other.instance_of? self.class
    +    return [other, self]
    +  end
    +
    +  [::Kernel.Float(other), ::Kernel.Float(self)]
    +end
    +
    +
    + +
    +

    + + #conjObject + + + + Also known as: + conjugate + + + + +

    + + + + +
    +
    +
    +
    +66
    +67
    +68
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 66
    +
    +def conj
    +  self
    +end
    +
    +
    + +
    +

    + + #denominatorObject + + + + + +

    + + + + +
    +
    +
    +
    +70
    +71
    +72
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 70
    +
    +def denominator
    +  to_r.denominator
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +74
    +75
    +76
    +77
    +78
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 74
    +
    +def div(other)
    +  ::Kernel.raise ::ZeroDivisionError, 'divided by o' if other == 0
    +
    +  (self / other).floor
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +80
    +81
    +82
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 80
    +
    +def divmod(other)
    +  [div(other), self % other]
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +326
    +327
    +328
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 326
    +
    +def dup
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +84
    +85
    +86
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 84
    +
    +def fdiv(other)
    +  to_f / other
    +end
    +
    +
    + +
    +

    + + #finite?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +334
    +335
    +336
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 334
    +
    +def finite?
    +  true
    +end
    +
    +
    + +
    +

    + + #floor(ndigits = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +88
    +89
    +90
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 88
    +
    +def floor(ndigits = 0)
    +  to_f.floor(ndigits)
    +end
    +
    +
    + +
    +

    + + #iObject + + + + + +

    + + + + +
    +
    +
    +
    +92
    +93
    +94
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 92
    +
    +def i
    +  ::Kernel.Complex(0, self)
    +end
    +
    +
    + +
    +

    + + #imagObject + + + + Also known as: + imaginary + + + + +

    + + + + +
    +
    +
    +
    +96
    +97
    +98
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 96
    +
    +def imag
    +  0
    +end
    +
    +
    + +
    +

    + + #infinite?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +338
    +339
    +340
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 338
    +
    +def infinite?
    +  nil
    +end
    +
    +
    + +
    +

    + + #integer?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +100
    +101
    +102
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 100
    +
    +def integer?
    +  false
    +end
    +
    +
    + +
    +

    + + #negative?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +322
    +323
    +324
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 322
    +
    +def negative?
    +  self < 0
    +end
    +
    +
    + +
    +

    + + #nonzero?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +104
    +105
    +106
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 104
    +
    +def nonzero?
    +  zero? ? nil : self
    +end
    +
    +
    + +
    +

    + + #numeratorObject + + + + + +

    + + + + +
    +
    +
    +
    +108
    +109
    +110
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 108
    +
    +def numerator
    +  to_r.numerator
    +end
    +
    +
    + +
    +

    + + #polarObject + + + + + +

    + + + + +
    +
    +
    +
    +112
    +113
    +114
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 112
    +
    +def polar
    +  [abs, arg]
    +end
    +
    +
    + +
    +

    + + #positive?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +318
    +319
    +320
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 318
    +
    +def positive?
    +  self > 0
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +116
    +117
    +118
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 116
    +
    +def quo(other)
    +  ::Opal.coerce_to!(self, ::Rational, :to_r) / other
    +end
    +
    +
    + +
    +

    + + #realObject + + + + + +

    + + + + +
    +
    +
    +
    +120
    +121
    +122
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 120
    +
    +def real
    +  self
    +end
    +
    +
    + +
    +

    + + #real?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +124
    +125
    +126
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 124
    +
    +def real?
    +  true
    +end
    +
    +
    + +
    +

    + + #rectObject + + + + Also known as: + rectangular + + + + +

    + + + + +
    +
    +
    +
    +128
    +129
    +130
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 128
    +
    +def rect
    +  [self, 0]
    +end
    +
    +
    + +
    +

    + + #round(digits = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +132
    +133
    +134
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 132
    +
    +def round(digits = undefined)
    +  to_f.round(digits)
    +end
    +
    +
    + +
    +

    + + #step(limit = undefined, step = undefined, to: undefined, by: undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +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
    +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
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 136
    +
    +def step(limit = undefined, step = undefined, to: undefined, by: undefined, &block)
    +  %x{
    +    if (limit !== undefined && to !== undefined) {
    +      #{::Kernel.raise ::ArgumentError, 'to is given twice'}
    +    }
    +
    +    if (step !== undefined && by !== undefined) {
    +      #{::Kernel.raise ::ArgumentError, 'step is given twice'}
    +    }
    +
    +    if (to !== undefined) {
    +      limit = to;
    +    }
    +
    +    if (by !== undefined) {
    +      step = by;
    +    }
    +
    +    if (limit === undefined) {
    +      limit = nil;
    +    }
    +
    +    function validateParameters() {
    +      if (step === nil) {
    +        #{::Kernel.raise ::TypeError, 'step must be numeric'}
    +      }
    +
    +      if (step != null && #{step == 0}) {
    +        #{::Kernel.raise ::ArgumentError, "step can't be 0"}
    +      }
    +
    +      if (step === nil || step == null) {
    +        step = 1;
    +      }
    +
    +      var sign = #{step <=> 0};
    +
    +      if (sign === nil) {
    +        #{::Kernel.raise ::ArgumentError, "0 can't be coerced into #{step.class}"}
    +      }
    +
    +      if (limit === nil || limit == null) {
    +        limit = sign > 0 ? #{::Float::INFINITY} : #{-::Float::INFINITY};
    +      }
    +
    +      #{::Opal.compare(self, limit)}
    +    }
    +
    +    function stepFloatSize() {
    +      if ((step > 0 && self > limit) || (step < 0 && self < limit)) {
    +        return 0;
    +      } else if (step === Infinity || step === -Infinity) {
    +        return 1;
    +      } else {
    +        var abs = Math.abs, floor = Math.floor,
    +            err = (abs(self) + abs(limit) + abs(limit - self)) / abs(step) * #{::Float::EPSILON};
    +
    +        if (err === Infinity || err === -Infinity) {
    +          return 0;
    +        } else {
    +          if (err > 0.5) {
    +            err = 0.5;
    +          }
    +
    +          return floor((limit - self) / step + err) + 1
    +        }
    +      }
    +    }
    +
    +    function stepSize() {
    +      validateParameters();
    +
    +      if (step === 0) {
    +        return Infinity;
    +      }
    +
    +      if (step % 1 !== 0) {
    +        return stepFloatSize();
    +      } else if ((step > 0 && self > limit) || (step < 0 && self < limit)) {
    +        return 0;
    +      } else {
    +        var ceil = Math.ceil, abs = Math.abs,
    +            lhs = abs(self - limit) + 1,
    +            rhs = abs(step);
    +
    +        return ceil(lhs / rhs);
    +      }
    +    }
    +
    +  }
    +
    +  unless block_given?
    +    if (!limit || limit.is_a?(::Numeric)) &&
    +       (!step || step.is_a?(::Numeric))
    +
    +      return ::Enumerator::ArithmeticSequence.new(
    +        [limit, step, ('to: ' if to), ('by: ' if by)], self
    +      )
    +    else
    +      return enum_for(:step, limit, step, &`stepSize`)
    +    end
    +  end
    +
    +  %x{
    +    validateParameters();
    +
    +    var isDesc = #{step.negative?},
    +        isInf = #{step == 0} ||
    +                (limit === Infinity && !isDesc) ||
    +                (limit === -Infinity && isDesc);
    +
    +    if (self.$$is_number && step.$$is_number && limit.$$is_number) {
    +      if (self % 1 === 0 && (isInf || limit % 1 === 0) && step % 1 === 0) {
    +        var value = self;
    +
    +        if (isInf) {
    +          for (;; value += step) {
    +            block(value);
    +          }
    +        } else if (isDesc) {
    +          for (; value >= limit; value += step) {
    +            block(value);
    +          }
    +        } else {
    +          for (; value <= limit; value += step) {
    +            block(value);
    +          }
    +        }
    +
    +        return self;
    +      } else {
    +        var begin = #{to_f}.valueOf();
    +        step = #{step.to_f}.valueOf();
    +        limit = #{limit.to_f}.valueOf();
    +
    +        var n = stepFloatSize();
    +
    +        if (!isFinite(step)) {
    +          if (n !== 0) block(begin);
    +        } else if (step === 0) {
    +          while (true) {
    +            block(begin);
    +          }
    +        } else {
    +          for (var i = 0; i < n; i++) {
    +            var d = i * step + self;
    +            if (step >= 0 ? limit < d : limit > d) {
    +              d = limit;
    +            }
    +            block(d);
    +          }
    +        }
    +
    +        return self;
    +      }
    +    }
    +  }
    +
    +  counter = self
    +
    +  while `isDesc ? #{counter >= limit} : #{counter <= limit}`
    +    yield counter
    +    counter += step
    +  end
    +end
    +
    +
    + +
    +

    + + #to_cObject + + + + + +

    + + + + +
    +
    +
    +
    +302
    +303
    +304
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 302
    +
    +def to_c
    +  ::Kernel.Complex(self, 0)
    +end
    +
    +
    + +
    +

    + + #to_intObject + + + + + +

    + + + + +
    +
    +
    +
    +306
    +307
    +308
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 306
    +
    +def to_int
    +  to_i
    +end
    +
    +
    + +
    +

    + + #truncate(ndigits = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +310
    +311
    +312
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 310
    +
    +def truncate(ndigits = 0)
    +  to_f.truncate(ndigits)
    +end
    +
    +
    + +
    +

    + + #zero?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +314
    +315
    +316
    +
    +
    # File 'opal/opal/corelib/numeric.rb', line 314
    +
    +def zero?
    +  self == 0
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Object.html b/docs/api/v1.8.2/corelib/Object.html new file mode 100644 index 00000000..53f0780a --- /dev/null +++ b/docs/api/v1.8.2/corelib/Object.html @@ -0,0 +1,131 @@ + + + + + + + Class: Object + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/ObjectSpace.html b/docs/api/v1.8.2/corelib/ObjectSpace.html new file mode 100644 index 00000000..677e1002 --- /dev/null +++ b/docs/api/v1.8.2/corelib/ObjectSpace.html @@ -0,0 +1,281 @@ + + + + + + + Module: ObjectSpace + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: ObjectSpace + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/object_space.rb
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true +helpers: respond_to, truthy

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

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .define_finalizer(obj, aproc = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +
    +
    # File 'opal/opal/corelib/object_space.rb', line 37
    +
    +def define_finalizer(obj, aproc = undefined, &block)
    +  %x{
    +    if ($truthy(block)) aproc = block;
    +    if (!$truthy(aproc)) aproc = #{::Kernel.proc};
    +    if (!$respond_to(aproc, '$call')) {
    +      #{::Kernel.raise ::ArgumentError, "Wrong type argument #{aproc.class} (should be callable)"};
    +    }
    +    var id = #{obj.__id__};
    +    add_caller(id, aproc);
    +    try {
    +      registry.register(obj, id, obj);
    +    }
    +    catch (e) {
    +      delete_callers(id);
    +      #{::Kernel.raise ::ArgumentError, "cannot define finalizer for #{obj.class}"};
    +    }
    +    return [0, aproc];
    +  }
    +end
    +
    +
    + +
    +

    + + .undefine_finalizer(obj) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +
    +
    # File 'opal/opal/corelib/object_space.rb', line 57
    +
    +def undefine_finalizer(obj)
    +  %{
    +    var id = #{obj.__id__};
    +    registry.unregister(obj);
    +    delete_callers(id);
    +    return obj;
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/ObjectSpace.self/WeakMap.html b/docs/api/v1.8.2/corelib/ObjectSpace.self/WeakMap.html new file mode 100644 index 00000000..aa263e72 --- /dev/null +++ b/docs/api/v1.8.2/corelib/ObjectSpace.self/WeakMap.html @@ -0,0 +1,429 @@ + + + + + + + Class: ObjectSpace.self::WeakMap + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: ObjectSpace.self::WeakMap + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/object_space.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #any?, #chunk, #chunk_while, #collect, #collect_concat, #compact, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #first, #grep, #grep_v, #group_by, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_h, #to_set, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

    + + #initializeWeakMap + + + + + +

    +
    +

    Returns a new instance of WeakMap.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +69
    +70
    +71
    +72
    +
    +
    # File 'opal/opal/corelib/object_space.rb', line 69
    +
    +def initialize
    +  @weak_map = `new WeakMap()`
    +  @primitive_map = {}
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #[](p1) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +74
    +75
    +76
    +77
    +78
    +79
    +
    +
    # File 'opal/opal/corelib/object_space.rb', line 74
    +
    +def [](p1)
    +  %x{
    +    if (typeof p1 !== "function" && typeof p1 !== "object") return #{@primitive_map[p1]};
    +    return #{@weak_map}.get(p1);
    +  }
    +end
    +
    +
    + +
    +

    + + #[]=(p1, p2) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +81
    +82
    +83
    +84
    +85
    +86
    +
    +
    # File 'opal/opal/corelib/object_space.rb', line 81
    +
    +def []=(p1, p2)
    +  %x{
    +    if (typeof p1 !== "function" && typeof p1 !== "object") return #{@primitive_map[p1] = p2};
    +    return #{@weak_map}.set(p1, p2);
    +  }
    +end
    +
    +
    + +
    +

    + + #include?(p1) ⇒ Boolean + + + + Also known as: + member?, key? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +88
    +89
    +90
    +91
    +92
    +93
    +
    +
    # File 'opal/opal/corelib/object_space.rb', line 88
    +
    +def include?(p1)
    +  %x{
    +    if (typeof p1 !== "function" && typeof p1 !== "object") return #{@primitive_map.key? p1};
    +    return #{@weak_map}.has(p1);
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Opal.html b/docs/api/v1.8.2/corelib/Opal.html new file mode 100644 index 00000000..02d1d9c1 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Opal.html @@ -0,0 +1,1250 @@ + + + + + + + Module: Opal + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Opal + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/irb.rb,
    + opal/opal/corelib/helpers.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    helpers: type_error, coerce_to +backtick_javascript: true

    + + +
    +
    +
    + + +

    Defined Under Namespace

    +

    + + + Modules: IRB + + + + +

    + + + + + + + + +

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .bridge(constructor, klass) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +5
    +6
    +7
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 5
    +
    +def self.bridge(constructor, klass)
    +  `Opal.bridge(constructor, klass)`
    +end
    +
    +
    + +
    +

    + + .class_variable_name!(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 88
    +
    +def self.class_variable_name!(name)
    +  name = ::Opal.coerce_to!(name, ::String, :to_str)
    +
    +  if `name.length < 3 || name.slice(0,2) !== '@@'`
    +    ::Kernel.raise ::NameError.new("`#{name}' is not allowed as a class variable name", name)
    +  end
    +
    +  name
    +end
    +
    +
    + +
    +

    + + .coerce_to!(object, type, method, *args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 9
    +
    +def self.coerce_to!(object, type, method, *args)
    +  coerced = `$coerce_to(object, type, method, args)`
    +
    +  unless type === coerced
    +    ::Kernel.raise `$type_error(object, type, method, coerced)`
    +  end
    +
    +  coerced
    +end
    +
    +
    + +
    +

    + + .coerce_to?(object, type, method, *args) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 19
    +
    +def self.coerce_to?(object, type, method, *args)
    +  return unless object.respond_to? method
    +
    +  coerced = `$coerce_to(object, type, method, args)`
    +
    +  return if coerced.nil?
    +
    +  unless type === coerced
    +    ::Kernel.raise `$type_error(object, type, method, coerced)`
    +  end
    +
    +  coerced
    +end
    +
    +
    + +
    +

    + + .compare(a, b) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 41
    +
    +def self.compare(a, b)
    +  compare = a <=> b
    +
    +  if `compare === nil`
    +    ::Kernel.raise ::ArgumentError, "comparison of #{a.class} with #{b.class} failed"
    +  end
    +
    +  compare
    +end
    +
    +
    + +
    +

    + + .const_name!(const_name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 108
    +
    +def self.const_name!(const_name)
    +  const_name = ::Opal.coerce_to!(const_name, ::String, :to_str) if defined? ::String
    +
    +  %x{
    +    if (!const_name || const_name[0] != const_name[0].toUpperCase()) {
    +      #{raise ::NameError, "wrong constant name #{const_name}"}
    +    }
    +  }
    +
    +  const_name
    +end
    +
    +
    + +
    +

    + + .const_name?(const_name) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 98
    +
    +def self.const_name?(const_name)
    +  %x{
    +    if (typeof const_name !== 'string') {
    +      #{const_name = ::Opal.coerce_to!(const_name, ::String, :to_str)}
    +    }
    +
    +    return #{const_name}[0] === #{const_name}[0].toUpperCase()
    +  }
    +end
    +
    +
    + +
    +

    + + .destructure(args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 51
    +
    +def self.destructure(args)
    +  %x{
    +    if (args.length == 1) {
    +      return args[0];
    +    }
    +    else if (args.$$is_array) {
    +      return args;
    +    }
    +    else {
    +      var args_ary = new Array(args.length);
    +      for(var i = 0, l = args_ary.length; i < l; i++) { args_ary[i] = args[i]; }
    +
    +      return args_ary;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .inspect(value = undefined) ⇒ String + + + + + +

    +
    +

    Performs a safe call to inspect for any value, whether +native or Opal-wrapped.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + value + + + (Object) + + + (defaults to: undefined) + + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 168
    +
    +def self.inspect(value = undefined)
    +  `var pushed = false`
    +  begin
    +    %x{
    +      if (value === null) {
    +        // JS null value
    +        return 'null';
    +      }
    +      else if (value === undefined) {
    +        // JS undefined value
    +        return 'undefined';
    +      }
    +      else if (typeof value.$$class === 'undefined') {
    +        // JS object / other value that is not bridged
    +        return Object.prototype.toString.apply(value);
    +      }
    +      else if (typeof value.$inspect !== 'function' || value.$inspect.$$stub) {
    +        // BasicObject and friends
    +        return #{"#<#{`value.$$class`}:0x#{value.__id__.to_s(16)}>"}
    +      }
    +      else if (inspect_stack.indexOf(#{value.__id__}) !== -1) {
    +        // inspect recursing inside inspect to find out about the
    +        // same object
    +        return #{"#<#{`value.$$class`}:0x#{value.__id__.to_s(16)}>"}
    +      }
    +      else {
    +        // anything supporting Opal
    +        inspect_stack.push(#{value.__id__});
    +        pushed = true;
    +        return value.$inspect();
    +      }
    +    }
    +    nil
    +  rescue ::Exception => e # rubocop:disable Lint/RescueException
    +    "#<#{`value.$$class`}:0x#{value.__id__.to_s(16)}>"
    +  ensure
    +    `if (pushed) inspect_stack.pop()`
    +  end
    +end
    +
    +
    + +
    +

    + + .instance_variable_name!(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 78
    +
    +def self.instance_variable_name!(name)
    +  name = ::Opal.coerce_to!(name, ::String, :to_str)
    +
    +  unless `/^@[a-zA-Z_][a-zA-Z0-9_]*?$/.test(name)`
    +    ::Kernel.raise ::NameError.new("'#{name}' is not allowed as an instance variable name", name)
    +  end
    +
    +  name
    +end
    +
    +
    + +
    +

    + + .pristine(owner_class, *method_names) ⇒ nil + + + + + +

    +
    +

    Mark some methods as pristine in order to apply optimizations when they +are still in their original form. This could probably be moved to +the Opal.def() JS API, but for now it will stay manual.

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    
    +Opal.pristine Array, :allocate, :copy_instance_variables, :initialize_dup
    +
    +class Array
    +  def dup
    +    %x{
    +      if (
    +        self.$allocate.$$pristine &&
    +        self.$copy_instance_variables.$$pristine &&
    +        self.$initialize_dup.$$pristine
    +      ) return self.slice(0);
    +    }
    +
    +    super
    +  end
    +end
    + +
    +

    Parameters:

    +
      + +
    • + + owner_class + + + (Class) + + + + — +

      the class owning the methods

      +
      + +
    • + +
    • + + method_names + + + (Array<Symbol>) + + + + — +

      the list of methods names to mark

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (nil) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 146
    +
    +def self.pristine(owner_class, *method_names)
    +  %x{
    +    var method_name, method;
    +    for (var i = method_names.length - 1; i >= 0; i--) {
    +      method_name = method_names[i];
    +      method = owner_class.$$prototype[Opal.jsid(method_name)];
    +
    +      if (method && !method.$$stub) {
    +        method.$$pristine = true;
    +      }
    +    }
    +  }
    +  nil
    +end
    +
    +
    + +
    +

    + + .respond_to?(obj, method, include_all = false) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 68
    +
    +def self.respond_to?(obj, method, include_all = false)
    +  %x{
    +    if (obj == null || !obj.$$class) {
    +      return false;
    +    }
    +  }
    +
    +  obj.respond_to?(method, include_all)
    +end
    +
    +
    + +
    +

    + + .try_convert(object, type, method) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +
    +
    # File 'opal/opal/corelib/helpers.rb', line 33
    +
    +def self.try_convert(object, type, method)
    +  return object if type === object
    +
    +  if object.respond_to? method
    +    object.__send__ method
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Opal/IRB.html b/docs/api/v1.8.2/corelib/Opal/IRB.html new file mode 100644 index 00000000..4f62d0a0 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Opal/IRB.html @@ -0,0 +1,529 @@ + + + + + + + Module: Opal::IRB + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Opal::IRB + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/irb.rb
    +
    + +
    + +

    Defined Under Namespace

    +

    + + + + + Classes: Silencer + + +

    + + +

    + Constant Summary + collapse +

    + +
    + +
    LINEBREAKS = + +
    +
    [
    +  'unexpected token $end',
    +  'unterminated string meets end of file'
    +].freeze
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #output ⇒ Object + + + + + + + + + + + + + + + + +

      Returns the value of attribute output.

      +
      + +
    • + + +
    + + + + + +

    + Class Method Summary + collapse +

    + + + + + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #outputObject + + + + + +

    +
    +

    Returns the value of attribute output.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 42
    +
    +def output
    +  @output
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .browser?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +80
    +81
    +82
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 80
    +
    +def self.browser?
    +  `typeof(document) !== 'undefined' && typeof(prompt) !== 'undefined'`
    +end
    +
    +
    + +
    +

    + + .ensure_loaded(library) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 10
    +
    +def self.ensure_loaded(library)
    +  return if `Opal.loaded_features`.include? library
    +
    +  version = if RUBY_ENGINE_VERSION.include? 'dev'
    +              'master'
    +            else
    +              RUBY_ENGINE_VERSION
    +            end
    +
    +  url = "https://cdn.opalrb.com/opal/#{version}/#{library}.js"
    +
    +  %x{
    +    var libcode;
    +
    +    if (typeof XMLHttpRequest !== 'undefined') { // Browser
    +      var r = new XMLHttpRequest();
    +      r.open("GET", url, false);
    +      r.send('');
    +      libcode = r.responseText;
    +    }
    +    else {
    +      #{::Kernel.raise "You need to provision #{library} yourself in this environment"}
    +    }
    +
    +    (new Function('Opal', libcode))(Opal);
    +
    +    Opal.require(library);
    +  }
    +
    +  ::Kernel.raise "Could not load #{library} for some reason" unless `Opal.loaded_features`.include? library
    +end
    +
    +
    + +
    +

    + + .prepare_console(&block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 44
    +
    +def self.prepare_console(&block)
    +  self.output = ''
    +
    +  original = {
    +    $stdout => ->(i) { $stdout = i },
    +    $stderr => ->(i) { $stderr = i },
    +  }
    +
    +  # Prepare a better prompt experience for a browser
    +  if browser?
    +    original.each do |pipe, pipe_setter|
    +      new_pipe = pipe.dup
    +      new_pipe.write_proc = proc do |str|
    +        self.output += str
    +        self.output = output.split("\n").last(30).join("\n")
    +        self.output += "\n" if str.end_with? "\n"
    +
    +        pipe.write_proc.call(str)
    +      end
    +      new_pipe.tty = false
    +      pipe_setter.call(new_pipe)
    +    end
    +
    +    original_read_proc = $stdin.read_proc
    +    $stdin.read_proc = `function(s) { var p = prompt(#{output}); if (p !== null) return p + "\n"; return nil; }`
    +  end
    +
    +  yield
    +ensure
    +  original.each do |pipe, pipe_setter|
    +    pipe_setter.call(pipe)
    +  end
    +  $stdin.read_proc = original_read_proc
    +  self.output = ''
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Opal/IRB/Silencer.html b/docs/api/v1.8.2/corelib/Opal/IRB/Silencer.html new file mode 100644 index 00000000..116502be --- /dev/null +++ b/docs/api/v1.8.2/corelib/Opal/IRB/Silencer.html @@ -0,0 +1,321 @@ + + + + + + + Class: Opal::IRB::Silencer + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Opal::IRB::Silencer + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/irb.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initializeSilencer + + + + + +

    +
    +

    Returns a new instance of Silencer.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +90
    +91
    +92
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 90
    +
    +def initialize
    +  @stderr = $stderr
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #silenceObject + + + + + +

    + + + + +
    +
    +
    +
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 94
    +
    +def silence
    +  @collector = ::StringIO.new
    +  $stderr = @collector
    +  yield
    +ensure
    +  $stderr = @stderr
    +end
    +
    +
    + +
    +

    + + #warningsObject + + + + + +

    + + + + +
    +
    +
    +
    +102
    +103
    +104
    +
    +
    # File 'opal/opal/corelib/irb.rb', line 102
    +
    +def warnings
    +  @collector.string
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/PackUnpack.html b/docs/api/v1.8.2/corelib/PackUnpack.html new file mode 100644 index 00000000..0207cd1a --- /dev/null +++ b/docs/api/v1.8.2/corelib/PackUnpack.html @@ -0,0 +1,117 @@ + + + + + + + Module: PackUnpack + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: PackUnpack + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/pack_unpack/format_string_parser.rb
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

    + + +
    +
    +
    + + +
    + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/PatternMatching.html b/docs/api/v1.8.2/corelib/PatternMatching.html new file mode 100644 index 00000000..23a4eaca --- /dev/null +++ b/docs/api/v1.8.2/corelib/PatternMatching.html @@ -0,0 +1,630 @@ + + + + + + + Class: PatternMatching + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: PatternMatching + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/pattern_matching.rb
    +
    + +
    + +

    Overview

    +
    +

    A "userland" implementation of pattern matching for Opal

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

    Instance Attribute Summary collapse

    +
      + +
    • + + + #returns ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute returns.

      +
      + +
    • + + +
    + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(from, pattern) ⇒ PatternMatching + + + + + +

    +
    +

    Returns a new instance of PatternMatching.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/pattern_matching.rb', line 12
    +
    +def initialize(from, pattern)
    +  @from, @pattern = from, pattern
    +  @returns = []
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #returnsObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute returns.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +
    +
    # File 'opal/opal/corelib/pattern_matching.rb', line 17
    +
    +def returns
    +  @returns
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .call(from, pattern) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +9
    +10
    +
    +
    # File 'opal/opal/corelib/pattern_matching.rb', line 6
    +
    +def self.call(from, pattern)
    +  pm = new(from, pattern)
    +  pm.match || (return nil)
    +  pm.returns
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #match(from = @from, pattern = @pattern) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +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
    +
    +
    # File 'opal/opal/corelib/pattern_matching.rb', line 19
    +
    +def match(from = @from, pattern = @pattern)
    +  if pattern == :var
    +    @returns << from
    +    true
    +  else # Pattern is otherwise an Array
    +    type, *args = *pattern
    +
    +    case type
    +    when :save # from =>
    +      @returns << from
    +      match(from, args[0])
    +    when :lit # 3, 4, :a, (1..), ... (but also ^a)
    +      args[0] === from
    +    when :any # a | b
    +      args.any? { |arg| match(from, arg) }
    +    when :all # Array(1) which works as Array & [1] (& doesn't exist though...)
    +      args.all? { |arg| match(from, arg) }
    +    when :array # [...]
    +      fixed_size, array_size, array_match = *args
    +      return false unless from.respond_to? :deconstruct
    +      a = from.deconstruct
    +      return false if fixed_size && a.length != array_size
    +      return false if a.length < array_size
    +
    +      skip_elems = 0
    +      skip_rests = 0
    +
    +      array_match.each_with_index.all? do |elem, i|
    +        type, *args = elem
    +        case type
    +        when :rest
    +          skip_elems = a.size - array_size
    +          skip_rests = 1
    +          match(a[i...i + skip_elems], args[0]) if args[0] # :save?
    +          true
    +        else
    +          match(a[i + skip_elems - skip_rests], elem)
    +        end
    +      end
    +    when :find # [*, a, b, *]
    +      find_match, = *args
    +      first, *find_match, last = *find_match
    +      pattern_length = find_match.length
    +
    +      return false unless from.respond_to? :deconstruct
    +      a = from.deconstruct
    +      a_length = a.length
    +      return false if a_length < pattern_length
    +
    +      # We will save the backup of returns, to be restored
    +      # on each iteration to try again.
    +      returns_backup = @returns.dup
    +
    +      # Extract the capture info from first and last.
    +      # Both are of a form [:rest], or [:rest, :var].
    +      # So our new variables will be either :var, or nil.
    +      first, last = first[1], last[1]
    +
    +      # Let's try to match each possibility...
    +      # [A, B, c, d], [a, B, C, d], [a, b, C, D]
    +      iterations = a_length - pattern_length + 1
    +
    +      iterations.times.any? do |skip|
    +        first_part = a[0, skip]
    +        content = a[skip, pattern_length]
    +        last_part = a[skip + pattern_length..-1]
    +
    +        match(first_part, first) if first
    +        success = content.each_with_index.all? do |e, i|
    +          match(e, find_match[i])
    +        end
    +        match(last_part, last) if last
    +
    +        # Match failed. Let's not return anything.
    +        @returns = returns_backup.dup unless success
    +
    +        success
    +      end
    +    when :hash # {...}
    +      any_size, hash_match = *args
    +
    +      hash_match = hash_match.to_h
    +
    +      return false unless from.respond_to? :deconstruct_keys
    +
    +      if any_size && any_size != true # a => {a:, **other}
    +        a = from.deconstruct_keys(nil) #          ^^^^^^^
    +      else
    +        a = from.deconstruct_keys(hash_match.keys)
    +      end
    +
    +      hash_match.all? do |k, v|
    +        return false unless a.key? k
    +        match(a[k], v)
    +      end || (return false)
    +
    +      if any_size && any_size != true
    +        match(a.except(*hash_match.keys), args[0])
    +      elsif !any_size
    +        return false unless a.except(*hash_match.keys).empty?
    +      end
    +
    +      true
    +    end
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Proc.html b/docs/api/v1.8.2/corelib/Proc.html new file mode 100644 index 00000000..e9d81e2a --- /dev/null +++ b/docs/api/v1.8.2/corelib/Proc.html @@ -0,0 +1,1082 @@ + + + + + + + Class: Proc + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Proc + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/proc.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    helpers: slice, each_ivar +backtick_javascript: true

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

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .new(&block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 8
    +
    +def self.new(&block)
    +  unless block
    +    ::Kernel.raise ::ArgumentError, 'tried to create a Proc object without a block'
    +  end
    +
    +  block
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +65
    +66
    +67
    +68
    +69
    +70
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 65
    +
    +def <<(other)
    +  ::Kernel.proc do |*args, &block|
    +    out = other.call(*args, &block)
    +    call(out)
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +58
    +59
    +60
    +61
    +62
    +63
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 58
    +
    +def >>(other)
    +  ::Kernel.proc do |*args, &block|
    +    out = call(*args, &block)
    +    other.call(out)
    +  end
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +97
    +98
    +99
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 97
    +
    +def __marshal__(buffer)
    +  ::Kernel.raise ::TypeError, "no _dump_data is defined for class #{self.class}"
    +end
    +
    +
    + +
    +

    + + #arityObject + + + + + +

    + + + + +
    +
    +
    +
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 82
    +
    +def arity
    +  %x{
    +    if (self.$$is_curried) {
    +      return -1;
    +    } else if (self.$$arity != null) {
    +      return self.$$arity;
    +    } else {
    +      return self.length;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #bindingObject + + + + + +

    + + + + +
    +
    +
    +
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 99
    +
    +def binding
    +  `if (self.$$is_curried) { #{::Kernel.raise ::ArgumentError, "Can't create Binding"} }`
    +
    +  if defined? ::Binding
    +    ::Binding.new(nil, [], `self.$$s`, source_location)
    +  end
    +end
    +
    +
    + +
    +

    + + #call(*args, &block) ⇒ Object + + + + Also known as: + ===, yield, [] + + + + +

    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 50
    +
    +def call(*args, &block)
    +  %x{
    +    if (block !== nil) self.$$p = block;
    +    if (self.$$is_lambda) return $call_lambda(self, args);
    +    return $call_proc(self, args);
    +  }
    +end
    +
    +
    + +
    +

    + + #curry(arity = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 136
    +
    +def curry(arity = undefined)
    +  %x{
    +    if (arity === undefined) {
    +      arity = self.length;
    +    }
    +    else {
    +      arity = #{::Opal.coerce_to!(arity, ::Integer, :to_int)};
    +      if (self.$$is_lambda && arity !== self.length) {
    +        #{::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arity`} for #{`self.length`})"}
    +      }
    +    }
    +
    +    function curried () {
    +      var args = $slice(arguments),
    +          length = args.length,
    +          result;
    +
    +      if (length > arity && self.$$is_lambda && !self.$$is_curried) {
    +        #{::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`length`} for #{`arity`})"}
    +      }
    +
    +      if (length >= arity) {
    +        return self.$call.apply(self, args);
    +      }
    +
    +      result = function () {
    +        return curried.apply(null,
    +          args.concat($slice(arguments)));
    +      }
    +      result.$$is_lambda = self.$$is_lambda;
    +      result.$$is_curried = true;
    +
    +      return result;
    +    };
    +
    +    curried.$$is_lambda = self.$$is_lambda;
    +    curried.$$is_curried = true;
    +    return curried;
    +  }
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + Also known as: + clone + + + + +

    + + + + +
    +
    +
    +
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 177
    +
    +def dup
    +  %x{
    +    var original_proc = self.$$original_proc || self,
    +        proc = function () {
    +          return original_proc.apply(this, arguments);
    +        };
    +
    +    $each_ivar(self, function(prop) {
    +      proc[prop] = self[prop];
    +    });
    +
    +    return proc;
    +  }
    +end
    +
    +
    + +
    +

    + + #lambda?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +76
    +77
    +78
    +79
    +80
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 76
    +
    +def lambda?
    +  # This method should tell the user if the proc tricks are unavailable,
    +  # (see Proc#lambda? on ruby docs to find out more).
    +  `!!self.$$is_lambda`
    +end
    +
    +
    + +
    +

    + + #parameters(lambda: undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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 'opal/opal/corelib/proc.rb', line 107
    +
    +def parameters(lambda: undefined)
    +  %x{
    +    if (self.$$is_curried) {
    +      return #{[[:rest]]};
    +    } else if (self.$$parameters) {
    +      if (lambda == null ? self.$$is_lambda : lambda) {
    +        return self.$$parameters;
    +      } else {
    +        var result = [], i, length;
    +
    +        for (i = 0, length = self.$$parameters.length; i < length; i++) {
    +          var parameter = self.$$parameters[i];
    +
    +          if (parameter[0] === 'req') {
    +            // required arguments always have name
    +            parameter = ['opt', parameter[1]];
    +          }
    +
    +          result.push(parameter);
    +        }
    +
    +        return result;
    +      }
    +    } else {
    +      return [];
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #source_locationObject + + + + + +

    + + + + +
    +
    +
    +
    +94
    +95
    +96
    +97
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 94
    +
    +def source_location
    +  `if (self.$$is_curried) { return nil; }`
    +  `self.$$source_location` || nil
    +end
    +
    +
    + +
    +

    + + #to_procObject + + + + + +

    + + + + +
    +
    +
    +
    +72
    +73
    +74
    +
    +
    # File 'opal/opal/corelib/proc.rb', line 72
    +
    +def to_proc
    +  self
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Process.html b/docs/api/v1.8.2/corelib/Process.html new file mode 100644 index 00000000..f497f596 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Process.html @@ -0,0 +1,384 @@ + + + + + + + Module: Process + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Process + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/process.rb,
    + opal/opal/corelib/process/status.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

    + + +
    +
    +
    + + +

    Defined Under Namespace

    +

    + + + + + Classes: Status + + +

    + + + + + + + + +

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .__register_clock__(name, func) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +5
    +6
    +7
    +8
    +
    +
    # File 'opal/opal/corelib/process.rb', line 5
    +
    +def self.__register_clock__(name, func)
    +  const_set name, @__clocks__.size
    +  @__clocks__ << func
    +end
    +
    +
    + +
    +

    + + .clock_gettime(clock_id, unit = :float_second) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +
    +
    # File 'opal/opal/corelib/process.rb', line 43
    +
    +def self.clock_gettime(clock_id, unit = :float_second)
    +  (clock = @__clocks__[clock_id]) || ::Kernel.raise(::Errno::EINVAL, "clock_gettime(#{clock_id}) #{@__clocks__[clock_id]}")
    +  %x{
    +    var ms = clock();
    +    switch (unit) {
    +      case 'float_second':      return  (ms / 1000);         // number of seconds as a float (default)
    +      case 'float_millisecond': return  (ms / 1);            // number of milliseconds as a float
    +      case 'float_microsecond': return  (ms * 1000);         // number of microseconds as a float
    +      case 'second':            return ((ms / 1000)    | 0); // number of seconds as an integer
    +      case 'millisecond':       return ((ms / 1)       | 0); // number of milliseconds as an integer
    +      case 'microsecond':       return ((ms * 1000)    | 0); // number of microseconds as an integer
    +      case 'nanosecond':        return ((ms * 1000000) | 0); // number of nanoseconds as an integer
    +      default: #{::Kernel.raise ::ArgumentError, "unexpected unit: #{unit}"}
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .pidObject + + + + + +

    + + + + +
    +
    +
    +
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/process.rb', line 34
    +
    +def self.pid
    +  0
    +end
    +
    +
    + +
    +

    + + .timesObject + + + + + +

    + + + + +
    +
    +
    +
    +38
    +39
    +40
    +41
    +
    +
    # File 'opal/opal/corelib/process.rb', line 38
    +
    +def self.times
    +  t = ::Time.now.to_f
    +  ::Benchmark::Tms.new(t, t, t, t, t)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Process/Status.html b/docs/api/v1.8.2/corelib/Process/Status.html new file mode 100644 index 00000000..abc89dc1 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Process/Status.html @@ -0,0 +1,467 @@ + + + + + + + Class: Process::Status + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Process::Status + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/process/status.rb
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #pid ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute pid.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(status, pid) ⇒ Status + + + + + +

    +
    +

    Returns a new instance of Status.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +3
    +4
    +5
    +
    +
    # File 'opal/opal/corelib/process/status.rb', line 3
    +
    +def initialize(status, pid)
    +  @status, @pid = status, pid
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #pidObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute pid.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +11
    +12
    +13
    +
    +
    # File 'opal/opal/corelib/process/status.rb', line 11
    +
    +def pid
    +  @pid
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #exitstatusObject + + + + + +

    + + + + +
    +
    +
    +
    +7
    +8
    +9
    +
    +
    # File 'opal/opal/corelib/process/status.rb', line 7
    +
    +def exitstatus
    +  @status
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +
    +
    # File 'opal/opal/corelib/process/status.rb', line 17
    +
    +def inspect
    +  "#<Process::Status: pid #{@pid} exit #{@status}>"
    +end
    +
    +
    + +
    +

    + + #success?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/process/status.rb', line 13
    +
    +def success?
    +  @status == 0
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Random.html b/docs/api/v1.8.2/corelib/Random.html new file mode 100644 index 00000000..8c44c8e1 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Random.html @@ -0,0 +1,1159 @@ + + + + + + + Class: Random + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Random + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + +
    +
    Extended by:
    +
    Formatter
    +
    + + + +
    +
    Includes:
    +
    Formatter
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/random/formatter.rb,
    + opal/opal/corelib/random.rb,
    opal/opal/corelib/random/seedrandom.js.rb,
    opal/opal/corelib/random/math_random.js.rb,
    opal/opal/corelib/random/mersenne_twister.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

    + + +
    +
    +
    + + +
    + +

    + Constant Summary + collapse +

    + +
    + +
    MATH_RANDOM_GENERATOR = + +
    +
    `{
    +  new_seed: function() { return 0; },
    +  reseed: function(seed) { return {}; },
    +  rand: function($rng) { return Math.random(); }
    +}`
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #seed ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute seed.

      +
      + +
    • + + +
    • + + + #state ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute state.

      +
      + +
    • + + +
    + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(seed = ::Random.new_seed) ⇒ Random + + + + + +

    +
    +

    Returns a new instance of Random.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +19
    +20
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/random.rb', line 19
    +
    +def initialize(seed = ::Random.new_seed)
    +  seed = ::Opal.coerce_to!(seed, ::Integer, :to_int)
    +  @state = seed
    +  reseed(seed)
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #seedObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute seed.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +7
    +8
    +9
    +
    +
    # File 'opal/opal/corelib/random.rb', line 7
    +
    +def seed
    +  @seed
    +end
    +
    +
    + + + +
    +

    + + #stateObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute state.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +7
    +8
    +9
    +
    +
    # File 'opal/opal/corelib/random.rb', line 7
    +
    +def state
    +  @state
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + ._verify_count(count) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +
    +
    # File 'opal/opal/corelib/random.rb', line 9
    +
    +def self._verify_count(count)
    +  %x{
    +    if (!$truthy(count)) count = 16;
    +    if (typeof count !== "number") count = #{`count`.to_int};
    +    if (count < 0) #{::Kernel.raise ::ArgumentError, 'negative string size (or size too big)'};
    +    count = Math.floor(count);
    +    return count;
    +  }
    +end
    +
    +
    + +
    +

    + + .bytes(length) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +62
    +63
    +64
    +
    +
    # File 'opal/opal/corelib/random.rb', line 62
    +
    +def self.bytes(length)
    +  self::DEFAULT.bytes(length)
    +end
    +
    +
    + +
    +

    + + .generator=(generator) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +
    +
    # File 'opal/opal/corelib/random.rb', line 84
    +
    +def self.generator=(generator)
    +  `Opal.$$rand = #{generator}`
    +
    +  if const_defined? :DEFAULT
    +    self::DEFAULT.reseed
    +  else
    +    const_set :DEFAULT, new(new_seed)
    +  end
    +end
    +
    +
    + +
    +

    + + .new_seedObject + + + + + +

    + + + + +
    +
    +
    +
    +30
    +31
    +32
    +
    +
    # File 'opal/opal/corelib/random.rb', line 30
    +
    +def self.new_seed
    +  `Opal.$$rand.new_seed()`
    +end
    +
    +
    + +
    +

    + + .rand(limit = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/random.rb', line 34
    +
    +def self.rand(limit = undefined)
    +  self::DEFAULT.rand(limit)
    +end
    +
    +
    + +
    +

    + + .random_floatObject + + + + + +

    + + + + +
    +
    +
    +
    +80
    +81
    +82
    +
    +
    # File 'opal/opal/corelib/random.rb', line 80
    +
    +def self.random_float
    +  self::DEFAULT.random_float
    +end
    +
    +
    + +
    +

    + + .srand(n = ::Random.new_seed) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +
    +
    # File 'opal/opal/corelib/random.rb', line 38
    +
    +def self.srand(n = ::Random.new_seed)
    +  n = ::Opal.coerce_to!(n, ::Integer, :to_int)
    +
    +  previous_seed = self::DEFAULT.seed
    +  self::DEFAULT.reseed(n)
    +  previous_seed
    +end
    +
    +
    + +
    +

    + + .urandom(size) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +46
    +47
    +48
    +
    +
    # File 'opal/opal/corelib/random.rb', line 46
    +
    +def self.urandom(size)
    +  ::SecureRandom.bytes(size)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +53
    +54
    +
    +
    # File 'opal/opal/corelib/random.rb', line 50
    +
    +def ==(other)
    +  return false unless ::Random === other
    +
    +  seed == other.seed && state == other.state
    +end
    +
    +
    + +
    +

    + + #bytes(length) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +56
    +57
    +58
    +59
    +60
    +
    +
    # File 'opal/opal/corelib/random.rb', line 56
    +
    +def bytes(length)
    +  length = ::Random._verify_count(length)
    +
    +  ::Array.new(length) { rand(255).chr }.join.encode('ASCII-8BIT')
    +end
    +
    +
    + +
    +

    + + #rand(limit = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +66
    +67
    +68
    +
    +
    # File 'opal/opal/corelib/random.rb', line 66
    +
    +def rand(limit = undefined)
    +  random_number(limit)
    +end
    +
    +
    + +
    +

    + + #random_floatObject + + + + + +

    +
    +

    Not part of the Ruby interface (use #random_number for portability), but +used by Random::Formatter as a shortcut, as for Random interface the float +RNG is primary.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +73
    +74
    +75
    +76
    +77
    +78
    +
    +
    # File 'opal/opal/corelib/random.rb', line 73
    +
    +def random_float
    +  %x{
    +    self.state++;
    +    return Opal.$$rand.rand(self.$rng);
    +  }
    +end
    +
    +
    + +
    +

    + + #reseed(seed) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +
    +
    # File 'opal/opal/corelib/random.rb', line 25
    +
    +def reseed(seed)
    +  @seed = seed
    +  `self.$rng = Opal.$$rand.reseed(seed)`
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Random.self/Formatter.html b/docs/api/v1.8.2/corelib/Random.self/Formatter.html new file mode 100644 index 00000000..632182af --- /dev/null +++ b/docs/api/v1.8.2/corelib/Random.self/Formatter.html @@ -0,0 +1,715 @@ + + + + + + + Module: Random.self::Formatter + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: Random.self::Formatter + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/random/formatter.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Instance Method Details

    + + +
    +

    + + #alphanumeric(count = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 113
    +
    +def alphanumeric(count = nil)
    +  count = Random._verify_count(count)
    +  map = ['0'..'9', 'a'..'z', 'A'..'Z'].map(&:to_a).flatten
    +  ::Array.new(count) do |i|
    +    map[random_number(map.length)]
    +  end.join
    +end
    +
    +
    + +
    +

    + + #base64(count = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 21
    +
    +def base64(count = nil)
    +  ::Base64.strict_encode64(random_bytes(count)).encode('US-ASCII')
    +end
    +
    +
    + +
    +

    + + #hex(count = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 5
    +
    +def hex(count = nil)
    +  count = ::Random._verify_count(count)
    +  %x{
    +    var bytes = #{bytes(count)};
    +    var out = "";
    +    for (var i = 0; i < #{count}; i++) {
    +      out += bytes.charCodeAt(i).toString(16).padStart(2, '0');
    +    }
    +    return #{`out`.encode('US-ASCII')};
    +  }
    +end
    +
    +
    + +
    +

    + + #random_bytes(count = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +17
    +18
    +19
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 17
    +
    +def random_bytes(count = nil)
    +  bytes(count)
    +end
    +
    +
    + +
    +

    + + #random_floatObject + + + + + +

    +
    +

    Implemented in terms of #bytes for SecureRandom, but Random overrides this +method to implement #bytes in terms of #random_float. Not part of standard +Ruby interface - use random_number for portability.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 41
    +
    +def random_float
    +  bs = bytes(4)
    +  num = 0
    +  4.times do |i|
    +    num <<= 8
    +    num |= bs[i].ord
    +  end
    +  num.abs / 0x7fffffff
    +end
    +
    +
    + +
    +

    + + #random_number(limit = undefined) ⇒ 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
    +108
    +109
    +110
    +111
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 51
    +
    +def random_number(limit = undefined)
    +  %x{
    +    function randomFloat() {
    +      return #{random_float};
    +    }
    +
    +    function randomInt(max) {
    +      return Math.floor(randomFloat() * max);
    +    }
    +
    +    function randomRange() {
    +      var min = limit.begin,
    +          max = limit.end;
    +
    +      if (min === nil || max === nil) {
    +        return nil;
    +      }
    +
    +      var length = max - min;
    +
    +      if (length < 0) {
    +        return nil;
    +      }
    +
    +      if (length === 0) {
    +        return min;
    +      }
    +
    +      if (max % 1 === 0 && min % 1 === 0 && !limit.excl) {
    +        length++;
    +      }
    +
    +      return randomInt(length) + min;
    +    }
    +
    +    if (limit == null) {
    +      return randomFloat();
    +    } else if (limit.$$is_range) {
    +      return randomRange();
    +    } else if (limit.$$is_number) {
    +      if (limit <= 0) {
    +        #{::Kernel.raise ::ArgumentError, "invalid argument - #{limit}"}
    +      }
    +
    +      if (limit % 1 === 0) {
    +        // integer
    +        return randomInt(limit);
    +      } else {
    +        return randomFloat() * limit;
    +      }
    +    } else {
    +      limit = #{::Opal.coerce_to!(limit, ::Integer, :to_int)};
    +
    +      if (limit <= 0) {
    +        #{::Kernel.raise ::ArgumentError, "invalid argument - #{limit}"}
    +      }
    +
    +      return randomInt(limit);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #urlsafe_base64(count = nil, padding = false) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 25
    +
    +def urlsafe_base64(count = nil, padding = false)
    +  ::Base64.urlsafe_encode64(random_bytes(count), padding).encode('US-ASCII')
    +end
    +
    +
    + +
    +

    + + #uuidObject + + + + + +

    + + + + +
    +
    +
    +
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/random/formatter.rb', line 29
    +
    +def uuid
    +  str = hex(16).split('')
    +  str[12] = '4'
    +  str[16] = `(parseInt(#{str[16]}, 16) & 3 | 8).toString(16)`
    +  str = [str[0...8], str[8...12], str[12...16], str[16...20], str[20...32]]
    +  str = str.map(&:join)
    +  str.join('-')
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Range.html b/docs/api/v1.8.2/corelib/Range.html new file mode 100644 index 00000000..5ddca7db --- /dev/null +++ b/docs/api/v1.8.2/corelib/Range.html @@ -0,0 +1,2142 @@ + + + + + + + Class: Range + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Range + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/range.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #begin ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute begin.

      +
      + +
    • + + +
    • + + + #end ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute end.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #any?, #chunk, #chunk_while, #collect, #collect_concat, #compact, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #grep, #grep_v, #group_by, #inject, #lazy, #max_by, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_h, #to_set, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(first, last, exclude = false) ⇒ Range + + + + + +

    +
    +

    Returns a new instance of Range.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +
    +
    # File 'opal/opal/corelib/range.rb', line 12
    +
    +def initialize(first, last, exclude = false)
    +  ::Kernel.raise ::NameError, "'initialize' called twice" if @begin
    +  ::Kernel.raise ::ArgumentError, 'bad value for range' unless first <=> last || first.nil? || last.nil?
    +
    +  @begin = first
    +  @end   = last
    +  @excl  = exclude
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #beginObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute begin.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +10
    +11
    +12
    +
    +
    # File 'opal/opal/corelib/range.rb', line 10
    +
    +def begin
    +  @begin
    +end
    +
    +
    + + + +
    +

    + + #endObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute end.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +10
    +11
    +12
    +
    +
    # File 'opal/opal/corelib/range.rb', line 10
    +
    +def end
    +  @end
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #%(n) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +
    +
    # File 'opal/opal/corelib/range.rb', line 326
    +
    +def %(n)
    +  if @begin.is_a?(Numeric) && @end.is_a?(Numeric)
    +    ::Enumerator::ArithmeticSequence.new(self, n, :%)
    +  else
    +    step(n)
    +  end
    +end
    +
    +
    + +
    +

    + + #===(value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +24
    +
    +
    # File 'opal/opal/corelib/range.rb', line 21
    +
    +def ===(value)
    +  return false if `value.$$is_range`
    +  cover? value
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 152
    +
    +def __marshal__(buffer)
    +  buffer.save_link(self)
    +  buffer.write_extends(self)
    +  buffer.append('o')
    +  buffer.append_symbol(self.class.name)
    +  buffer.write_fixnum(3)
    +  buffer.append_symbol('excl')
    +  buffer.write(exclude_end?)
    +  buffer.append_symbol('begin')
    +  buffer.write(self.begin)
    +  buffer.append_symbol('end')
    +  buffer.write(self.end)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +
    +
    # File 'opal/opal/corelib/range.rb', line 334
    +
    +def bsearch(&block)
    +  return enum_for(:bsearch) unless block_given?
    +
    +  if `is_infinite(self) && (self.begin.$$is_number || self.end.$$is_number)`
    +    ::Kernel.raise ::NotImplementedError, "Can't #bsearch an infinite range"
    +  end
    +
    +  unless `self.begin.$$is_number && self.end.$$is_number`
    +    ::Kernel.raise ::TypeError, "can't do binary search for #{@begin.class}"
    +  end
    +
    +  to_a.bsearch(&block)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +35
    +36
    +37
    +38
    +39
    +40
    +
    +
    # File 'opal/opal/corelib/range.rb', line 35
    +
    +def count(&block)
    +  if !block_given? && `is_infinite(self)`
    +    return ::Float::INFINITY
    +  end
    +  super
    +end
    +
    +
    + +
    +

    + + #cover?(value) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +
    +
    # File 'opal/opal/corelib/range.rb', line 47
    +
    +def cover?(value)
    +  compare = ->(a, b) {
    +    a <=> b || 1
    +  }
    +
    +  if `value.$$is_range`
    +    val_begin = value.begin
    +    val_end = value.end
    +    val_excl = value.exclude_end?
    +    if (@begin && val_begin.nil?) ||
    +       (@end && val_end.nil?) ||
    +       (val_begin && val_end && compare.call(val_begin, val_end).then { |c| val_excl ? c >= 0 : c > 0 }) ||
    +       (val_begin && !cover?(val_begin))
    +      return false
    +    end
    +
    +    cmp = compare.call(@end, val_end)
    +    return cmp >= 0 if @excl == val_excl
    +    return cmp > 0 if @excl
    +    return true if cmp >= 0
    +
    +    val_max = value.max
    +    return !val_max.nil? && compare.call(val_max, @end) <= 0
    +  end
    +
    +  return false if @begin && compare.call(@begin, value) > 0
    +  return true if @end.nil?
    +  end_cmp = compare.call(value, @end)
    +  @excl ? end_cmp < 0 : end_cmp <= 0
    +end
    +
    +
    + +
    +

    + + #each {|current| ... } ⇒ Object + + + + + +

    +
    + + +
    +
    +
    + +

    Yields:

    +
      + +
    • + + + (current) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/range.rb', line 78
    +
    +def each(&block)
    +  return enum_for(:each) { size } unless block_given?
    +
    +  %x{
    +    var i, limit;
    +
    +    if (#{@begin}.$$is_number && #{@end}.$$is_number) {
    +      if (#{@begin} % 1 !== 0 || #{@end} % 1 !== 0) {
    +        #{::Kernel.raise ::TypeError, "can't iterate from Float"}
    +      }
    +
    +      for (i = #{@begin}, limit = #{@end} + #{@excl ? 0 : 1}; i < limit; i++) {
    +        block(i);
    +      }
    +
    +      return self;
    +    }
    +
    +    if (#{@begin}.$$is_string && #{@end}.$$is_string) {
    +      #{@begin.upto(@end, @excl, &block)}
    +      return self;
    +    }
    +  }
    +
    +  current = @begin
    +  last    = @end
    +
    +  unless current.respond_to?(:succ)
    +    ::Kernel.raise ::TypeError, "can't iterate from #{current.class}"
    +  end
    +
    +  while @end.nil? || (current <=> last) < 0
    +    yield current
    +
    +    current = current.succ
    +  end
    +
    +  yield current if !@excl && current == last
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #eql?(other) ⇒ Boolean + + + + Also known as: + == + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +
    +
    # File 'opal/opal/corelib/range.rb', line 120
    +
    +def eql?(other)
    +  return false unless ::Range === other
    +
    +  @excl === other.exclude_end? &&
    +    @begin.eql?(other.begin) &&
    +    @end.eql?(other.end)
    +end
    +
    +
    + +
    +

    + + #exclude_end?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +128
    +129
    +130
    +
    +
    # File 'opal/opal/corelib/range.rb', line 128
    +
    +def exclude_end?
    +  @excl
    +end
    +
    +
    + +
    +

    + + #first(n = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +132
    +133
    +134
    +135
    +136
    +
    +
    # File 'opal/opal/corelib/range.rb', line 132
    +
    +def first(n = undefined)
    +  ::Kernel.raise ::RangeError, 'cannot get the minimum of beginless range' if @begin.nil?
    +  return @begin if `n == null`
    +  super
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +362
    +363
    +364
    +
    +
    # File 'opal/opal/corelib/range.rb', line 362
    +
    +def hash
    +  [::Range, @begin, @end, @excl].hash
    +end
    +
    +
    + +
    +

    + + #include?(val) ⇒ Boolean + + + + Also known as: + member? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +
    +
    # File 'opal/opal/corelib/range.rb', line 138
    +
    +def include?(val)
    +  if `self.begin.$$is_number || self.end.$$is_number` ||
    +     @begin.is_a?(::Time) || @end.is_a?(::Time) ||
    +     ::Integer.try_convert(@begin) || ::Integer.try_convert(@end)
    +    return cover?(val)
    +  end
    +
    +  if `self.begin.$$is_string || self.end.$$is_string`
    +    if `self.begin.$$is_string && self.end.$$is_string`
    +      return @begin.upto(@end, @excl).any? { |s| s == val }
    +    elsif @begin.nil?
    +      cmp = val <=> @end
    +      return !cmp.nil? && (@excl ? cmp < 0 : cmp <= 0)
    +    elsif @end.nil?
    +      cmp = @begin <=> val
    +      return !cmp.nil? && cmp <= 0
    +    end
    +  end
    +
    +  # invoke Enumerable#include?
    +  super
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +352
    +353
    +354
    +
    +
    # File 'opal/opal/corelib/range.rb', line 352
    +
    +def inspect
    +  "#{@begin && @begin.inspect}#{@excl ? '...' : '..'}#{@end && @end.inspect}"
    +end
    +
    +
    + +
    +

    + + #last(n = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +161
    +162
    +163
    +164
    +165
    +
    +
    # File 'opal/opal/corelib/range.rb', line 161
    +
    +def last(n = undefined)
    +  ::Kernel.raise ::RangeError, 'cannot get the maximum of endless range' if @end.nil?
    +  return @end if `n == null`
    +  to_a.last(n)
    +end
    +
    +
    + +
    +

    + + #marshal_load(args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +356
    +357
    +358
    +359
    +360
    +
    +
    # File 'opal/opal/corelib/range.rb', line 356
    +
    +def marshal_load(args)
    +  @begin = args[:begin]
    +  @end = args[:end]
    +  @excl = args[:excl]
    +end
    +
    +
    + +
    +

    + + #maxObject + + + + + +

    +
    +

    FIXME: currently hardcoded to assume range holds numerics

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +
    +
    # File 'opal/opal/corelib/range.rb', line 168
    +
    +def max
    +  if @end.nil?
    +    ::Kernel.raise ::RangeError, 'cannot get the maximum of endless range'
    +  elsif block_given?
    +    super
    +  elsif !@begin.nil? && (@begin > @end ||
    +                         @excl && @begin == @end)
    +    nil
    +  else
    +    `#{@excl} ? #{@end} - 1 : #{@end}`
    +  end
    +end
    +
    +
    + +
    +

    + + #minObject + + + + + +

    + + + + +
    +
    +
    +
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +
    +
    # File 'opal/opal/corelib/range.rb', line 181
    +
    +def min
    +  if @begin.nil?
    +    ::Kernel.raise ::RangeError, 'cannot get the minimum of beginless range'
    +  elsif block_given?
    +    super
    +  elsif !@end.nil? && (@begin > @end ||
    +                       @excl && @begin == @end)
    +    nil
    +  else
    +    @begin
    +  end
    +end
    +
    +
    + +
    +

    + + #sizeObject + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/range.rb', line 194
    +
    +def size
    +  %x{
    +    var b = this.begin, e = this.end;
    +
    +    // If begin is Numeric
    +    if (#{::Numeric === `b`}) {
    +      // If end is Numeric
    +      if (#{::Numeric === `e`}) {
    +        // Calculating size based on whether range is exclusive or inclusive
    +        var size = #{`e` - `b`};
    +        if (size < 0) {
    +          return 0;
    +        }
    +        if (!this.excl) {
    +          size += 1;
    +        }
    +        return (#{::Float === `b`} || #{::Float === `e`}) ? Math.floor(size) : size;
    +      }
    +      // If end is nil
    +      else if (e === nil) {
    +        return Infinity;
    +      }
    +    }
    +    // If begin is nil
    +    else if (b === nil) {
    +      // If end is Numeric
    +      if (#{::Numeric === `e`}) {
    +        return Infinity;
    +      }
    +    }
    +
    +    // If neither begin nor end is Numeric
    +    return nil;
    +  }
    +end
    +
    +
    + +
    +

    + + #step(n = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +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
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +
    +
    # File 'opal/opal/corelib/range.rb', line 230
    +
    +def step(n = undefined)
    +  %x{
    +    function coerceStepSize() {
    +      if (n == null) {
    +        n = 1;
    +      }
    +      else if (!n.$$is_number) {
    +        n = #{::Opal.coerce_to!(n, ::Integer, :to_int)}
    +      }
    +
    +      if (n < 0) {
    +        #{::Kernel.raise ::ArgumentError, "step can't be negative"}
    +      } else if (n === 0) {
    +        #{::Kernel.raise ::ArgumentError, "step can't be 0"}
    +      }
    +    }
    +
    +    function enumeratorSize() {
    +      if (!#{@begin.respond_to?(:succ)}) {
    +        return nil;
    +      }
    +
    +      if (#{@begin}.$$is_string && #{@end}.$$is_string) {
    +        return nil;
    +      }
    +
    +      if (n % 1 === 0) {
    +        return #{(size / n).ceil};
    +      } else {
    +        // n is a float
    +        var begin = self.begin, end = self.end,
    +            abs = Math.abs, floor = Math.floor,
    +            err = (abs(begin) + abs(end) + abs(end - begin)) / abs(n) * #{::Float::EPSILON},
    +            size;
    +
    +        if (err > 0.5) {
    +          err = 0.5;
    +        }
    +
    +        if (self.excl) {
    +          size = floor((end - begin) / n - err);
    +          if (size * n + begin < end) {
    +            size++;
    +          }
    +        } else {
    +          size = floor((end - begin) / n + err) + 1
    +        }
    +
    +        return size;
    +      }
    +    }
    +  }
    +
    +  unless block_given?
    +    if (@begin.is_a?(Numeric) || @begin.nil?) &&
    +       (@end.is_a?(Numeric) || @end.nil?) &&
    +       !(@begin.nil? && @end.nil?)
    +
    +      return ::Enumerator::ArithmeticSequence.new(self, n, :step)
    +    else
    +      return enum_for(:step, n) do
    +        %x{
    +          coerceStepSize();
    +          return enumeratorSize();
    +        }
    +      end
    +    end
    +  end
    +
    +  `coerceStepSize()`
    +
    +  if `self.begin.$$is_number && self.end.$$is_number`
    +    i = 0
    +    loop do
    +      current = @begin + i * n
    +      if @excl
    +        break if current >= @end
    +      elsif current > @end
    +        break
    +      end
    +      yield(current)
    +      i += 1
    +    end
    +  else
    +    %x{
    +      if (#{@begin}.$$is_string && #{@end}.$$is_string && n % 1 !== 0) {
    +        #{::Kernel.raise ::TypeError, 'no implicit conversion to float from string'}
    +      }
    +    }
    +    each_with_index do |value, idx|
    +      yield(value) if idx % n == 0
    +    end
    +  end
    +  self
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + + +

    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +45
    +
    +
    # File 'opal/opal/corelib/range.rb', line 42
    +
    +def to_a
    +  ::Kernel.raise ::TypeError, 'cannot convert endless range to an array' if `is_infinite(self)`
    +  super
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +348
    +349
    +350
    +
    +
    # File 'opal/opal/corelib/range.rb', line 348
    +
    +def to_s
    +  "#{@begin || ''}#{@excl ? '...' : '..'}#{@end || ''}"
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/RangeError.html b/docs/api/v1.8.2/corelib/RangeError.html new file mode 100644 index 00000000..0781d122 --- /dev/null +++ b/docs/api/v1.8.2/corelib/RangeError.html @@ -0,0 +1,154 @@ + + + + + + + Exception: RangeError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: RangeError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    FloatDomainError

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Rational.html b/docs/api/v1.8.2/corelib/Rational.html new file mode 100644 index 00000000..87306bce --- /dev/null +++ b/docs/api/v1.8.2/corelib/Rational.html @@ -0,0 +1,2164 @@ + + + + + + + Class: Rational + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Rational + + + +

    +
    + +
    +
    Inherits:
    +
    + Numeric + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/rational.rb
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Numeric

    +

    #%, #+@, #-@, #__coerced__, #abs2, #angle, #clone, #conj, #div, #divmod, #dup, #fdiv, #finite?, #i, #imag, #infinite?, #integer?, #negative?, #nonzero?, #polar, #positive?, #real, #real?, #rect, #step, #to_c, #to_int, #zero?

    + + + + + + + + + +

    Methods included from Comparable

    +

    #<, #<=, #>, #>=, #between?, #clamp

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(num, den) ⇒ Rational + + + + + +

    +
    +

    Returns a new instance of Rational.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +51
    +52
    +53
    +54
    +55
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 51
    +
    +def initialize(num, den)
    +  @num = num
    +  @den = den
    +  freeze
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .convert(num, den) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 25
    +
    +def self.convert(num, den)
    +  if num.nil? || den.nil?
    +    ::Kernel.raise ::TypeError, 'cannot convert nil into Rational'
    +  end
    +
    +  if ::Integer === num && ::Integer === den
    +    return reduce(num, den)
    +  end
    +
    +  if ::Float === num || ::String === num || ::Complex === num
    +    num = num.to_r
    +  end
    +
    +  if ::Float === den || ::String === den || ::Complex === den
    +    den = den.to_r
    +  end
    +
    +  if den.equal?(1) && !(::Integer === num)
    +    ::Opal.coerce_to!(num, ::Rational, :to_r)
    +  elsif ::Numeric === num && ::Numeric === den
    +    num / den
    +  else
    +    reduce(num, den)
    +  end
    +end
    +
    +
    + +
    +

    + + .from_string(string) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 354
    +
    +def self.from_string(string)
    +  %x{
    +    var str = string.trimLeft(),
    +        re = /^[+-]?[\d_]+(\.[\d_]+)?/,
    +        match = str.match(re),
    +        numerator, denominator;
    +
    +    function isFloat() {
    +      return re.test(str);
    +    }
    +
    +    function cutFloat() {
    +      var match = str.match(re);
    +      var number = match[0];
    +      str = str.slice(number.length);
    +      return number.replace(/_/g, '');
    +    }
    +
    +    if (isFloat()) {
    +      numerator = parseFloat(cutFloat());
    +
    +      if (str[0] === '/') {
    +        // rational real part
    +        str = str.slice(1);
    +
    +        if (isFloat()) {
    +          denominator = parseFloat(cutFloat());
    +          return #{::Kernel.Rational(`numerator`, `denominator`)};
    +        } else {
    +          return #{::Kernel.Rational(`numerator`, 1)};
    +        }
    +      } else {
    +        return #{::Kernel.Rational(`numerator`, 1)};
    +      }
    +    } else {
    +      return #{::Kernel.Rational(0, 1)};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + .reduce(num, den) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 7
    +
    +def self.reduce(num, den)
    +  num = num.to_i
    +  den = den.to_i
    +
    +  if den == 0
    +    ::Kernel.raise ::ZeroDivisionError, 'divided by 0'
    +  elsif den < 0
    +    num = -num
    +    den = -den
    +  elsif den == 1
    +    return new(num, den)
    +  end
    +
    +  gcd = num.gcd(den)
    +
    +  new(num / gcd, den / gcd)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 148
    +
    +def *(other)
    +  case other
    +  when ::Rational
    +    num = @num * other.numerator
    +    den = @den * other.denominator
    +
    +    ::Kernel.Rational(num, den)
    +
    +  when ::Integer
    +    ::Kernel.Rational(@num * other, @den)
    +
    +  when ::Float
    +    to_f * other
    +
    +  else
    +    __coerced__ :*, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 190
    +
    +def **(other)
    +  case other
    +  when ::Integer
    +    if self == 0 && other < 0
    +      ::Float::INFINITY
    +    elsif other > 0
    +      ::Kernel.Rational(@num**other, @den**other)
    +    elsif other < 0
    +      ::Kernel.Rational(@den**-other, @num**-other)
    +    else
    +      ::Kernel.Rational(1, 1)
    +    end
    +
    +  when ::Float
    +    to_f**other
    +
    +  when ::Rational
    +    if other == 0
    +      ::Kernel.Rational(1, 1)
    +    elsif other.denominator == 1
    +      if other < 0
    +        ::Kernel.Rational(@den**other.numerator.abs, @num**other.numerator.abs)
    +      else
    +        ::Kernel.Rational(@num**other.numerator, @den**other.numerator)
    +      end
    +    elsif self == 0 && other < 0
    +      ::Kernel.raise ::ZeroDivisionError, 'divided by 0'
    +    else
    +      to_f**other
    +    end
    +
    +  else
    +    __coerced__ :**, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 110
    +
    +def +(other)
    +  case other
    +  when ::Rational
    +    num = @num * other.denominator + @den * other.numerator
    +    den = @den * other.denominator
    +
    +    ::Kernel.Rational(num, den)
    +
    +  when ::Integer
    +    ::Kernel.Rational(@num + other * @den, @den)
    +
    +  when ::Float
    +    to_f + other
    +
    +  else
    +    __coerced__ :+, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 129
    +
    +def -(other)
    +  case other
    +  when ::Rational
    +    num = @num * other.denominator - @den * other.numerator
    +    den = @den * other.denominator
    +
    +    ::Kernel.Rational(num, den)
    +
    +  when ::Integer
    +    ::Kernel.Rational(@num - other * @den, @den)
    +
    +  when ::Float
    +    to_f - other
    +
    +  else
    +    __coerced__ :-, other
    +  end
    +end
    +
    +
    + +
    +

    + + #/(other) ⇒ Object + + + + Also known as: + divide, quo + + + + +

    + + + + +
    +
    +
    +
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 167
    +
    +def /(other)
    +  case other
    +  when ::Rational
    +    num = @num * other.denominator
    +    den = @den * other.numerator
    +
    +    ::Kernel.Rational(num, den)
    +
    +  when ::Integer
    +    if other == 0
    +      to_f / 0.0
    +    else
    +      ::Kernel.Rational(@num, @den * other)
    +    end
    +
    +  when ::Float
    +    to_f / other
    +
    +  else
    +    __coerced__ :/, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 94
    +
    +def <=>(other)
    +  case other
    +  when ::Rational
    +    @num * other.denominator - @den * other.numerator <=> 0
    +
    +  when ::Integer
    +    @num - @den * other <=> 0
    +
    +  when ::Float
    +    to_f <=> other
    +
    +  else
    +    __coerced__ :<=>, other
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 78
    +
    +def ==(other)
    +  case other
    +  when ::Rational
    +    @num == other.numerator && @den == other.denominator
    +
    +  when ::Integer
    +    @num == other && @den == 1
    +
    +  when ::Float
    +    to_f == other
    +
    +  else
    +    other == self
    +  end
    +end
    +
    +
    + +
    +

    + + #absObject + + + + + +

    + + + + +
    +
    +
    +
    +226
    +227
    +228
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 226
    +
    +def abs
    +  ::Kernel.Rational(@num.abs, @den.abs)
    +end
    +
    +
    + +
    +

    + + #ceil(precision = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 230
    +
    +def ceil(precision = 0)
    +  if precision == 0
    +    (-(-@num / @den)).ceil
    +  else
    +    with_precision(:ceil, precision)
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 65
    +
    +def coerce(other)
    +  case other
    +  when ::Rational
    +    [other, self]
    +
    +  when ::Integer
    +    [other.to_r, self]
    +
    +  when ::Float
    +    [other, to_f]
    +  end
    +end
    +
    +
    + +
    +

    + + #denominatorObject + + + + + +

    + + + + +
    +
    +
    +
    +61
    +62
    +63
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 61
    +
    +def denominator
    +  @den
    +end
    +
    +
    + +
    +

    + + #floor(precision = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 238
    +
    +def floor(precision = 0)
    +  if precision == 0
    +    (-(-@num / @den)).floor
    +  else
    +    with_precision(:floor, precision)
    +  end
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +246
    +247
    +248
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 246
    +
    +def hash
    +  [::Rational, @num, @den].hash
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +250
    +251
    +252
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 250
    +
    +def inspect
    +  "(#{self})"
    +end
    +
    +
    + +
    +

    + + #numeratorObject + + + + + +

    + + + + +
    +
    +
    +
    +57
    +58
    +59
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 57
    +
    +def numerator
    +  @num
    +end
    +
    +
    + +
    +

    + + #rationalize(eps = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 254
    +
    +def rationalize(eps = undefined)
    +  %x{
    +    if (arguments.length > 1) {
    +      #{::Kernel.raise ::ArgumentError, "wrong number of arguments (#{`arguments.length`} for 0..1)"};
    +    }
    +
    +    if (eps == null) {
    +      return self;
    +    }
    +
    +    var e = #{eps.abs},
    +        a = #{self - `e`},
    +        b = #{self + `e`};
    +
    +    var p0 = 0,
    +        p1 = 1,
    +        q0 = 1,
    +        q1 = 0,
    +        p2, q2;
    +
    +    var c, k, t;
    +
    +    while (true) {
    +      c = #{`a`.ceil};
    +
    +      if (#{`c` <= `b`}) {
    +        break;
    +      }
    +
    +      k  = c - 1;
    +      p2 = k * p1 + p0;
    +      q2 = k * q1 + q0;
    +      t  = #{1 / (`b` - `k`)};
    +      b  = #{1 / (`a` - `k`)};
    +      a  = t;
    +
    +      p0 = p1;
    +      q0 = q1;
    +      p1 = p2;
    +      q1 = q2;
    +    }
    +
    +    return #{::Kernel.Rational(`c * p1 + p0`, `c * q1 + q0`)};
    +  }
    +end
    +
    +
    + +
    +

    + + #round(precision = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 300
    +
    +def round(precision = 0)
    +  return with_precision(:round, precision) unless precision == 0
    +  return 0 if @num == 0
    +  return @num if @den == 1
    +
    +  num = @num.abs * 2 + @den
    +  den = @den * 2
    +
    +  approx = (num / den).truncate
    +
    +  if @num < 0
    +    -approx
    +  else
    +    approx
    +  end
    +end
    +
    +
    + +
    +

    + + #to_fObject + + + + + +

    + + + + +
    +
    +
    +
    +317
    +318
    +319
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 317
    +
    +def to_f
    +  @num / @den
    +end
    +
    +
    + +
    +

    + + #to_iObject + + + + + +

    + + + + +
    +
    +
    +
    +321
    +322
    +323
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 321
    +
    +def to_i
    +  truncate
    +end
    +
    +
    + +
    +

    + + #to_rObject + + + + + +

    + + + + +
    +
    +
    +
    +325
    +326
    +327
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 325
    +
    +def to_r
    +  self
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + + +

    + + + + +
    +
    +
    +
    +329
    +330
    +331
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 329
    +
    +def to_s
    +  "#{@num}/#{@den}"
    +end
    +
    +
    + +
    +

    + + #truncate(precision = 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 333
    +
    +def truncate(precision = 0)
    +  if precision == 0
    +    @num < 0 ? ceil : floor
    +  else
    +    with_precision(:truncate, precision)
    +  end
    +end
    +
    +
    + +
    +

    + + #with_precision(method, precision) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +
    +
    # File 'opal/opal/corelib/rational.rb', line 341
    +
    +def with_precision(method, precision)
    +  ::Kernel.raise ::TypeError, 'not an Integer' unless ::Integer === precision
    +
    +  p = 10**precision
    +  s = self * p
    +
    +  if precision < 1
    +    (s.send(method) / p).to_i
    +  else
    +    ::Kernel.Rational(s.send(method), p)
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Refinement.html b/docs/api/v1.8.2/corelib/Refinement.html new file mode 100644 index 00000000..e2a193c5 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Refinement.html @@ -0,0 +1,299 @@ + + + + + + + Class: Refinement + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Refinement + + + +

    +
    + +
    +
    Inherits:
    +
    + Module + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/module.rb
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #refined_class ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute refined_class.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Module

    +

    #<, #<=, #<=>, #===, #>, #>=, #__marshal__, #alias_method, #alias_native, allocate, #ancestors, #append_features, #attr, #attr_accessor, #attr_reader, #attr_writer, #autoload, #autoload?, #class_variable_defined?, #class_variable_get, #class_variable_set, #class_variables, #const_added, #const_defined?, #const_get, #const_missing, #const_set, constants, #constants, #copy_class_variables, #copy_constants, #define_method, #extend_object, #extended, #freeze, #include, #include?, #included, #included_modules, #initialize, #initialize_copy, #initialize_dup, #instance_method, #instance_methods, #instance_variables, #method_added, #method_defined?, #method_removed, #method_undefined, #module_eval, #module_exec, #module_function, #name, nesting, #prepend, #prepend_features, #prepended, #private_class_method, #private_constant, #private_method_defined?, #public, #public_constant, #refine, #refinements, #remove_class_variable, #remove_const, #remove_method, #singleton_class?, #to_s, #undef_method, #using

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Module

    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #refined_classObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute refined_class.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +863
    +864
    +865
    +
    +
    # File 'opal/opal/corelib/module.rb', line 863
    +
    +def refined_class
    +  @refined_class
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +865
    +866
    +867
    +868
    +869
    +870
    +871
    +
    +
    # File 'opal/opal/corelib/module.rb', line 865
    +
    +def inspect
    +  if @refinement_module
    +    "#<refinement:#{@refined_class.inspect}@#{@refinement_module.inspect}>"
    +  else
    +    super
    +  end
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Regexp.html b/docs/api/v1.8.2/corelib/Regexp.html new file mode 100644 index 00000000..d7add34c --- /dev/null +++ b/docs/api/v1.8.2/corelib/Regexp.html @@ -0,0 +1,1661 @@ + + + + + + + Class: Regexp + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Regexp + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/regexp.rb,
    + opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .allocateObject + + + + + +

    + + + + +
    +
    +
    +
    +14
    +15
    +16
    +17
    +18
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 14
    +
    +def allocate
    +  allocated = super
    +  `#{allocated}.uninitialized = true`
    +  allocated
    +end
    +
    +
    + +
    +

    + + .escape(string) ⇒ Object + + + + Also known as: + quote + + + + +

    + + + + +
    +
    +
    +
    +20
    +21
    +22
    +23
    +24
    +25
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 20
    +
    +def escape(string)
    +  %x{
    +    string = $coerce_to(string, #{::String}, 'to_str');
    +    return Opal.escape_regexp(string);
    +  }
    +end
    +
    +
    + +
    +

    + + .last_match(n = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 27
    +
    +def last_match(n = nil)
    +  if n.nil?
    +    $~
    +  elsif $~
    +    $~[n]
    +  end
    +end
    +
    +
    + +
    +

    + + .new(regexp, options = undefined) ⇒ Object + + + + Also known as: + compile + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 78
    +
    +def new(regexp, options = undefined)
    +  %x{
    +    if (regexp.$$is_regexp) {
    +      return new RegExp(regexp);
    +    }
    +
    +    regexp = #{::Opal.coerce_to!(regexp, ::String, :to_str)};
    +
    +    if (regexp.charAt(regexp.length - 1) === '\\' && regexp.charAt(regexp.length - 2) !== '\\') {
    +      #{::Kernel.raise ::RegexpError, "too short escape sequence: /#{regexp}/"}
    +    }
    +
    +    regexp = regexp.replace('\\A', '^').replace('\\z', '$')
    +
    +    if (options === undefined || #{!options}) {
    +      return new RegExp(regexp);
    +    }
    +
    +    if (options.$$is_number) {
    +      var temp = '';
    +      if (#{IGNORECASE} & options) { temp += 'i'; }
    +      if (#{MULTILINE}  & options) { temp += 'm'; }
    +      options = temp;
    +    }
    +    else {
    +      options = 'i';
    +    }
    +
    +    return new RegExp(regexp, options);
    +  }
    +end
    +
    +
    + +
    +

    + + .union(*parts) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 35
    +
    +def union(*parts)
    +  %x{
    +    var is_first_part_array, quoted_validated, part, options, each_part_options;
    +    if (parts.length == 0) {
    +      return /(?!)/;
    +    }
    +    // return fast if there's only one element
    +    if (parts.length == 1 && parts[0].$$is_regexp) {
    +      return parts[0];
    +    }
    +    // cover the 2 arrays passed as arguments case
    +    is_first_part_array = parts[0].$$is_array;
    +    if (parts.length > 1 && is_first_part_array) {
    +      #{::Kernel.raise ::TypeError, 'no implicit conversion of Array into String'}
    +    }
    +    // deal with splat issues (related to https://github.com/opal/opal/issues/858)
    +    if (is_first_part_array) {
    +      parts = parts[0];
    +    }
    +    options = undefined;
    +    quoted_validated = [];
    +    for (var i=0; i < parts.length; i++) {
    +      part = parts[i];
    +      if (part.$$is_string) {
    +        quoted_validated.push(#{escape(`part`)});
    +      }
    +      else if (part.$$is_regexp) {
    +        each_part_options = #{`part`.options};
    +        if (options != undefined && options != each_part_options) {
    +          #{::Kernel.raise ::TypeError, 'All expressions must use the same options'}
    +        }
    +        options = each_part_options;
    +        quoted_validated.push('('+part.source+')');
    +      }
    +      else {
    +        quoted_validated.push(#{escape(`part`.to_str)});
    +      }
    +    }
    +  }
    +  # Take advantage of logic that can parse options from JS Regex
    +  new(`quoted_validated`.join('|'), `options`)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + eql? + + + + +

    + + + + +
    +
    +
    +
    +114
    +115
    +116
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 114
    +
    +def ==(other)
    +  `other instanceof RegExp && self.toString() === other.toString()`
    +end
    +
    +
    + +
    +

    + + #===(string) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +118
    +119
    +120
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 118
    +
    +def ===(string)
    +  `#{match(::Opal.coerce_to?(string, ::String, :to_str))} !== nil`
    +end
    +
    +
    + +
    +

    + + #=~(string) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +122
    +123
    +124
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 122
    +
    +def =~(string)
    +  match(string) && $~.begin(0)
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 85
    +
    +def __marshal__(buffer)
    +  buffer.save_link(self)
    +  buffer.write_ivars_prefix(self)
    +  buffer.write_extends(self)
    +  buffer.write_user_class(::Regexp, self)
    +  buffer.append('/')
    +  buffer.write_regexp(self)
    +  buffer.write_ivars_suffix(self)
    +end
    +
    +
    + +
    +

    + + #casefold?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +304
    +305
    +306
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 304
    +
    +def casefold?
    +  `self.ignoreCase`
    +end
    +
    +
    + +
    +

    + + #freezeObject + + + + + +

    + + + + +
    +
    +
    +
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 126
    +
    +def freeze
    +  # Specialized version of freeze, because the $$gm and $$g properties need to be set
    +  # especially for RegExp.
    +
    +  return self if frozen?
    +
    +  %x{
    +    if (!self.hasOwnProperty('$$g')) { $prop(self, '$$g', null); }
    +    if (!self.hasOwnProperty('$$gm')) { $prop(self, '$$gm', null); }
    +
    +    return $freeze(self);
    +  }
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 140
    +
    +def inspect
    +  # Use a regexp to extract the regular expression and the optional mode modifiers from the string.
    +  # In the regular expression, escape any front slash (not already escaped) with a backslash.
    +  %x{
    +    var regexp_format = /^\/(.*)\/([^\/]*)$/;
    +    var value = self.toString();
    +    var matches = regexp_format.exec(value);
    +    if (matches) {
    +      var regexp_pattern = matches[1];
    +      var regexp_flags = matches[2];
    +      var chars = regexp_pattern.split('');
    +      var chars_length = chars.length;
    +      var char_escaped = false;
    +      var regexp_pattern_escaped = '';
    +      for (var i = 0; i < chars_length; i++) {
    +        var current_char = chars[i];
    +        if (!char_escaped && current_char == '/') {
    +          regexp_pattern_escaped = regexp_pattern_escaped.concat('\\');
    +        }
    +        regexp_pattern_escaped = regexp_pattern_escaped.concat(current_char);
    +        if (current_char == '\\') {
    +          if (char_escaped) {
    +            // does not over escape
    +            char_escaped = false;
    +          } else {
    +            char_escaped = true;
    +          }
    +        } else {
    +          char_escaped = false;
    +        }
    +      }
    +      return '/' + regexp_pattern_escaped + '/' + regexp_flags;
    +    } else {
    +      return value;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #match(string, pos = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +178
    +179
    +180
    +181
    +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
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 178
    +
    +def match(string, pos = undefined, &block)
    +  %x{
    +    if (self.uninitialized) {
    +      #{::Kernel.raise ::TypeError, 'uninitialized Regexp'}
    +    }
    +
    +    if (pos === undefined) {
    +      if (string === nil) return #{$~ = nil};
    +      var m = self.exec($coerce_to(string, #{::String}, 'to_str'));
    +      if (m) {
    +        #{$~ = ::MatchData.new(`self`, `m`)};
    +        return block === nil ? #{$~} : #{yield $~};
    +      } else {
    +        return #{$~ = nil};
    +      }
    +    }
    +
    +    pos = $coerce_to(pos, #{::Integer}, 'to_int');
    +
    +    if (string === nil) {
    +      return #{$~ = nil};
    +    }
    +
    +    string = $coerce_to(string, #{::String}, 'to_str');
    +
    +    if (pos < 0) {
    +      pos += string.length;
    +      if (pos < 0) {
    +        return #{$~ = nil};
    +      }
    +    }
    +
    +    // global RegExp maintains state, so not using self/this
    +    var md, re = Opal.global_regexp(self);
    +
    +    while (true) {
    +      md = re.exec(string);
    +      if (md === null) {
    +        return #{$~ = nil};
    +      }
    +      if (md.index >= pos) {
    +        #{$~ = ::MatchData.new(`re`, `md`)};
    +        return block === nil ? #{$~} : #{yield $~};
    +      }
    +      re.lastIndex = md.index + 1;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #match?(string, pos = undefined) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 227
    +
    +def match?(string, pos = undefined)
    +  %x{
    +    if (self.uninitialized) {
    +      #{::Kernel.raise ::TypeError, 'uninitialized Regexp'}
    +    }
    +
    +    if (pos === undefined) {
    +      return string === nil ? false : self.test($coerce_to(string, #{::String}, 'to_str'));
    +    }
    +
    +    pos = $coerce_to(pos, #{::Integer}, 'to_int');
    +
    +    if (string === nil) {
    +      return false;
    +    }
    +
    +    string = $coerce_to(string, #{::String}, 'to_str');
    +
    +    if (pos < 0) {
    +      pos += string.length;
    +      if (pos < 0) {
    +        return false;
    +      }
    +    }
    +
    +    // global RegExp maintains state, so not using self/this
    +    var md, re = Opal.global_regexp(self);
    +
    +    md = re.exec(string);
    +    if (md === null || md.index < pos) {
    +      return false;
    +    } else {
    +      return true;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #named_capturesObject + + + + + +

    + + + + +
    +
    +
    +
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 268
    +
    +def named_captures
    +  source.scan(/\(?<(\w+)>/, no_matchdata: true) # Scan for capture groups
    +        .map(&:first)                           # Get the first regexp match (\w+)
    +        .each_with_index                        # Add index to an iterator
    +        .group_by(&:first)                      # Group by the capture group names
    +        .transform_values do |i|                # Convert hash values
    +          i.map { |j| j.last + 1 }              # Drop the capture group names; increase indexes by 1
    +        end
    +end
    +
    +
    + +
    +

    + + #namesObject + + + + + +

    + + + + +
    +
    +
    +
    +264
    +265
    +266
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 264
    +
    +def names
    +  source.scan(/\(?<(\w+)>/, no_matchdata: true).map(&:first).uniq
    +end
    +
    +
    + +
    +

    + + #optionsObject + + + + + +

    + + + + +
    +
    +
    +
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 286
    +
    +def options
    +  # Flags would be nice to use with this, but still experimental - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags
    +  %x{
    +    if (self.uninitialized) {
    +      #{::Kernel.raise ::TypeError, 'uninitialized Regexp'}
    +    }
    +    var result = 0;
    +    // should be supported in IE6 according to https://msdn.microsoft.com/en-us/library/7f5z26w4(v=vs.94).aspx
    +    if (self.multiline) {
    +      result |= #{MULTILINE};
    +    }
    +    if (self.ignoreCase) {
    +      result |= #{IGNORECASE};
    +    }
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #sourceObject + + + + Also known as: + to_s + + + + +

    + + + + +
    +
    +
    +
    +282
    +283
    +284
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 282
    +
    +def source
    +  `self.source`
    +end
    +
    +
    + +
    +

    + + #~Object + + + + + +

    + + + + +
    +
    +
    +
    +278
    +279
    +280
    +
    +
    # File 'opal/opal/corelib/regexp.rb', line 278
    +
    +def ~
    +  self =~ $_
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/RegexpError.html b/docs/api/v1.8.2/corelib/RegexpError.html new file mode 100644 index 00000000..9f7dc5d8 --- /dev/null +++ b/docs/api/v1.8.2/corelib/RegexpError.html @@ -0,0 +1,163 @@ + + + + + + + Exception: RegexpError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: RegexpError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/regexp.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + +

    Overview

    +
    +

    helpers: coerce_to, prop, freeze +backtick_javascript: true

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/RuntimeError.html b/docs/api/v1.8.2/corelib/RuntimeError.html new file mode 100644 index 00000000..7f4cfcb9 --- /dev/null +++ b/docs/api/v1.8.2/corelib/RuntimeError.html @@ -0,0 +1,154 @@ + + + + + + + Exception: RuntimeError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: RuntimeError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    FrozenError

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/ScriptError.html b/docs/api/v1.8.2/corelib/ScriptError.html new file mode 100644 index 00000000..2ba10805 --- /dev/null +++ b/docs/api/v1.8.2/corelib/ScriptError.html @@ -0,0 +1,156 @@ + + + + + + + Exception: ScriptError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: ScriptError + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +

    Overview

    +
    +

    keep the indentation, it makes the exception hierarchy clear

    + + +
    +
    +
    + + +
    +

    Direct Known Subclasses

    +

    LoadError, NotImplementedError, SyntaxError

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/SecurityError.html b/docs/api/v1.8.2/corelib/SecurityError.html new file mode 100644 index 00000000..a50e8ecc --- /dev/null +++ b/docs/api/v1.8.2/corelib/SecurityError.html @@ -0,0 +1,142 @@ + + + + + + + Exception: SecurityError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: SecurityError + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Set.html b/docs/api/v1.8.2/corelib/Set.html new file mode 100644 index 00000000..fb57adef --- /dev/null +++ b/docs/api/v1.8.2/corelib/Set.html @@ -0,0 +1,2568 @@ + + + + + + + Class: Set + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Set + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/set.rb
    +
    + +
    + +

    Overview

    +
    +

    Portions Copyright (c) 2002-2013 Akinori MUSHA knu@iDaemons.org

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

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #any?, #chunk, #chunk_while, #collect, #collect_concat, #compact, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #first, #grep, #grep_v, #group_by, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_h, #to_set, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(enum = nil, &block) ⇒ Set + + + + + +

    +
    +

    Returns a new instance of Set.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +
    +
    # File 'opal/opal/corelib/set.rb', line 12
    +
    +def initialize(enum = nil, &block)
    +  @hash = {}
    +
    +  return if enum.nil?
    +  ::Kernel.raise ::ArgumentError, 'value must be enumerable' unless ::Enumerable === enum
    +
    +  if block
    +    enum.each { |item| add yield(item) }
    +  else
    +    merge(enum)
    +  end
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .[](*ary) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +
    +
    # File 'opal/opal/corelib/set.rb', line 8
    +
    +def self.[](*ary)
    +  new(ary)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #-(enum) ⇒ Object + + + + Also known as: + difference + + + + +

    + + + + +
    +
    +
    +
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/set.rb', line 30
    +
    +def -(enum)
    +  unless enum.respond_to? :each
    +    ::Kernel.raise ::ArgumentError, 'value must be enumerable'
    +  end
    +
    +  dup.subtract(enum)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/set.rb', line 42
    +
    +def ==(other)
    +  if equal?(other)
    +    true
    +  elsif other.instance_of?(self.class)
    +    @hash == other.instance_variable_get(:@hash)
    +  elsif other.is_a?(::Set) && size == other.size
    +    other.all? { |o| @hash.include?(o) }
    +  else
    +    false
    +  end
    +end
    +
    +
    + +
    +

    + + #add(o) ⇒ Object + + + + Also known as: + << + + + + +

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +57
    +
    +
    # File 'opal/opal/corelib/set.rb', line 54
    +
    +def add(o)
    +  @hash[o] = true
    +  self
    +end
    +
    +
    + +
    +

    + + #add?(o) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +
    +
    # File 'opal/opal/corelib/set.rb', line 136
    +
    +def add?(o)
    +  if include?(o)
    +    nil
    +  else
    +    add(o)
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +
    +
    # File 'opal/opal/corelib/set.rb', line 59
    +
    +def classify(&block)
    +  return enum_for(:classify) unless block_given?
    +
    +  result = ::Hash.new { |h, k| h[k] = self.class.new }
    +
    +  each { |item| result[yield(item)].add item }
    +
    +  result
    +end
    +
    +
    + +
    +

    + + #clearObject + + + + + +

    + + + + +
    +
    +
    +
    +158
    +159
    +160
    +161
    +
    +
    # File 'opal/opal/corelib/set.rb', line 158
    +
    +def clear
    +  @hash.clear
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +69
    +70
    +71
    +72
    +73
    +74
    +
    +
    # File 'opal/opal/corelib/set.rb', line 69
    +
    +def collect!(&block)
    +  return enum_for(:collect!) unless block_given?
    +  result = self.class.new
    +  each { |item| result << yield(item) }
    +  replace result
    +end
    +
    +
    + +
    +

    + + #compare_by_identityObject + + + + + +

    + + + + +
    +
    +
    +
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +
    +
    # File 'opal/opal/corelib/set.rb', line 76
    +
    +def compare_by_identity
    +  if @hash.respond_to?(:compare_by_identity)
    +    @hash.compare_by_identity
    +    self
    +  else
    +    raise NotImplementedError, "#{self.class.name}\##{__method__} is not implemented"
    +  end
    +end
    +
    +
    + +
    +

    + + #compare_by_identity?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +85
    +86
    +87
    +
    +
    # File 'opal/opal/corelib/set.rb', line 85
    +
    +def compare_by_identity?
    +  @hash.respond_to?(:compare_by_identity?) && @hash.compare_by_identity?
    +end
    +
    +
    + +
    +

    + + #delete(o) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +89
    +90
    +91
    +92
    +
    +
    # File 'opal/opal/corelib/set.rb', line 89
    +
    +def delete(o)
    +  @hash.delete(o)
    +  self
    +end
    +
    +
    + +
    +

    + + #delete?(o) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +94
    +95
    +96
    +97
    +98
    +99
    +
    +
    # File 'opal/opal/corelib/set.rb', line 94
    +
    +def delete?(o)
    +  if include?(o)
    +    delete(o)
    +    self
    +  end
    +end
    +
    +
    + +
    +

    + + #delete_ifObject + + + + + +

    + + + + +
    +
    +
    +
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +
    +
    # File 'opal/opal/corelib/set.rb', line 101
    +
    +def delete_if
    +  return enum_for(:delete_if) unless block_given?
    +  # @hash.delete_if should be faster, but using it breaks the order
    +  # of enumeration in subclasses.
    +  select { |o| yield o }.each { |o| @hash.delete(o) }
    +  self
    +end
    +
    +
    + +
    +

    + + #disjoint?(set) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +234
    +235
    +236
    +
    +
    # File 'opal/opal/corelib/set.rb', line 234
    +
    +def disjoint?(set)
    +  !intersect?(set)
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +25
    +26
    +27
    +28
    +
    +
    # File 'opal/opal/corelib/set.rb', line 25
    +
    +def dup
    +  result = self.class.new
    +  result.merge(self)
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +144
    +145
    +146
    +147
    +148
    +
    +
    # File 'opal/opal/corelib/set.rb', line 144
    +
    +def each(&block)
    +  return enum_for(:each) unless block_given?
    +  @hash.each_key(&block)
    +  self
    +end
    +
    +
    + +
    +

    + + #empty?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +150
    +151
    +152
    +
    +
    # File 'opal/opal/corelib/set.rb', line 150
    +
    +def empty?
    +  @hash.empty?
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +154
    +155
    +156
    +
    +
    # File 'opal/opal/corelib/set.rb', line 154
    +
    +def eql?(other)
    +  @hash.eql?(other.instance_eval { @hash })
    +end
    +
    +
    + +
    +

    + + #freezeObject + + + + + +

    + + + + +
    +
    +
    +
    +109
    +110
    +111
    +112
    +113
    +114
    +
    +
    # File 'opal/opal/corelib/set.rb', line 109
    +
    +def freeze
    +  return self if frozen?
    +
    +  @hash.freeze
    +  `$freeze(self)`
    +end
    +
    +
    + +
    +

    + + #include?(o) ⇒ Boolean + + + + Also known as: + member? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +163
    +164
    +165
    +
    +
    # File 'opal/opal/corelib/set.rb', line 163
    +
    +def include?(o)
    +  @hash.include?(o)
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +38
    +39
    +40
    +
    +
    # File 'opal/opal/corelib/set.rb', line 38
    +
    +def inspect
    +  "#<Set: {#{to_a.join(',')}}>"
    +end
    +
    +
    + +
    +

    + + #intersect?(set) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +
    +
    # File 'opal/opal/corelib/set.rb', line 225
    +
    +def intersect?(set)
    +  `is_set(set)`
    +  if size < set.size
    +    any? { |o| set.include?(o) }
    +  else
    +    set.any? { |o| include?(o) }
    +  end
    +end
    +
    +
    + +
    +

    + + #keep_ifObject + + + + + +

    + + + + +
    +
    +
    +
    +116
    +117
    +118
    +119
    +120
    +
    +
    # File 'opal/opal/corelib/set.rb', line 116
    +
    +def keep_if
    +  return enum_for(:keep_if) unless block_given?
    +  reject { |o| yield o }.each { |o| @hash.delete(o) }
    +  self
    +end
    +
    +
    + +
    +

    + + #merge(enum) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +167
    +168
    +169
    +170
    +
    +
    # File 'opal/opal/corelib/set.rb', line 167
    +
    +def merge(enum)
    +  enum.each { |item| add item }
    +  self
    +end
    +
    +
    + +
    +

    + + #proper_subset?(set) ⇒ Boolean + + + + Also known as: + < + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +219
    +220
    +221
    +222
    +223
    +
    +
    # File 'opal/opal/corelib/set.rb', line 219
    +
    +def proper_subset?(set)
    +  `is_set(set)`
    +  return false if set.size <= size
    +  all? { |o| set.include?(o) }
    +end
    +
    +
    + +
    +

    + + #proper_superset?(set) ⇒ Boolean + + + + Also known as: + > + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +207
    +208
    +209
    +210
    +211
    +
    +
    # File 'opal/opal/corelib/set.rb', line 207
    +
    +def proper_superset?(set)
    +  `is_set(set)`
    +  return false if size <= set.size
    +  set.all? { |o| include?(o) }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +122
    +123
    +124
    +125
    +126
    +127
    +
    +
    # File 'opal/opal/corelib/set.rb', line 122
    +
    +def reject!(&block)
    +  return enum_for(:reject!) unless block_given?
    +  before = size
    +  delete_if(&block)
    +  size == before ? nil : self
    +end
    +
    +
    + +
    +

    + + #replace(enum) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +172
    +173
    +174
    +175
    +176
    +177
    +
    +
    # File 'opal/opal/corelib/set.rb', line 172
    +
    +def replace(enum)
    +  clear
    +  merge(enum)
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +129
    +130
    +131
    +132
    +133
    +134
    +
    +
    # File 'opal/opal/corelib/set.rb', line 129
    +
    +def select!(&block)
    +  return enum_for(:select!) unless block_given?
    +  before = size
    +  keep_if(&block)
    +  size == before ? nil : self
    +end
    +
    +
    + +
    +

    + + #sizeObject + + + + Also known as: + length + + + + +

    + + + + +
    +
    +
    +
    +179
    +180
    +181
    +
    +
    # File 'opal/opal/corelib/set.rb', line 179
    +
    +def size
    +  @hash.size
    +end
    +
    +
    + +
    +

    + + #subset?(set) ⇒ Boolean + + + + Also known as: + <= + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +213
    +214
    +215
    +216
    +217
    +
    +
    # File 'opal/opal/corelib/set.rb', line 213
    +
    +def subset?(set)
    +  `is_set(set)`
    +  return false if set.size < size
    +  all? { |o| set.include?(o) }
    +end
    +
    +
    + +
    +

    + + #subtract(enum) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +183
    +184
    +185
    +186
    +
    +
    # File 'opal/opal/corelib/set.rb', line 183
    +
    +def subtract(enum)
    +  enum.each { |item| delete item }
    +  self
    +end
    +
    +
    + +
    +

    + + #superset?(set) ⇒ Boolean + + + + Also known as: + >= + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +201
    +202
    +203
    +204
    +205
    +
    +
    # File 'opal/opal/corelib/set.rb', line 201
    +
    +def superset?(set)
    +  `is_set(set)`
    +  return false if size < set.size
    +  set.all? { |o| include?(o) }
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + + +

    + + + + +
    +
    +
    +
    +238
    +239
    +240
    +
    +
    # File 'opal/opal/corelib/set.rb', line 238
    +
    +def to_a
    +  @hash.keys
    +end
    +
    +
    + +
    +

    + + #|(enum) ⇒ Object + + + + Also known as: + +, union + + + + +

    + + + + +
    +
    +
    +
    +188
    +189
    +190
    +191
    +192
    +193
    +
    +
    # File 'opal/opal/corelib/set.rb', line 188
    +
    +def |(enum)
    +  unless enum.respond_to? :each
    +    ::Kernel.raise ::ArgumentError, 'value must be enumerable'
    +  end
    +  dup.merge(enum)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Signal.html b/docs/api/v1.8.2/corelib/Signal.html new file mode 100644 index 00000000..c0a916b0 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Signal.html @@ -0,0 +1,190 @@ + + + + + + + Class: Signal + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Signal + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/process/base.rb
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + + + + +
    +

    Class Method Details

    + + +
    +

    + + .trapObject + + + + + +

    + + + + +
    +
    +
    +
    +2
    +3
    +
    +
    # File 'opal/opal/corelib/process/base.rb', line 2
    +
    +def self.trap(*)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/SignalException.html b/docs/api/v1.8.2/corelib/SignalException.html new file mode 100644 index 00000000..38dcac4c --- /dev/null +++ b/docs/api/v1.8.2/corelib/SignalException.html @@ -0,0 +1,146 @@ + + + + + + + Exception: SignalException + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: SignalException + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    Interrupt

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

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/StandardError.html b/docs/api/v1.8.2/corelib/StandardError.html new file mode 100644 index 00000000..e1f05885 --- /dev/null +++ b/docs/api/v1.8.2/corelib/StandardError.html @@ -0,0 +1,146 @@ + + + + + + + Exception: StandardError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: StandardError + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/StopIteration.html b/docs/api/v1.8.2/corelib/StopIteration.html new file mode 100644 index 00000000..57b93ed1 --- /dev/null +++ b/docs/api/v1.8.2/corelib/StopIteration.html @@ -0,0 +1,244 @@ + + + + + + + Exception: StopIteration + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: StopIteration + + + +

    +
    + +
    +
    Inherits:
    +
    + IndexError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + +
    +

    Direct Known Subclasses

    +

    ClosedQueueError

    +
    + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #result ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute result.

      +
      + +
    • + + +
    + + + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #resultObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute result.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +300
    +301
    +302
    +
    +
    # File 'opal/opal/corelib/error.rb', line 300
    +
    +def result
    +  @result
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/String.html b/docs/api/v1.8.2/corelib/String.html new file mode 100644 index 00000000..02e708df --- /dev/null +++ b/docs/api/v1.8.2/corelib/String.html @@ -0,0 +1,8379 @@ + + + + + + + Class: String + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: String + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Comparable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/string.rb,
    + opal/opal/corelib/unsupported.rb,
    opal/opal/corelib/complex/base.rb,
    opal/opal/corelib/rational/base.rb,
    opal/opal/corelib/string/unpack.rb,
    opal/opal/corelib/string/encoding.rb,
    opal/opal/corelib/marshal/write_buffer.rb
    +
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #encoding ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute encoding.

      +
      + +
    • + + +
    • + + + #internal_encoding ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute internal_encoding.

      +
      + +
    • + + +
    + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Comparable

    +

    #<, #<=, #>, #>=, #between?, #clamp

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(str = undefined, encoding: nil, capacity: nil) ⇒ String + + + + + +

    +
    +

    Our initialize method does nothing, the string value setup is being +done by String.new. Therefore not all kinds of subclassing will work. +As a rule of thumb, when subclassing String, either make sure to override +.new or make sure that the first argument given to a constructor is +a string we want our subclass-string to hold.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +73
    +74
    +
    +
    # File 'opal/opal/corelib/string.rb', line 73
    +
    +def initialize(str = undefined, encoding: nil, capacity: nil)
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #encodingObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute encoding.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +308
    +309
    +310
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 308
    +
    +def encoding
    +  @encoding
    +end
    +
    +
    + + + +
    +

    + + #internal_encodingObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute internal_encoding.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +309
    +310
    +311
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 309
    +
    +def internal_encoding
    +  @internal_encoding
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + ._load(*args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1870
    +1871
    +1872
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1870
    +
    +def self._load(*args)
    +  new(*args)
    +end
    +
    +
    + +
    +

    + + .new(*args) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +
    +
    # File 'opal/opal/corelib/string.rb', line 54
    +
    +def self.new(*args)
    +  %x{
    +    var str = args[0] || "";
    +    var opts = args[args.length-1];
    +    str = $coerce_to(str, #{::String}, 'to_str');
    +    if (opts && opts.$$is_hash) {
    +      if (opts.has('encoding')) str = str.$force_encoding(opts.get('encoding').value);
    +    }
    +    str = new self.$$constructor(str);
    +    if (!str.$initialize.$$pristine) #{`str`.initialize(*args)};
    +    return str;
    +  }
    +end
    +
    +
    + +
    +

    + + .try_convert(what) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +50
    +51
    +52
    +
    +
    # File 'opal/opal/corelib/string.rb', line 50
    +
    +def self.try_convert(what)
    +  ::Opal.coerce_to?(what, ::String, :to_str)
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #%(data) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +
    +
    # File 'opal/opal/corelib/string.rb', line 76
    +
    +def %(data)
    +  if ::Array === data
    +    format(self, *data)
    +  else
    +    format(self, data)
    +  end
    +end
    +
    +
    + +
    +

    + + #*(count) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/string.rb', line 84
    +
    +def *(count)
    +  %x{
    +    count = $coerce_to(count, #{::Integer}, 'to_int');
    +
    +    if (count < 0) {
    +      #{::Kernel.raise ::ArgumentError, 'negative argument'}
    +    }
    +
    +    if (count === 0) {
    +      return '';
    +    }
    +
    +    var result = '',
    +        string = self.toString();
    +
    +    // All credit for the bit-twiddling magic code below goes to Mozilla
    +    // polyfill implementation of String.prototype.repeat() posted here:
    +    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
    +
    +    if (string.length * count >= 1 << 28) {
    +      #{::Kernel.raise ::RangeError, 'multiply count must not overflow maximum string size'}
    +    }
    +
    +    for (;;) {
    +      if ((count & 1) === 1) {
    +        result += string;
    +      }
    +      count >>>= 1;
    +      if (count === 0) {
    +        break;
    +      }
    +      string += string;
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +
    +
    # File 'opal/opal/corelib/string.rb', line 122
    +
    +def +(other)
    +  other = `$coerce_to(#{other}, #{::String}, 'to_str')`
    +
    +  %x{
    +    if (other == "" && self.$$class === Opal.String) return #{self};
    +    if (self == "" && other.$$class === Opal.String) return #{other};
    +    var out = self + other;
    +    if (self.encoding === out.encoding && other.encoding === out.encoding) return out;
    +    if (self.encoding.name === "UTF-8" || other.encoding.name === "UTF-8") return out;
    +    return Opal.enc(out, self.encoding);
    +  }
    +end
    +
    +
    + +
    +

    + + #-@Object + + + + + +

    + + + + +
    +
    +
    +
    +1899
    +1900
    +1901
    +1902
    +1903
    +1904
    +1905
    +1906
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1899
    +
    +def -@
    +  %x{
    +    if (typeof self === 'string') return self;
    +    if (self.$$frozen) return self;
    +    if (self.encoding.name == 'UTF-8' && self.internal_encoding.name == 'UTF-8') return self.toString();
    +    return self.$dup().$freeze();
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +
    +
    # File 'opal/opal/corelib/string.rb', line 135
    +
    +def <=>(other)
    +  if other.respond_to? :to_str
    +    other = other.to_str.to_s
    +
    +    `self > other ? 1 : (self < other ? -1 : 0)`
    +  else
    +    %x{
    +      var cmp = #{other <=> self};
    +
    +      if (cmp === nil) {
    +        return nil;
    +      }
    +      else {
    +        return cmp > 0 ? -1 : (cmp < 0 ? 1 : 0);
    +      }
    +    }
    +  end
    +end
    +
    +
    + +
    +

    + + #==(other) ⇒ Object + + + + Also known as: + ===, eql? + + + + +

    + + + + +
    +
    +
    +
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +
    +
    # File 'opal/opal/corelib/string.rb', line 154
    +
    +def ==(other)
    +  %x{
    +    if (other.$$is_string) {
    +      return self.toString() === other.toString();
    +    }
    +    if ($respond_to(other, '$to_str')) {
    +      return #{other == self};
    +    }
    +    return false;
    +  }
    +end
    +
    +
    + +
    +

    + + #=~(other) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +
    +
    # File 'opal/opal/corelib/string.rb', line 166
    +
    +def =~(other)
    +  %x{
    +    if (other.$$is_string) {
    +      #{::Kernel.raise ::TypeError, 'type mismatch: String given'};
    +    }
    +
    +    return #{other =~ self};
    +  }
    +end
    +
    +
    + +
    +

    + + #[](index, length = undefined) ⇒ Object + + + + Also known as: + byteslice, slice + + + + +

    + + + + +
    +
    +
    +
    +176
    +177
    +178
    +179
    +180
    +181
    +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
    +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
    +
    +
    # File 'opal/opal/corelib/string.rb', line 176
    +
    +def [](index, length = undefined)
    +  %x{
    +    var size = self.length, exclude, range;
    +
    +    if (index.$$is_range) {
    +      exclude = index.excl;
    +      range   = index;
    +      length  = index.end === nil ? -1 : $coerce_to(index.end, #{::Integer}, 'to_int');
    +      index   = index.begin === nil ? 0 : $coerce_to(index.begin, #{::Integer}, 'to_int');
    +
    +      if (Math.abs(index) > size) {
    +        return nil;
    +      }
    +
    +      if (index < 0) {
    +        index += size;
    +      }
    +
    +      if (length < 0) {
    +        length += size;
    +      }
    +
    +      if (!exclude || range.end === nil) {
    +        length += 1;
    +      }
    +
    +      length = length - index;
    +
    +      if (length < 0) {
    +        length = 0;
    +      }
    +
    +      return self.substr(index, length);
    +    }
    +
    +
    +    if (index.$$is_string) {
    +      if (length != null) {
    +        #{::Kernel.raise ::TypeError}
    +      }
    +      return self.indexOf(index) !== -1 ? index : nil;
    +    }
    +
    +
    +    if (index.$$is_regexp) {
    +      var match = self.match(index);
    +
    +      if (match === null) {
    +        #{$~ = nil}
    +        return nil;
    +      }
    +
    +      #{$~ = ::MatchData.new(`index`, `match`)}
    +
    +      if (length == null) {
    +        return match[0];
    +      }
    +
    +      length = $coerce_to(length, #{::Integer}, 'to_int');
    +
    +      if (length < 0 && -length < match.length) {
    +        return match[length += match.length];
    +      }
    +
    +      if (length >= 0 && length < match.length) {
    +        return match[length];
    +      }
    +
    +      return nil;
    +    }
    +
    +
    +    index = $coerce_to(index, #{::Integer}, 'to_int');
    +
    +    if (index < 0) {
    +      index += size;
    +    }
    +
    +    if (length == null) {
    +      if (index >= size || index < 0) {
    +        return nil;
    +      }
    +      return self.substr(index, 1);
    +    }
    +
    +    length = $coerce_to(length, #{::Integer}, 'to_int');
    +
    +    if (length < 0) {
    +      return nil;
    +    }
    +
    +    if (index > size || index < 0) {
    +      return nil;
    +    }
    +
    +    return self.substr(index, length);
    +  }
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 40
    +
    +def __marshal__(buffer)
    +  buffer.save_link(self)
    +  buffer.write_ivars_prefix(self)
    +  buffer.write_extends(self)
    +  buffer.write_user_class(::String, self)
    +  buffer.append('"')
    +  buffer.write_string(self)
    +end
    +
    +
    + +
    +

    + + #ascii_only?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +730
    +731
    +732
    +733
    +734
    +735
    +736
    +
    +
    # File 'opal/opal/corelib/string.rb', line 730
    +
    +def ascii_only?
    +  # non-ASCII-compatible encoding must return false
    +  %x{
    +    if (!self.encoding.ascii) return false;
    +    return /^[\x00-\x7F]*$/.test(self);
    +  }
    +end
    +
    +
    + +
    +

    + + #bObject + + + + + +

    + + + + +
    +
    +
    +
    +275
    +276
    +277
    +
    +
    # File 'opal/opal/corelib/string.rb', line 275
    +
    +def b
    +  `new String(#{self})`.force_encoding('binary')
    +end
    +
    +
    + +
    +

    + + #bytesObject + + + + + +

    + + + + +
    +
    +
    +
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 330
    +
    +def bytes
    +  # REMIND: required when running in strict mode, otherwise the following error will be thrown:
    +  # Cannot create property 'bytes' on string 'abc'
    +  %x{
    +    if (typeof self === 'string') {
    +      return #{`new String(self)`.each_byte.to_a};
    +    }
    +  }
    +
    +  @bytes ||= each_byte.to_a
    +  @bytes.dup
    +end
    +
    +
    + +
    +

    + + #bytesizeObject + + + + + +

    + + + + +
    +
    +
    +
    +318
    +319
    +320
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 318
    +
    +def bytesize
    +  @internal_encoding.bytesize(self)
    +end
    +
    +
    + +
    +

    + + #capitalizeObject + + + + + +

    + + + + +
    +
    +
    +
    +279
    +280
    +281
    +
    +
    # File 'opal/opal/corelib/string.rb', line 279
    +
    +def capitalize
    +  `self.charAt(0).toUpperCase() + self.substr(1).toLowerCase()`
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +
    +
    # File 'opal/opal/corelib/string.rb', line 283
    +
    +def casecmp(other)
    +  return nil unless other.respond_to?(:to_str)
    +  other = `$coerce_to(other, #{::String}, 'to_str')`.to_s
    +  %x{
    +    var ascii_only = /^[\x00-\x7F]*$/;
    +    if (ascii_only.test(self) && ascii_only.test(other)) {
    +      self = self.toLowerCase();
    +      other = other.toLowerCase();
    +    }
    +  }
    +  self <=> other
    +end
    +
    +
    + +
    +

    + + #casecmp?(other) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +
    +
    # File 'opal/opal/corelib/string.rb', line 296
    +
    +def casecmp?(other)
    +  %x{
    +    var cmp = #{casecmp(other)};
    +    if (cmp === nil) {
    +      return nil;
    +    } else {
    +      return cmp === 0;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #center(width, padstr = ' ') ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +
    +
    # File 'opal/opal/corelib/string.rb', line 307
    +
    +def center(width, padstr = ' ')
    +  width  = `$coerce_to(#{width}, #{::Integer}, 'to_int')`
    +  padstr = `$coerce_to(#{padstr}, #{::String}, 'to_str')`.to_s
    +
    +  if padstr.empty?
    +    ::Kernel.raise ::ArgumentError, 'zero width padding'
    +  end
    +
    +  return self if `width <= self.length`
    +
    +  %x{
    +    var ljustified = #{ljust ((width + `self.length`) / 2).ceil, padstr},
    +        rjustified = #{rjust ((width + `self.length`) / 2).floor, padstr};
    +
    +    return rjustified + ljustified.slice(self.length);
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +351
    +352
    +353
    +354
    +355
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 351
    +
    +def chars(&block)
    +  return each_char.to_a unless block
    +
    +  each_char(&block)
    +end
    +
    +
    + +
    +

    + + #chomp(separator = $/) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +
    +
    # File 'opal/opal/corelib/string.rb', line 325
    +
    +def chomp(separator = $/)
    +  return self if `separator === nil || self.length === 0`
    +
    +  separator = ::Opal.coerce_to!(separator, ::String, :to_str).to_s
    +
    +  %x{
    +    var result;
    +
    +    if (separator === "\n") {
    +      result = self.replace(/\r?\n?$/, '');
    +    }
    +    else if (separator === "") {
    +      result = self.replace(/(\r?\n)+$/, '');
    +    }
    +    else if (self.length >= separator.length) {
    +      var tail = self.substr(self.length - separator.length, separator.length);
    +
    +      if (tail === separator) {
    +        result = self.substr(0, self.length - separator.length);
    +      }
    +    }
    +
    +    if (result != null) {
    +      return result;
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #chopObject + + + + + +

    + + + + +
    +
    +
    +
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +
    +
    # File 'opal/opal/corelib/string.rb', line 355
    +
    +def chop
    +  %x{
    +    var length = self.length, result;
    +
    +    if (length <= 1) {
    +      result = "";
    +    } else if (self.charAt(length - 1) === "\n" && self.charAt(length - 2) === "\r") {
    +      result = self.substr(0, length - 2);
    +    } else {
    +      result = self.substr(0, length - 1);
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #chrObject + + + + + +

    + + + + +
    +
    +
    +
    +371
    +372
    +373
    +
    +
    # File 'opal/opal/corelib/string.rb', line 371
    +
    +def chr
    +  `self.charAt(0)`
    +end
    +
    +
    + +
    +

    + + #clone(freeze: nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +
    +
    # File 'opal/opal/corelib/string.rb', line 375
    +
    +def clone(freeze: nil)
    +  unless freeze.nil? || freeze == true || freeze == false
    +    raise ArgumentError, "unexpected value for freeze: #{freeze.class}"
    +  end
    +
    +  copy = `new String(self)`
    +  copy.copy_singleton_methods(self)
    +  copy.initialize_clone(self, freeze: freeze)
    +
    +  if freeze == true
    +    `if (!copy.$$frozen) { copy.$$frozen = true; }`
    +  elsif freeze.nil?
    +    `if (self.$$frozen) { copy.$$frozen = true; }`
    +  end
    +
    +  copy
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +367
    +368
    +369
    +370
    +371
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 367
    +
    +def codepoints(&block)
    +  # If a block is given, which is a deprecated form, works the same as each_codepoint.
    +  return each_codepoint(&block) if block_given?
    +  each_codepoint.to_a
    +end
    +
    +
    + +
    +

    + + #count(*sets) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +
    +
    # File 'opal/opal/corelib/string.rb', line 399
    +
    +def count(*sets)
    +  %x{
    +    if (sets.length === 0) {
    +      #{::Kernel.raise ::ArgumentError, 'ArgumentError: wrong number of arguments (0 for 1+)'}
    +    }
    +    var char_class = char_class_from_char_sets(sets);
    +    if (char_class === null) {
    +      return 0;
    +    }
    +    return self.length - self.replace(new RegExp(char_class, 'g'), '').length;
    +  }
    +end
    +
    +
    + +
    +

    + + #delete(*sets) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +
    +
    # File 'opal/opal/corelib/string.rb', line 412
    +
    +def delete(*sets)
    +  %x{
    +    if (sets.length === 0) {
    +      #{::Kernel.raise ::ArgumentError, 'ArgumentError: wrong number of arguments (0 for 1+)'}
    +    }
    +    var char_class = char_class_from_char_sets(sets);
    +    if (char_class === null) {
    +      return self;
    +    }
    +    return self.replace(new RegExp(char_class, 'g'), '');
    +  }
    +end
    +
    +
    + +
    +

    + + #delete_prefix(prefix) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +
    +
    # File 'opal/opal/corelib/string.rb', line 425
    +
    +def delete_prefix(prefix)
    +  %x{
    +    if (!prefix.$$is_string) {
    +      prefix = $coerce_to(prefix, #{::String}, 'to_str');
    +    }
    +
    +    if (self.slice(0, prefix.length) === prefix) {
    +      return self.slice(prefix.length);
    +    } else {
    +      return self;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #delete_suffix(suffix) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +
    +
    # File 'opal/opal/corelib/string.rb', line 439
    +
    +def delete_suffix(suffix)
    +  %x{
    +    if (!suffix.$$is_string) {
    +      suffix = $coerce_to(suffix, #{::String}, 'to_str');
    +    }
    +
    +    if (self.slice(self.length - suffix.length) === suffix) {
    +      return self.slice(0, self.length - suffix.length);
    +    } else {
    +      return self;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #downcaseObject + + + + + +

    + + + + +
    +
    +
    +
    +453
    +454
    +455
    +
    +
    # File 'opal/opal/corelib/string.rb', line 453
    +
    +def downcase
    +  `self.toLowerCase()`
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + Also known as: + +@ + + + + +

    + + + + +
    +
    +
    +
    +393
    +394
    +395
    +396
    +397
    +
    +
    # File 'opal/opal/corelib/string.rb', line 393
    +
    +def dup
    +  copy = `new String(self)`
    +  copy.initialize_dup(self)
    +  copy
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 322
    +
    +def each_byte(&block)
    +  return enum_for(:each_byte) { bytesize } unless block_given?
    +
    +  @internal_encoding.each_byte(self, &block)
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 343
    +
    +def each_char(&block)
    +  return enum_for(:each_char) { length } unless block_given?
    +
    +  @encoding.each_char(self, &block)
    +
    +  self
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 357
    +
    +def each_codepoint(&block)
    +  return enum_for :each_codepoint unless block_given?
    +  %x{
    +    for (var i = 0, length = self.length; i < length; i++) {
    +      #{yield `self.codePointAt(i)`};
    +    }
    +  }
    +  self
    +end
    +
    +
    + +
    +

    + + #each_line(separator = $/, chomp: false, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +
    +
    # File 'opal/opal/corelib/string.rb', line 457
    +
    +def each_line(separator = $/, chomp: false, &block)
    +  return enum_for :each_line, separator, chomp: chomp unless block_given?
    +
    +  %x{
    +    if (separator === nil) {
    +      Opal.yield1(block, self);
    +
    +      return self;
    +    }
    +
    +    separator = $coerce_to(separator, #{::String}, 'to_str');
    +
    +    var a, i, n, length, chomped, trailing, splitted, value;
    +
    +    if (separator.length === 0) {
    +      for (a = self.split(/((?:\r?\n){2})(?:(?:\r?\n)*)/), i = 0, n = a.length; i < n; i += 2) {
    +        if (a[i] || a[i + 1]) {
    +          value = (a[i] || "") + (a[i + 1] || "");
    +          if (chomp) {
    +            value = #{`value`.chomp("\n")};
    +          }
    +          Opal.yield1(block, value);
    +        }
    +      }
    +
    +      return self;
    +    }
    +
    +    chomped  = #{chomp(separator)};
    +    trailing = self.length != chomped.length;
    +    splitted = chomped.split(separator);
    +
    +    for (i = 0, length = splitted.length; i < length; i++) {
    +      value = splitted[i];
    +      if (i < length - 1 || trailing) {
    +        value += separator;
    +      }
    +      if (chomp) {
    +        value = #{`value`.chomp(separator)};
    +      }
    +      Opal.yield1(block, value);
    +    }
    +  }
    +
    +  self
    +end
    +
    +
    + +
    +

    + + #empty?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +504
    +505
    +506
    +
    +
    # File 'opal/opal/corelib/string.rb', line 504
    +
    +def empty?
    +  `self.length === 0`
    +end
    +
    +
    + +
    +

    + + #encode(encoding) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +373
    +374
    +375
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 373
    +
    +def encode(encoding)
    +  `Opal.enc(self, encoding)`
    +end
    +
    +
    + +
    +

    + + #end_with?(*suffixes) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +
    +
    # File 'opal/opal/corelib/string.rb', line 508
    +
    +def end_with?(*suffixes)
    +  %x{
    +    for (var i = 0, length = suffixes.length; i < length; i++) {
    +      var suffix = $coerce_to(suffixes[i], #{::String}, 'to_str').$to_s();
    +
    +      if (self.length >= suffix.length &&
    +          self.substr(self.length - suffix.length, suffix.length) == suffix) {
    +        return true;
    +      }
    +    }
    +  }
    +
    +  false
    +end
    +
    +
    + +
    +

    + + #force_encoding(encoding) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 377
    +
    +def force_encoding(encoding)
    +  %x{
    +    var str = self;
    +
    +    if (encoding === str.encoding) { return str; }
    +
    +    encoding = #{::Opal.coerce_to!(encoding, ::String, :to_s)};
    +    encoding = #{::Encoding.find(encoding)};
    +
    +    if (encoding === str.encoding) { return str; }
    +
    +    str = Opal.set_encoding(str, encoding);
    +
    +    return str;
    +  }
    +end
    +
    +
    + +
    +

    + + #freezeObject + + + + + +

    + + + + +
    +
    +
    +
    +1891
    +1892
    +1893
    +1894
    +1895
    +1896
    +1897
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1891
    +
    +def freeze
    +  %x{
    +    if (typeof self === 'string') { return self; }
    +    $prop(self, "$$frozen", true);
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #frozen?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +1908
    +1909
    +1910
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1908
    +
    +def frozen?
    +  `typeof self === 'string' || self.$$frozen === true`
    +end
    +
    +
    + +
    +

    + + #getbyte(idx) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 394
    +
    +def getbyte(idx)
    +  string_bytes = bytes
    +  idx = ::Opal.coerce_to!(idx, ::Integer, :to_int)
    +  return if string_bytes.length < idx
    +
    +  string_bytes[idx]
    +end
    +
    +
    + +
    +

    + + #gsub(pattern, replacement = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +523
    +524
    +525
    +526
    +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
    +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
    +577
    +578
    +579
    +580
    +581
    +582
    +583
    +584
    +585
    +586
    +587
    +588
    +589
    +590
    +591
    +592
    +593
    +594
    +595
    +
    +
    # File 'opal/opal/corelib/string.rb', line 523
    +
    +def gsub(pattern, replacement = undefined, &block)
    +  %x{
    +    if (replacement === undefined && block === nil) {
    +      return #{enum_for :gsub, pattern};
    +    }
    +
    +    var result = '', match_data = nil, index = 0, match, _replacement;
    +
    +    if (pattern.$$is_regexp) {
    +      pattern = $global_multiline_regexp(pattern);
    +    } else {
    +      pattern = $coerce_to(pattern, #{::String}, 'to_str');
    +      pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gm');
    +    }
    +
    +    var lastIndex;
    +    while (true) {
    +      match = pattern.exec(self);
    +
    +      if (match === null) {
    +        #{$~ = nil}
    +        result += self.slice(index);
    +        break;
    +      }
    +
    +      match_data = #{::MatchData.new `pattern`, `match`};
    +
    +      if (replacement === undefined) {
    +        lastIndex = pattern.lastIndex;
    +        _replacement = block(match[0]);
    +        pattern.lastIndex = lastIndex; // save and restore lastIndex
    +      }
    +      else if (replacement.$$is_hash) {
    +        _replacement = #{`replacement`[`match[0]`].to_s};
    +      }
    +      else {
    +        if (!replacement.$$is_string) {
    +          replacement = $coerce_to(replacement, #{::String}, 'to_str');
    +        }
    +        _replacement = replacement.replace(/([\\]+)([0-9+&`'])/g, function (original, slashes, command) {
    +          if (slashes.length % 2 === 0) {
    +            return original;
    +          }
    +          switch (command) {
    +          case "+":
    +            for (var i = match.length - 1; i > 0; i--) {
    +              if (match[i] !== undefined) {
    +                return slashes.slice(1) + match[i];
    +              }
    +            }
    +            return '';
    +          case "&": return slashes.slice(1) + match[0];
    +          case "`": return slashes.slice(1) + self.slice(0, match.index);
    +          case "'": return slashes.slice(1) + self.slice(match.index + match[0].length);
    +          default:  return slashes.slice(1) + (match[command] || '');
    +          }
    +        }).replace(/\\\\/g, '\\');
    +      }
    +
    +      if (pattern.lastIndex === match.index) {
    +        result += (self.slice(index, match.index) + _replacement + (self[match.index] || ""));
    +        pattern.lastIndex += 1;
    +      }
    +      else {
    +        result += (self.slice(index, match.index) + _replacement)
    +      }
    +      index = pattern.lastIndex;
    +    }
    +
    +    #{$~ = `match_data`}
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #hexObject + + + + + +

    + + + + +
    +
    +
    +
    +597
    +598
    +599
    +
    +
    # File 'opal/opal/corelib/string.rb', line 597
    +
    +def hex
    +  to_i 16
    +end
    +
    +
    + +
    +

    + + #include?(other) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +601
    +602
    +603
    +604
    +605
    +606
    +607
    +608
    +
    +
    # File 'opal/opal/corelib/string.rb', line 601
    +
    +def include?(other)
    +  %x{
    +    if (!other.$$is_string) {
    +      other = $coerce_to(other, #{::String}, 'to_str');
    +    }
    +    return self.indexOf(other) !== -1;
    +  }
    +end
    +
    +
    + +
    +

    + + #index(search, offset = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +648
    +649
    +650
    +651
    +652
    +653
    +654
    +655
    +
    +
    # File 'opal/opal/corelib/string.rb', line 610
    +
    +def index(search, offset = undefined)
    +  %x{
    +    var index,
    +        match,
    +        regex;
    +
    +    if (offset === undefined) {
    +      offset = 0;
    +    } else {
    +      offset = $coerce_to(offset, #{::Integer}, 'to_int');
    +      if (offset < 0) {
    +        offset += self.length;
    +        if (offset < 0) {
    +          return nil;
    +        }
    +      }
    +    }
    +
    +    if (search.$$is_regexp) {
    +      regex = $global_multiline_regexp(search);
    +      while (true) {
    +        match = regex.exec(self);
    +        if (match === null) {
    +          #{$~ = nil};
    +          index = -1;
    +          break;
    +        }
    +        if (match.index >= offset) {
    +          #{$~ = ::MatchData.new(`regex`, `match`)}
    +          index = match.index;
    +          break;
    +        }
    +        regex.lastIndex = match.index + 1;
    +      }
    +    } else {
    +      search = $coerce_to(search, #{::String}, 'to_str');
    +      if (search.length === 0 && offset > self.length) {
    +        index = -1;
    +      } else {
    +        index = self.indexOf(search, offset);
    +      }
    +    }
    +
    +    return index === -1 ? nil : index;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +402
    +403
    +404
    +405
    +406
    +407
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 402
    +
    +def initialize_copy(other)
    +  %{
    +    self.encoding = other.encoding;
    +    self.internal_encoding = other.internal_encoding;
    +  }
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/string.rb', line 657
    +
    +def inspect
    +  %x{
    +    /* eslint-disable no-misleading-character-class */
    +    var escapable = /[\\\"\x00-\x1f\u007F-\u009F\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    +        meta = {
    +          '\u0007': '\\a',
    +          '\u001b': '\\e',
    +          '\b': '\\b',
    +          '\t': '\\t',
    +          '\n': '\\n',
    +          '\f': '\\f',
    +          '\r': '\\r',
    +          '\v': '\\v',
    +          '"' : '\\"',
    +          '\\': '\\\\'
    +        },
    +        escaped = self.replace(escapable, function (chr) {
    +          if (meta[chr]) return meta[chr];
    +          chr = chr.charCodeAt(0);
    +          if (chr <= 0xff && (self.encoding["$binary?"]() || self.internal_encoding["$binary?"]())) {
    +            return '\\x' + ('00' + chr.toString(16).toUpperCase()).slice(-2);
    +          } else {
    +            return '\\u' + ('0000' + chr.toString(16).toUpperCase()).slice(-4);
    +          }
    +        });
    +    return '"' + escaped.replace(/\#[\$\@\{]/g, '\\$&') + '"';
    +    /* eslint-enable no-misleading-character-class */
    +  }
    +end
    +
    +
    + +
    +

    + + #instance_variablesObject + + + + + +

    + + + + +
    +
    +
    +
    +1866
    +1867
    +1868
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1866
    +
    +def instance_variables
    +  []
    +end
    +
    +
    + +
    +

    + + #internObject + + + + Also known as: + to_sym + + + + +

    + + + + +
    +
    +
    +
    +687
    +688
    +689
    +
    +
    # File 'opal/opal/corelib/string.rb', line 687
    +
    +def intern
    +  `self.toString()`
    +end
    +
    +
    + +
    +

    + + #lengthObject + + + + Also known as: + size + + + + +

    + + + + +
    +
    +
    +
    +691
    +692
    +693
    +
    +
    # File 'opal/opal/corelib/string.rb', line 691
    +
    +def length
    +  `self.length`
    +end
    +
    +
    + +
    +

    + + #lines(separator = $/, chomp: false, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +697
    +698
    +699
    +700
    +
    +
    # File 'opal/opal/corelib/string.rb', line 697
    +
    +def lines(separator = $/, chomp: false, &block)
    +  e = each_line(separator, chomp: chomp, &block)
    +  block ? self : e.to_a
    +end
    +
    +
    + +
    +

    + + #ljust(width, padstr = ' ') ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +702
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +714
    +715
    +716
    +717
    +718
    +719
    +720
    +721
    +722
    +723
    +724
    +
    +
    # File 'opal/opal/corelib/string.rb', line 702
    +
    +def ljust(width, padstr = ' ')
    +  width  = `$coerce_to(#{width}, #{::Integer}, 'to_int')`
    +  padstr = `$coerce_to(#{padstr}, #{::String}, 'to_str')`.to_s
    +
    +  if padstr.empty?
    +    ::Kernel.raise ::ArgumentError, 'zero width padding'
    +  end
    +
    +  return self if `width <= self.length`
    +
    +  %x{
    +    var index  = -1,
    +        result = "";
    +
    +    width -= self.length;
    +
    +    while (++index < width) {
    +      result += padstr;
    +    }
    +
    +    return self + result.slice(0, width);
    +  }
    +end
    +
    +
    + +
    +

    + + #lstripObject + + + + + +

    + + + + +
    +
    +
    +
    +726
    +727
    +728
    +
    +
    # File 'opal/opal/corelib/string.rb', line 726
    +
    +def lstrip
    +  `self.replace(/^[\x00\x09\x0a-\x0d\x20]*/, '')`
    +end
    +
    +
    + +
    +

    + + #match(pattern, pos = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +738
    +739
    +740
    +741
    +742
    +743
    +744
    +745
    +746
    +747
    +748
    +
    +
    # File 'opal/opal/corelib/string.rb', line 738
    +
    +def match(pattern, pos = undefined, &block)
    +  if String === pattern || pattern.respond_to?(:to_str)
    +    pattern = ::Regexp.new(pattern.to_str)
    +  end
    +
    +  unless ::Regexp === pattern
    +    ::Kernel.raise ::TypeError, "wrong argument type #{pattern.class} (expected Regexp)"
    +  end
    +
    +  pattern.match(self, pos, &block)
    +end
    +
    +
    + +
    +

    + + #match?(pattern, pos = undefined) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +750
    +751
    +752
    +753
    +754
    +755
    +756
    +757
    +758
    +759
    +760
    +
    +
    # File 'opal/opal/corelib/string.rb', line 750
    +
    +def match?(pattern, pos = undefined)
    +  if String === pattern || pattern.respond_to?(:to_str)
    +    pattern = ::Regexp.new(pattern.to_str)
    +  end
    +
    +  unless ::Regexp === pattern
    +    ::Kernel.raise ::TypeError, "wrong argument type #{pattern.class} (expected Regexp)"
    +  end
    +
    +  pattern.match?(self, pos)
    +end
    +
    +
    + +
    +

    + + #nextObject + + + + Also known as: + succ + + + + +

    + + + + +
    +
    +
    +
    +762
    +763
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +776
    +777
    +778
    +779
    +780
    +781
    +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
    +824
    +825
    +826
    +827
    +828
    +829
    +830
    +
    +
    # File 'opal/opal/corelib/string.rb', line 762
    +
    +def next
    +  %x{
    +    var i = self.length;
    +    if (i === 0) {
    +      return '';
    +    }
    +    var result = self;
    +    var first_alphanum_char_index = self.search(/[a-zA-Z0-9]/);
    +    var carry = false;
    +    var code;
    +    while (i--) {
    +      code = self.charCodeAt(i);
    +      if ((code >= 48 && code <= 57) ||
    +        (code >= 65 && code <= 90) ||
    +        (code >= 97 && code <= 122)) {
    +        switch (code) {
    +        case 57:
    +          carry = true;
    +          code = 48;
    +          break;
    +        case 90:
    +          carry = true;
    +          code = 65;
    +          break;
    +        case 122:
    +          carry = true;
    +          code = 97;
    +          break;
    +        default:
    +          carry = false;
    +          code += 1;
    +        }
    +      } else {
    +        if (first_alphanum_char_index === -1) {
    +          if (code === 255) {
    +            carry = true;
    +            code = 0;
    +          } else {
    +            carry = false;
    +            code += 1;
    +          }
    +        } else {
    +          carry = true;
    +        }
    +      }
    +      result = result.slice(0, i) + String.fromCharCode(code) + result.slice(i + 1);
    +      if (carry && (i === 0 || i === first_alphanum_char_index)) {
    +        switch (code) {
    +        case 65:
    +          break;
    +        case 97:
    +          break;
    +        default:
    +          code += 1;
    +        }
    +        if (i === 0) {
    +          result = String.fromCharCode(code) + result;
    +        } else {
    +          result = result.slice(0, i) + String.fromCharCode(code) + result.slice(i);
    +        }
    +        carry = false;
    +      }
    +      if (!carry) {
    +        break;
    +      }
    +    }
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #octObject + + + + + +

    + + + + +
    +
    +
    +
    +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
    +869
    +870
    +871
    +872
    +873
    +
    +
    # File 'opal/opal/corelib/string.rb', line 832
    +
    +def oct
    +  %x{
    +    var result,
    +        string = self,
    +        radix = 8;
    +
    +    if (/^\s*_/.test(string)) {
    +      return 0;
    +    }
    +
    +    string = string.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i, function (original, head, flag, tail) {
    +      switch (tail.charAt(0)) {
    +      case '+':
    +      case '-':
    +        return original;
    +      case '0':
    +        if (tail.charAt(1) === 'x' && flag === '0x') {
    +          return original;
    +        }
    +      }
    +      switch (flag) {
    +      case '0b':
    +        radix = 2;
    +        break;
    +      case '0':
    +      case '0o':
    +        radix = 8;
    +        break;
    +      case '0d':
    +        radix = 10;
    +        break;
    +      case '0x':
    +        radix = 16;
    +        break;
    +      }
    +      return head + tail;
    +    });
    +
    +    result = parseInt(string.replace(/_(?!_)/g, ''), radix);
    +    return isNaN(result) ? 0 : result;
    +  }
    +end
    +
    +
    + +
    +

    + + #ordObject + + + + + +

    + + + + +
    +
    +
    +
    +875
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +883
    +884
    +
    +
    # File 'opal/opal/corelib/string.rb', line 875
    +
    +def ord
    +  %x{
    +    if (typeof self.codePointAt === "function") {
    +      return self.codePointAt(0);
    +    }
    +    else {
    +      return self.charCodeAt(0);
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #partition(sep) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/string.rb', line 886
    +
    +def partition(sep)
    +  %x{
    +    var i, m;
    +
    +    if (sep.$$is_regexp) {
    +      m = sep.exec(self);
    +      if (m === null) {
    +        i = -1;
    +      } else {
    +        #{::MatchData.new `sep`, `m`};
    +        sep = m[0];
    +        i = m.index;
    +      }
    +    } else {
    +      sep = $coerce_to(sep, #{::String}, 'to_str');
    +      i = self.indexOf(sep);
    +    }
    +
    +    if (i === -1) {
    +      return [self, '', ''];
    +    }
    +
    +    return [
    +      self.slice(0, i),
    +      self.slice(i, i + sep.length),
    +      self.slice(i + sep.length)
    +    ];
    +  }
    +end
    +
    +
    + +
    +

    + + #reverseObject + + + + + +

    + + + + +
    +
    +
    +
    +916
    +917
    +918
    +
    +
    # File 'opal/opal/corelib/string.rb', line 916
    +
    +def reverse
    +  `self.split('').reverse().join('')`
    +end
    +
    +
    + +
    +

    + + #rindex(search, offset = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/string.rb', line 920
    +
    +def rindex(search, offset = undefined)
    +  %x{
    +    var i, m, r, _m;
    +
    +    if (offset === undefined) {
    +      offset = self.length;
    +    } else {
    +      offset = $coerce_to(offset, #{::Integer}, 'to_int');
    +      if (offset < 0) {
    +        offset += self.length;
    +        if (offset < 0) {
    +          return nil;
    +        }
    +      }
    +    }
    +
    +    if (search.$$is_regexp) {
    +      m = null;
    +      r = $global_multiline_regexp(search);
    +      while (true) {
    +        _m = r.exec(self);
    +        if (_m === null || _m.index > offset) {
    +          break;
    +        }
    +        m = _m;
    +        r.lastIndex = m.index + 1;
    +      }
    +      if (m === null) {
    +        #{$~ = nil}
    +        i = -1;
    +      } else {
    +        #{::MatchData.new `r`, `m`};
    +        i = m.index;
    +      }
    +    } else {
    +      search = $coerce_to(search, #{::String}, 'to_str');
    +      i = self.lastIndexOf(search, offset);
    +    }
    +
    +    return i === -1 ? nil : i;
    +  }
    +end
    +
    +
    + +
    +

    + + #rjust(width, padstr = ' ') ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +963
    +964
    +965
    +966
    +967
    +968
    +969
    +970
    +971
    +972
    +973
    +974
    +975
    +976
    +977
    +978
    +979
    +980
    +981
    +
    +
    # File 'opal/opal/corelib/string.rb', line 963
    +
    +def rjust(width, padstr = ' ')
    +  width  = `$coerce_to(#{width}, #{::Integer}, 'to_int')`
    +  padstr = `$coerce_to(#{padstr}, #{::String}, 'to_str')`.to_s
    +
    +  if padstr.empty?
    +    ::Kernel.raise ::ArgumentError, 'zero width padding'
    +  end
    +
    +  return self if `width <= self.length`
    +
    +  %x{
    +    var chars     = Math.floor(width - self.length),
    +        patterns  = Math.floor(chars / padstr.length),
    +        result    = Array(patterns + 1).join(padstr),
    +        remaining = chars - result.length;
    +
    +    return result + padstr.slice(0, remaining) + self;
    +  }
    +end
    +
    +
    + +
    +

    + + #rpartition(sep) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +983
    +984
    +985
    +986
    +987
    +988
    +989
    +990
    +991
    +992
    +993
    +994
    +995
    +996
    +997
    +998
    +999
    +1000
    +1001
    +1002
    +1003
    +1004
    +1005
    +1006
    +1007
    +1008
    +1009
    +1010
    +1011
    +1012
    +1013
    +1014
    +1015
    +1016
    +1017
    +1018
    +1019
    +1020
    +1021
    +1022
    +1023
    +
    +
    # File 'opal/opal/corelib/string.rb', line 983
    +
    +def rpartition(sep)
    +  %x{
    +    var i, m, r, _m;
    +
    +    if (sep.$$is_regexp) {
    +      m = null;
    +      r = $global_multiline_regexp(sep);
    +
    +      while (true) {
    +        _m = r.exec(self);
    +        if (_m === null) {
    +          break;
    +        }
    +        m = _m;
    +        r.lastIndex = m.index + 1;
    +      }
    +
    +      if (m === null) {
    +        i = -1;
    +      } else {
    +        #{::MatchData.new `r`, `m`};
    +        sep = m[0];
    +        i = m.index;
    +      }
    +
    +    } else {
    +      sep = $coerce_to(sep, #{::String}, 'to_str');
    +      i = self.lastIndexOf(sep);
    +    }
    +
    +    if (i === -1) {
    +      return ['', '', self];
    +    }
    +
    +    return [
    +      self.slice(0, i),
    +      self.slice(i, i + sep.length),
    +      self.slice(i + sep.length)
    +    ];
    +  }
    +end
    +
    +
    + +
    +

    + + #rstripObject + + + + + +

    + + + + +
    +
    +
    +
    +1025
    +1026
    +1027
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1025
    +
    +def rstrip
    +  `self.replace(/[\x00\x09\x0a-\x0d\x20]*$/, '')`
    +end
    +
    +
    + +
    +

    + + #scan(pattern, no_matchdata: false, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1029
    +1030
    +1031
    +1032
    +1033
    +1034
    +1035
    +1036
    +1037
    +1038
    +1039
    +1040
    +1041
    +1042
    +1043
    +1044
    +1045
    +1046
    +1047
    +1048
    +1049
    +1050
    +1051
    +1052
    +1053
    +1054
    +1055
    +1056
    +1057
    +1058
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1029
    +
    +def scan(pattern, no_matchdata: false, &block)
    +  %x{
    +    var result = [],
    +        match_data = nil,
    +        match;
    +
    +    if (pattern.$$is_regexp) {
    +      pattern = $global_multiline_regexp(pattern);
    +    } else {
    +      pattern = $coerce_to(pattern, #{::String}, 'to_str');
    +      pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gm');
    +    }
    +
    +    while ((match = pattern.exec(self)) != null) {
    +      match_data = #{::MatchData.new `pattern`, `match`, no_matchdata: no_matchdata};
    +      if (block === nil) {
    +        match.length == 1 ? result.push(match[0]) : result.push(#{`match_data`.captures});
    +      } else {
    +        match.length == 1 ? Opal.yield1(block, match[0]) : Opal.yield1(block, #{`match_data`.captures});
    +      }
    +      if (pattern.lastIndex === match.index) {
    +        pattern.lastIndex += 1;
    +      }
    +    }
    +
    +    if (!no_matchdata) #{$~ = `match_data`};
    +
    +    return (block !== nil ? self : result);
    +  }
    +end
    +
    +
    + +
    +

    + + #singleton_classObject + + + + + +

    +
    +

    We redefine this method on String, as kernel.rb is in strict mode +so that things like Boolean don't get boxed. For String though - +we either need to box it to define properties on it, or run it in +non-strict mode. This is a mess and we need to come back to it +at a later time.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +1065
    +1066
    +1067
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1065
    +
    +def singleton_class
    +  `Opal.get_singleton_class(self)`
    +end
    +
    +
    + +
    +

    + + #split(pattern = undefined, limit = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1069
    +1070
    +1071
    +1072
    +1073
    +1074
    +1075
    +1076
    +1077
    +1078
    +1079
    +1080
    +1081
    +1082
    +1083
    +1084
    +1085
    +1086
    +1087
    +1088
    +1089
    +1090
    +1091
    +1092
    +1093
    +1094
    +1095
    +1096
    +1097
    +1098
    +1099
    +1100
    +1101
    +1102
    +1103
    +1104
    +1105
    +1106
    +1107
    +1108
    +1109
    +1110
    +1111
    +1112
    +1113
    +1114
    +1115
    +1116
    +1117
    +1118
    +1119
    +1120
    +1121
    +1122
    +1123
    +1124
    +1125
    +1126
    +1127
    +1128
    +1129
    +1130
    +1131
    +1132
    +1133
    +1134
    +1135
    +1136
    +1137
    +1138
    +1139
    +1140
    +1141
    +1142
    +1143
    +1144
    +1145
    +1146
    +1147
    +1148
    +1149
    +1150
    +1151
    +1152
    +1153
    +1154
    +1155
    +1156
    +1157
    +1158
    +1159
    +1160
    +1161
    +1162
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1069
    +
    +def split(pattern = undefined, limit = undefined)
    +  %x{
    +    if (self.length === 0) {
    +      return [];
    +    }
    +
    +    if (limit === undefined) {
    +      limit = 0;
    +    } else {
    +      limit = #{::Opal.coerce_to!(limit, ::Integer, :to_int)};
    +      if (limit === 1) {
    +        return [self];
    +      }
    +    }
    +
    +    if (pattern === undefined || pattern === nil) {
    +      pattern = #{$; || ' '};
    +    }
    +
    +    var result = [],
    +        string = self.toString(),
    +        index = 0,
    +        match,
    +        match_count = 0,
    +        valid_result_length = 0,
    +        i, max;
    +
    +    if (pattern.$$is_regexp) {
    +      pattern = $global_multiline_regexp(pattern);
    +    } else {
    +      pattern = $coerce_to(pattern, #{::String}, 'to_str').$to_s();
    +
    +      if (pattern === ' ') {
    +        pattern = /\s+/gm;
    +        string = string.replace(/^\s+/, '');
    +      }
    +    }
    +
    +    result = string.split(pattern);
    +
    +    if (result.length === 1 && result[0] === string) {
    +      return [result[0]];
    +    }
    +
    +    while ((i = result.indexOf(undefined)) !== -1) {
    +      result.splice(i, 1);
    +    }
    +
    +    if (limit === 0) {
    +      while (result[result.length - 1] === '') {
    +        result.pop();
    +      }
    +      return result;
    +    }
    +
    +    if (!pattern.$$is_regexp) {
    +      pattern = Opal.escape_regexp(pattern)
    +      pattern = new RegExp(pattern, 'gm');
    +    }
    +
    +    match = pattern.exec(string);
    +
    +    if (limit < 0) {
    +      if (match !== null && match[0] === '' && pattern.source.indexOf('(?=') === -1) {
    +        for (i = 0, max = match.length; i < max; i++) {
    +          result.push('');
    +        }
    +      }
    +      return result;
    +    }
    +
    +    if (match !== null && match[0] === '') {
    +      valid_result_length = (match.length - 1) * (limit - 1) + limit
    +      result.splice(valid_result_length - 1, result.length - 1, result.slice(valid_result_length - 1).join(''));
    +      return result;
    +    }
    +
    +    if (limit >= result.length) {
    +      return result;
    +    }
    +
    +    while (match !== null) {
    +      match_count++;
    +      index = pattern.lastIndex;
    +      valid_result_length += match.length
    +      if (match_count + 1 === limit) {
    +        break;
    +      }
    +      match = pattern.exec(string);
    +    }
    +    result.splice(valid_result_length, result.length - 1, string.slice(index));
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #squeeze(*sets) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1164
    +1165
    +1166
    +1167
    +1168
    +1169
    +1170
    +1171
    +1172
    +1173
    +1174
    +1175
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1164
    +
    +def squeeze(*sets)
    +  %x{
    +    if (sets.length === 0) {
    +      return self.replace(/(.)\1+/g, '$1');
    +    }
    +    var char_class = char_class_from_char_sets(sets);
    +    if (char_class === null) {
    +      return self;
    +    }
    +    return self.replace(new RegExp('(' + char_class + ')\\1+', 'g'), '$1');
    +  }
    +end
    +
    +
    + +
    +

    + + #start_with?(*prefixes) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +1177
    +1178
    +1179
    +1180
    +1181
    +1182
    +1183
    +1184
    +1185
    +1186
    +1187
    +1188
    +1189
    +1190
    +1191
    +1192
    +1193
    +1194
    +1195
    +1196
    +1197
    +1198
    +1199
    +1200
    +1201
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1177
    +
    +def start_with?(*prefixes)
    +  %x{
    +    for (var i = 0, length = prefixes.length; i < length; i++) {
    +      if (prefixes[i].$$is_regexp) {
    +        var regexp = prefixes[i];
    +        var match = regexp.exec(self);
    +
    +        if (match != null && match.index === 0) {
    +          #{$~ = ::MatchData.new(`regexp`, `match`)};
    +          return true;
    +        } else {
    +          #{$~ = nil}
    +        }
    +      } else {
    +        var prefix = $coerce_to(prefixes[i], #{::String}, 'to_str').$to_s();
    +
    +        if (self.length >= prefix.length && self.startsWith(prefix)) {
    +          return true;
    +        }
    +      }
    +    }
    +
    +    return false;
    +  }
    +end
    +
    +
    + +
    +

    + + #stripObject + + + + + +

    + + + + +
    +
    +
    +
    +1203
    +1204
    +1205
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1203
    +
    +def strip
    +  `self.replace(/^[\x00\x09\x0a-\x0d\x20]*|[\x00\x09\x0a-\x0d\x20]*$/g, '')`
    +end
    +
    +
    + +
    +

    + + #sub(pattern, replacement = undefined, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1207
    +1208
    +1209
    +1210
    +1211
    +1212
    +1213
    +1214
    +1215
    +1216
    +1217
    +1218
    +1219
    +1220
    +1221
    +1222
    +1223
    +1224
    +1225
    +1226
    +1227
    +1228
    +1229
    +1230
    +1231
    +1232
    +1233
    +1234
    +1235
    +1236
    +1237
    +1238
    +1239
    +1240
    +1241
    +1242
    +1243
    +1244
    +1245
    +1246
    +1247
    +1248
    +1249
    +1250
    +1251
    +1252
    +1253
    +1254
    +1255
    +1256
    +1257
    +1258
    +1259
    +1260
    +1261
    +1262
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1207
    +
    +def sub(pattern, replacement = undefined, &block)
    +  %x{
    +    if (!pattern.$$is_regexp) {
    +      pattern = $coerce_to(pattern, #{::String}, 'to_str');
    +      pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
    +    }
    +
    +    var result, match = pattern.exec(self);
    +
    +    if (match === null) {
    +      #{$~ = nil}
    +      result = self.toString();
    +    } else {
    +      #{::MatchData.new `pattern`, `match`}
    +
    +      if (replacement === undefined) {
    +
    +        if (block === nil) {
    +          #{::Kernel.raise ::ArgumentError, 'wrong number of arguments (1 for 2)'}
    +        }
    +        result = self.slice(0, match.index) + block(match[0]) + self.slice(match.index + match[0].length);
    +
    +      } else if (replacement.$$is_hash) {
    +
    +        result = self.slice(0, match.index) + #{`replacement`[`match[0]`].to_s} + self.slice(match.index + match[0].length);
    +
    +      } else {
    +
    +        replacement = $coerce_to(replacement, #{::String}, 'to_str');
    +
    +        replacement = replacement.replace(/([\\]+)([0-9+&`'])/g, function (original, slashes, command) {
    +          if (slashes.length % 2 === 0) {
    +            return original;
    +          }
    +          switch (command) {
    +          case "+":
    +            for (var i = match.length - 1; i > 0; i--) {
    +              if (match[i] !== undefined) {
    +                return slashes.slice(1) + match[i];
    +              }
    +            }
    +            return '';
    +          case "&": return slashes.slice(1) + match[0];
    +          case "`": return slashes.slice(1) + self.slice(0, match.index);
    +          case "'": return slashes.slice(1) + self.slice(match.index + match[0].length);
    +          default:  return slashes.slice(1) + (match[command] || '');
    +          }
    +        }).replace(/\\\\/g, '\\');
    +
    +        result = self.slice(0, match.index) + replacement + self.slice(match.index + match[0].length);
    +      }
    +    }
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #sum(n = 16) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1264
    +1265
    +1266
    +1267
    +1268
    +1269
    +1270
    +1271
    +1272
    +1273
    +1274
    +1275
    +1276
    +1277
    +1278
    +1279
    +1280
    +1281
    +1282
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1264
    +
    +def sum(n = 16)
    +  %x{
    +    n = $coerce_to(n, #{::Integer}, 'to_int');
    +
    +    var result = 0,
    +        length = self.length,
    +        i = 0;
    +
    +    for (; i < length; i++) {
    +      result += self.charCodeAt(i);
    +    }
    +
    +    if (n <= 0) {
    +      return result;
    +    }
    +
    +    return result & (Math.pow(2, n) - 1);
    +  }
    +end
    +
    +
    + +
    +

    + + #swapcaseObject + + + + + +

    + + + + +
    +
    +
    +
    +1284
    +1285
    +1286
    +1287
    +1288
    +1289
    +1290
    +1291
    +1292
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1284
    +
    +def swapcase
    +  %x{
    +    var str = self.replace(/([a-z]+)|([A-Z]+)/g, function($0,$1,$2) {
    +      return $1 ? $0.toUpperCase() : $0.toLowerCase();
    +    });
    +
    +    return str;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_cObject + + + + + +

    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +
    +
    # File 'opal/opal/corelib/complex/base.rb', line 12
    +
    +def to_c
    +  Complex.from_string(self)
    +end
    +
    +
    + +
    +

    + + #to_fObject + + + + + +

    + + + + +
    +
    +
    +
    +1294
    +1295
    +1296
    +1297
    +1298
    +1299
    +1300
    +1301
    +1302
    +1303
    +1304
    +1305
    +1306
    +1307
    +1308
    +1309
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1294
    +
    +def to_f
    +  %x{
    +    if (self.charAt(0) === '_') {
    +      return 0;
    +    }
    +
    +    var result = parseFloat(self.replace(/_/g, ''));
    +
    +    if (isNaN(result) || result == Infinity || result == -Infinity) {
    +      return 0;
    +    }
    +    else {
    +      return result;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #to_i(base = 10) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1311
    +1312
    +1313
    +1314
    +1315
    +1316
    +1317
    +1318
    +1319
    +1320
    +1321
    +1322
    +1323
    +1324
    +1325
    +1326
    +1327
    +1328
    +1329
    +1330
    +1331
    +1332
    +1333
    +1334
    +1335
    +1336
    +1337
    +1338
    +1339
    +1340
    +1341
    +1342
    +1343
    +1344
    +1345
    +1346
    +1347
    +1348
    +1349
    +1350
    +1351
    +1352
    +1353
    +1354
    +1355
    +1356
    +1357
    +1358
    +1359
    +1360
    +1361
    +1362
    +1363
    +1364
    +1365
    +1366
    +1367
    +1368
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1311
    +
    +def to_i(base = 10)
    +  %x{
    +    var result,
    +        string = self.toLowerCase(),
    +        radix = $coerce_to(base, #{::Integer}, 'to_int');
    +
    +    if (radix === 1 || radix < 0 || radix > 36) {
    +      #{::Kernel.raise ::ArgumentError, "invalid radix #{`radix`}"}
    +    }
    +
    +    if (/^\s*_/.test(string)) {
    +      return 0;
    +    }
    +
    +    string = string.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/, function (original, head, flag, tail) {
    +      switch (tail.charAt(0)) {
    +      case '+':
    +      case '-':
    +        return original;
    +      case '0':
    +        if (tail.charAt(1) === 'x' && flag === '0x' && (radix === 0 || radix === 16)) {
    +          return original;
    +        }
    +      }
    +      switch (flag) {
    +      case '0b':
    +        if (radix === 0 || radix === 2) {
    +          radix = 2;
    +          return head + tail;
    +        }
    +        break;
    +      case '0':
    +      case '0o':
    +        if (radix === 0 || radix === 8) {
    +          radix = 8;
    +          return head + tail;
    +        }
    +        break;
    +      case '0d':
    +        if (radix === 0 || radix === 10) {
    +          radix = 10;
    +          return head + tail;
    +        }
    +        break;
    +      case '0x':
    +        if (radix === 0 || radix === 16) {
    +          radix = 16;
    +          return head + tail;
    +        }
    +        break;
    +      }
    +      return original
    +    });
    +
    +    result = parseInt(string.replace(/_(?!_)/g, ''), radix);
    +    return isNaN(result) ? 0 : result;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_procObject + + + + + +

    + + + + +
    +
    +
    +
    +1370
    +1371
    +1372
    +1373
    +1374
    +1375
    +1376
    +1377
    +1378
    +1379
    +1380
    +1381
    +1382
    +1383
    +1384
    +1385
    +1386
    +1387
    +1388
    +1389
    +1390
    +1391
    +1392
    +1393
    +1394
    +1395
    +1396
    +1397
    +1398
    +1399
    +1400
    +1401
    +1402
    +1403
    +1404
    +1405
    +1406
    +1407
    +1408
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1370
    +
    +def to_proc
    +  method_name = `self.valueOf()`
    +  jsid = `Opal.jsid(method_name)`
    +
    +  proc = ::Kernel.proc do |*args, &block|
    +    %x{
    +      if (args.length === 0) {
    +        #{::Kernel.raise ::ArgumentError, 'no receiver given'}
    +      }
    +
    +      var recv = args[0];
    +
    +      if (recv == null) recv = nil;
    +
    +      var body = recv[jsid];
    +
    +      if (!body) {
    +        body = recv.$method_missing;
    +        args[0] = #{method_name};
    +      } else {
    +        args = args.slice(1);
    +      }
    +
    +      if (typeof block === 'function') {
    +        body.$$p = block;
    +      }
    +
    +      if (args.length === 0) {
    +        return body.call(recv);
    +      } else {
    +        return body.apply(recv, args);
    +      }
    +    }
    +  end
    +
    +  `proc.$$source_location = nil`
    +
    +  proc
    +end
    +
    +
    + +
    +

    + + #to_rObject + + + + + +

    + + + + +
    +
    +
    +
    +8
    +9
    +10
    +
    +
    # File 'opal/opal/corelib/rational/base.rb', line 8
    +
    +def to_r
    +  ::Rational.from_string(self)
    +end
    +
    +
    + +
    +

    + + #to_sObject + + + + Also known as: + to_str + + + + +

    + + + + +
    +
    +
    +
    +1410
    +1411
    +1412
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1410
    +
    +def to_s
    +  `self.toString()`
    +end
    +
    +
    + +
    +

    + + #tr(from, to) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1414
    +1415
    +1416
    +1417
    +1418
    +1419
    +1420
    +1421
    +1422
    +1423
    +1424
    +1425
    +1426
    +1427
    +1428
    +1429
    +1430
    +1431
    +1432
    +1433
    +1434
    +1435
    +1436
    +1437
    +1438
    +1439
    +1440
    +1441
    +1442
    +1443
    +1444
    +1445
    +1446
    +1447
    +1448
    +1449
    +1450
    +1451
    +1452
    +1453
    +1454
    +1455
    +1456
    +1457
    +1458
    +1459
    +1460
    +1461
    +1462
    +1463
    +1464
    +1465
    +1466
    +1467
    +1468
    +1469
    +1470
    +1471
    +1472
    +1473
    +1474
    +1475
    +1476
    +1477
    +1478
    +1479
    +1480
    +1481
    +1482
    +1483
    +1484
    +1485
    +1486
    +1487
    +1488
    +1489
    +1490
    +1491
    +1492
    +1493
    +1494
    +1495
    +1496
    +1497
    +1498
    +1499
    +1500
    +1501
    +1502
    +1503
    +1504
    +1505
    +1506
    +1507
    +1508
    +1509
    +1510
    +1511
    +1512
    +1513
    +1514
    +1515
    +1516
    +1517
    +1518
    +1519
    +1520
    +1521
    +1522
    +1523
    +1524
    +1525
    +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
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1414
    +
    +def tr(from, to)
    +  %x{
    +    from = $coerce_to(from, #{::String}, 'to_str').$to_s();
    +    to = $coerce_to(to, #{::String}, 'to_str').$to_s();
    +
    +    if (from.length == 0 || from === to) {
    +      return self;
    +    }
    +
    +    var i, in_range, c, ch, start, end, length;
    +    var subs = {};
    +    var from_chars = from.split('');
    +    var from_length = from_chars.length;
    +    var to_chars = to.split('');
    +    var to_length = to_chars.length;
    +
    +    var inverse = false;
    +    var global_sub = null;
    +    if (from_chars[0] === '^' && from_chars.length > 1) {
    +      inverse = true;
    +      from_chars.shift();
    +      global_sub = to_chars[to_length - 1]
    +      from_length -= 1;
    +    }
    +
    +    var from_chars_expanded = [];
    +    var last_from = null;
    +    in_range = false;
    +    for (i = 0; i < from_length; i++) {
    +      ch = from_chars[i];
    +      if (last_from == null) {
    +        last_from = ch;
    +        from_chars_expanded.push(ch);
    +      }
    +      else if (ch === '-') {
    +        if (last_from === '-') {
    +          from_chars_expanded.push('-');
    +          from_chars_expanded.push('-');
    +        }
    +        else if (i == from_length - 1) {
    +          from_chars_expanded.push('-');
    +        }
    +        else {
    +          in_range = true;
    +        }
    +      }
    +      else if (in_range) {
    +        start = last_from.charCodeAt(0);
    +        end = ch.charCodeAt(0);
    +        if (start > end) {
    +          #{::Kernel.raise ::ArgumentError, "invalid range \"#{`String.fromCharCode(start)`}-#{`String.fromCharCode(end)`}\" in string transliteration"}
    +        }
    +        for (c = start + 1; c < end; c++) {
    +          from_chars_expanded.push(String.fromCharCode(c));
    +        }
    +        from_chars_expanded.push(ch);
    +        in_range = null;
    +        last_from = null;
    +      }
    +      else {
    +        from_chars_expanded.push(ch);
    +      }
    +    }
    +
    +    from_chars = from_chars_expanded;
    +    from_length = from_chars.length;
    +
    +    if (inverse) {
    +      for (i = 0; i < from_length; i++) {
    +        subs[from_chars[i]] = true;
    +      }
    +    }
    +    else {
    +      if (to_length > 0) {
    +        var to_chars_expanded = [];
    +        var last_to = null;
    +        in_range = false;
    +        for (i = 0; i < to_length; i++) {
    +          ch = to_chars[i];
    +          if (last_to == null) {
    +            last_to = ch;
    +            to_chars_expanded.push(ch);
    +          }
    +          else if (ch === '-') {
    +            if (last_to === '-') {
    +              to_chars_expanded.push('-');
    +              to_chars_expanded.push('-');
    +            }
    +            else if (i == to_length - 1) {
    +              to_chars_expanded.push('-');
    +            }
    +            else {
    +              in_range = true;
    +            }
    +          }
    +          else if (in_range) {
    +            start = last_to.charCodeAt(0);
    +            end = ch.charCodeAt(0);
    +            if (start > end) {
    +              #{::Kernel.raise ::ArgumentError, "invalid range \"#{`String.fromCharCode(start)`}-#{`String.fromCharCode(end)`}\" in string transliteration"}
    +            }
    +            for (c = start + 1; c < end; c++) {
    +              to_chars_expanded.push(String.fromCharCode(c));
    +            }
    +            to_chars_expanded.push(ch);
    +            in_range = null;
    +            last_to = null;
    +          }
    +          else {
    +            to_chars_expanded.push(ch);
    +          }
    +        }
    +
    +        to_chars = to_chars_expanded;
    +        to_length = to_chars.length;
    +      }
    +
    +      var length_diff = from_length - to_length;
    +      if (length_diff > 0) {
    +        var pad_char = (to_length > 0 ? to_chars[to_length - 1] : '');
    +        for (i = 0; i < length_diff; i++) {
    +          to_chars.push(pad_char);
    +        }
    +      }
    +
    +      for (i = 0; i < from_length; i++) {
    +        subs[from_chars[i]] = to_chars[i];
    +      }
    +    }
    +
    +    var new_str = ''
    +    for (i = 0, length = self.length; i < length; i++) {
    +      ch = self.charAt(i);
    +      var sub = subs[ch];
    +      if (inverse) {
    +        new_str += (sub == null ? global_sub : ch);
    +      }
    +      else {
    +        new_str += (sub != null ? sub : ch);
    +      }
    +    }
    +    return new_str;
    +  }
    +end
    +
    +
    + +
    +

    + + #tr_s(from, to) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +1593
    +1594
    +1595
    +1596
    +1597
    +1598
    +1599
    +1600
    +1601
    +1602
    +1603
    +1604
    +1605
    +1606
    +1607
    +1608
    +1609
    +1610
    +1611
    +1612
    +1613
    +1614
    +1615
    +1616
    +1617
    +1618
    +1619
    +1620
    +1621
    +1622
    +1623
    +1624
    +1625
    +1626
    +1627
    +1628
    +1629
    +1630
    +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
    +1663
    +1664
    +1665
    +1666
    +1667
    +1668
    +1669
    +1670
    +1671
    +1672
    +1673
    +1674
    +1675
    +1676
    +1677
    +1678
    +1679
    +1680
    +1681
    +1682
    +1683
    +1684
    +1685
    +1686
    +1687
    +1688
    +1689
    +1690
    +1691
    +1692
    +1693
    +1694
    +1695
    +1696
    +1697
    +1698
    +1699
    +1700
    +1701
    +1702
    +1703
    +1704
    +1705
    +1706
    +1707
    +1708
    +1709
    +1710
    +1711
    +1712
    +1713
    +1714
    +1715
    +1716
    +1717
    +1718
    +1719
    +1720
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1559
    +
    +def tr_s(from, to)
    +  %x{
    +    from = $coerce_to(from, #{::String}, 'to_str').$to_s();
    +    to = $coerce_to(to, #{::String}, 'to_str').$to_s();
    +
    +    if (from.length == 0) {
    +      return self;
    +    }
    +
    +    var i, in_range, c, ch, start, end, length;
    +    var subs = {};
    +    var from_chars = from.split('');
    +    var from_length = from_chars.length;
    +    var to_chars = to.split('');
    +    var to_length = to_chars.length;
    +
    +    var inverse = false;
    +    var global_sub = null;
    +    if (from_chars[0] === '^' && from_chars.length > 1) {
    +      inverse = true;
    +      from_chars.shift();
    +      global_sub = to_chars[to_length - 1]
    +      from_length -= 1;
    +    }
    +
    +    var from_chars_expanded = [];
    +    var last_from = null;
    +    in_range = false;
    +    for (i = 0; i < from_length; i++) {
    +      ch = from_chars[i];
    +      if (last_from == null) {
    +        last_from = ch;
    +        from_chars_expanded.push(ch);
    +      }
    +      else if (ch === '-') {
    +        if (last_from === '-') {
    +          from_chars_expanded.push('-');
    +          from_chars_expanded.push('-');
    +        }
    +        else if (i == from_length - 1) {
    +          from_chars_expanded.push('-');
    +        }
    +        else {
    +          in_range = true;
    +        }
    +      }
    +      else if (in_range) {
    +        start = last_from.charCodeAt(0);
    +        end = ch.charCodeAt(0);
    +        if (start > end) {
    +          #{::Kernel.raise ::ArgumentError, "invalid range \"#{`String.fromCharCode(start)`}-#{`String.fromCharCode(end)`}\" in string transliteration"}
    +        }
    +        for (c = start + 1; c < end; c++) {
    +          from_chars_expanded.push(String.fromCharCode(c));
    +        }
    +        from_chars_expanded.push(ch);
    +        in_range = null;
    +        last_from = null;
    +      }
    +      else {
    +        from_chars_expanded.push(ch);
    +      }
    +    }
    +
    +    from_chars = from_chars_expanded;
    +    from_length = from_chars.length;
    +
    +    if (inverse) {
    +      for (i = 0; i < from_length; i++) {
    +        subs[from_chars[i]] = true;
    +      }
    +    }
    +    else {
    +      if (to_length > 0) {
    +        var to_chars_expanded = [];
    +        var last_to = null;
    +        in_range = false;
    +        for (i = 0; i < to_length; i++) {
    +          ch = to_chars[i];
    +          if (last_from == null) {
    +            last_from = ch;
    +            to_chars_expanded.push(ch);
    +          }
    +          else if (ch === '-') {
    +            if (last_to === '-') {
    +              to_chars_expanded.push('-');
    +              to_chars_expanded.push('-');
    +            }
    +            else if (i == to_length - 1) {
    +              to_chars_expanded.push('-');
    +            }
    +            else {
    +              in_range = true;
    +            }
    +          }
    +          else if (in_range) {
    +            start = last_from.charCodeAt(0);
    +            end = ch.charCodeAt(0);
    +            if (start > end) {
    +              #{::Kernel.raise ::ArgumentError, "invalid range \"#{`String.fromCharCode(start)`}-#{`String.fromCharCode(end)`}\" in string transliteration"}
    +            }
    +            for (c = start + 1; c < end; c++) {
    +              to_chars_expanded.push(String.fromCharCode(c));
    +            }
    +            to_chars_expanded.push(ch);
    +            in_range = null;
    +            last_from = null;
    +          }
    +          else {
    +            to_chars_expanded.push(ch);
    +          }
    +        }
    +
    +        to_chars = to_chars_expanded;
    +        to_length = to_chars.length;
    +      }
    +
    +      var length_diff = from_length - to_length;
    +      if (length_diff > 0) {
    +        var pad_char = (to_length > 0 ? to_chars[to_length - 1] : '');
    +        for (i = 0; i < length_diff; i++) {
    +          to_chars.push(pad_char);
    +        }
    +      }
    +
    +      for (i = 0; i < from_length; i++) {
    +        subs[from_chars[i]] = to_chars[i];
    +      }
    +    }
    +    var new_str = ''
    +    var last_substitute = null
    +    for (i = 0, length = self.length; i < length; i++) {
    +      ch = self.charAt(i);
    +      var sub = subs[ch]
    +      if (inverse) {
    +        if (sub == null) {
    +          if (last_substitute == null) {
    +            new_str += global_sub;
    +            last_substitute = true;
    +          }
    +        }
    +        else {
    +          new_str += ch;
    +          last_substitute = null;
    +        }
    +      }
    +      else {
    +        if (sub != null) {
    +          if (last_substitute == null || last_substitute !== sub) {
    +            new_str += sub;
    +            last_substitute = sub;
    +          }
    +        }
    +        else {
    +          new_str += ch;
    +          last_substitute = null;
    +        }
    +      }
    +    }
    +    return new_str;
    +  }
    +end
    +
    +
    + +
    +

    + + #unicode_normalize(form = :nfc) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1874
    +1875
    +1876
    +1877
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1874
    +
    +def unicode_normalize(form = :nfc)
    +  ::Kernel.raise ::ArgumentError, "Invalid normalization form #{form}" unless %i[nfc nfd nfkc nfkd].include?(form)
    +  `self.normalize(#{form.upcase})`
    +end
    +
    +
    + +
    +

    + + #unicode_normalized?(form = :nfc) ⇒ Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +1879
    +1880
    +1881
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1879
    +
    +def unicode_normalized?(form = :nfc)
    +  unicode_normalize(form) == self
    +end
    +
    +
    + +
    +

    + + #unpack(format, offset: 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1883
    +1884
    +1885
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1883
    +
    +def unpack(format)
    +  ::Kernel.raise "To use String#unpack, you must first require 'corelib/string/unpack'."
    +end
    +
    +
    + +
    +

    + + #unpack1(format, offset: 0) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1887
    +1888
    +1889
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1887
    +
    +def unpack1(format)
    +  ::Kernel.raise "To use String#unpack1, you must first require 'corelib/string/unpack'."
    +end
    +
    +
    + +
    +

    + + #upcaseObject + + + + + +

    + + + + +
    +
    +
    +
    +1722
    +1723
    +1724
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1722
    +
    +def upcase
    +  `self.toUpperCase()`
    +end
    +
    +
    + +
    +

    + + #upto(stop, excl = false, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +1726
    +1727
    +1728
    +1729
    +1730
    +1731
    +1732
    +1733
    +1734
    +1735
    +1736
    +1737
    +1738
    +1739
    +1740
    +1741
    +1742
    +1743
    +1744
    +1745
    +1746
    +1747
    +1748
    +1749
    +1750
    +1751
    +1752
    +1753
    +1754
    +1755
    +1756
    +1757
    +1758
    +1759
    +1760
    +1761
    +1762
    +1763
    +1764
    +1765
    +1766
    +1767
    +1768
    +1769
    +1770
    +1771
    +1772
    +1773
    +1774
    +1775
    +1776
    +1777
    +1778
    +
    +
    # File 'opal/opal/corelib/string.rb', line 1726
    +
    +def upto(stop, excl = false, &block)
    +  return enum_for :upto, stop, excl unless block_given?
    +  %x{
    +    var a, b, s = self.toString();
    +
    +    stop = $coerce_to(stop, #{::String}, 'to_str');
    +
    +    if (s.length === 1 && stop.length === 1) {
    +
    +      a = s.charCodeAt(0);
    +      b = stop.charCodeAt(0);
    +
    +      while (a <= b) {
    +        if (excl && a === b) {
    +          break;
    +        }
    +
    +        block(String.fromCharCode(a));
    +
    +        a += 1;
    +      }
    +
    +    } else if (parseInt(s, 10).toString() === s && parseInt(stop, 10).toString() === stop) {
    +
    +      a = parseInt(s, 10);
    +      b = parseInt(stop, 10);
    +
    +      while (a <= b) {
    +        if (excl && a === b) {
    +          break;
    +        }
    +
    +        block(a.toString());
    +
    +        a += 1;
    +      }
    +
    +    } else {
    +
    +      while (s.length <= stop.length && s <= stop) {
    +        if (excl && s === stop) {
    +          break;
    +        }
    +
    +        block(s);
    +
    +        s = #{`s`.succ};
    +      }
    +
    +    }
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #valid_encoding?Boolean + + + + + +

    +
    +

    stub

    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +410
    +411
    +412
    +
    +
    # File 'opal/opal/corelib/string/encoding.rb', line 410
    +
    +def valid_encoding?
    +  true
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Struct.html b/docs/api/v1.8.2/corelib/Struct.html new file mode 100644 index 00000000..4ebe1099 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Struct.html @@ -0,0 +1,1981 @@ + + + + + + + Class: Struct + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Struct + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Enumerable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/struct.rb,
    + opal/opal/corelib/marshal/write_buffer.rb,
    opal/opal/corelib/pattern_matching/base.rb
    +
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Enumerable

    +

    #all?, #any?, #chunk, #chunk_while, #collect, #collect_concat, #compact, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #enumerator_size, #filter_map, #find_all, #find_index, #first, #grep, #grep_v, #group_by, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_set, #uniq, #zip

    +
    +

    Constructor Details

    + +
    +

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

    +
    +

    Returns a new instance of Struct.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 86
    +
    +def initialize(*args)
    +  if `#{self.class}.$$keyword_init`
    +    kwargs = args.last || {}
    +
    +    if args.length > 1 || `(args.length === 1 && !kwargs.$$is_hash)`
    +      ::Kernel.raise ::ArgumentError, "wrong number of arguments (given #{args.length}, expected 0)"
    +    end
    +
    +    extra = kwargs.keys - self.class.members
    +    if extra.any?
    +      ::Kernel.raise ::ArgumentError, "unknown keywords: #{extra.join(', ')}"
    +    end
    +
    +    self.class.members.each do |name|
    +      self[name] = kwargs[name]
    +    end
    +  else
    +    if args.length > self.class.members.length
    +      ::Kernel.raise ::ArgumentError, 'struct size differs'
    +    end
    +
    +    self.class.members.each_with_index do |name, index|
    +      self[name] = args[index]
    +    end
    +  end
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .define_struct_attribute(name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 54
    +
    +def self.define_struct_attribute(name)
    +  if self == ::Struct
    +    ::Kernel.raise ::ArgumentError, 'you cannot define attributes to the Struct class'
    +  end
    +
    +  members << name
    +
    +  define_method name do
    +    `self.$$data[name]`
    +  end
    +
    +  define_method "#{name}=" do |value|
    +    `self.$$data[name] = value`
    +  end
    +end
    +
    +
    + +
    +

    + + .inherited(klass) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 78
    +
    +def self.inherited(klass)
    +  members = @members
    +
    +  klass.instance_eval do
    +    @members = members
    +  end
    +end
    +
    +
    + +
    +

    + + .keyword_init?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +124
    +125
    +126
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 124
    +
    +def self.keyword_init?
    +  `self.$$keyword_init`
    +end
    +
    +
    + +
    +

    + + .membersObject + + + + + +

    + + + + +
    +
    +
    +
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 70
    +
    +def self.members
    +  if self == ::Struct
    +    ::Kernel.raise ::ArgumentError, 'the Struct class has no members'
    +  end
    +
    +  @members ||= []
    +end
    +
    +
    + +
    +

    + + .new(const_name, *args, keyword_init: false, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 8
    +
    +def self.new(const_name, *args, keyword_init: false, &block)
    +  if const_name
    +    if const_name.class == ::String && const_name[0].upcase != const_name[0]
    +      # Fast track so that we skip needlessly going thru exceptions
    +      # in most cases.
    +      args.unshift(const_name)
    +      const_name = nil
    +    else
    +      begin
    +        const_name = ::Opal.const_name!(const_name)
    +      rescue ::TypeError, ::NameError
    +        args.unshift(const_name)
    +        const_name = nil
    +      end
    +    end
    +  end
    +
    +  args.map do |arg|
    +    ::Opal.coerce_to!(arg, ::String, :to_str)
    +  end
    +
    +  klass = ::Class.new(self) do
    +    args.each { |arg| define_struct_attribute(arg) }
    +
    +    class << self
    +      def new(*args)
    +        instance = allocate
    +        `#{instance}.$$data = {}`
    +        instance.initialize(*args)
    +        instance
    +      end
    +
    +      alias_method :[], :new
    +    end
    +  end
    +
    +  klass.module_eval(&block) if block
    +  `klass.$$keyword_init = keyword_init`
    +
    +  if const_name
    +    ::Struct.const_set(const_name, klass)
    +  end
    +
    +  klass
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 172
    +
    +def ==(other)
    +  return false unless other.instance_of?(self.class)
    +
    +  %x{
    +    var recursed1 = {}, recursed2 = {};
    +
    +    function _eqeq(struct, other) {
    +      var key, a, b;
    +
    +      recursed1[#{`struct`.__id__}] = true;
    +      recursed2[#{`other`.__id__}] = true;
    +
    +      for (key in struct.$$data) {
    +        a = struct.$$data[key];
    +        b = other.$$data[key];
    +
    +        if (#{::Struct === `a`}) {
    +          if (!recursed1.hasOwnProperty(#{`a`.__id__}) || !recursed2.hasOwnProperty(#{`b`.__id__})) {
    +            if (!_eqeq(a, b)) {
    +              return false;
    +            }
    +          }
    +        } else {
    +          if (!#{`a` == `b`}) {
    +            return false;
    +          }
    +        }
    +      }
    +
    +      return true;
    +    }
    +
    +    return _eqeq(self, other);
    +  }
    +end
    +
    +
    + +
    +

    + + #[](name) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 136
    +
    +def [](name)
    +  if ::Integer === name
    +    ::Kernel.raise ::IndexError, "offset #{name} too small for struct(size:#{self.class.members.size})" if name < -self.class.members.size
    +    ::Kernel.raise ::IndexError, "offset #{name} too large for struct(size:#{self.class.members.size})" if name >= self.class.members.size
    +
    +    name = self.class.members[name]
    +  elsif ::String === name
    +    %x{
    +      if(!self.$$data.hasOwnProperty(name)) {
    +        #{::Kernel.raise ::NameError.new("no member '#{name}' in struct", name)}
    +      }
    +    }
    +  else
    +    ::Kernel.raise ::TypeError, "no implicit conversion of #{name.class} into Integer"
    +  end
    +
    +  name = ::Opal.coerce_to!(name, ::String, :to_str)
    +  `self.$$data[name]`
    +end
    +
    +
    + +
    +

    + + #[]=(name, value) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 156
    +
    +def []=(name, value)
    +  if ::Integer === name
    +    ::Kernel.raise ::IndexError, "offset #{name} too small for struct(size:#{self.class.members.size})" if name < -self.class.members.size
    +    ::Kernel.raise ::IndexError, "offset #{name} too large for struct(size:#{self.class.members.size})" if name >= self.class.members.size
    +
    +    name = self.class.members[name]
    +  elsif ::String === name
    +    ::Kernel.raise ::NameError.new("no member '#{name}' in struct", name) unless self.class.members.include?(name.to_sym)
    +  else
    +    ::Kernel.raise ::TypeError, "no implicit conversion of #{name.class} into Integer"
    +  end
    +
    +  name = ::Opal.coerce_to!(name, ::String, :to_str)
    +  `self.$$data[name] = value`
    +end
    +
    +
    + +
    +

    + + #__marshal__(buffer) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +
    +
    # File 'opal/opal/corelib/marshal/write_buffer.rb', line 168
    +
    +def __marshal__(buffer)
    +  buffer.save_link(self)
    +  buffer.write_ivars_prefix(self)
    +  buffer.write_extends(self)
    +  buffer.append('S')
    +  buffer.append_symbol(self.class.name)
    +  buffer.write_fixnum(length)
    +  each_pair do |attr_name, value|
    +    buffer.append_symbol(attr_name)
    +    buffer.write(value)
    +  end
    +  buffer.write_ivars_suffix(self)
    +end
    +
    +
    + +
    +

    + + #deconstruct_keys(keys) ⇒ Object + + + + + +

    +
    +

    This function is specified in a very weird way...

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +
    +
    # File 'opal/opal/corelib/pattern_matching/base.rb', line 16
    +
    +def deconstruct_keys(keys)
    +  return to_h if keys.nil?
    +  ::Kernel.raise ::TypeError, 'expected Array or nil' unless ::Array === keys
    +  return {} if keys.length > values.length
    +  out = {}
    +  keys.each do |key|
    +    should_break = case key
    +                   when ::Integer
    +                     values.length < key
    +                   when ::Symbol # Or String? Doesn't matter, we're in Opal.
    +                     !members.include?(key)
    +                   end
    +    break if should_break
    +    out[key] = self[key]
    +  end
    +  out
    +end
    +
    +
    + +
    +

    + + #dig(key, *keys) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 313
    +
    +def dig(key, *keys)
    +  item = if `key.$$is_string && self.$$data.hasOwnProperty(key)`
    +           `self.$$data[key] || nil`
    +         end
    +
    +  %x{
    +    if (item === nil || keys.length === 0) {
    +      return item;
    +    }
    +  }
    +
    +  unless item.respond_to?(:dig)
    +    ::Kernel.raise ::TypeError, "#{item.class} does not have #dig method"
    +  end
    +
    +  item.dig(*keys)
    +end
    +
    +
    + +
    +

    + + #eachObject + + + + + +

    + + + + +
    +
    +
    +
    +244
    +245
    +246
    +247
    +248
    +249
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 244
    +
    +def each
    +  return enum_for(:each) { size } unless block_given?
    +
    +  self.class.members.each { |name| yield self[name] }
    +  self
    +end
    +
    +
    + +
    +

    + + #each_pairObject + + + + + +

    + + + + +
    +
    +
    +
    +251
    +252
    +253
    +254
    +255
    +256
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 251
    +
    +def each_pair
    +  return enum_for(:each_pair) { size } unless block_given?
    +
    +  self.class.members.each { |name| yield [name, self[name]] }
    +  self
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 208
    +
    +def eql?(other)
    +  return false unless other.instance_of?(self.class)
    +
    +  %x{
    +    var recursed1 = {}, recursed2 = {};
    +
    +    function _eqeq(struct, other) {
    +      var key, a, b;
    +
    +      recursed1[#{`struct`.__id__}] = true;
    +      recursed2[#{`other`.__id__}] = true;
    +
    +      for (key in struct.$$data) {
    +        a = struct.$$data[key];
    +        b = other.$$data[key];
    +
    +        if (#{::Struct === `a`}) {
    +          if (!recursed1.hasOwnProperty(#{`a`.__id__}) || !recursed2.hasOwnProperty(#{`b`.__id__})) {
    +            if (!_eqeq(a, b)) {
    +              return false;
    +            }
    +          }
    +        } else {
    +          if (!#{`a`.eql?(`b`)}) {
    +            return false;
    +          }
    +        }
    +      }
    +
    +      return true;
    +    }
    +
    +    return _eqeq(self, other);
    +  }
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +132
    +133
    +134
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 132
    +
    +def hash
    +  [self.class, to_a].hash
    +end
    +
    +
    + +
    +

    + + #initialize_copy(from) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 113
    +
    +def initialize_copy(from)
    +  %x{
    +    self.$$data = {}
    +    var keys = Object.keys(from.$$data), i, max, name;
    +    for (i = 0, max = keys.length; i < max; i++) {
    +      name = keys[i];
    +      self.$$data[name] = from.$$data[name];
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + Also known as: + to_s + + + + +

    + + + + +
    +
    +
    +
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 268
    +
    +def inspect
    +  result = '#<struct '
    +
    +  if `inspect_stack`.include? __id__
    +    result + ':...>'
    +  else
    +    `inspect_stack` << __id__
    +    pushed = true
    +
    +    if ::Struct === self && self.class.name
    +      result += "#{self.class} "
    +    end
    +
    +    result += each_pair.map do |name, value|
    +      "#{name}=#{Opal.inspect(value)}"
    +    end.join ', '
    +
    +    result += '>'
    +
    +    result
    +  end
    +ensure
    +  `inspect_stack.pop()` if pushed
    +end
    +
    +
    + +
    +

    + + #lengthObject + + + + Also known as: + size + + + + +

    + + + + +
    +
    +
    +
    +258
    +259
    +260
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 258
    +
    +def length
    +  self.class.members.length
    +end
    +
    +
    + +
    +

    + + #membersObject + + + + + +

    + + + + +
    +
    +
    +
    +128
    +129
    +130
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 128
    +
    +def members
    +  self.class.members
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + Also known as: + values, deconstruct + + + + +

    + + + + +
    +
    +
    +
    +262
    +263
    +264
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 262
    +
    +def to_a
    +  self.class.members.map { |name| self[name] }
    +end
    +
    +
    + +
    +

    + + #to_h(*args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +293
    +294
    +295
    +296
    +297
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 293
    +
    +def to_h(*args, &block)
    +  return map(&block).to_h(*args) if block_given?
    +
    +  self.class.members.each_with_object({}) { |name, h| h[name] = self[name] }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +
    +
    # File 'opal/opal/corelib/struct.rb', line 299
    +
    +def values_at(*args)
    +  args = args.map { |arg| `arg.$$is_range ? #{arg.to_a} : arg` }.flatten
    +  %x{
    +    var result = [];
    +    for (var i = 0, len = args.length; i < len; i++) {
    +      if (!args[i].$$is_number) {
    +        #{::Kernel.raise ::TypeError, "no implicit conversion of #{`args[i]`.class} into Integer"}
    +      }
    +      result.push(#{self[`args[i]`]});
    +    }
    +    return result;
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/SyntaxError.html b/docs/api/v1.8.2/corelib/SyntaxError.html new file mode 100644 index 00000000..6a68ce43 --- /dev/null +++ b/docs/api/v1.8.2/corelib/SyntaxError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: SyntaxError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: SyntaxError + + + +

    +
    + +
    +
    Inherits:
    +
    + ScriptError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/SystemCallError.html b/docs/api/v1.8.2/corelib/SystemCallError.html new file mode 100644 index 00000000..b5cd2384 --- /dev/null +++ b/docs/api/v1.8.2/corelib/SystemCallError.html @@ -0,0 +1,301 @@ + + + + + + + Exception: SystemCallError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: SystemCallError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error/errno.rb
    +
    +
    + +
    + + + + + +

    Class Attribute Summary collapse

    +
      + +
    • + + + .errno ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute errno.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + +
    +

    Class Attribute Details

    + + + +
    +

    + + .errnoObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute errno.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +49
    +50
    +51
    +
    +
    # File 'opal/opal/corelib/error/errno.rb', line 49
    +
    +def errno
    +  @errno
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #errnoObject + + + + + +

    + + + + +
    +
    +
    +
    +44
    +45
    +46
    +
    +
    # File 'opal/opal/corelib/error/errno.rb', line 44
    +
    +def errno
    +  self.class.errno
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/SystemExit.html b/docs/api/v1.8.2/corelib/SystemExit.html new file mode 100644 index 00000000..b8333c96 --- /dev/null +++ b/docs/api/v1.8.2/corelib/SystemExit.html @@ -0,0 +1,142 @@ + + + + + + + Exception: SystemExit + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: SystemExit + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/SystemStackError.html b/docs/api/v1.8.2/corelib/SystemStackError.html new file mode 100644 index 00000000..89f981cd --- /dev/null +++ b/docs/api/v1.8.2/corelib/SystemStackError.html @@ -0,0 +1,142 @@ + + + + + + + Exception: SystemStackError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: SystemStackError + + + +

    +
    + +
    +
    Inherits:
    +
    + Exception + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/ThreadError.html b/docs/api/v1.8.2/corelib/ThreadError.html new file mode 100644 index 00000000..c86ed240 --- /dev/null +++ b/docs/api/v1.8.2/corelib/ThreadError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: ThreadError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: ThreadError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/Time.html b/docs/api/v1.8.2/corelib/Time.html new file mode 100644 index 00000000..7b833e86 --- /dev/null +++ b/docs/api/v1.8.2/corelib/Time.html @@ -0,0 +1,2817 @@ + + + + + + + Class: Time + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Time + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + +
    +
    Includes:
    +
    Comparable
    +
    + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/time.rb
    +
    + +
    + + + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

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

    Methods included from Comparable

    +

    #<, #<=, #>, #>=, #between?, #clamp

    + + +
    +

    Class Method Details

    + + +
    +

    + + ._parse_offset(utc_offset) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +
    +
    # File 'opal/opal/corelib/time.rb', line 175
    +
    +def self._parse_offset(utc_offset)
    +  %x{
    +    var timezone;
    +    if (utc_offset.$$is_string) {
    +      if (utc_offset == 'UTC') {
    +        timezone = 0;
    +      }
    +      else if(/^[+-]\d\d:[0-5]\d$/.test(utc_offset)) {
    +        var sign, hours, minutes;
    +        sign = utc_offset[0];
    +        hours = +(utc_offset[1] + utc_offset[2]);
    +        minutes = +(utc_offset[4] + utc_offset[5]);
    +
    +        timezone = (sign == '-' ? -1 : 1) * (hours + minutes / 60);
    +      }
    +      else {
    +        // Unsupported: "A".."I","K".."Z"
    +        #{::Kernel.raise ::ArgumentError, %'"+HH:MM", "-HH:MM", "UTC" expected for utc_offset: #{utc_offset}'}
    +      }
    +    }
    +    else if (utc_offset.$$is_number) {
    +      timezone = utc_offset / 3600;
    +    }
    +    else {
    +      #{::Kernel.raise ::ArgumentError, "Opal doesn't support other types for a timezone argument than Integer and String"}
    +    }
    +    return timezone;
    +  }
    +end
    +
    +
    + +
    +

    + + .at(seconds, frac = undefined) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/time.rb', line 16
    +
    +def self.at(seconds, frac = undefined)
    +  %x{
    +    var result;
    +
    +    if (#{::Time === seconds}) {
    +      if (frac !== undefined) {
    +        #{::Kernel.raise ::TypeError, "can't convert Time into an exact number"}
    +      }
    +      result = new Date(seconds.getTime());
    +      result.timezone = seconds.timezone;
    +      return result;
    +    }
    +
    +    if (!seconds.$$is_number) {
    +      seconds = #{::Opal.coerce_to!(seconds, ::Integer, :to_int)};
    +    }
    +
    +    if (frac === undefined) {
    +      return new Date(seconds * 1000);
    +    }
    +
    +    if (!frac.$$is_number) {
    +      frac = #{::Opal.coerce_to!(frac, ::Integer, :to_int)};
    +    }
    +
    +    return new Date(seconds * 1000 + (frac / 1000));
    +  }
    +end
    +
    +
    + +
    +

    + + .gm(year, month = nil, day = nil, hour = nil, min = nil, sec = nil, millisecond = nil, _dummy1 = nil, _dummy2 = nil, _dummy3 = nil) ⇒ Object + + + + Also known as: + utc + + + + +

    + + + + +
    +
    +
    +
    +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 'opal/opal/corelib/time.rb', line 236
    +
    +def self.gm(year, month = nil, day = nil, hour = nil, min = nil, sec = nil, millisecond = nil, _dummy1 = nil, _dummy2 = nil, _dummy3 = nil)
    +  # The _dummy args are there only because the MRI version accepts up to 10 arguments
    +  %x{
    +    var args, result;
    +
    +    if (arguments.length === 10) {
    +      args  = $slice(arguments);
    +      year  = args[5];
    +      month = args[4];
    +      day   = args[3];
    +      hour  = args[2];
    +      min   = args[1];
    +      sec   = args[0];
    +    }
    +
    +    args  = time_params(year, month, day, hour, min, sec);
    +    year  = args[0];
    +    month = args[1];
    +    day   = args[2];
    +    hour  = args[3];
    +    min   = args[4];
    +    sec   = args[5];
    +
    +    result = new Date(Date.UTC(year, month, day, hour, min, 0, sec * 1000));
    +    if (year < 100) {
    +      result.setUTCFullYear(year);
    +    }
    +    result.timezone = 0;
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + .local(year, month = nil, day = nil, hour = nil, min = nil, sec = nil, millisecond = nil, _dummy1 = nil, _dummy2 = nil, _dummy3 = nil) ⇒ Object + + + + Also known as: + mktime + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/time.rb', line 205
    +
    +def self.local(year, month = nil, day = nil, hour = nil, min = nil, sec = nil, millisecond = nil, _dummy1 = nil, _dummy2 = nil, _dummy3 = nil)
    +  # The _dummy args are there only because the MRI version accepts up to 10 arguments
    +  %x{
    +    var args, result;
    +
    +    if (arguments.length === 10) {
    +      args  = $slice(arguments);
    +      year  = args[5];
    +      month = args[4];
    +      day   = args[3];
    +      hour  = args[2];
    +      min   = args[1];
    +      sec   = args[0];
    +    }
    +
    +    args  = time_params(year, month, day, hour, min, sec);
    +    year  = args[0];
    +    month = args[1];
    +    day   = args[2];
    +    hour  = args[3];
    +    min   = args[4];
    +    sec   = args[5];
    +
    +    result = new Date(year, month, day, hour, min, 0, sec * 1000);
    +    if (year < 100) {
    +      result.setFullYear(year);
    +    }
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + .new(year = undefined, month = nil, day = nil, hour = nil, min = nil, sec = nil, utc_offset = nil) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +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
    +
    +
    # File 'opal/opal/corelib/time.rb', line 137
    +
    +def self.new(year = undefined, month = nil, day = nil, hour = nil, min = nil, sec = nil, utc_offset = nil)
    +  %x{
    +    var args, result, timezone, utc_date;
    +
    +    if (year === undefined) {
    +      return new Date();
    +    }
    +
    +    args  = time_params(year, month, day, hour, min, sec);
    +    year  = args[0];
    +    month = args[1];
    +    day   = args[2];
    +    hour  = args[3];
    +    min   = args[4];
    +    sec   = args[5];
    +
    +    if (utc_offset === nil) {
    +      result = new Date(year, month, day, hour, min, 0, sec * 1000);
    +      if (year < 100) {
    +        result.setFullYear(year);
    +      }
    +      return result;
    +    }
    +
    +    timezone = #{_parse_offset(utc_offset)};
    +    utc_date = new Date(Date.UTC(year, month, day, hour, min, 0, sec * 1000));
    +    if (year < 100) {
    +      utc_date.setUTCFullYear(year);
    +    }
    +
    +    result = new Date(utc_date.getTime() - timezone * 3600000);
    +    result.timezone = timezone;
    +
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + .nowObject + + + + + +

    + + + + +
    +
    +
    +
    +268
    +269
    +270
    +
    +
    # File 'opal/opal/corelib/time.rb', line 268
    +
    +def self.now
    +  new
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

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

    + + + + +
    +
    +
    +
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +
    +
    # File 'opal/opal/corelib/time.rb', line 272
    +
    +def +(other)
    +  if ::Time === other
    +    ::Kernel.raise ::TypeError, 'time + time?'
    +  end
    +
    +  %x{
    +    if (!other.$$is_number) {
    +      other = #{::Opal.coerce_to!(other, ::Integer, :to_int)};
    +    }
    +    var result = new Date(self.getTime() + (other * 1000));
    +    result.timezone = self.timezone;
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +
    +
    # File 'opal/opal/corelib/time.rb', line 287
    +
    +def -(other)
    +  if ::Time === other
    +    return `(self.getTime() - other.getTime()) / 1000`
    +  end
    +
    +  %x{
    +    if (!other.$$is_number) {
    +      other = #{::Opal.coerce_to!(other, ::Integer, :to_int)};
    +    }
    +    var result = new Date(self.getTime() - (other * 1000));
    +    result.timezone = self.timezone;
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +
    +
    # File 'opal/opal/corelib/time.rb', line 302
    +
    +def <=>(other)
    +  if ::Time === other
    +    to_f <=> other.to_f
    +  else
    +    r = other <=> self
    +    if r.nil?
    +      nil
    +    elsif r > 0
    +      -1
    +    elsif r < 0
    +      1
    +    else
    +      0
    +    end
    +  end
    +end
    +
    +
    + +
    +

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

    + + + + +
    +
    +
    +
    +319
    +320
    +321
    +
    +
    # File 'opal/opal/corelib/time.rb', line 319
    +
    +def ==(other)
    +  ::Time === other && `#{to_f} === #{other.to_f}`
    +end
    +
    +
    + +
    +

    + + #asctimeObject + + + + Also known as: + ctime + + + + +

    + + + + +
    +
    +
    +
    +323
    +324
    +325
    +
    +
    # File 'opal/opal/corelib/time.rb', line 323
    +
    +def asctime
    +  strftime '%a %b %e %H:%M:%S %Y'
    +end
    +
    +
    + +
    +

    + + #cweek_cyearObject + + + + + +

    + + + + +
    +
    +
    +
    +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
    +764
    +765
    +766
    +767
    +768
    +769
    +
    +
    # File 'opal/opal/corelib/time.rb', line 739
    +
    +def cweek_cyear
    +  jan01 = ::Time.new(year, 1, 1)
    +  jan01_wday = jan01.wday
    +  first_monday = 0
    +  year = self.year
    +  if jan01_wday <= 4 && jan01_wday != 0
    +    # Jan 01 is in the first week of the year
    +    offset = jan01_wday - 1
    +  else
    +    # Jan 01 is in the last week of the previous year
    +    offset = jan01_wday - 7 - 1
    +    offset = -1 if offset == -8 # Adjust if Jan 01 is a Sunday
    +  end
    +
    +  week = ((yday + offset) / 7.00).ceil
    +
    +  if week <= 0
    +    # Get the last week of the previous year
    +    return ::Time.new(self.year - 1, 12, 31).cweek_cyear
    +  elsif week == 53
    +    # Find out whether this is actually week 53 or already week 01 of the following year
    +    dec31 = ::Time.new(self.year, 12, 31)
    +    dec31_wday = dec31.wday
    +    if dec31_wday <= 3 && dec31_wday != 0
    +      week = 1
    +      year += 1
    +    end
    +  end
    +
    +  [week, year]
    +end
    +
    +
    + +
    +

    + + #dupObject + + + + + +

    + + + + +
    +
    +
    +
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +
    +
    # File 'opal/opal/corelib/time.rb', line 364
    +
    +def dup
    +  copy = `new Date(self.getTime())`
    +
    +  copy.copy_instance_variables(self)
    +  copy.initialize_dup(self)
    +
    +  copy
    +end
    +
    +
    + +
    +

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

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +373
    +374
    +375
    +
    +
    # File 'opal/opal/corelib/time.rb', line 373
    +
    +def eql?(other)
    +  other.is_a?(::Time) && (self <=> other).zero?
    +end
    +
    +
    + +
    +

    + + #getgmObject + + + + Also known as: + getutc + + + + +

    + + + + +
    +
    +
    +
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +
    +
    # File 'opal/opal/corelib/time.rb', line 439
    +
    +def getgm
    +  %x{
    +    var result = new Date(self.getTime());
    +    result.timezone = 0;
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #gmt?Boolean + + + + Also known as: + utc? + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +457
    +458
    +459
    +
    +
    # File 'opal/opal/corelib/time.rb', line 457
    +
    +def gmt?
    +  `self.timezone === 0`
    +end
    +
    +
    + +
    +

    + + #gmt_offsetObject + + + + Also known as: + gmtoff, utc_offset + + + + +

    + + + + +
    +
    +
    +
    +461
    +462
    +463
    +
    +
    # File 'opal/opal/corelib/time.rb', line 461
    +
    +def gmt_offset
    +  `(self.timezone != null) ? self.timezone * 60 : -self.getTimezoneOffset() * 60`
    +end
    +
    +
    + +
    +

    + + #gmtimeObject + + + + Also known as: + utc + + + + +

    + + + + +
    +
    +
    +
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +
    +
    # File 'opal/opal/corelib/time.rb', line 447
    +
    +def gmtime
    +  %x{
    +    if (self.timezone !== 0) {
    +      $deny_frozen_access(self);
    +      self.timezone = 0;
    +    }
    +    return self;
    +  }
    +end
    +
    +
    + +
    +

    + + #hashObject + + + + + +

    + + + + +
    +
    +
    +
    +391
    +392
    +393
    +
    +
    # File 'opal/opal/corelib/time.rb', line 391
    +
    +def hash
    +  [::Time, `self.getTime()`].hash
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + Also known as: + to_s + + + + +

    + + + + +
    +
    +
    +
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +
    +
    # File 'opal/opal/corelib/time.rb', line 395
    +
    +def inspect
    +  if utc?
    +    strftime '%Y-%m-%d %H:%M:%S UTC'
    +  else
    +    strftime '%Y-%m-%d %H:%M:%S %z'
    +  end
    +end
    +
    +
    + +
    +

    + + #isdstObject + + + + Also known as: + dst? + + + + +

    + + + + +
    +
    +
    +
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +
    +
    # File 'opal/opal/corelib/time.rb', line 356
    +
    +def isdst
    +  %x{
    +    var jan = new Date(self.getFullYear(), 0, 1),
    +        jul = new Date(self.getFullYear(), 6, 1);
    +    return self.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
    +  }
    +end
    +
    +
    + +
    +

    + + #strftime(format) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +465
    +466
    +467
    +468
    +469
    +470
    +471
    +472
    +473
    +474
    +475
    +476
    +477
    +478
    +479
    +480
    +481
    +482
    +483
    +484
    +485
    +486
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +548
    +549
    +550
    +551
    +552
    +553
    +554
    +555
    +556
    +557
    +558
    +559
    +560
    +561
    +562
    +563
    +564
    +565
    +566
    +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
    +611
    +612
    +613
    +614
    +615
    +616
    +617
    +618
    +619
    +620
    +621
    +622
    +623
    +624
    +625
    +626
    +627
    +628
    +629
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +638
    +639
    +640
    +641
    +642
    +643
    +644
    +645
    +646
    +647
    +648
    +649
    +650
    +651
    +652
    +653
    +654
    +655
    +656
    +657
    +658
    +659
    +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
    +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
    +
    +
    # File 'opal/opal/corelib/time.rb', line 465
    +
    +def strftime(format)
    +  %x{
    +    return format.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g, function(full, flags, width, _, conv) {
    +      var result = "", jd, c, s,
    +          zero   = flags.indexOf('0') !== -1,
    +          pad    = flags.indexOf('-') === -1,
    +          blank  = flags.indexOf('_') !== -1,
    +          upcase = flags.indexOf('^') !== -1,
    +          invert = flags.indexOf('#') !== -1,
    +          colons = (flags.match(':') || []).length;
    +
    +      width = parseInt(width, 10);
    +
    +      if (zero && blank) {
    +        if (flags.indexOf('0') < flags.indexOf('_')) {
    +          zero = false;
    +        }
    +        else {
    +          blank = false;
    +        }
    +      }
    +
    +      switch (conv) {
    +        case 'Y':
    +          result += #{year};
    +          break;
    +
    +        case 'C':
    +          zero    = !blank;
    +          result += Math.round(#{year} / 100);
    +          break;
    +
    +        case 'y':
    +          zero    = !blank;
    +          result += (#{year} % 100);
    +          break;
    +
    +        case 'm':
    +          zero    = !blank;
    +          result += #{mon};
    +          break;
    +
    +        case 'B':
    +          result += long_months[#{mon} - 1];
    +          break;
    +
    +        case 'b':
    +        case 'h':
    +          blank   = !zero;
    +          result += short_months[#{mon} - 1];
    +          break;
    +
    +        case 'd':
    +          zero    = !blank
    +          result += #{day};
    +          break;
    +
    +        case 'e':
    +          blank   = !zero
    +          result += #{day};
    +          break;
    +
    +        case 'j':
    +          zero    = !blank;
    +          width   = isNaN(width) ? 3 : width;
    +          result += #{yday};
    +          break;
    +
    +        case 'H':
    +          zero    = !blank;
    +          result += #{hour};
    +          break;
    +
    +        case 'k':
    +          blank   = !zero;
    +          result += #{hour};
    +          break;
    +
    +        case 'I':
    +          zero    = !blank;
    +          result += (#{hour} % 12 || 12);
    +          break;
    +
    +        case 'l':
    +          blank   = !zero;
    +          result += (#{hour} % 12 || 12);
    +          break;
    +
    +        case 'P':
    +          result += (#{hour} >= 12 ? "pm" : "am");
    +          break;
    +
    +        case 'p':
    +          result += (#{hour} >= 12 ? "PM" : "AM");
    +          break;
    +
    +        case 'M':
    +          zero    = !blank;
    +          result += #{min};
    +          break;
    +
    +        case 'S':
    +          zero    = !blank;
    +          result += #{sec}
    +          break;
    +
    +        case 'L':
    +          zero    = !blank;
    +          width   = isNaN(width) ? 3 : width;
    +          result += self.getMilliseconds();
    +          break;
    +
    +        case 'N':
    +          width   = isNaN(width) ? 9 : width;
    +          result += #{`self.getMilliseconds().toString()`.rjust(3, '0')};
    +          result  = #{`result`.ljust(`width`, '0')};
    +          break;
    +
    +        case 'z':
    +          var offset  = (self.timezone == null) ? self.getTimezoneOffset() : (-self.timezone * 60),
    +              hours   = Math.floor(Math.abs(offset) / 60),
    +              minutes = Math.abs(offset) % 60;
    +
    +          result += offset < 0 ? "+" : "-";
    +          result += hours < 10 ? "0" : "";
    +          result += hours;
    +
    +          if (colons > 0) {
    +            result += ":";
    +          }
    +
    +          result += minutes < 10 ? "0" : "";
    +          result += minutes;
    +
    +          if (colons > 1) {
    +            result += ":00";
    +          }
    +
    +          break;
    +
    +        case 'Z':
    +          result += #{zone};
    +          break;
    +
    +        case 'A':
    +          result += days_of_week[#{wday}];
    +          break;
    +
    +        case 'a':
    +          result += short_days[#{wday}];
    +          break;
    +
    +        case 'u':
    +          result += (#{wday} + 1);
    +          break;
    +
    +        case 'w':
    +          result += #{wday};
    +          break;
    +
    +        case 'V':
    +          result += #{cweek_cyear[0].to_s.rjust(2, '0')};
    +          break;
    +
    +        case 'G':
    +          result += #{cweek_cyear[1]};
    +          break;
    +
    +        case 'g':
    +          result += #{cweek_cyear[1][-2..-1]};
    +          break;
    +
    +        case 's':
    +          result += #{to_i};
    +          break;
    +
    +        case 'n':
    +          result += "\n";
    +          break;
    +
    +        case 't':
    +          result += "\t";
    +          break;
    +
    +        case '%':
    +          result += "%";
    +          break;
    +
    +        case 'c':
    +          result += #{strftime('%a %b %e %T %Y')};
    +          break;
    +
    +        case 'D':
    +        case 'x':
    +          result += #{strftime('%m/%d/%y')};
    +          break;
    +
    +        case 'F':
    +          result += #{strftime('%Y-%m-%d')};
    +          break;
    +
    +        case 'v':
    +          result += #{strftime('%e-%^b-%4Y')};
    +          break;
    +
    +        case 'r':
    +          result += #{strftime('%I:%M:%S %p')};
    +          break;
    +
    +        case 'R':
    +          result += #{strftime('%H:%M')};
    +          break;
    +
    +        case 'T':
    +        case 'X':
    +          result += #{strftime('%H:%M:%S')};
    +          break;
    +
    +        // Non-standard: JIS X 0301 date format
    +        case 'J':
    +          jd = #{to_date.jd};
    +          if (jd < 2405160) {
    +            result += #{strftime('%Y-%m-%d')};
    +            break;
    +          }
    +          else if (jd < 2419614)
    +            c = 'M', s = 1867;
    +          else if (jd < 2424875)
    +            c = 'T', s = 1911;
    +          else if (jd < 2447535)
    +            c = 'S', s = 1925;
    +          else if (jd < 2458605)
    +            c = 'H', s = 1988;
    +          else
    +            c = 'R', s = 2018;
    +
    +          result += #{format '%c%02d', `c`, year - `s`};
    +          result += #{strftime('-%m-%d')};
    +          break;
    +
    +        default:
    +          return full;
    +      }
    +
    +      if (upcase) {
    +        result = result.toUpperCase();
    +      }
    +
    +      if (invert) {
    +        result = result.replace(/[A-Z]/, function(c) { c.toLowerCase() }).
    +                        replace(/[a-z]/, function(c) { c.toUpperCase() });
    +      }
    +
    +      if (pad && (zero || blank)) {
    +        result = #{`result`.rjust(`isNaN(width) ? 2 : width`, `blank ? " " : "0"`)};
    +      }
    +
    +      return result;
    +    });
    +  }
    +end
    +
    +
    + +
    +

    + + #succObject + + + + + +

    + + + + +
    +
    +
    +
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +
    +
    # File 'opal/opal/corelib/time.rb', line 403
    +
    +def succ
    +  %x{
    +    var result = new Date(self.getTime() + 1000);
    +    result.timezone = self.timezone;
    +    return result;
    +  }
    +end
    +
    +
    + +
    +

    + + #to_aObject + + + + + +

    + + + + +
    +
    +
    +
    +727
    +728
    +729
    +
    +
    # File 'opal/opal/corelib/time.rb', line 727
    +
    +def to_a
    +  [sec, min, hour, day, month, year, wday, yday, isdst, zone]
    +end
    +
    +
    + +
    +

    + + #to_fObject + + + + + +

    + + + + +
    +
    +
    +
    +731
    +732
    +733
    +
    +
    # File 'opal/opal/corelib/time.rb', line 731
    +
    +def to_f
    +  `self.getTime() / 1000`
    +end
    +
    +
    + +
    +

    + + #to_iObject + + + + Also known as: + tv_sec + + + + +

    + + + + +
    +
    +
    +
    +735
    +736
    +737
    +
    +
    # File 'opal/opal/corelib/time.rb', line 735
    +
    +def to_i
    +  `parseInt(self.getTime() / 1000, 10)`
    +end
    +
    +
    + +
    +

    + + #usecObject + + + + Also known as: + tv_usec + + + + +

    + + + + +
    +
    +
    +
    +411
    +412
    +413
    +
    +
    # File 'opal/opal/corelib/time.rb', line 411
    +
    +def usec
    +  `self.getMilliseconds() * 1000`
    +end
    +
    +
    + +
    +

    + + #ydayObject + + + + + +

    + + + + +
    +
    +
    +
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +
    +
    # File 'opal/opal/corelib/time.rb', line 345
    +
    +def yday
    +  # http://javascript.about.com/library/bldayyear.htm
    +  # also see moment.js implementation: http://git.io/vCKNE
    +
    +  start_of_year = Time.new(year).to_i
    +  start_of_day  = Time.new(year, month, day).to_i
    +  one_day       = 86_400
    +
    +  ((start_of_day - start_of_year) / one_day).round + 1
    +end
    +
    +
    + +
    +

    + + #zoneObject + + + + + +

    + + + + +
    +
    +
    +
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +
    +
    # File 'opal/opal/corelib/time.rb', line 415
    +
    +def zone
    +  %x{
    +    if (self.timezone === 0) return "UTC";
    +    else if (self.timezone != null) return nil;
    +
    +    var string = self.toString(),
    +        result;
    +
    +    if (string.indexOf('(') == -1) {
    +      result = string.match(/[A-Z]{3,4}/)[0];
    +    }
    +    else {
    +      result = string.match(/\((.+)\)(?:\s|$)/)[1]
    +    }
    +
    +    if (result == "GMT" && /(GMT\W*\d{4})/.test(string)) {
    +      return RegExp.$1;
    +    }
    +    else {
    +      return result;
    +    }
    +  }
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/TracePoint.html b/docs/api/v1.8.2/corelib/TracePoint.html new file mode 100644 index 00000000..8f1498d5 --- /dev/null +++ b/docs/api/v1.8.2/corelib/TracePoint.html @@ -0,0 +1,664 @@ + + + + + + + Class: TracePoint + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: TracePoint + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/trace_point.rb
    +
    + +
    + +

    Overview

    +
    +

    backtick_javascript: true

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

    Instance Attribute Summary collapse

    +
      + +
    • + + + #event ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute event.

      +
      + +
    • + + +
    + + + + + +

    + Class Method Summary + collapse +

    + +
      + +
    • + + + .trace(event, &block) ⇒ Object + + + + + + + + + + + + + +

      partial implementation of TracePoint for the moment only supports the :class event.

      +
      + +
    • + + +
    + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(event, &block) ⇒ TracePoint + + + + + +

    +
    +

    Returns a new instance of TracePoint.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +
    +
    # File 'opal/opal/corelib/trace_point.rb', line 12
    +
    +def initialize(event, &block)
    +  ::Kernel.raise 'Only the :class event is supported' unless event == :class
    +  @event = event
    +  @block = block
    +  @trace_object = nil
    +  @trace_evt = "trace_#{@event}"
    +  @tracers_for_evt = "tracers_for_#{@event}"
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #eventObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute event.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +10
    +11
    +12
    +
    +
    # File 'opal/opal/corelib/trace_point.rb', line 10
    +
    +def event
    +  @event
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .trace(event, &block) ⇒ Object + + + + + +

    +
    +

    partial implementation of TracePoint +for the moment only supports the :class event

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +6
    +7
    +8
    +
    +
    # File 'opal/opal/corelib/trace_point.rb', line 6
    +
    +def self.trace(event, &block)
    +  new(event, &block).enable
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #disableObject + + + + + +

    + + + + +
    +
    +
    +
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +
    +
    # File 'opal/opal/corelib/trace_point.rb', line 38
    +
    +def disable
    +  %x{
    +    var idx = Opal[#{@tracers_for_evt}].indexOf(self)
    +
    +    if (idx > -1) {
    +      Opal[#{@tracers_for_evt}].splice(idx, 1);
    +
    +      if (Opal[#{@tracers_for_evt}].length === 0) {
    +        Opal[#{@trace_evt}] = false;
    +      }
    +
    +      return true;
    +    } else {
    +      return false;
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #enable(*args, &enable_block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +
    +
    # File 'opal/opal/corelib/trace_point.rb', line 21
    +
    +def enable(*args, &enable_block)
    +  previous_state = enabled?
    +  %x{
    +    Opal[#{@tracers_for_evt}].push(self);
    +    Opal[#{@trace_evt}] = true;
    +  }
    +  if block_given?
    +    yield
    +    disable
    +  end
    +  previous_state
    +end
    +
    +
    + +
    +

    + + #enabled?Boolean + + + + + +

    +
    + + +
    +
    +
    + +

    Returns:

    + + +
    + + + + +
    +
    +
    +
    +34
    +35
    +36
    +
    +
    # File 'opal/opal/corelib/trace_point.rb', line 34
    +
    +def enabled?
    +  `Opal[#{@trace_evt}] && Opal[#{@tracers_for_evt}].includes(self)`
    +end
    +
    +
    + +
    +

    + + #selfObject + + + + + +

    + + + + +
    +
    +
    +
    +56
    +57
    +58
    +
    +
    # File 'opal/opal/corelib/trace_point.rb', line 56
    +
    +def self
    +  @trace_object
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/TrueClass.html b/docs/api/v1.8.2/corelib/TrueClass.html new file mode 100644 index 00000000..15cb2b6d --- /dev/null +++ b/docs/api/v1.8.2/corelib/TrueClass.html @@ -0,0 +1,146 @@ + + + + + + + Class: TrueClass + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: TrueClass + + + +

    +
    + +
    +
    Inherits:
    +
    + Boolean + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/boolean.rb
    +
    + +
    + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Boolean

    +

    #!, #&, #==, #^, #__id__, #__marshal__, allocate, #clone, #dup, #method_missing, #respond_to_missing?, #singleton_class, #to_s, #|

    +
    +

    Dynamic Method Handling

    +

    + This class handles dynamic methods through the method_missing method + + in the class Boolean + +

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/TypeError.html b/docs/api/v1.8.2/corelib/TypeError.html new file mode 100644 index 00000000..4056e247 --- /dev/null +++ b/docs/api/v1.8.2/corelib/TypeError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: TypeError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: TypeError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/UnboundMethod.html b/docs/api/v1.8.2/corelib/UnboundMethod.html new file mode 100644 index 00000000..6f159070 --- /dev/null +++ b/docs/api/v1.8.2/corelib/UnboundMethod.html @@ -0,0 +1,815 @@ + + + + + + + Class: UnboundMethod + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: UnboundMethod + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/method.rb
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute name.

      +
      + +
    • + + +
    • + + + #owner ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute owner.

      +
      + +
    • + + +
    • + + + #source ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute source.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(source, owner, method, name) ⇒ UnboundMethod + + + + + +

    +
    +

    Returns a new instance of UnboundMethod.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +
    +
    # File 'opal/opal/corelib/method.rb', line 75
    +
    +def initialize(source, owner, method, name)
    +  @source = source
    +  @owner  = owner
    +  @method = method
    +  @name   = name
    +  `self.$$method = method`
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #nameObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute name.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +73
    +74
    +75
    +
    +
    # File 'opal/opal/corelib/method.rb', line 73
    +
    +def name
    +  @name
    +end
    +
    +
    + + + +
    +

    + + #ownerObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute owner.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +73
    +74
    +75
    +
    +
    # File 'opal/opal/corelib/method.rb', line 73
    +
    +def owner
    +  @owner
    +end
    +
    +
    + + + +
    +

    + + #sourceObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute source.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +73
    +74
    +75
    +
    +
    # File 'opal/opal/corelib/method.rb', line 73
    +
    +def source
    +  @source
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #arityObject + + + + + +

    + + + + +
    +
    +
    +
    +83
    +84
    +85
    +
    +
    # File 'opal/opal/corelib/method.rb', line 83
    +
    +def arity
    +  @method.arity
    +end
    +
    +
    + +
    +

    + + #bind(object) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +
    +
    # File 'opal/opal/corelib/method.rb', line 99
    +
    +def bind(object)
    +  %x{
    +    if (#{@owner}.$$is_module || Opal.is_a(#{object}, #{@owner})) {
    +      return #{::Method.new(object, @owner, @method, @name)};
    +    }
    +    else {
    +      #{::Kernel.raise ::TypeError, "can't bind singleton method to a different class (expected #{object}.kind_of?(#{@owner} to be true)"};
    +    }
    +  }
    +end
    +
    +
    + +
    +

    + + #bind_call(object, *args, &block) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +110
    +111
    +112
    +
    +
    # File 'opal/opal/corelib/method.rb', line 110
    +
    +def bind_call(object, *args, &block)
    +  bind(object).call(*args, &block)
    +end
    +
    +
    + +
    +

    + + #commentsObject + + + + + +

    + + + + +
    +
    +
    +
    +95
    +96
    +97
    +
    +
    # File 'opal/opal/corelib/method.rb', line 95
    +
    +def comments
    +  `#{@method}.$$comments` || []
    +end
    +
    +
    + +
    +

    + + #inspectObject + + + + + +

    + + + + +
    +
    +
    +
    +114
    +115
    +116
    +
    +
    # File 'opal/opal/corelib/method.rb', line 114
    +
    +def inspect
    +  "#<#{self.class}: #{@source}##{@name} (defined in #{@owner} in #{source_location.join(':')})>"
    +end
    +
    +
    + +
    +

    + + #parametersObject + + + + + +

    + + + + +
    +
    +
    +
    +87
    +88
    +89
    +
    +
    # File 'opal/opal/corelib/method.rb', line 87
    +
    +def parameters
    +  `#{@method}.$$parameters`
    +end
    +
    +
    + +
    +

    + + #source_locationObject + + + + + +

    + + + + +
    +
    +
    +
    +91
    +92
    +93
    +
    +
    # File 'opal/opal/corelib/method.rb', line 91
    +
    +def source_location
    +  `#{@method}.$$source_location` || ['(eval)', 0]
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/UncaughtThrowError.html b/docs/api/v1.8.2/corelib/UncaughtThrowError.html new file mode 100644 index 00000000..0a172b07 --- /dev/null +++ b/docs/api/v1.8.2/corelib/UncaughtThrowError.html @@ -0,0 +1,390 @@ + + + + + + + Exception: UncaughtThrowError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: UncaughtThrowError + + + +

    +
    + +
    +
    Inherits:
    +
    + ArgumentError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb,
    + opal/opal/corelib/error.rb
    +
    +
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #tag ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute tag.

      +
      + +
    • + + +
    • + + + #value ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

      Returns the value of attribute value.

      +
      + +
    • + + +
    + + + + + +

    + Instance Method Summary + collapse +

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

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +
    +

    + + #initialize(tag, value = nil) ⇒ UncaughtThrowError + + + + + +

    +
    +

    Returns a new instance of UncaughtThrowError.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +273
    +274
    +275
    +276
    +277
    +278
    +
    +
    # File 'opal/opal/corelib/error.rb', line 273
    +
    +def initialize(tag, value = nil)
    +  @tag = tag
    +  @value = value
    +
    +  super("uncaught throw #{@tag.inspect}")
    +end
    +
    +
    + +
    + +
    +

    Instance Attribute Details

    + + + +
    +

    + + #tagObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute tag.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +271
    +272
    +273
    +
    +
    # File 'opal/opal/corelib/error.rb', line 271
    +
    +def tag
    +  @tag
    +end
    +
    +
    + + + +
    +

    + + #valueObject (readonly) + + + + + +

    +
    +

    Returns the value of attribute value.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +271
    +272
    +273
    +
    +
    # File 'opal/opal/corelib/error.rb', line 271
    +
    +def value
    +  @value
    +end
    +
    +
    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/ZeroDivisionError.html b/docs/api/v1.8.2/corelib/ZeroDivisionError.html new file mode 100644 index 00000000..8fd67f52 --- /dev/null +++ b/docs/api/v1.8.2/corelib/ZeroDivisionError.html @@ -0,0 +1,150 @@ + + + + + + + Exception: ZeroDivisionError + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    Exception: ZeroDivisionError + + + +

    +
    + +
    +
    Inherits:
    +
    + StandardError + + + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    opal/opal/corelib/error.rb
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +

    Method Summary

    + +

    Methods inherited from Exception

    +

    #backtrace, #backtrace_locations, #cause, #copy_instance_variables, exception, #exception, #full_message, #initialize, #inspect, #message, new, #set_backtrace, #to_s

    +
    +

    Constructor Details

    + +

    This class inherits a constructor from Exception

    + +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/_index.html b/docs/api/v1.8.2/corelib/_index.html new file mode 100644 index 00000000..f69b4d0c --- /dev/null +++ b/docs/api/v1.8.2/corelib/_index.html @@ -0,0 +1,850 @@ + + + + + + + corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
    + + +

    corelib (Opal v1.8.2)

    +
    +

    Alphabetic Index

    + +

    File Listing

    + + +
    +

    Namespace Listing A-Z

    + + + + + + + + + + +
    + + + + + + + + + + + +
      +
    • D
    • +
        + +
      • + Dir + +
      • + +
      +
    + + + + + + + + +
      +
    • G
    • +
        + +
      • + GC + +
      • + +
      • + Generator + + (Enumerator) + +
      • + +
      +
    + + +
    + + +
      +
    • H
    • +
        + +
      • + Hash + +
      • + +
      +
    + + + + + +
      +
    • J
    • +
        + +
      • + JS + +
      • + +
      +
    + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
      +
    • W
    • + +
    + + +
      +
    • Y
    • +
        + +
      • + Yielder + + (Enumerator) + +
      • + +
      +
    + + + + + +
    + + +
      +
    • _
    • + +
    + +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/class_list.html b/docs/api/v1.8.2/corelib/class_list.html new file mode 100644 index 00000000..6a1d0685 --- /dev/null +++ b/docs/api/v1.8.2/corelib/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
    +
    +

    Class List

    + + + +
    + + +
    + + diff --git a/docs/api/v1.8.2/corelib/css/common.css b/docs/api/v1.8.2/corelib/css/common.css new file mode 100644 index 00000000..cf25c452 --- /dev/null +++ b/docs/api/v1.8.2/corelib/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/css/full_list.css b/docs/api/v1.8.2/corelib/css/full_list.css new file mode 100644 index 00000000..fa359824 --- /dev/null +++ b/docs/api/v1.8.2/corelib/css/full_list.css @@ -0,0 +1,58 @@ +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/v1.8.2/corelib/css/style.css b/docs/api/v1.8.2/corelib/css/style.css new file mode 100644 index 00000000..eb0dbc86 --- /dev/null +++ b/docs/api/v1.8.2/corelib/css/style.css @@ -0,0 +1,497 @@ +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; + box-sizing: border-box; +} + +@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 > li > ol { font-size: 0.9em; } +#toc ol ol > li > 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/v1.8.2/corelib/file.README.html b/docs/api/v1.8.2/corelib/file.README.html new file mode 100644 index 00000000..3bd0d0f0 --- /dev/null +++ b/docs/api/v1.8.2/corelib/file.README.html @@ -0,0 +1,87 @@ + + + + + + + File: README + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Opal corelib

      + +

      This is the Opal corelib implementation API documentation. +The whole corelib is loaded upon require 'opal'.

      + +

      The runtime.js documentation is available here (in master)

      + +

      Cherry-picking

      + +

      Note that require 'opal' will load all of the corelib, which is likely to +have a ton of stuff you don't need.

      + +

      If you're concerned about runtime size, you can require 'opal/base' and +require anything you need, or require 'opal/mini' to have a working Ruby +without useless stuff.

      +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/file.RUNTIME.html b/docs/api/v1.8.2/corelib/file.RUNTIME.html new file mode 100644 index 00000000..71c3483c --- /dev/null +++ b/docs/api/v1.8.2/corelib/file.RUNTIME.html @@ -0,0 +1,2726 @@ + + + + + + + File: RUNTIME + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      runtime.js

      + +

      ``

      + +

      @note + A few conventions for the documentation of this file:

      + +
        +
      1. Always use "//" (in contrast with "/**/")
      2. +
      3. The syntax used is Yardoc (yardoc.org), which is intended for Ruby (se below)
      4. +
      5. @param and @return types should be preceded by JS. when referring to + JavaScript constructors (e.g. JS.Function) otherwise Ruby is assumed.
      6. +
      7. nil and null being unambiguous refer to the respective + objects/values in Ruby and JavaScript
      8. +
      9. This is still WIP :) so please give feedback and suggestions on how + to improve or for alternative solutions
      10. +
      + +

      The way the code is digested before going through Yardoc is a secret kept + in the docs repo (https://github.com/opal/docs/tree/master).

      + +
      
      +
      + +

      if (typeof(globalThis) !== 'undefined') { global_object = globalThis; }

      + +

      Detect the global object

      + +
      if (typeof(globalThis) !== 'undefined') { global_object = globalThis; }
      +
      + +

      if (global_object.console == null)

      + +

      Setup a dummy console object if missing

      + +
      if (global_object.console == null) {
      +
      + +

      BasicObject

      + +

      The actual class for BasicObject

      + +
      var BasicObject;
      +
      + +

      _Object

      + +

      The actual Object class. +The leading underscore is to avoid confusion with window.Object()

      + +
      var _Object;
      +
      + +

      Module

      + +

      The actual Module class

      + +
      var Module;
      +
      + +

      Class

      + +

      The actual Class class

      + +
      var Class;
      +
      + +

      _Opal

      + +

      The Opal.Opal class (helpers etc.)

      + +
      var _Opal;
      +
      + +

      Kernel

      + +

      The Kernel module

      + +
      var Kernel;
      +
      + +

      Opal = global_object.Opal = {}

      + +

      The Opal object that is exposed globally

      + +
      var Opal = global_object.Opal = {};
      +
      + +

      Opal.global = global_object

      + +

      This is a useful reference to global object inside ruby files

      + +
      Opal.global = global_object;
      +
      + +

      Opal.config =

      + +

      Configure runtime behavior with regards to require and unsupported features

      + +
      Opal.config = {
      +
      + +

      $call = Function.prototype.call

      + +

      Minify common function calls

      + +
      var $call      = Function.prototype.call;
      +
      + +

      nil_id = 4

      + +

      Nil object id is always 4

      + +
      var nil_id = 4;
      +
      + +

      unique_id = nil_id

      + +

      Generates even sequential numbers greater than 4 +(nil_id) to serve as unique ids for ruby objects

      + +
      var unique_id = nil_id;
      +
      + +

      function $uid()

      + +

      Return next unique id

      + +
      function $uid() {
      +  unique_id += 2;
      +  return unique_id;
      +};
      +
      + +

      Opal.id = function(obj)

      + +

      Retrieve or assign the id of an object

      + +
      Opal.id = function(obj) {
      +  if (obj.$$is_number) return (obj * 2)+1;
      +  if (obj.$$id == null) {
      +    $prop(obj, '$$id', $uid());
      +  }
      +  return obj.$$id;
      +};
      +
      + +

      $gvars = Opal.gvars = {}

      + +

      Globals table

      + +
      var $gvars = Opal.gvars = {};
      +
      + +

      Opal.exit = function(status) { if ($gvars.DEBUG) console.log('Exited with status '+status); }

      + +

      Exit function, this should be replaced by platform specific implementation +(See nodejs and chrome for examples)

      + +
      Opal.exit = function(status) { if ($gvars.DEBUG) console.log('Exited with status '+status); };
      +
      + +

      Opal.exceptions = []

      + +

      keeps track of exceptions for $!

      + +
      Opal.exceptions = [];
      +
      + +

      Opal.pop_exception = function(rescued_exception)

      + +

      @private +Pops an exception from the stack and updates $!.

      + +
      Opal.pop_exception = function(rescued_exception) {
      +  var exception = Opal.exceptions.pop();
      +  if (exception === rescued_exception) {
      +    // Current $! is raised in the rescue block, so we don't update it
      +  }
      +  else if (exception) {
      +    $gvars["!"] = exception;
      +  }
      +  else {
      +    $gvars["!"] = nil;
      +  }
      +};
      +
      + +

      function $raise(klass, message)

      + +

      A helper function for raising things, that gracefully degrades if necessary +functionality is not yet loaded.

      + +
      function $raise(klass, message) {
      +  // Raise Exception, so we can know that something wrong is going on.
      +  if (!klass) klass = Opal.Exception || Error;
      +
      +  if (Kernel && Kernel.$raise) {
      +    if (arguments.length > 2) {
      +      Kernel.$raise(klass.$new.apply(klass, $slice(arguments, 1)));
      +    }
      +    else {
      +      Kernel.$raise(klass, message);
      +    }
      +  }
      +  else if (!klass.$new) {
      +    throw new klass(message);
      +  }
      +  else {
      +    throw klass.$new(message);
      +  }
      +}
      +
      + +

      prop_options =

      + +

      Reuse the same object for performance/memory sake

      + +
      var prop_options = {
      +
      + +

      object[name] = initialValue

      + +

      Special case for: + s = "string" + def s.m; end +String class is the only class that:

      + +
        +
      • compiles to JS primitive
      • +
      • allows method definition directly on instances +numbers, true, false and null do not support it.
      • +
      + +
      object[name] = initialValue;
      +
      + +

      Opal.defineProperty = Opal.prop

      + +

      @deprecated

      + +
      Opal.defineProperty = Opal.prop;
      +
      + +

      ``

      + +

      Helpers

      + +
      
      +
      + +

      if (object['$respond_to?'].$$pristine && object.$method_missing.$$pristine)

      + +

      Fast path for the most common situation

      + +
      if (object['$respond_to?'].$$pristine && object.$method_missing.$$pristine) {
      +
      + +

      Opal.trace_class = false

      + +

      TracePoint support

      + +

      Support for TracePoint.trace(:class) do ... end

      + +
      Opal.trace_class = false;
      +
      + +

      ``

      + +

      Constants

      + +

      For future reference:

      + + + +

      Legend of MRI concepts/names:

      + +
        +
      • constant reference (cref): the module/class that acts as a namespace
      • +
      • nesting: the namespaces wrapping the current scope, e.g. nesting inside + module A; module B::C; end; end is [B::C, A]
      • +
      + +
      
      +
      + +

      function const_get_name(cref, name)

      + +

      Get the constant in the scope of the current cref

      + +
      function const_get_name(cref, name) {
      +  if (cref) {
      +    if (cref.$$const[name] != null) { return cref.$$const[name]; }
      +    if (cref.$$autoload && cref.$$autoload[name]) {
      +      return handle_autoload(cref, name);
      +    }
      +  }
      +}
      +
      + +

      function const_lookup_nesting(nesting, name)

      + +

      Walk up the nesting array looking for the constant

      + +
      function const_lookup_nesting(nesting, name) {
      +  var i, ii, constant;
      +
      +  if (nesting.length === 0) return;
      +
      +  // If the nesting is not empty the constant is looked up in its elements
      +  // and in order. The ancestors of those elements are ignored.
      +  for (i = 0, ii = nesting.length; i < ii; i++) {
      +    constant = nesting[i].$$const[name];
      +    if (constant != null) {
      +      return constant;
      +    } else if (nesting[i].$$autoload && nesting[i].$$autoload[name]) {
      +      return handle_autoload(nesting[i], name);
      +    }
      +  }
      +}
      +
      + +

      function const_lookup_ancestors(cref, name)

      + +

      Walk up the ancestors chain looking for the constant

      + +
      function const_lookup_ancestors(cref, name) {
      +  var i, ii, ancestors;
      +
      +  if (cref == null) return;
      +
      +  ancestors = $ancestors(cref);
      +
      +  for (i = 0, ii = ancestors.length; i < ii; i++) {
      +    if (ancestors[i].$$const && $has_own(ancestors[i].$$const, name)) {
      +      return ancestors[i].$$const[name];
      +    } else if (ancestors[i].$$autoload && ancestors[i].$$autoload[name]) {
      +      return handle_autoload(ancestors[i], name);
      +    }
      +  }
      +}
      +
      + +

      function const_lookup_Object(cref, name)

      + +

      Walk up Object's ancestors chain looking for the constant, +but only if cref is missing or a module.

      + +
      function const_lookup_Object(cref, name) {
      +  if (cref == null || cref.$$is_module) {
      +    return const_lookup_ancestors(_Object, name);
      +  }
      +}
      +
      + +

      function const_missing(cref, name)

      + +

      Call const_missing if nothing else worked

      + +
      function const_missing(cref, name) {
      +  return (cref || _Object).$const_missing(name);
      +}
      +
      + +

      Opal.const_get_local = function(cref, name, skip_missing)

      + +

      Look for the constant just in the current cref or call #const_missing

      + +
      Opal.const_get_local = function(cref, name, skip_missing) {
      +  var result;
      +
      +  if (cref == null) return;
      +
      +  if (cref === '::') cref = _Object;
      +
      +  if (!cref.$$is_module && !cref.$$is_class) {
      +    $raise(Opal.TypeError, cref.toString() + " is not a class/module");
      +  }
      +
      +  result = const_get_name(cref, name);
      +  return result != null || skip_missing ? result : const_missing(cref, name);
      +};
      +
      + +

      Opal.const_get_qualified = function(cref, name, skip_missing)

      + +

      Look for the constant relative to a cref or call #const_missing (when the +constant is prefixed by ::).

      + +
      Opal.const_get_qualified = function(cref, name, skip_missing) {
      +  var result, cache, cached, current_version = Opal.const_cache_version;
      +
      +  if (name == null) {
      +    // A shortpath for calls like ::String => $$$("String")
      +    result = const_get_name(_Object, cref);
      +
      +    if (result != null) return result;
      +    return Opal.const_get_qualified(_Object, cref, skip_missing);
      +  }
      +
      +  if (cref == null) return;
      +
      +  if (cref === '::') cref = _Object;
      +
      +  if (!cref.$$is_module && !cref.$$is_class) {
      +    $raise(Opal.TypeError, cref.toString() + " is not a class/module");
      +  }
      +
      +  if ((cache = cref.$$const_cache) == null) {
      +    $prop(cref, '$$const_cache', Object.create(null));
      +    cache = cref.$$const_cache;
      +  }
      +  cached = cache[name];
      +
      +  if (cached == null || cached[0] !== current_version) {
      +    ((result = const_get_name(cref, name))              != null) ||
      +    ((result = const_lookup_ancestors(cref, name))      != null);
      +    cache[name] = [current_version, result];
      +  } else {
      +    result = cached[1];
      +  }
      +
      +  return result != null || skip_missing ? result : const_missing(cref, name);
      +};
      +
      + +

      Opal.const_cache_version = 1

      + +

      Initialize the top level constant cache generation counter

      + +
      Opal.const_cache_version = 1;
      +
      + +

      Opal.const_get_relative = function(nesting, name, skip_missing)

      + +

      Look for the constant in the open using the current nesting and the nearest +cref ancestors or call #const_missing (when the constant has no :: prefix).

      + +
      Opal.const_get_relative = function(nesting, name, skip_missing) {
      +  var cref = nesting[0], result, current_version = Opal.const_cache_version, cache, cached;
      +
      +  if ((cache = nesting.$$const_cache) == null) {
      +    $prop(nesting, '$$const_cache', Object.create(null));
      +    cache = nesting.$$const_cache;
      +  }
      +  cached = cache[name];
      +
      +  if (cached == null || cached[0] !== current_version) {
      +    ((result = const_get_name(cref, name))              != null) ||
      +    ((result = const_lookup_nesting(nesting, name))     != null) ||
      +    ((result = const_lookup_ancestors(cref, name))      != null) ||
      +    ((result = const_lookup_Object(cref, name))         != null);
      +
      +    cache[name] = [current_version, result];
      +  } else {
      +    result = cached[1];
      +  }
      +
      +  return result != null || skip_missing ? result : const_missing(cref, name);
      +};
      +
      + +

      function $const_set(cref, name, value)

      + +

      Register the constant on a cref and opportunistically set the name of +unnamed classes/modules.

      + +
      function $const_set(cref, name, value) {
      +  var new_const = true;
      +
      +  if (cref == null || cref === '::') cref = _Object;
      +
      +  if (value.$$is_a_module) {
      +    if (value.$$name == null || value.$$name === nil) value.$$name = name;
      +    if (value.$$base_module == null) value.$$base_module = cref;
      +  }
      +
      +  cref.$$const = (cref.$$const || Object.create(null));
      +
      +  if (name in cref.$$const || ("$$autoload" in cref && name in cref.$$autoload)) {
      +    new_const = false;
      +  }
      +
      +  cref.$$const[name] = value;
      +
      +  // Add a short helper to navigate constants manually.
      +  // @example
      +  //   Opal.$$.Regexp.$$.IGNORECASE
      +  cref.$$ = cref.$$const;
      +
      +  Opal.const_cache_version++;
      +
      +  // Expose top level constants onto the Opal object
      +  if (cref === _Object) Opal[name] = value;
      +
      +  // Name new class directly onto current scope (Opal.Foo.Baz = klass)
      +  $prop(cref, name, value);
      +
      +  if (new_const && cref.$const_added && !cref.$const_added.$$pristine) {
      +    cref.$const_added(name);
      +  }
      +
      +  return value;
      +};
      +
      + +

      Opal.constants = function(cref, inherit)

      + +

      Get all the constants reachable from a given cref, by default will include +inherited constants.

      + +
      Opal.constants = function(cref, inherit) {
      +  if (inherit == null) inherit = true;
      +
      +  var module, modules = [cref], i, ii, constants = {}, constant;
      +
      +  if (inherit) modules = modules.concat($ancestors(cref));
      +  if (inherit && cref.$$is_module) modules = modules.concat([Opal.Object]).concat($ancestors(Opal.Object));
      +
      +  for (i = 0, ii = modules.length; i < ii; i++) {
      +    module = modules[i];
      +
      +    // Do not show Objects constants unless we're querying Object itself
      +    if (cref !== _Object && module == _Object) break;
      +
      +    for (constant in module.$$const) {
      +      constants[constant] = true;
      +    }
      +    if (module.$$autoload) {
      +      for (constant in module.$$autoload) {
      +        constants[constant] = true;
      +      }
      +    }
      +  }
      +
      +  return Object.keys(constants);
      +};
      +
      + +

      Opal.const_remove = function(cref, name)

      + +

      Remove a constant from a cref.

      + +
      Opal.const_remove = function(cref, name) {
      +  Opal.const_cache_version++;
      +
      +  if (cref.$$const[name] != null) {
      +    var old = cref.$$const[name];
      +    delete cref.$$const[name];
      +    return old;
      +  }
      +
      +  if (cref.$$autoload && cref.$$autoload[name]) {
      +    delete cref.$$autoload[name];
      +    return nil;
      +  }
      +
      +  $raise(Opal.NameError, "constant "+cref+"::"+cref.$name()+" not defined");
      +};
      +
      + +

      Opal.const_get_relative_factory = function(nesting)

      + +

      Generates a function that is a curried const_get_relative.

      + +
      Opal.const_get_relative_factory = function(nesting) {
      +  return function(name, skip_missing) {
      +    return Opal.$$(nesting, name, skip_missing);
      +  }
      +}
      +
      + +

      Opal.$$ = Opal.const_get_relative

      + +

      Setup some shortcuts to reduce compiled size

      + +
      Opal.$$ = Opal.const_get_relative;
      +
      + +

      ``

      + +

      Modules & Classes

      + +
      
      +
      + +

      function $allocate_class(name, superclass, singleton)

      + +

      A class Foo; end expression in ruby is compiled to call this runtime +method which either returns an existing class of the given name, or creates +a new class in the given base scope.

      + +

      If a constant with the given name exists, then we check to make sure that +it is a class and also that the superclasses match. If either of these +fail, then we raise a TypeError. Note, superclass may be null if one +was not specified in the ruby code.

      + +

      We pass a constructor to this method of the form function ClassName() {} +simply so that classes show up with nicely formatted names inside debuggers +in the web browser (or node/sprockets).

      + +

      The scope is the current self value where the class is being created +from. We use this to get the scope for where the class should be created. +If scope is an object (not a class/module), we simple get its class and +use that as the scope instead.

      + +

      @param scope [Object] where the class is being created +@param superclass [Class,null] superclass of the new class (may be null) +@param singleton [Boolean,null] a true value denotes we want to allocate + a singleton

      + +

      @return new [Class] or existing ruby class

      + +
      function $allocate_class(name, superclass, singleton) {
      +  var klass, bridged_descendant;
      +
      +  if (bridged_descendant = descends_from_bridged_class(superclass)) {
      +    // Inheritance from bridged classes requires
      +    // calling original JS constructors
      +    klass = function() {
      +      var self = new ($bind.apply(bridged_descendant.$$constructor, $prepend(null, arguments)))();
      +
      +      // and replacing a __proto__ manually
      +      $set_proto(self, klass.$$prototype);
      +      return self;
      +    }
      +  } else {
      +    klass = function(){};
      +  }
      +
      +  if (name && name !== nil) {
      +    $prop(klass, 'displayName', '::'+name);
      +  }
      +
      +  $prop(klass, '$$name', name);
      +  $prop(klass, '$$constructor', klass);
      +  $prop(klass, '$$prototype', klass.prototype);
      +  $prop(klass, '$$const', {});
      +  $prop(klass, '$$is_class', true);
      +  $prop(klass, '$$is_a_module', true);
      +  $prop(klass, '$$super', superclass);
      +  $prop(klass, '$$cvars', {});
      +  $prop(klass, '$$own_included_modules', []);
      +  $prop(klass, '$$own_prepended_modules', []);
      +  $prop(klass, '$$ancestors', []);
      +  $prop(klass, '$$ancestors_cache_version', null);
      +  $prop(klass, '$$subclasses', []);
      +  $prop(klass, '$$cloned_from', []);
      +
      +  $prop(klass.$$prototype, '$$class', klass);
      +
      +  // By default if there are no singleton class methods
      +  // __proto__ is Class.prototype
      +  // Later singleton methods generate a singleton_class
      +  // and inject it into ancestors chain
      +  if (Opal.Class) {
      +    $set_proto(klass, Opal.Class.prototype);
      +  }
      +
      +  if (superclass != null) {
      +    $set_proto(klass.$$prototype, superclass.$$prototype);
      +
      +    if (singleton !== true) {
      +      // Let's not forbid GC from cleaning up our
      +      // subclasses.
      +      if (typeof WeakRef !== 'undefined') {
      +        // First, let's clean up our array from empty objects.
      +        var i, subclass, rebuilt_subclasses = [];
      +        for (i = 0; i < superclass.$$subclasses.length; i++) {
      +          subclass = superclass.$$subclasses[i];
      +          if (subclass.deref() !== undefined) {
      +            rebuilt_subclasses.push(subclass);
      +          }
      +        }
      +        // Now, let's add our class.
      +        rebuilt_subclasses.push(new WeakRef(klass));
      +        superclass.$$subclasses = rebuilt_subclasses;
      +      }
      +      else {
      +        superclass.$$subclasses.push(klass);
      +      }
      +    }
      +
      +    if (superclass.$$meta) {
      +      // If superclass has metaclass then we have explicitely inherit it.
      +      Opal.build_class_singleton_class(klass);
      +    }
      +  }
      +
      +  return klass;
      +};
      +
      + +

      klass = const_get_name(scope, name)

      + +

      Try to find the class in the current scope

      + +
      var klass = const_get_name(scope, name);
      +
      + +

      if (klass)

      + +

      If the class exists in the scope, then we must use that

      + +
      if (klass) {
      +
      + +

      if (!klass.$$is_class)

      + +

      Make sure the existing constant is a class, or raise error

      + +
      if (!klass.$$is_class) {
      +
      + +

      scope = _Object

      + +

      Global scope

      + +
      scope = _Object;
      +
      + +

      scope = scope.$$class

      + +

      Scope is an object, use its class

      + +
      scope = scope.$$class;
      +
      + +

      if (

      + +

      If the superclass is not an Opal-generated class then we're bridging a native JS class

      + +
      if (
      +
      + +

      ensureSuperclassMatch(klass, superclass)

      + +

      Make sure existing class has same superclass

      + +
      ensureSuperclassMatch(klass, superclass);
      +
      + +

      ``

      + +

      Class doesn't exist, create a new one with given superclass...

      + +
      
      +
      + +

      if (superclass == null)

      + +

      Not specifying a superclass means we can assume it to be Object

      + +
      if (superclass == null) {
      +
      + +

      klass = $allocate_class(name, superclass)

      + +

      Create the class object (instance of Class)

      + +
      klass = $allocate_class(name, superclass);
      +
      + +

      if (superclass.$inherited)

      + +

      Call .inherited() hook with new class on the superclass

      + +
      if (superclass.$inherited) {
      +
      + +

      function $allocate_module(name)

      + +

      Define new module (or return existing module). The given scope is basically +the current self value the module statement was defined in. If this is +a ruby module or class, then it is used, otherwise if the scope is a ruby +object then that objects real ruby class is used (e.g. if the scope is the +main object, then the top level Object class is used as the scope).

      + +

      If a module of the given name is already defined in the scope, then that +instance is just returned.

      + +

      If there is a class of the given name in the scope, then an error is +generated instead (cannot have a class and module of same name in same scope).

      + +

      Otherwise, a new module is created in the scope with the given name, and that +new instance is returned back (to be referenced at runtime).

      + +

      @param scope [Module, Class] class or module this definition is inside +@param id [String] the name of the new (or existing) module

      + +

      @return [Module]

      + +
      function $allocate_module(name) {
      +  var constructor = function(){};
      +  var module = constructor;
      +
      +  if (name)
      +    $prop(constructor, 'displayName', name+'.constructor');
      +
      +  $prop(module, '$$name', name);
      +  $prop(module, '$$prototype', constructor.prototype);
      +  $prop(module, '$$const', {});
      +  $prop(module, '$$is_module', true);
      +  $prop(module, '$$is_a_module', true);
      +  $prop(module, '$$cvars', {});
      +  $prop(module, '$$iclasses', []);
      +  $prop(module, '$$own_included_modules', []);
      +  $prop(module, '$$own_prepended_modules', []);
      +  $prop(module, '$$ancestors', [module]);
      +  $prop(module, '$$ancestors_cache_version', null);
      +  $prop(module, '$$cloned_from', []);
      +
      +  $set_proto(module, Opal.Module.prototype);
      +
      +  return module;
      +};
      +
      + +

      scope = _Object

      + +

      Global scope

      + +
      scope = _Object;
      +
      + +

      scope = scope.$$class

      + +

      Scope is an object, use its class

      + +
      scope = scope.$$class;
      +
      + +

      module = $allocate_module(name)

      + +

      Module doesnt exist, create a new one...

      + +
      module = $allocate_module(name);
      +
      + +

      Opal.get_singleton_class = function(object)

      + +

      Return the singleton class for the passed object.

      + +

      If the given object alredy has a singleton class, then it will be stored on +the object as the $$meta property. If this exists, then it is simply +returned back.

      + +

      Otherwise, a new singleton object for the class or object is created, set on +the object at $$meta for future use, and then returned.

      + +

      @param object [Object] the ruby object +@return [Class] the singleton class for object

      + +
      Opal.get_singleton_class = function(object) {
      +  if (object.$$is_number) {
      +    $raise(Opal.TypeError, "can't define singleton");
      +  }
      +  if (object.$$meta) {
      +    return object.$$meta;
      +  }
      +
      +  if (object.hasOwnProperty('$$is_class')) {
      +    return Opal.build_class_singleton_class(object);
      +  } else if (object.hasOwnProperty('$$is_module')) {
      +    return Opal.build_module_singleton_class(object);
      +  } else {
      +    return Opal.build_object_singleton_class(object);
      +  }
      +};
      +
      + +

      function set_meta(obj, meta)

      + +

      helper to set $$meta on klass, module or instance

      + +
      function set_meta(obj, meta) {
      +  if (obj.hasOwnProperty('$$meta')) {
      +    obj.$$meta = meta;
      +  } else {
      +    $prop(obj, '$$meta', meta);
      +  }
      +  if (obj.$$frozen) {
      +    // If a object is frozen (sealed), freeze $$meta too.
      +    // No need to inject $$meta.$$prototype in the prototype chain,
      +    // as $$meta cannot be modified anyway.
      +    obj.$$meta.$freeze();
      +  } else {
      +    $set_proto(obj, meta.$$prototype);
      +  }
      +};
      +
      + +

      Opal.build_class_singleton_class = function(klass)

      + +

      Build the singleton class for an existing class. Class object are built +with their singleton class already in the prototype chain and inheriting +from their superclass object (up to Class itself).

      + +

      NOTE: Actually in MRI a class' singleton class inherits from its +superclass' singleton class which in turn inherits from Class.

      + +

      @param klass [Class] +@return [Class]

      + +
      Opal.build_class_singleton_class = function(klass) {
      +  if (klass.$$meta) {
      +    return klass.$$meta;
      +  }
      +
      +  // The singleton_class superclass is the singleton_class of its superclass;
      +  // but BasicObject has no superclass (its `$$super` is null), thus we
      +  // fallback on `Class`.
      +  var superclass = klass === BasicObject ? Class : Opal.get_singleton_class(klass.$$super);
      +
      +  var meta = $allocate_class(null, superclass, true);
      +
      +  $prop(meta, '$$is_singleton', true);
      +  $prop(meta, '$$singleton_of', klass);
      +  set_meta(klass, meta);
      +  // Restoring ClassName.class
      +  $prop(klass, '$$class', Opal.Class);
      +
      +  return meta;
      +};
      +
      + +

      $prop(mod, '$$class', Opal.Module)

      + +

      Restoring ModuleName.class

      + +
      $prop(mod, '$$class', Opal.Module);
      +
      + +

      Opal.build_object_singleton_class = function(object)

      + +

      Build the singleton class for a Ruby (non class) Object.

      + +

      @param object [Object] +@return [Class]

      + +
      Opal.build_object_singleton_class = function(object) {
      +  var superclass = object.$$class,
      +      klass = $allocate_class(nil, superclass, true);
      +
      +  $prop(klass, '$$is_singleton', true);
      +  $prop(klass, '$$singleton_of', object);
      +
      +  delete klass.$$prototype.$$class;
      +
      +  set_meta(object, klass);
      +
      +  return klass;
      +};
      +
      + +

      Opal.class_variables = function(module)

      + +

      Returns an object containing all pairs of names/values +for all class variables defined in provided +module+ +and its ancestors.

      + +

      @param module [Module] +@return [Object]

      + +
      Opal.class_variables = function(module) {
      +  var ancestors = $ancestors(module),
      +      i, length = ancestors.length,
      +      result = {};
      +
      +  for (i = length - 1; i >= 0; i--) {
      +    var ancestor = ancestors[i];
      +
      +    for (var cvar in ancestor.$$cvars) {
      +      result[cvar] = ancestor.$$cvars[cvar];
      +    }
      +  }
      +
      +  return result;
      +};
      +
      + +

      Opal.class_variable_set = function(module, name, value)

      + +

      Sets class variable with specified +name+ to +value+ +in provided +module+

      + +

      @param module [Module] +@param name [String] +@param value [Object]

      + +
      Opal.class_variable_set = function(module, name, value) {
      +  var ancestors = $ancestors(module),
      +      i, length = ancestors.length;
      +
      +  for (i = length - 2; i >= 0; i--) {
      +    var ancestor = ancestors[i];
      +
      +    if ($has_own(ancestor.$$cvars, name)) {
      +      ancestor.$$cvars[name] = value;
      +      return value;
      +    }
      +  }
      +
      +  module.$$cvars[name] = value;
      +
      +  return value;
      +};
      +
      + +

      Opal.class_variable_get = function(module, name, tolerant)

      + +

      Gets class variable with specified +name+ from provided +module+

      + +

      @param module [Module] +@param name [String]

      + +
      Opal.class_variable_get = function(module, name, tolerant) {
      +  if ($has_own(module.$$cvars, name))
      +    return module.$$cvars[name];
      +
      +  var ancestors = $ancestors(module),
      +    i, length = ancestors.length;
      +
      +  for (i = 0; i < length; i++) {
      +    var ancestor = ancestors[i];
      +
      +    if ($has_own(ancestor.$$cvars, name)) {
      +      return ancestor.$$cvars[name];
      +    }
      +  }
      +
      +  if (!tolerant)
      +    $raise(Opal.NameError, 'uninitialized class variable '+name+' in '+module.$name());
      +
      +  return nil;
      +}
      +
      + +

      break

      + +

      superclass

      + +
      break;
      +
      + +

      Opal.append_features = function(module, includer)

      + +

      The actual inclusion of a module into a class.

      + +

      Class $$parent and iclass

      + +

      To handle super calls, every class has a $$parent. This parent is +used to resolve the next class for a super call. A normal class would +have this point to its superclass. However, if a class includes a module +then this would need to take into account the module. The module would +also have to then point its $$parent to the actual superclass. We +cannot modify modules like this, because it might be included in more +then one class. To fix this, we actually insert an iclass as the class' +$$parent which can then point to the superclass. The iclass acts as +a proxy to the actual module, so the super chain can then search it for +the required method.

      + +

      @param module [Module] the module to include +@param includer [Module] the target class to include module into +@return [null]

      + +
      Opal.append_features = function(module, includer) {
      +  var module_ancestors = $ancestors(module);
      +  var iclasses = [];
      +
      +  if (module_ancestors.indexOf(includer) !== -1) {
      +    $raise(Opal.ArgumentError, 'cyclic include detected');
      +  }
      +
      +  for (var i = 0, length = module_ancestors.length; i < length; i++) {
      +    var ancestor = module_ancestors[i], iclass = create_iclass(ancestor);
      +    $prop(iclass, '$$included', true);
      +    iclasses.push(iclass);
      +  }
      +  var includer_ancestors = $ancestors(includer),
      +      chain = chain_iclasses(iclasses),
      +      start_chain_after,
      +      end_chain_on;
      +
      +  if (includer_ancestors.indexOf(module) === -1) {
      +    // first time include
      +
      +    // includer -> chain.first -> ...chain... -> chain.last -> includer.parent
      +    start_chain_after = includer.$$prototype;
      +    end_chain_on = Object.getPrototypeOf(includer.$$prototype);
      +  } else {
      +    // The module has been already included,
      +    // we don't need to put it into the ancestors chain again,
      +    // but this module may have new included modules.
      +    // If it's true we need to copy them.
      +    //
      +    // The simplest way is to replace ancestors chain from
      +    //          parent
      +    //            |
      +    //   `module` iclass (has a $$root flag)
      +    //            |
      +    //   ...previos chain of module.included_modules ...
      +    //            |
      +    //  "next ancestor" (has a $$root flag or is a real class)
      +    //
      +    // to
      +    //          parent
      +    //            |
      +    //    `module` iclass (has a $$root flag)
      +    //            |
      +    //   ...regenerated chain of module.included_modules
      +    //            |
      +    //   "next ancestor" (has a $$root flag or is a real class)
      +    //
      +    // because there are no intermediate classes between `parent` and `next ancestor`.
      +    // It doesn't break any prototypes of other objects as we don't change class references.
      +
      +    var parent = includer.$$prototype, module_iclass = Object.getPrototypeOf(parent);
      +
      +    while (module_iclass != null) {
      +      if (module_iclass.$$module === module && isRoot(module_iclass)) {
      +        break;
      +      }
      +
      +      parent = module_iclass;
      +      module_iclass = Object.getPrototypeOf(module_iclass);
      +    }
      +
      +    if (module_iclass) {
      +      // module has been directly included
      +      var next_ancestor = Object.getPrototypeOf(module_iclass);
      +
      +      // skip non-root iclasses (that were recursively included)
      +      while (next_ancestor.hasOwnProperty('$$iclass') && !isRoot(next_ancestor)) {
      +        next_ancestor = Object.getPrototypeOf(next_ancestor);
      +      }
      +
      +      start_chain_after = parent;
      +      end_chain_on = next_ancestor;
      +    } else {
      +      // module has not been directly included but was in ancestor chain because it was included by another module
      +      // include it directly
      +      start_chain_after = includer.$$prototype;
      +      end_chain_on = Object.getPrototypeOf(includer.$$prototype);
      +    }
      +  }
      +
      +  $set_proto(start_chain_after, chain.first);
      +  $set_proto(chain.last, end_chain_on);
      +
      +  // recalculate own_included_modules cache
      +  includer.$$own_included_modules = own_included_modules(includer);
      +
      +  Opal.const_cache_version++;
      +};
      +
      + +

      module_ancestors = $ancestors(module)

      + +

      Here we change the ancestors chain from

      + +

      prepender + | + parent

      + +

      to:

      + +

      dummy(prepender) + | + iclass(module) + | +iclass(prepender) + | + parent

      + +
      var module_ancestors = $ancestors(module);
      +
      + +

      prepender_iclass = dummy_prepender.$$define_methods_on

      + +

      The module already has some prepended modules +which means that we don't need to make it "dummy"

      + +
      prepender_iclass = dummy_prepender.$$define_methods_on;
      +
      + +

      prepender_iclass = create_dummy_iclass(prepender)

      + +

      Making the module "dummy"

      + +
      prepender_iclass = create_dummy_iclass(prepender);
      +
      + +

      $set_proto(dummy_prepender, prepender_iclass)

      + +

      Converting + dummy(prepender) -> previous_parent +to + dummy(prepender) -> iclass(prepender) -> previous_parent

      + +
      $set_proto(dummy_prepender, prepender_iclass);
      +
      + +

      ``

      + +

      first time prepend

      + +
      
      +
      + +

      end_chain_on = Object.getPrototypeOf(dummy_prepender)

      + +

      next $$root or prepender_iclass or non-$$iclass

      + +
      end_chain_on = Object.getPrototypeOf(dummy_prepender);
      +
      + +

      prepender.$$own_prepended_modules = own_prepended_modules(prepender)

      + +

      recalculate own_prepended_modules cache

      + +
      prepender.$$own_prepended_modules = own_prepended_modules(prepender);
      +
      + +

      function create_dummy_iclass(module)

      + +

      Dummy iclass doesn't receive updates when the module gets a new method.

      + +
      function create_dummy_iclass(module) {
      +  var iclass = {},
      +      proto = module.$$prototype;
      +
      +  if (proto.hasOwnProperty('$$dummy')) {
      +    proto = proto.$$define_methods_on;
      +  }
      +
      +  var props = Object.getOwnPropertyNames(proto),
      +      length = props.length, i;
      +
      +  for (i = 0; i < length; i++) {
      +    var prop = props[i];
      +    $prop(iclass, prop, proto[prop]);
      +  }
      +
      +  $prop(iclass, '$$iclass', true);
      +  $prop(iclass, '$$module', module);
      +
      +  return iclass;
      +}
      +
      + +

      Opal.bridge = function(native_klass, klass)

      + +

      For performance, some core Ruby classes are toll-free bridged to their +native JavaScript counterparts (e.g. a Ruby Array is a JavaScript Array).

      + +

      This method is used to setup a native constructor (e.g. Array), to have +its prototype act like a normal Ruby class. Firstly, a new Ruby class is +created using the native constructor so that its prototype is set as the +target for the new class. Note: all bridged classes are set to inherit +from Object.

      + +

      Example:

      + +

      Opal.bridge(self, Function);

      + +

      @param klass [Class] the Ruby class to bridge +@param constructor [JS.Function] native JavaScript constructor to use +@return [Class] returns the passed Ruby class

      + +
      Opal.bridge = function(native_klass, klass) {
      +  if (native_klass.hasOwnProperty('$$bridge')) {
      +    $raise(Opal.ArgumentError, "already bridged");
      +  }
      +
      +  // constructor is a JS function with a prototype chain like:
      +  // - constructor
      +  //   - super
      +  //
      +  // What we need to do is to inject our class (with its prototype chain)
      +  // between constructor and super. For example, after injecting ::Object
      +  // into JS String we get:
      +  //
      +  // - constructor (window.String)
      +  //   - Opal.Object
      +  //     - Opal.Kernel
      +  //       - Opal.BasicObject
      +  //         - super (window.Object)
      +  //           - null
      +  //
      +  $prop(native_klass, '$$bridge', klass);
      +  $set_proto(native_klass.prototype, (klass.$$super || Opal.Object).$$prototype);
      +  $prop(klass, '$$prototype', native_klass.prototype);
      +
      +  $prop(klass.$$prototype, '$$class', klass);
      +  $prop(klass, '$$constructor', native_klass);
      +  $prop(klass, '$$bridge', true);
      +};
      +
      + +

      function $ancestors(module)

      + +

      The Array of ancestors for a given module/class

      + +
      function $ancestors(module) {
      +  if (!module) { return []; }
      +
      +  if (module.$$ancestors_cache_version === Opal.const_cache_version) {
      +    return module.$$ancestors;
      +  }
      +
      +  var result = [], i, mods, length;
      +
      +  for (i = 0, mods = own_ancestors(module), length = mods.length; i < length; i++) {
      +    result.push(mods[i]);
      +  }
      +
      +  if (module.$$super) {
      +    for (i = 0, mods = $ancestors(module.$$super), length = mods.length; i < length; i++) {
      +      result.push(mods[i]);
      +    }
      +  }
      +
      +  module.$$ancestors_cache_version = Opal.const_cache_version;
      +  module.$$ancestors = result;
      +
      +  return result;
      +};
      +
      + +

      ``

      + +

      Method Missing

      + +
      
      +
      + +

      Opal.add_stubs = function(stubs)

      + +

      Methods stubs are used to facilitate method_missing in opal. A stub is a +placeholder function which just calls method_missing on the receiver. +If no method with the given name is actually defined on an object, then it +is obvious to say that the stub will be called instead, and then in turn +method_missing will be called.

      + +

      When a file in ruby gets compiled to javascript, it includes a call to +this function which adds stubs for every method name in the compiled file. +It should then be safe to assume that method_missing will work for any +method call detected.

      + +

      Method stubs are added to the BasicObject prototype, which every other +ruby object inherits, so all objects should handle method missing. A stub +is only added if the given property name (method name) is not already +defined.

      + +

      Note: all ruby methods have a $ prefix in javascript, so all stubs will +have this prefix as well (to make this method more performant).

      + +

      Opal.add_stubs("foo,bar,baz=");

      + +

      All stub functions will have a private $$stub property set to true so +that other internal methods can detect if a method is just a stub or not. +Kernel#respond_to? uses this property to detect a methods presence.

      + +

      @param stubs [Array] an array of method stubs to add +@return [undefined]

      + +
      Opal.add_stubs = function(stubs) {
      +  var proto = Opal.BasicObject.$$prototype;
      +  var stub, existing_method;
      +  stubs = stubs.split(',');
      +
      +  for (var i = 0, length = stubs.length; i < length; i++) {
      +    stub = $jsid(stubs[i]), existing_method = proto[stub];
      +
      +    if (existing_method == null || existing_method.$$stub) {
      +      Opal.add_stub_for(proto, stub);
      +    }
      +  }
      +};
      +
      + +

      Opal.add_stub_for = function(prototype, stub)

      + +

      Add a method_missing stub function to the given prototype for the +given name.

      + +

      @param prototype [Prototype] the target prototype +@param stub [String] stub name to add (e.g. "$foo") +@return [undefined]

      + +
      Opal.add_stub_for = function(prototype, stub) {
      +  // Opal.stub_for(stub) is the method_missing_stub
      +  $prop(prototype, stub, Opal.stub_for(stub));
      +};
      +
      + +

      Opal.stub_for = function(method_name)

      + +

      Generate the method_missing stub for a given method name.

      + +

      @param method_name [String] The js-name of the method to stub (e.g. "$foo") +@return [undefined]

      + +
      Opal.stub_for = function(method_name) {
      +  function method_missing_stub() {
      +    // Copy any given block onto the method_missing dispatcher
      +    this.$method_missing.$$p = method_missing_stub.$$p;
      +
      +    // Set block property to null ready for the next call (stop false-positives)
      +    method_missing_stub.$$p = null;
      +
      +    // call method missing with correct args (remove '$' prefix on method name)
      +    return this.$method_missing.apply(this, $prepend(method_name.slice(1), arguments));
      +  };
      +
      +  method_missing_stub.$$stub = true;
      +
      +  return method_missing_stub;
      +};
      +
      + +

      ``

      + +

      Methods

      + +
      
      +
      + +

      Opal.ac = function(actual, expected, object, meth)

      + +

      Arity count error dispatcher for methods

      + +

      @param actual [Fixnum] number of arguments given to method +@param expected [Fixnum] expected number of arguments +@param object [Object] owner of the method +meth+ +@param meth [String] method name that got wrong number of arguments +@raise [ArgumentError]

      + +
      Opal.ac = function(actual, expected, object, meth) {
      +  var inspect = '';
      +  if (object.$$is_a_module) {
      +    inspect += object.$$name + '.';
      +  }
      +  else {
      +    inspect += object.$$class.$$name + '#';
      +  }
      +  inspect += meth;
      +
      +  $raise(Opal.ArgumentError, '[' + inspect + '] wrong number of arguments (given ' + actual + ', expected ' + expected + ')');
      +};
      +
      + +

      Opal.block_ac = function(actual, expected, context)

      + +

      Arity count error dispatcher for blocks

      + +

      @param actual [Fixnum] number of arguments given to block +@param expected [Fixnum] expected number of arguments +@param context [Object] context of the block definition +@raise [ArgumentError]

      + +
      Opal.block_ac = function(actual, expected, context) {
      +  var inspect = "`block in " + context + "'";
      +
      +  $raise(Opal.ArgumentError, inspect + ': wrong number of arguments (given ' + actual + ', expected ' + expected + ')');
      +};
      +
      + +

      Opal.find_super = function(obj, mid, current_func, defcheck, allow_stubs)

      + +

      Super dispatcher

      + +
      Opal.find_super = function(obj, mid, current_func, defcheck, allow_stubs) {
      +  var jsid = $jsid(mid), ancestors, ancestor, super_method, method_owner, current_index = -1, i;
      +
      +  ancestors = get_ancestors(obj);
      +  method_owner = current_func.$$owner;
      +
      +  for (i = 0; i < ancestors.length; i++) {
      +    ancestor = ancestors[i];
      +    if (ancestor === method_owner || ancestor.$$cloned_from.indexOf(method_owner) !== -1) {
      +      current_index = i;
      +      break;
      +    }
      +  }
      +
      +  for (i = current_index + 1; i < ancestors.length; i++) {
      +    ancestor = ancestors[i];
      +    var proto = ancestor.$$prototype;
      +
      +    if (proto.hasOwnProperty('$$dummy')) {
      +      proto = proto.$$define_methods_on;
      +    }
      +
      +    if (proto.hasOwnProperty(jsid)) {
      +      super_method = proto[jsid];
      +      break;
      +    }
      +  }
      +
      +  if (!defcheck && super_method && super_method.$$stub && obj.$method_missing.$$pristine) {
      +    // method_missing hasn't been explicitly defined
      +    $raise(Opal.NoMethodError, 'super: no superclass method `'+mid+"' for "+obj, mid);
      +  }
      +
      +  return (super_method.$$stub && !allow_stubs) ? null : super_method;
      +};
      +
      + +

      Opal.find_block_super = function(obj, jsid, current_func, defcheck, implicit)

      + +

      Iter dispatcher for super in a block

      + +
      Opal.find_block_super = function(obj, jsid, current_func, defcheck, implicit) {
      +  var call_jsid = jsid;
      +
      +  if (!current_func) {
      +    $raise(Opal.RuntimeError, "super called outside of method");
      +  }
      +
      +  if (implicit && current_func.$$define_meth) {
      +    $raise(Opal.RuntimeError,
      +      "implicit argument passing of super from method defined by define_method() is not supported. " +
      +      "Specify all arguments explicitly"
      +    );
      +  }
      +
      +  if (current_func.$$def) {
      +    call_jsid = current_func.$$jsid;
      +  }
      +
      +  return Opal.find_super(obj, call_jsid, current_func, defcheck);
      +};
      +
      + +

      Opal.find_super_dispatcher = Opal.find_super

      + +

      @deprecated

      + +
      Opal.find_super_dispatcher = Opal.find_super;
      +
      + +

      Opal.find_iter_super_dispatcher = Opal.find_block_super

      + +

      @deprecated

      + +
      Opal.find_iter_super_dispatcher = Opal.find_block_super;
      +
      + +

      Opal.yield1 = function(block, arg)

      + +

      handles yield calls for 1 yielded arg

      + +
      Opal.yield1 = function(block, arg) {
      +  if (typeof(block) !== "function") {
      +    $raise(Opal.LocalJumpError, "no block given");
      +  }
      +
      +  var has_mlhs = block.$$has_top_level_mlhs_arg,
      +      has_trailing_comma = block.$$has_trailing_comma_in_args,
      +      is_returning_lambda = block.$$is_lambda && block.$$ret;
      +
      +  if (block.length > 1 || ((has_mlhs || has_trailing_comma) && block.length === 1)) {
      +    arg = Opal.to_ary(arg);
      +  }
      +
      +  if ((block.length > 1 || (has_trailing_comma && block.length === 1)) && arg.$$is_array) {
      +    if (is_returning_lambda) {
      +      return call_lambda(block.apply.bind(block, null), arg, block.$$ret);
      +    }
      +    return block.apply(null, arg);
      +  }
      +  else {
      +    if (is_returning_lambda) {
      +      return call_lambda(block, arg, block.$$ret);
      +    }
      +    return block(arg);
      +  }
      +};
      +
      + +

      Opal.yieldX = function(block, args)

      + +

      handles yield for > 1 yielded arg

      + +
      Opal.yieldX = function(block, args) {
      +  if (typeof(block) !== "function") {
      +    $raise(Opal.LocalJumpError, "no block given");
      +  }
      +
      +  if (block.length > 1 && args.length === 1) {
      +    if (args[0].$$is_array) {
      +      args = args[0];
      +    }
      +  }
      +
      +  if (block.$$is_lambda && block.$$ret) {
      +    return call_lambda(block.apply.bind(block, null), args, block.$$ret);
      +  }
      +  return block.apply(null, args);
      +};
      +
      + +

      Opal.rescue = function(exception, candidates)

      + +

      Finds the corresponding exception match in candidates. Each candidate can +be a value, or an array of values. Returns null if not found.

      + +
      Opal.rescue = function(exception, candidates) {
      +  for (var i = 0; i < candidates.length; i++) {
      +    var candidate = candidates[i];
      +
      +    if (candidate.$$is_array) {
      +      var result = Opal.rescue(exception, candidate);
      +
      +      if (result) {
      +        return result;
      +      }
      +    }
      +    else if (candidate === Opal.JS.Error || candidate['$==='](exception)) {
      +      return candidate;
      +    }
      +  }
      +
      +  return null;
      +};
      +
      + +

      Opal.to_hash = function(value)

      + +

      Helpers for extracting kwsplats +Used for: { **h }

      + +
      Opal.to_hash = function(value) {
      +  if (value.$$is_hash) {
      +    return value;
      +  }
      +  else if (value['$respond_to?']('to_hash', true)) {
      +    var hash = value.$to_hash();
      +    if (hash.$$is_hash) {
      +      return hash;
      +    }
      +    else {
      +      $raise(Opal.TypeError, "Can't convert " + value.$$class +
      +        " to Hash (" + value.$$class + "#to_hash gives " + hash.$$class + ")");
      +    }
      +  }
      +  else {
      +    $raise(Opal.TypeError, "no implicit conversion of " + value.$$class + " into Hash");
      +  }
      +};
      +
      + +

      ``

      + +

      Helpers for implementing multiple assignment +Our code for extracting the values and assigning them only works if the +return value is a JS array. +So if we get an Array subclass, extract the wrapped JS array from it

      + +
      
      +
      + +

      Opal.to_ary = function(value)

      + +

      Used for: a, b = something (no splat)

      + +
      Opal.to_ary = function(value) {
      +  if (value.$$is_array) {
      +    return value;
      +  }
      +  else if (value['$respond_to?']('to_ary', true)) {
      +    var ary = value.$to_ary();
      +    if (ary === nil) {
      +      return [value];
      +    }
      +    else if (ary.$$is_array) {
      +      return ary;
      +    }
      +    else {
      +      $raise(Opal.TypeError, "Can't convert " + value.$$class +
      +        " to Array (" + value.$$class + "#to_ary gives " + ary.$$class + ")");
      +    }
      +  }
      +  else {
      +    return [value];
      +  }
      +};
      +
      + +

      Opal.to_a = function(value)

      + +

      Used for: a, b = *something (with splat)

      + +
      Opal.to_a = function(value) {
      +  if (value.$$is_array) {
      +    // A splatted array must be copied
      +    return value.slice();
      +  }
      +  else if (value['$respond_to?']('to_a', true)) {
      +    var ary = value.$to_a();
      +    if (ary === nil) {
      +      return [value];
      +    }
      +    else if (ary.$$is_array) {
      +      return ary;
      +    }
      +    else {
      +      $raise(Opal.TypeError, "Can't convert " + value.$$class +
      +        " to Array (" + value.$$class + "#to_a gives " + ary.$$class + ")");
      +    }
      +  }
      +  else {
      +    return [value];
      +  }
      +};
      +
      + +

      Opal.extract_kwargs = function(parameters)

      + +

      Used for extracting keyword arguments from arguments passed to +JS function.

      + +

      @param parameters [Array] +@return [Hash] or undefined

      + +
      Opal.extract_kwargs = function(parameters) {
      +  var kwargs = parameters[parameters.length - 1];
      +  if (kwargs != null && Opal.respond_to(kwargs, '$to_hash', true)) {
      +    $splice(parameters, parameters.length - 1);
      +    return kwargs;
      +  }
      +};
      +
      + +

      Opal.kwrestargs = function(given_args, used_args)

      + +

      Used to get a list of rest keyword arguments. Method takes the given +keyword args, i.e. the hash literal passed to the method containing all +keyword arguments passed to method, as well as the used args which are +the names of required and optional arguments defined. This method then +just returns all key/value pairs which have not been used, in a new +hash literal.

      + +

      @param given_args [Hash] all kwargs given to method +@param used_args [Object] all keys used as named kwargs +@return [Hash]

      + +
      Opal.kwrestargs = function(given_args, used_args) {
      +  var map = new Map();
      +
      +  Opal.hash_each(given_args, false, function(key, value) {
      +    if (!used_args[key]) {
      +      Opal.hash_put(map, key, value);
      +    }
      +    return [false, false];
      +  });
      +
      +  return map;
      +};
      +
      + +

      jsid_cache = new Map()

      + +

      Optimization for a costly operation of prepending '$' to method names

      + +
      var jsid_cache = new Map();
      +
      + +

      Opal.send = function(recv, method, args, block, blockopts)

      + +

      Calls passed method on a ruby object with arguments and block:

      + +

      Can take a method or a method name.

      + +
        +
      1. When method name gets passed it invokes it by its name +and calls 'method_missing' when object doesn't have this method. +Used internally by Opal to invoke method that takes a block or a splat.
      2. +
      3. When method (i.e. method body) gets passed, it doesn't trigger 'method_missing' +because it doesn't know the name of the actual method. +Used internally by Opal to invoke 'super'.
      4. +
      + +

      @example + var my_array = [1, 2, 3, 4] + Opal.send(my_array, 'length') # => 4 + Opal.send(my_array, my_array.$length) # => 4

      + +

      Opal.send(my_array, 'reverse!') # => [4, 3, 2, 1] + Opal.send(my_array, my_array['$reverse!']') # => [4, 3, 2, 1]

      + +

      @param recv [Object] ruby object +@param method [Function, String] method body or name of the method +@param args [Array] arguments that will be passed to the method call +@param block [Function] ruby block +@param blockopts [Object, Number] optional properties to set on the block +@return [Object] returning value of the method call

      + +
      Opal.send = function(recv, method, args, block, blockopts) {
      +  var body;
      +
      +  if (typeof(method) === 'function') {
      +    body = method;
      +    method = null;
      +  } else if (typeof(method) === 'string') {
      +    body = recv[$jsid(method)];
      +  } else {
      +    $raise(Opal.NameError, "Passed method should be a string or a function");
      +  }
      +
      +  return Opal.send2(recv, body, method, args, block, blockopts);
      +};
      +
      + +

      for (i = 0; i < ancestors.length; i++)

      + +

      For all ancestors that there are, starting from the closest to the furthest...

      + +
      for (i = 0; i < ancestors.length; i++) {
      +
      + +

      for (j = 0; j < refinement_groups.length; j++)

      + +

      For all refinement groups there are, starting from the closest scope to the furthest...

      + +
      for (j = 0; j < refinement_groups.length; j++) {
      +
      + +

      for (k = refinements.length - 1; k >= 0; k--)

      + +

      For all refinements there are, starting from the last using call to the furthest...

      + +
      for (k = refinements.length - 1; k >= 0; k--) {
      +
      + +

      refine_modules = refinement.$$refine_modules

      + +

      A single module being given as an argument of the using call contains multiple +refinement modules

      + +
      refine_modules = refinement.$$refine_modules;
      +
      + +

      if (typeof refine_modules[ancestor] === 'undefined') continue

      + +

      Does this module refine a given call for a given ancestor module?

      + +
      if (typeof refine_modules[ancestor] === 'undefined') continue;
      +
      + +

      if (typeof refine_module.$$prototype[$jsid(method)] !== 'undefined')

      + +

      Does this module define a method we want to call?

      + +
      if (typeof refine_module.$$prototype[$jsid(method)] !== 'undefined') {
      +
      + +

      Opal.def = function(obj, jsid, body, blockopts)

      + +

      Used to define methods on an object. This is a helper method, used by the +compiled source to define methods on special case objects when the compiler +can not determine the destination object, or the object is a Module +instance. This can get called by Module#define_method as well.

      + +

      Modules

      + +

      Any method defined on a module will come through this runtime helper. +The method is added to the module body, and the owner of the method is +set to be the module itself. This is used later when choosing which +method should show on a class if more than 1 included modules define +the same method. Finally, if the module is in module_function mode, +then the method is also defined onto the module itself.

      + +

      Classes

      + +

      This helper will only be called for classes when a method is being +defined indirectly; either through Module#define_method, or by a +literal def method inside an instance_eval or class_eval body. In +either case, the method is simply added to the class' prototype. A special +exception exists for BasicObject and Object. These two classes are +special because they are used in toll-free bridged classes. In each of +these two cases, extra work is required to define the methods on toll-free +bridged class' prototypes as well.

      + +

      Objects

      + +

      If a simple ruby object is the object, then the method is simply just +defined on the object as a singleton method. This would be the case when +a method is defined inside an instance_eval block.

      + +

      @param obj [Object, Class] the actual obj to define method for +@param jsid [String] the JavaScript friendly method name (e.g. '$foo') +@param body [JS.Function] the literal JavaScript function used as method +@param blockopts [Object, Number] optional properties to set on the body +@return [null]

      + +
      Opal.def = function(obj, jsid, body, blockopts) {
      +  apply_blockopts(body, blockopts);
      +
      +  // Special case for a method definition in the
      +  // top-level namespace
      +  if (obj === Opal.top) {
      +    return Opal.defn(Opal.Object, jsid, body);
      +  }
      +  // if instance_eval is invoked on a module/class, it sets inst_eval_mod
      +  else if (!obj.$$eval && obj.$$is_a_module) {
      +    return Opal.defn(obj, jsid, body);
      +  }
      +  else {
      +    return Opal.defs(obj, jsid, body);
      +  }
      +};
      +
      + +

      Opal.defn = function(module, jsid, body)

      + +

      Define method on a module or class (see Opal.def).

      + +
      Opal.defn = function(module, jsid, body) {
      +  $deny_frozen_access(module);
      +
      +  body.displayName = jsid;
      +  body.$$owner = module;
      +
      +  var name = jsid.substr(1);
      +
      +  var proto = module.$$prototype;
      +  if (proto.hasOwnProperty('$$dummy')) {
      +    proto = proto.$$define_methods_on;
      +  }
      +  $prop(proto, jsid, body);
      +
      +  if (module.$$is_module) {
      +    if (module.$$module_function) {
      +      Opal.defs(module, jsid, body)
      +    }
      +
      +    for (var i = 0, iclasses = module.$$iclasses, length = iclasses.length; i < length; i++) {
      +      var iclass = iclasses[i];
      +      $prop(iclass, jsid, body);
      +    }
      +  }
      +
      +  var singleton_of = module.$$singleton_of;
      +  if (module.$method_added && !module.$method_added.$$stub && !singleton_of) {
      +    module.$method_added(name);
      +  }
      +  else if (singleton_of && singleton_of.$singleton_method_added && !singleton_of.$singleton_method_added.$$stub) {
      +    singleton_of.$singleton_method_added(name);
      +  }
      +
      +  return name;
      +};
      +
      + +

      Opal.defs = function(obj, jsid, body, blockopts)

      + +

      Define a singleton method on the given object (see Opal.def).

      + +
      Opal.defs = function(obj, jsid, body, blockopts) {
      +  apply_blockopts(body, blockopts);
      +
      +  if (obj.$$is_string || obj.$$is_number) {
      +    $raise(Opal.TypeError, "can't define singleton");
      +  }
      +  return Opal.defn(Opal.get_singleton_class(obj), jsid, body);
      +};
      +
      + +

      function remove_method_from_iclasses(obj, jsid)

      + +

      Since JavaScript has no concept of modules, we create proxy classes +called iclasses that store copies of methods loaded. We need to +update them if we remove a method.

      + +
      function remove_method_from_iclasses(obj, jsid) {
      +  if (obj.$$is_module) {
      +    for (var i = 0, iclasses = obj.$$iclasses, length = iclasses.length; i < length; i++) {
      +      var iclass = iclasses[i];
      +      delete iclass[jsid];
      +    }
      +  }
      +}
      +
      + +

      Opal.rdef = function(obj, jsid)

      + +

      Called from #remove_method.

      + +
      Opal.rdef = function(obj, jsid) {
      +  if (!$has_own(obj.$$prototype, jsid)) {
      +    $raise(Opal.NameError, "method '" + jsid.substr(1) + "' not defined in " + obj.$name());
      +  }
      +
      +  delete obj.$$prototype[jsid];
      +
      +  remove_method_from_iclasses(obj, jsid);
      +
      +  if (obj.$$is_singleton) {
      +    if (obj.$$prototype.$singleton_method_removed && !obj.$$prototype.$singleton_method_removed.$$stub) {
      +      obj.$$prototype.$singleton_method_removed(jsid.substr(1));
      +    }
      +  }
      +  else {
      +    if (obj.$method_removed && !obj.$method_removed.$$stub) {
      +      obj.$method_removed(jsid.substr(1));
      +    }
      +  }
      +};
      +
      + +

      Opal.udef = function(obj, jsid)

      + +

      Called from #undef_method.

      + +
      Opal.udef = function(obj, jsid) {
      +  if (!obj.$$prototype[jsid] || obj.$$prototype[jsid].$$stub) {
      +    $raise(Opal.NameError, "method '" + jsid.substr(1) + "' not defined in " + obj.$name());
      +  }
      +
      +  Opal.add_stub_for(obj.$$prototype, jsid);
      +
      +  remove_method_from_iclasses(obj, jsid);
      +
      +  if (obj.$$is_singleton) {
      +    if (obj.$$prototype.$singleton_method_undefined && !obj.$$prototype.$singleton_method_undefined.$$stub) {
      +      obj.$$prototype.$singleton_method_undefined(jsid.substr(1));
      +    }
      +  }
      +  else {
      +    if (obj.$method_undefined && !obj.$method_undefined.$$stub) {
      +      obj.$method_undefined(jsid.substr(1));
      +    }
      +  }
      +};
      +
      + +

      if (typeof obj.$$prototype === 'undefined')

      + +

      Aliasing on main means aliasing on Object...

      + +
      if (typeof obj.$$prototype === 'undefined') {
      +
      + +

      if (obj.$$eval)

      + +

      When running inside #instance_eval the alias refers to class methods.

      + +
      if (obj.$$eval) {
      +
      + +

      body = Opal.Object.$$prototype[old_id]

      + +

      try to look into Object

      + +
      body = Opal.Object.$$prototype[old_id]
      +
      + +

      if (body.$$alias_of) body = body.$$alias_of

      + +

      If the body is itself an alias use the original body +to keep the max depth at 1.

      + +
      if (body.$$alias_of) body = body.$$alias_of;
      +
      + +

      alias = Opal.wrap_method_body(body)

      + +

      We need a wrapper because otherwise properties +would be overwritten on the original body.

      + +
      alias = Opal.wrap_method_body(body);
      +
      + +

      alias.displayName = name

      + +

      Try to make the browser pick the right name

      + +
      alias.displayName  = name;
      +
      + +

      try

      + +

      Assign the 'length' value with defineProperty because +in strict mode the property is not writable. +It doesn't work in older browsers (like Chrome 38), where +an exception is thrown breaking Opal altogether.

      + +
      try {
      +
      + +

      ``

      + +

      Hashes

      + +
      
      +
      + +

      objects.splice(objects.indexOf(object), 1)

      + +

      got a duplicate, remove it

      + +
      objects.splice(objects.indexOf(object), 1);
      +
      + +

      Opal.hash2 = function(keys, smap)

      + +

      A faster Hash creator for hashes that just use symbols and +strings as keys. The map and keys array can be constructed at +compile time, so they are just added here by the constructor +function.

      + +
      Opal.hash2 = function(keys, smap) {
      +  console.warn("DEPRECATION: `Opal.hash2` is deprecated and will be removed in Opal 2.0. Use `new Map()` with an array of key/value pairs instead.");
      +
      +  var hash = new Map();
      +  for (var i = 0, max = keys.length; i < max; i++) {
      +    hash.set(keys[i], smap[keys[i]]);
      +  }
      +  return hash;
      +};
      +
      + +

      res

      + +

      dres = default result, returned if hash is empty +fun is called as fun(key, value) and must return a array with [break, result] +if break is true, iteration stops and result is returned +if break is false, iteration continues and eventually the last result is returned

      + +
      var res;
      +
      + +

      Opal.range = function(first, last, exc)

      + +

      Create a new range instance with first and last values, and whether the +range excludes the last value.

      + +
      Opal.range = function(first, last, exc) {
      +  var range         = new Opal.Range();
      +      range.begin   = first;
      +      range.end     = last;
      +      range.excl    = exc;
      +
      +  return range;
      +};
      +
      + +

      "constructor", "displayName", "__count__", "__noSuchMethod__",

      + +

      properties

      + +
      "constructor", "displayName", "__count__", "__noSuchMethod__",
      +
      + +

      "hasOwnProperty", "valueOf"

      + +

      methods

      + +
      "hasOwnProperty", "valueOf"
      +
      + +

      Opal.ivar = function(name)

      + +

      Get the ivar name for a given name. +Mostly adds a trailing $ to reserved names.

      + +
      Opal.ivar = function(name) {
      +  if (reserved_ivar_names.indexOf(name) !== -1) {
      +    name += "$";
      +  }
      +
      +  return name;
      +};
      +
      + +

      ``

      + +

      Support for #freeze

      + +
      
      +
      + +

      function $deny_frozen_access(obj)

      + +

      helper that can be used from methods

      + +
      function $deny_frozen_access(obj) {
      +  if (obj.$$frozen) {
      +    $raise(Opal.FrozenError, "can't modify frozen " + (obj.$class()) + ": " + (obj), new Map([["receiver", obj]]));
      +  }
      +};
      +
      + +

      Opal.freeze = function(obj)

      + +

      common #freeze runtime support

      + +
      Opal.freeze = function(obj) {
      +  $prop(obj, "$$frozen", true);
      +
      +  // set $$id
      +  if (!obj.hasOwnProperty('$$id')) { $prop(obj, '$$id', $uid()); }
      +
      +  if (obj.hasOwnProperty('$$meta')) {
      +    // freeze $$meta if it has already been set
      +    obj.$$meta.$freeze();
      +  } else {
      +    // ensure $$meta can be set lazily, $$meta is frozen when set in runtime.js
      +    $prop(obj, '$$meta', null);
      +  }
      +
      +  // $$comparable is used internally and set multiple times
      +  // defining it before sealing ensures it can be modified later on
      +  if (!obj.hasOwnProperty('$$comparable')) { $prop(obj, '$$comparable', null); }
      +
      +  // seal the Object
      +  Object.seal(obj);
      +
      +  return obj;
      +};
      +
      + +

      function $each_ivar(obj, func)

      + +

      Iterate over every instance variable and call func for each one +giving name of the ivar and optionally the property descriptor.

      + +
      function $each_ivar(obj, func) {
      +  var own_props = Object.getOwnPropertyNames(obj), own_props_length = own_props.length, i, prop, desc;
      +
      +  for(i = 0; i < own_props_length; i++) {
      +    prop = own_props[i];
      +
      +    if (prop[0] === '$') continue;
      +
      +    desc = Object.getOwnPropertyDescriptor(obj, prop);
      +
      +    if (desc && desc.enumerable) {
      +      func(prop, desc);
      +    }
      +  }
      +}
      +
      + +

      Opal.freeze_props = function(obj)

      + +

      freze props, make setters of instance variables throw FrozenError

      + +
      Opal.freeze_props = function(obj) {
      +  var dp_template = {
      +    get: null,
      +    set: function(_val) { $deny_frozen_access(obj); },
      +    enumerable: true
      +  };
      +
      +  $each_ivar(obj, function(prop, desc) {
      +    if (!desc.writable) return;
      +
      +    // Redefine a property with a setter that raises an error.
      +    dp_template.get = $return_val(desc.value);
      +
      +    Object.defineProperty(obj, prop, dp_template);
      +  });
      +};
      +
      + +

      ``

      + +

      Regexps

      + +
      
      +
      + +

      Opal.escape_regexp = function(str)

      + +

      Escape Regexp special chars letting the resulting string be used to build +a new Regexp.

      + +
      Opal.escape_regexp = function(str) {
      +  return str.replace(/([-[\]\/{}()*+?.^$\\| ])/g, '\\$1')
      +            .replace(/[\n]/g, '\\n')
      +            .replace(/[\r]/g, '\\r')
      +            .replace(/[\f]/g, '\\f')
      +            .replace(/[\t]/g, '\\t');
      +};
      +
      + +

      Opal.global_regexp = function(pattern)

      + +

      Create a global Regexp from a RegExp object and cache the result +on the object itself ($$g attribute).

      + +
      Opal.global_regexp = function(pattern) {
      +  if (pattern.global) {
      +    return pattern; // RegExp already has the global flag
      +  }
      +  if (pattern.$$g == null) {
      +    pattern.$$g = new RegExp(pattern.source, (pattern.multiline ? 'gm' : 'g') + (pattern.ignoreCase ? 'i' : ''));
      +  } else {
      +    pattern.$$g.lastIndex = null; // reset lastIndex property
      +  }
      +  return pattern.$$g;
      +};
      +
      + +

      Opal.global_multiline_regexp = function(pattern)

      + +

      Create a global multiline Regexp from a RegExp object and cache the result +on the object itself ($$gm or $$g attribute).

      + +
      Opal.global_multiline_regexp = function(pattern) {
      +  var result, flags;
      +
      +  // RegExp already has the global and multiline flag
      +  if (pattern.global && pattern.multiline) return pattern;
      +
      +  flags = 'gm' + (pattern.ignoreCase ? 'i' : '');
      +  if (pattern.multiline) {
      +    // we are using the $$g attribute because the Regexp is already multiline
      +    if (pattern.$$g == null) {
      +      pattern.$$g = new RegExp(pattern.source, flags);
      +    }
      +    result = pattern.$$g;
      +  } else {
      +    if (pattern.$$gm == null) {
      +      pattern.$$gm = new RegExp(pattern.source, flags);
      +    }
      +    result = pattern.$$gm;
      +  }
      +  result.lastIndex = null; // reset lastIndex property
      +  return result;
      +};
      +
      + +

      Opal.regexp = function(parts, flags)

      + +

      Combine multiple regexp parts together

      + +
      Opal.regexp = function(parts, flags) {
      +  var part;
      +  var ignoreCase = typeof flags !== 'undefined' && flags && flags.indexOf('i') >= 0;
      +
      +  for (var i = 0, ii = parts.length; i < ii; i++) {
      +    part = parts[i];
      +    if (part instanceof RegExp) {
      +      if (part.ignoreCase !== ignoreCase)
      +        Opal.Kernel.$warn(
      +          "ignore case doesn't match for " + part.source.$inspect(),
      +          new Map([['uplevel',  1]])
      +        )
      +
      +      part = part.source;
      +    }
      +    if (part === '') part = '(?:' + part + ')';
      +    parts[i] = part;
      +  }
      +
      +  if (flags) {
      +    return new RegExp(parts.join(''), flags);
      +  } else {
      +    return new RegExp(parts.join(''));
      +  }
      +};
      +
      + +

      ``

      + +

      Require system

      + +
      
      +
      + +

      return retval.then($return_val(true))

      + +

      A special case of require having an async top: +We will need to await it.

      + +
      return retval.then($return_val(true));
      +
      + +

      ``

      + +

      Strings

      + +
      
      +
      + +

      Opal.set_encoding = function(str, name, type)

      + +

      Sets the encoding on a string, will treat string literals as frozen strings +raising a FrozenError.

      + +

      @param str [String] the string on which the encoding should be set +@param name [String] the canonical name of the encoding +@param type [String] possible values are either "encoding", "internal_encoding", or `undefined

      + +
      Opal.set_encoding = function(str, name, type) {
      +  if (typeof type === "undefined") type = "encoding";
      +  if (typeof str === 'string' || str.$$frozen === true)
      +    $raise(Opal.FrozenError, "can't modify frozen String");
      +
      +  var encoding = Opal.find_encoding(name);
      +
      +  if (encoding === str[type]) { return str; }
      +
      +  str[type] = encoding;
      +
      +  return str;
      +};
      +
      + +

      Opal.find_encoding = function(name)

      + +

      Fetches the encoding for the given name or raises ArgumentError.

      + +
      Opal.find_encoding = function(name) {
      +  var register = Opal.encodings;
      +  var encoding = register[name] || register[name.toUpperCase()];
      +  if (!encoding) $raise(Opal.ArgumentError, "unknown encoding name - " + name);
      +  return encoding;
      +}
      +
      + +

      Opal.enc = function(str, name)

      + +

      @returns a String object with the encoding set from a string literal

      + +
      Opal.enc = function(str, name) {
      +  var dup = new String(str);
      +  dup = Opal.set_encoding(dup, name);
      +  dup.internal_encoding = dup.encoding;
      +  return dup
      +}
      +
      + +

      Opal.binary = function(str)

      + +

      @returns a String object with the internal encoding set to Binary

      + +
      Opal.binary = function(str) {
      +  var dup = new String(str);
      +  return Opal.set_encoding(dup, "binary", "internal_encoding");
      +}
      +
      + +

      Opal.queue = function(proc)

      + +

      Run a block of code, but if it returns a Promise, don't run the next +one, but queue it.

      + +
      Opal.queue = function(proc) {
      +  if (Opal.last_promise) {
      +    // The async path is taken only if anything before returned a
      +    // Promise(V2).
      +    Opal.last_promise = Opal.last_promise.then(function() {
      +      if (!Opal.promise_unhandled_exception) return proc(Opal);
      +    })['catch'](function(error) {
      +      if (Opal.respond_to(error, '$full_message')) {
      +        error = error.$full_message();
      +      }
      +      console.error(error);
      +      // Abort further execution
      +      Opal.promise_unhandled_exception = true;
      +      Opal.exit(1);
      +    });
      +    return Opal.last_promise;
      +  }
      +  else {
      +    var ret = proc(Opal);
      +    if (typeof Promise === 'function' && typeof ret === 'object' && ret instanceof Promise) {
      +      Opal.last_promise = ret;
      +    }
      +    return ret;
      +  }
      +}
      +
      + +

      ``

      + +

      Operator helpers

      + +
      
      +
      + +

      function are_both_numbers_or_strings(lhs, rhs)

      + +

      Optimized helpers for calls like $truthy((a)'$===') -> $eqeqeq(a, b)

      + +
      function are_both_numbers_or_strings(lhs, rhs) {
      +  return (typeof lhs === 'number' && typeof rhs === 'number') ||
      +         (typeof lhs === 'string' && typeof rhs === 'string');
      +}
      +
      + +

      function $return_val(arg)

      + +

      Shortcuts - optimized function generators for simple kinds of functions

      + +
      function $return_val(arg) {
      +  return function() {
      +    return arg;
      +  }
      +}
      +
      + +

      Opal.ensure_kwargs = function(kwargs)

      + +

      Primitives for handling parameters

      + +
      Opal.ensure_kwargs = function(kwargs) {
      +  if (kwargs == null) {
      +    return new Map();
      +  } else if (kwargs.$$is_hash) {
      +    return kwargs;
      +  } else {
      +    $raise(Opal.ArgumentError, 'expected kwargs');
      +  }
      +}
      +
      + +

      Opal.large_array_unpack = function(str)

      + +

      Arrays of size > 32 elements that contain only strings, +symbols, integers and nils are compiled as a self-extracting +string.

      + +
      Opal.large_array_unpack = function(str) {
      +  var array = str.split(","), length = array.length, i;
      +  for (i = 0; i < length; i++) {
      +    switch(array[i][0]) {
      +      case undefined:
      +        array[i] = nil
      +        break;
      +      case '-':
      +      case '0':
      +      case '1':
      +      case '2':
      +      case '3':
      +      case '4':
      +      case '5':
      +      case '6':
      +      case '7':
      +      case '8':
      +      case '9':
      +        array[i] = +array[i];
      +    }
      +  }
      +  return array;
      +}
      +
      + +

      Opal.opal32_init = $return_val(0x4f70616c)

      + +

      Opal32-checksum algorithm for #hash

      + +
      Opal.opal32_init = $return_val(0x4f70616c);
      +
      + +

      Opal.BasicObject = BasicObject = $allocate_class('BasicObject', null)

      + +

      Initialization

      + +
      Opal.BasicObject = BasicObject = $allocate_class('BasicObject', null);
      +
      + +

      BasicObject.$$const.BasicObject = BasicObject

      + +

      BasicObject can reach itself, avoid const_set to skip the $$base_module logic

      + +
      BasicObject.$$const.BasicObject = BasicObject;
      +
      + +

      $const_set(_Object, "BasicObject", BasicObject)

      + +

      Assign basic constants

      + +
      $const_set(_Object, "BasicObject",  BasicObject);
      +
      + +

      BasicObject.$$class = Class

      + +

      Fix booted classes to have correct .class value

      + +
      BasicObject.$$class = Class;
      +
      + +

      $prop(_Object.$$prototype, 'toString', function()

      + +

      Forward .toString() to #to_s

      + +
      $prop(_Object.$$prototype, 'toString', function() {
      +  var to_s = this.$to_s();
      +  if (to_s.$$is_string && typeof(to_s) === 'object') {
      +    // a string created using new String('string')
      +    return to_s.valueOf();
      +  } else {
      +    return to_s;
      +  }
      +});
      +
      + +

      $prop(_Object.$$prototype, '$require', Opal.require)

      + +

      Make Kernel#require immediately available as it's needed to require all the +other corelib files.

      + +
      $prop(_Object.$$prototype, '$require', Opal.require);
      +
      + +

      Opal.top = new _Object()

      + +

      Instantiate the main object

      + +
      Opal.top = new _Object();
      +
      + +

      function top_define_method()

      + +

      Foward calls to define_method on the top object to Object

      + +
      function top_define_method() {
      +  var block = top_define_method.$$p;
      +  top_define_method.$$p = null;
      +  return Opal.send(_Object, 'define_method', arguments, block)
      +};
      +
      + +

      Opal.NilClass = $allocate_class('NilClass', Opal.Object)

      + +

      Nil

      + +
      Opal.NilClass = $allocate_class('NilClass', Opal.Object);
      +
      + +

      Object.defineProperty($gvars, "@",

      + +

      Define a "$@" global variable, which would compute and return a backtrace on demand.

      + +
      Object.defineProperty($gvars, "@", {
      +
      + +

      Opal.file_sources = {}

      + +

      If enable-file-source-embed compiler option is enabled, each module loaded will add its +sources to this object

      + +
      Opal.file_sources = {};
      +
      +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/file_list.html b/docs/api/v1.8.2/corelib/file_list.html new file mode 100644 index 00000000..77a0691c --- /dev/null +++ b/docs/api/v1.8.2/corelib/file_list.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + File List + + + +
      +
      +

      File List

      + + + +
      + + +
      + + diff --git a/docs/api/v1.8.2/corelib/frames.html b/docs/api/v1.8.2/corelib/frames.html new file mode 100644 index 00000000..2071b25f --- /dev/null +++ b/docs/api/v1.8.2/corelib/frames.html @@ -0,0 +1,17 @@ + + + + + corelib (Opal v1.8.2) + + + + diff --git a/docs/api/v1.8.2/corelib/index.html b/docs/api/v1.8.2/corelib/index.html new file mode 100644 index 00000000..3a50b1da --- /dev/null +++ b/docs/api/v1.8.2/corelib/index.html @@ -0,0 +1,87 @@ + + + + + + + File: README + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Opal corelib

      + +

      This is the Opal corelib implementation API documentation. +The whole corelib is loaded upon require 'opal'.

      + +

      The runtime.js documentation is available here (in master)

      + +

      Cherry-picking

      + +

      Note that require 'opal' will load all of the corelib, which is likely to +have a ton of stuff you don't need.

      + +

      If you're concerned about runtime size, you can require 'opal/base' and +require anything you need, or require 'opal/mini' to have a working Ruby +without useless stuff.

      +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/js/Error.html b/docs/api/v1.8.2/corelib/js/Error.html new file mode 100644 index 00000000..577a5c64 --- /dev/null +++ b/docs/api/v1.8.2/corelib/js/Error.html @@ -0,0 +1,123 @@ + + + + + + + Class: JS::Error + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: JS::Error + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/opal/corelib/error.rb
      +
      + +
      + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/corelib/js/app.js b/docs/api/v1.8.2/corelib/js/app.js new file mode 100644 index 00000000..8d067fe3 --- /dev/null +++ b/docs/api/v1.8.2/corelib/js/app.js @@ -0,0 +1,314 @@ +(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; + var curli; + 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++) { + if ( typeof(curli) == "undefined" ) { + curli = $('
        1. '); + toc.append(curli); + } + toc = $('
            '); + curli.append(toc); + curli = undefined; + } + } + if (thisTag < lastTag) { + for (i = 0; i < lastTag - thisTag; i++) { + toc = toc.parent(); + toc = toc.parent(); + } + } + var title = $(this).attr('toc-title'); + if (typeof(title) == "undefined") title = $(this).text(); + curli =$('
          1. ' + title + '
          2. '); + toc.append(curli); + 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/v1.8.2/corelib/js/full_list.js b/docs/api/v1.8.2/corelib/js/full_list.js new file mode 100644 index 00000000..59069c5e --- /dev/null +++ b/docs/api/v1.8.2/corelib/js/full_list.js @@ -0,0 +1,216 @@ +(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/v1.8.2/corelib/js/jquery.js b/docs/api/v1.8.2/corelib/js/jquery.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/docs/api/v1.8.2/corelib/js/jquery.js @@ -0,0 +1,4 @@ +/*! 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/v1.8.2/corelib/method_list.html b/docs/api/v1.8.2/corelib/method_list.html new file mode 100644 index 00000000..ec0f828d --- /dev/null +++ b/docs/api/v1.8.2/corelib/method_list.html @@ -0,0 +1,9827 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
      +
      +

      Method List

      + + + +
      + + +
      + + diff --git a/docs/api/v1.8.2/corelib/top-level-namespace.html b/docs/api/v1.8.2/corelib/top-level-namespace.html new file mode 100644 index 00000000..730e4816 --- /dev/null +++ b/docs/api/v1.8.2/corelib/top-level-namespace.html @@ -0,0 +1,482 @@ + + + + + + + Top Level Namespace + + — corelib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Top Level Namespace + + + +

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

      Defined Under Namespace

      +

      + + + Modules: Comparable, Enumerable, Errno, JS, Kernel, Marshal, Math, ObjectSpace, Opal, PackUnpack, Process, __JS__ + + + + Classes: ArgumentError, Array, BasicObject, Binding, Boolean, Class, ClosedQueueError, CompatibilityError, Complex, Dir, EOFError, Encoding, EncodingError, Enumerator, Exception, FalseClass, FiberError, File, Float, FloatDomainError, FrozenError, GC, Hash, IO, IOError, IndexError, Integer, Interrupt, KeyError, LoadError, LocalJumpError, MatchData, Method, Module, NameError, NilClass, NoMatchingPatternError, NoMemoryError, NoMethodError, NotImplementedError, Number, Numeric, Object, PatternMatching, Proc, Random, Range, RangeError, Rational, Refinement, Regexp, RegexpError, RuntimeError, ScriptError, SecurityError, Set, Signal, SignalException, StandardError, StopIteration, String, Struct, SyntaxError, SystemCallError, SystemExit, SystemStackError, ThreadError, Time, TracePoint, TrueClass, TypeError, UnboundMethod, UncaughtThrowError, ZeroDivisionError + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      Symbol = + +
      +
      String
      + +
      TOPLEVEL_BINDING = + +
      +
      ::Binding.new(
      +  %x{
      +    function(js) {
      +      return (new Function("self", "return " + js))(self);
      +    }
      +  },
      +  [], self, ['<main>', 0]
      +)
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .autoload(*args) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/opal/corelib/main.rb', line 12
      +
      +def autoload(*args)
      +  `Opal.Object.$autoload.apply(Opal.Object, args)`
      +end
      +
      + + +
      +

      + + .include(mod) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'opal/opal/corelib/main.rb', line 8
      +
      +def include(mod)
      +  ::Object.include mod
      +end
      +
      +
      + +
      +

      + + .private(*methods) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +115
      +116
      +117
      +
      +
      # File 'opal/opal/corelib/unsupported.rb', line 115
      +
      +def self.private(*methods)
      +  `return (methods.length === 1) ? methods[0] : methods`
      +end
      +
      +
      + +
      +

      + + .public(*methods) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +111
      +112
      +113
      +
      +
      # File 'opal/opal/corelib/unsupported.rb', line 111
      +
      +def self.public(*methods)
      +  `return (methods.length === 1) ? methods[0] : methods`
      +end
      +
      +
      + +
      +

      + + .to_sObject + + + + + +

      + + + + +
      +
      +
      +
      +4
      +5
      +6
      +
      +
      # File 'opal/opal/corelib/main.rb', line 4
      +
      +def to_s
      +  'main'
      +end
      +
      +
      + +
      +

      + + .using(mod) ⇒ Object + + + + + +

      +
      +

      Compiler overrides this method

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'opal/opal/corelib/main.rb', line 17
      +
      +def using(mod)
      +  ::Kernel.raise 'main.using is permitted only at toplevel'
      +end
      +
      +
      + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/v1.8.2/index.html b/docs/api/v1.8.2/index.html new file mode 100644 index 00000000..d9d34bf7 --- /dev/null +++ b/docs/api/v1.8.2/index.html @@ -0,0 +1,97 @@ + + + + + + Opal v1.8.2 API Documentation Index + + + + + + + + + +
      +

      Opal v1.8.2 API Documentation Index

      + + +
      + + + + + + + + + + + + + diff --git a/docs/api/v1.8.2/lib/AST/Processor/Mixin.html b/docs/api/v1.8.2/lib/AST/Processor/Mixin.html new file mode 100644 index 00000000..223c2118 --- /dev/null +++ b/docs/api/v1.8.2/lib/AST/Processor/Mixin.html @@ -0,0 +1,215 @@ + + + + + + + Module: AST::Processor::Mixin + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: AST::Processor::Mixin + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/patch.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #process(node) ⇒ Object + + + + + + + + + + + + + +

        This patch to #process removes a bit of dynamic abilities (removed call to node.to_ast) and it tries to optimize away the string operations and method existence check by caching them inside a processor.

        +
        + +
      • + + +
      + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #process(node) ⇒ Object + + + + + +

      +
      +

      This patch to #process removes a bit of dynamic abilities (removed +call to node.to_ast) and it tries to optimize away the string +operations and method existence check by caching them inside a +processor.

      + +

      This is the second most inefficient call in the compilation phase +so an optimization may be warranted.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 145
      +
      +def process(node)
      +  return if node.nil?
      +
      +  @_on_handler_cache ||= {}
      +  type = node.type
      +
      +  on_handler = @_on_handler_cache[type] ||= begin
      +    handler = :"on_#{type}"
      +    handler = :handler_missing unless respond_to?(handler)
      +    handler
      +  end
      +
      +  send(on_handler, node) || node
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal.html b/docs/api/v1.8.2/lib/Opal.html new file mode 100644 index 00000000..8714eed5 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal.html @@ -0,0 +1,1177 @@ + + + + + + + Module: Opal + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal + + + +

      +
      + + + + +
      +
      Extended by:
      +
      Deprecations, UseGem
      +
      + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/requires.rb,
      + opal/lib/opal/os.rb,
      opal/lib/opal/cli.rb,
      opal/lib/opal/erb.rb,
      opal/lib/opal/hike.rb,
      opal/lib/opal/repl.rb,
      opal/lib/opal/util.rb,
      opal/lib/tilt/opal.rb,
      opal/lib/opal/cache.rb,
      opal/lib/opal/paths.rb,
      opal/lib/opal/config.rb,
      opal/lib/opal/errors.rb,
      opal/lib/opal/builder.rb,
      opal/lib/opal/version.rb,
      opal/lib/opal/ast/node.rb,
      opal/lib/opal/compiler.rb,
      opal/lib/opal/fragment.rb,
      opal/lib/opal/nodes/if.rb,
      opal/lib/opal/rewriter.rb,
      opal/lib/opal/nodes/def.rb,
      opal/lib/opal/nodes/top.rb,
      opal/lib/opal/nodes/args.rb,
      opal/lib/opal/nodes/base.rb,
      opal/lib/opal/nodes/call.rb,
      opal/lib/opal/nodes/defs.rb,
      opal/lib/opal/nodes/hash.rb,
      opal/lib/opal/nodes/iter.rb,
      opal/lib/opal/source_map.rb,
      opal/lib/opal/ast/builder.rb,
      opal/lib/opal/ast/matcher.rb,
      opal/lib/opal/cli_options.rb,
      opal/lib/opal/cli_runners.rb,
      opal/lib/opal/eof_content.rb,
      opal/lib/opal/nodes/array.rb,
      opal/lib/opal/nodes/class.rb,
      opal/lib/opal/nodes/logic.rb,
      opal/lib/opal/nodes/masgn.rb,
      opal/lib/opal/nodes/scope.rb,
      opal/lib/opal/nodes/super.rb,
      opal/lib/opal/nodes/while.rb,
      opal/lib/opal/nodes/yield.rb,
      opal/lib/opal/path_reader.rb,
      opal/lib/opal/deprecations.rb,
      opal/lib/opal/nodes/lambda.rb,
      opal/lib/opal/nodes/module.rb,
      opal/lib/opal/nodes/rescue.rb,
      opal/lib/opal/nodes/arglist.rb,
      opal/lib/opal/nodes/closure.rb,
      opal/lib/opal/nodes/defined.rb,
      opal/lib/opal/nodes/helpers.rb,
      opal/lib/opal/nodes/literal.rb,
      opal/lib/opal/nodes/args/arg.rb,
      opal/lib/opal/nodes/x_string.rb,
      opal/lib/opal/regexp_anchors.rb,
      opal/lib/opal/rewriters/base.rb,
      opal/lib/opal/cli_runners/gjs.rb,
      opal/lib/opal/nodes/constants.rb,
      opal/lib/opal/nodes/variables.rb,
      opal/lib/opal/cache/file_cache.rb,
      opal/lib/opal/cli_runners/deno.rb,
      opal/lib/opal/builder_scheduler.rb,
      opal/lib/opal/nodes/definitions.rb,
      opal/lib/opal/builder_processors.rb,
      opal/lib/opal/cli_runners/chrome.rb,
      opal/lib/opal/cli_runners/nodejs.rb,
      opal/lib/opal/cli_runners/safari.rb,
      opal/lib/opal/cli_runners/server.rb,
      opal/lib/opal/nodes/call_special.rb,
      opal/lib/opal/cli_runners/firefox.rb,
      opal/lib/opal/cli_runners/nashorn.rb,
      opal/lib/opal/cli_runners/quickjs.rb,
      opal/lib/opal/nodes/args/fake_arg.rb,
      opal/lib/opal/rewriters/arguments.rb,
      opal/lib/opal/rewriters/dump_args.rb,
      opal/lib/opal/rewriters/mlhs_args.rb,
      opal/lib/opal/rewriters/numblocks.rb,
      opal/lib/opal/nodes/node_with_args.rb,
      opal/lib/opal/parser/source_buffer.rb,
      opal/lib/opal/nodes/args/parameters.rb,
      opal/lib/opal/nodes/singleton_class.rb,
      opal/lib/opal/parser/default_config.rb,
      opal/lib/opal/rewriters/inline_args.rb,
      opal/lib/opal/cli_runners/mini_racer.rb,
      opal/lib/opal/nodes/args/arity_check.rb,
      opal/lib/opal/rewriters/for_rewriter.rb,
      opal/lib/opal/rewriters/forward_args.rb,
      opal/lib/opal/cli_runners/applescript.rb,
      opal/lib/opal/rewriters/block_to_iter.rb,
      opal/lib/opal/rewriters/dot_js_syntax.rb,
      opal/lib/opal/nodes/args/extract_kwarg.rb,
      opal/lib/opal/rewriters/thrower_finder.rb,
      opal/lib/opal/builder_scheduler/prefork.rb,
      opal/lib/opal/nodes/args/extract_kwargs.rb,
      opal/lib/opal/nodes/args/extract_optarg.rb,
      opal/lib/opal/nodes/args/extract_restarg.rb,
      opal/lib/opal/rewriters/pattern_matching.rb,
      opal/lib/opal/rewriters/returnable_logic.rb,
      opal/lib/opal/rewriters/targeted_patches.rb,
      opal/lib/opal/nodes/args/extract_kwoptarg.rb,
      opal/lib/opal/nodes/args/extract_post_arg.rb,
      opal/lib/opal/rewriters/js_reserved_words.rb,
      opal/lib/opal/rewriters/opal_engine_check.rb,
      opal/lib/opal/builder_scheduler/sequential.rb,
      opal/lib/opal/nodes/args/extract_block_arg.rb,
      opal/lib/opal/nodes/args/extract_kwrestarg.rb,
      opal/lib/opal/nodes/args/prepare_post_args.rb,
      opal/lib/opal/nodes/args/initialize_iterarg.rb,
      opal/lib/opal/nodes/args/extract_post_optarg.rb,
      opal/lib/opal/nodes/node_with_args/shortcuts.rb,
      opal/lib/opal/rewriters/deduplicate_arg_name.rb,
      opal/lib/opal/nodes/args/initialize_shadowarg.rb,
      opal/lib/opal/nodes/args/ensure_kwargs_are_kwargs.rb,
      opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb,
      opal/lib/opal/rewriters/binary_operator_assignment.rb,
      opal/lib/opal/rewriters/logical_operator_assignment.rb,
      opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb
      +
      +
      + +
      + +

      Overview

      +
      +

      rubocop:disable Layout/EmptyLineBetweenDefs, Style/SingleLineMethods

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + Modules: AST, BuilderProcessors, Cache, CliRunners, Config, Deprecations, ERB, Hike, MagicComments, Nodes, OS, Parser, Rewriters, Rubyspec, SourceMap, UseGem, Util + + + + Classes: Builder, BuilderScheduler, CLI, CLIOptions, CompilationError, Compiler, EofContent, Error, Fragment, GemNotFound, OpalBacktraceLocation, ParsingError, PathReader, REPL, Rewriter, RewritingError, SimpleServer, SyntaxError, TiltTemplate + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      Server = + +
      +
      Opal::Sprockets::Server
      + +
      VERSION = +
      +
      +

      WHEN RELEASING: +Remember to update RUBY_ENGINE_VERSION in opal/corelib/constants.rb too!

      + + +
      +
      +
      + + +
      +
      +
      '1.8.2'
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #builder_scheduler ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute builder_scheduler.

        +
        + +
      • + + +
      • + + + #cache ⇒ Object + + + + + + + + + + writeonly + + + + + + + + +

        A Sprockets-compatible cache, for example an instance of Opal::Cache::FileCache or Opal::Cache::NullCache.

        +
        + +
      • + + +
      + + + + + +

      Attributes included from Deprecations

      +

      #raise_on_deprecation

      + + + +

      + Class Method Summary + collapse +

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

      Methods included from UseGem

      +

      use_gem

      + + + + + + + + + +

      Methods included from Deprecations

      +

      deprecation

      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #builder_schedulerObject + + + + + +

      +
      +

      Returns the value of attribute builder_scheduler.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/builder_scheduler.rb', line 14
      +
      +def builder_scheduler
      +  @builder_scheduler
      +end
      +
      +
      + + + +
      +

      + + #cache=(value) ⇒ Object (writeonly) + + + + + +

      +
      +

      A Sprockets-compatible cache, for example an instance of +Opal::Cache::FileCache or Opal::Cache::NullCache.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/cache.rb', line 13
      +
      +def cache=(value)
      +  @cache = value
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .add_opal_location_to_error(opal_location, error) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +41
      +42
      +43
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/errors.rb', line 41
      +
      +def self.add_opal_location_to_error(opal_location, error)
      +  backtrace = error.backtrace.to_a
      +  backtrace.unshift opal_location.to_s
      +  error.set_backtrace backtrace
      +  error
      +end
      +
      +
      + +
      +

      + + .append_path(path) ⇒ Object + + + + + +

      +
      +

      Add a file path to opals load path. Any gem containing ruby code that Opal +has access to should add a load path through this method. Load paths added +here should only be paths which contain code targeted at being compiled by +Opal.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/paths.rb', line 23
      +
      +def self.append_path(path)
      +  append_paths(path)
      +end
      +
      +
      + +
      +

      + + .append_paths(*paths) ⇒ Object + + + + + +

      +
      +

      Same as #append_path but can take multiple paths.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/paths.rb', line 28
      +
      +def self.append_paths(*paths)
      +  @paths.concat(paths)
      +  nil
      +end
      +
      +
      + +
      +

      + + .cacheObject + + + + + +

      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/cache.rb', line 15
      +
      +def self.cache
      +  @cache ||=
      +    if RUBY_ENGINE == 'opal' || ENV['OPAL_CACHE_DISABLE'] || !Cache::FileCache.find_dir
      +      Cache::NullCache.new
      +    else
      +      Cache::FileCache.new
      +    end
      +end
      +
      +
      + +
      +

      + + .compile(source, options = {}) ⇒ String + + + + + +

      +
      +

      Compile a string of ruby code into javascript.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      
      +Opal.compile "ruby_code"
      +# => "string of javascript code"
      + +
      +

      Parameters:

      +
        + +
      • + + source + + + (String) + + + + — +

        ruby source

        +
        + +
      • + +
      • + + options + + + (Hash) + + + (defaults to: {}) + + + — +

        compiler options

        +
        + +
      • + +
      + +

      Returns:

      +
        + +
      • + + + (String) + + + + — +

        javascript code

        +
        + +
      • + +
      + +

      See Also:

      +
        + +
      • for compiler options
      • + +
      + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 30
      +
      +def self.compile(source, options = {})
      +  Compiler.new(source, options).compile
      +end
      +
      +
      + +
      +

      + + .core_dirObject + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/paths.rb', line 10
      +
      +def self.core_dir
      +  File.expand_path('../../../opal', __FILE__)
      +end
      +
      +
      + +
      +

      + + .dependent_filesObject + + + + + +

      +
      +

      All files that Opal depends on while compiling (for cache keying and +watching)

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +
      +
      # File 'opal/lib/opal/paths.rb', line 35
      +
      +def self.dependent_files
      +  # We want to ensure the compiler and any Gemfile/gemspec (for development)
      +  # stays untouched
      +  opal_path = File.expand_path('..', Opal.gem_dir)
      +  files = Dir["#{opal_path}/{Gemfile*,*.gemspec,lib/**/*}"]
      +
      +  # Also check if parser wasn't changed:
      +  files += $LOADED_FEATURES.grep(%r{lib/(parser|ast)})
      +
      +  files
      +end
      +
      +
      + +
      +

      + + .gem_dirObject + + + + + +

      +
      +

      We use this file from inside Opal as well, and dir is not yet supported. +rubocop:disable Style/ExpandPathArguments

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/paths.rb', line 6
      +
      +def self.gem_dir
      +  File.expand_path('../..', __FILE__)
      +end
      +
      +
      + +
      +

      + + .opal_location_from_error(error) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/errors.rb', line 34
      +
      +def self.opal_location_from_error(error)
      +  opal_location = OpalBacktraceLocation.new
      +  opal_location.location = error.location if error.respond_to?(:location)
      +  opal_location.diagnostic = error.diagnostic if error.respond_to?(:diagnostic)
      +  opal_location
      +end
      +
      +
      + +
      +

      + + .pathsObject + + + + + +

      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +
      +
      # File 'opal/lib/opal/paths.rb', line 86
      +
      +def self.paths
      +  @paths.freeze
      +end
      +
      +
      + +
      +

      + + .reset_paths!Object + + + + + +

      +
      +

      Resets Opal.paths to the default value +(includes corelib, stdlib, opal/lib, ast gem and parser gem)

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +
      +
      # File 'opal/lib/opal/paths.rb', line 92
      +
      +def self.reset_paths!
      +  @paths = [core_dir, std_dir, gem_dir]
      +  if RUBY_ENGINE != 'opal'
      +    use_gem 'ast'
      +    use_gem 'parser'
      +  end
      +  nil
      +end
      +
      +
      + +
      +

      + + .std_dirObject + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/paths.rb', line 14
      +
      +def self.std_dir
      +  File.expand_path('../../../stdlib', __FILE__)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/AST.html b/docs/api/v1.8.2/lib/Opal/AST.html new file mode 100644 index 00000000..3e5bc35e --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/AST.html @@ -0,0 +1,119 @@ + + + + + + + Module: Opal::AST + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::AST + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/ast/node.rb,
      + opal/lib/opal/ast/builder.rb,
      opal/lib/opal/ast/matcher.rb
      +
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: Builder, Matcher, Node + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/AST/Builder.html b/docs/api/v1.8.2/lib/Opal/AST/Builder.html new file mode 100644 index 00000000..29a497c0 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/AST/Builder.html @@ -0,0 +1,195 @@ + + + + + + + Class: Opal::AST::Builder + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::AST::Builder + + + +

      +
      + +
      +
      Inherits:
      +
      + Parser::Builders::Default + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/ast/builder.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #n(type, children, location) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +
      +
      # File 'opal/lib/opal/ast/builder.rb', line 11
      +
      +def n(type, children, location)
      +  ::Opal::AST::Node.new(type, children, location: location)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/AST/Matcher.html b/docs/api/v1.8.2/lib/Opal/AST/Matcher.html new file mode 100644 index 00000000..7036e8be --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/AST/Matcher.html @@ -0,0 +1,509 @@ + + + + + + + Class: Opal::AST::Matcher + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::AST::Matcher + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/ast/matcher.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: Node + + +

      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #captures ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute captures.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(&block) ⇒ Matcher + + + + + +

      +
      +

      Returns a new instance of Matcher.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 9
      +
      +def initialize(&block)
      +  @root = instance_exec(&block)
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #capturesObject + + + + + +

      +
      +

      Returns the value of attribute captures.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 31
      +
      +def captures
      +  @captures
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #cap(capture) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 17
      +
      +def cap(capture)
      +  Node.new(:capture, [capture])
      +end
      +
      +
      + +
      +

      + + #inspectObject + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 27
      +
      +def inspect
      +  "#<Opal::AST::Matcher: #{@root.inspect}>"
      +end
      +
      +
      + +
      +

      + + #match(ast) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 21
      +
      +def match(ast)
      +  @captures = []
      +  @root.match(ast, self) || (return false)
      +  @captures
      +end
      +
      +
      + +
      +

      + + #s(type, *children) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 13
      +
      +def s(type, *children)
      +  Node.new(type, children)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/AST/Matcher/Node.html b/docs/api/v1.8.2/lib/Opal/AST/Matcher/Node.html new file mode 100644 index 00000000..50b4580a --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/AST/Matcher/Node.html @@ -0,0 +1,493 @@ + + + + + + + Class: Opal::AST::Matcher::Node + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::AST::Matcher::Node + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/ast/matcher.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #children ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute children.

        +
        + +
      • + + +
      • + + + #type ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute type.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #childrenObject + + + + + +

      +
      +

      Returns the value of attribute children

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of children

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 33
      +
      +def children
      +  @children
      +end
      +
      +
      + + + +
      +

      + + #typeObject + + + + + +

      +
      +

      Returns the value of attribute type

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of type

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 33
      +
      +def type
      +  @type
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #inspectObject + + + + + +

      + + + + +
      +
      +
      +
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 67
      +
      +def inspect
      +  if type == :capture
      +    "{#{children.first.inspect}}"
      +  else
      +    "s(#{type.inspect}, #{children.inspect[1..-2]})"
      +  end
      +end
      +
      +
      + +
      +

      + + #match(ast, matcher) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +62
      +63
      +64
      +65
      +
      +
      # File 'opal/lib/opal/ast/matcher.rb', line 34
      +
      +def match(ast, matcher)
      +  return false if ast.nil?
      +
      +  ast_parts = [ast.type] + ast.children
      +  self_parts = [type] + children
      +
      +  return false if ast_parts.length != self_parts.length
      +
      +  ast_parts.length.times.all? do |i|
      +    ast_elem = ast_parts[i]
      +    self_elem = self_parts[i]
      +
      +    if self_elem.is_a?(Node) && self_elem.type == :capture
      +      capture = true
      +      self_elem = self_elem.children.first
      +    end
      +
      +    res = case self_elem
      +          when Node
      +            self_elem.match(ast_elem, matcher)
      +          when Array
      +            self_elem.include?(ast_elem)
      +          when :*
      +            true
      +          else
      +            self_elem == ast_elem
      +          end
      +
      +    matcher.captures << ast_elem if capture
      +    res
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/AST/Node.html b/docs/api/v1.8.2/lib/Opal/AST/Node.html new file mode 100644 index 00000000..04ea6185 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/AST/Node.html @@ -0,0 +1,393 @@ + + + + + + + Class: Opal::AST::Node + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::AST::Node + + + +

      +
      + +
      +
      Inherits:
      +
      + Parser::AST::Node + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/ast/node.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #meta ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute meta.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #metaObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute meta.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'opal/lib/opal/ast/node.rb', line 9
      +
      +def meta
      +  @meta
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #assign_properties(properties) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/ast/node.rb', line 11
      +
      +def assign_properties(properties)
      +  if meta = properties[:meta]
      +    meta = meta.dup if meta.frozen?
      +    @meta.merge!(meta)
      +  else
      +    @meta ||= {}
      +  end
      +
      +  super
      +end
      +
      +
      + +
      +

      + + #columnObject + + + + + +

      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/ast/node.rb', line 26
      +
      +def column
      +  loc.column if loc
      +end
      +
      +
      + +
      +

      + + #lineObject + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/ast/node.rb', line 22
      +
      +def line
      +  loc.line if loc
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Builder.html b/docs/api/v1.8.2/lib/Opal/Builder.html new file mode 100644 index 00000000..07963747 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Builder.html @@ -0,0 +1,2199 @@ + + + + + + + Class: Opal::Builder + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Builder + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      UseGem
      +
      + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: MissingRequire, ProcessorNotFound + + +

      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #cache ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute cache.

        +
        + +
      • + + +
      • + + + #compiler_options ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute compiler_options.

        +
        + +
      • + + +
      • + + + #missing_require_severity ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute missing_require_severity.

        +
        + +
      • + + +
      • + + + #path_reader ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute path_reader.

        +
        + +
      • + + +
      • + + + #preload ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute preload.

        +
        + +
      • + + +
      • + + + #prerequired ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute prerequired.

        +
        + +
      • + + +
      • + + + #processed ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute processed.

        +
        + +
      • + + +
      • + + + #processors ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute processors.

        +
        + +
      • + + +
      • + + + #scheduler ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute scheduler.

        +
        + +
      • + + +
      • + + + #stubs ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute stubs.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods included from UseGem

      +

      #use_gem

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(options = nil) ⇒ Builder + + + + + +

      +
      +

      Returns a new instance of Builder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +
      +
      # File 'opal/lib/opal/builder.rb', line 65
      +
      +def initialize(options = nil)
      +  (options || {}).each_pair do |k, v|
      +    public_send("#{k}=", v)
      +  end
      +
      +  @stubs                    ||= []
      +  @preload                  ||= []
      +  @processors               ||= ::Opal::Builder.processors
      +  @path_reader              ||= PathReader.new(Opal.paths, extensions.map { |e| [".#{e}", ".js.#{e}"] }.flatten)
      +  @prerequired              ||= []
      +  @compiler_options         ||= Opal::Config.compiler_options
      +  @missing_require_severity ||= Opal::Config.missing_require_severity
      +  @cache                    ||= Opal.cache
      +  @scheduler                ||= Opal.builder_scheduler
      +
      +  if @scheduler.respond_to? :new
      +    @scheduler = @scheduler.new(self)
      +  end
      +
      +  @processed = []
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #cacheObject + + + + + +

      +
      +

      Returns the value of attribute cache.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def cache
      +  @cache
      +end
      +
      +
      + + + +
      +

      + + #compiler_optionsObject + + + + + +

      +
      +

      Returns the value of attribute compiler_options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def compiler_options
      +  @compiler_options
      +end
      +
      +
      + + + +
      +

      + + #missing_require_severityObject + + + + + +

      +
      +

      Returns the value of attribute missing_require_severity.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def missing_require_severity
      +  @missing_require_severity
      +end
      +
      +
      + + + +
      +

      + + #path_readerObject + + + + + +

      +
      +

      Returns the value of attribute path_reader.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def path_reader
      +  @path_reader
      +end
      +
      +
      + + + +
      +

      + + #preloadObject + + + + + +

      +
      +

      Returns the value of attribute preload.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def preload
      +  @preload
      +end
      +
      +
      + + + +
      +

      + + #prerequiredObject + + + + + +

      +
      +

      Returns the value of attribute prerequired.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def prerequired
      +  @prerequired
      +end
      +
      +
      + + + +
      +

      + + #processedObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute processed.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +176
      +177
      +178
      +
      +
      # File 'opal/lib/opal/builder.rb', line 176
      +
      +def processed
      +  @processed
      +end
      +
      +
      + + + +
      +

      + + #processorsObject + + + + + +

      +
      +

      Returns the value of attribute processors.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def processors
      +  @processors
      +end
      +
      +
      + + + +
      +

      + + #schedulerObject + + + + + +

      +
      +

      Returns the value of attribute scheduler.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def scheduler
      +  @scheduler
      +end
      +
      +
      + + + +
      +

      + + #stubsObject + + + + + +

      +
      +

      Returns the value of attribute stubs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder.rb', line 178
      +
      +def stubs
      +  @stubs
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .build(*args, &block) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'opal/lib/opal/builder.rb', line 87
      +
      +def self.build(*args, &block)
      +  new.build(*args, &block)
      +end
      +
      +
      + +
      +

      + + .extensionsObject + + + + + +

      +
      +

      All the extensions supported by registered processors

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/builder.rb', line 18
      +
      +def self.extensions
      +  @extensions ||= []
      +end
      +
      +
      + +
      +

      + + .processorsObject + + + + + +

      +
      +

      The registered processors

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/builder.rb', line 13
      +
      +def self.processors
      +  @processors ||= []
      +end
      +
      +
      + +
      +

      + + .register_processor(processor, processor_extensions) ⇒ Object + + + + + +

      +
      +

      Register a builder processor and the supported extensions. +A processor will respond to:

      + +

      #requires

      + +

      An array of string containing the logic paths of required assets

      + +

      #required_trees

      + +

      An array of string containing the logic paths of required directories

      + +

      #autoloads

      + +

      An array of entities that are autoloaded and their compile-time load failure can +be safely ignored

      + +

      #to_s

      + +

      The processed source

      + +

      #source_map

      + +

      An instance of ::Opal::SourceMap::File representing the processd asset's source +map.

      + +

      .new(source, filename, compiler_options)

      + +

      The processor will be instantiated passing:

      + +
        +
      • the unprocessed source
      • +
      • the asset's filename
      • +
      • Opal's compiler options
      • +
      + +

      .match?(path)

      + +

      The processor is able to recognize paths suitable for its type of +processing.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +53
      +54
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/builder.rb', line 53
      +
      +def self.register_processor(processor, processor_extensions)
      +  return if processors.include?(processor)
      +  processors << processor
      +  processor_extensions.each { |ext| extensions << ext }
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #already_processedObject + + + + + +

      + + + + +
      +
      +
      +
      +170
      +171
      +172
      +
      +
      # File 'opal/lib/opal/builder.rb', line 170
      +
      +def already_processed
      +  @already_processed ||= Set.new
      +end
      +
      +
      + +
      +

      + + #append_paths(*paths) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +137
      +138
      +139
      +
      +
      # File 'opal/lib/opal/builder.rb', line 137
      +
      +def append_paths(*paths)
      +  path_reader.append_paths(*paths)
      +end
      +
      +
      + +
      +

      + + #build(path, options = {}) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +91
      +92
      +93
      +
      +
      # File 'opal/lib/opal/builder.rb', line 91
      +
      +def build(path, options = {})
      +  build_str(source_for(path), path, options)
      +end
      +
      +
      + +
      +

      + + #build_require(path, options = {}) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +112
      +113
      +114
      +
      +
      # File 'opal/lib/opal/builder.rb', line 112
      +
      +def build_require(path, options = {})
      +  process_require(path, [], options)
      +end
      +
      +
      + +
      +

      + + #build_str(source, rel_path, options = {}) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +
      +
      # File 'opal/lib/opal/builder.rb', line 100
      +
      +def build_str(source, rel_path, options = {})
      +  return if source.nil?
      +  abs_path = expand_path(rel_path)
      +  rel_path = expand_ext(rel_path)
      +  asset = processor_for(source, rel_path, abs_path, false, options)
      +  requires = preload + asset.requires + tree_requires(asset, abs_path)
      +  # Don't automatically load modules required by the module
      +  process_requires(rel_path, requires, asset.autoloads, options.merge(load: false))
      +  processed << asset
      +  self
      +end
      +
      +
      + +
      +

      + + #dependent_filesObject + + + + + +

      +
      +

      Return a list of dependent files, for watching purposes

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +196
      +197
      +198
      +
      +
      # File 'opal/lib/opal/builder.rb', line 196
      +
      +def dependent_files
      +  processed.map(&:abs_path).compact.select { |fn| File.exist?(fn) }
      +end
      +
      +
      + +
      +

      + + #esm?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +181
      +182
      +183
      +
      +
      # File 'opal/lib/opal/builder.rb', line 181
      +
      +def esm?
      +  @compiler_options[:esm]
      +end
      +
      +
      + +
      +

      + + #expand_ext(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +211
      +
      +
      # File 'opal/lib/opal/builder.rb', line 200
      +
      +def expand_ext(path)
      +  abs_path = path_reader.expand(path)
      +
      +  if abs_path
      +    File.join(
      +      File.dirname(path),
      +      File.basename(abs_path)
      +    )
      +  else
      +    path
      +  end
      +end
      +
      +
      + +
      +

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

      + + + + +
      +
      +
      +
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +
      +
      # File 'opal/lib/opal/builder.rb', line 116
      +
      +def initialize_copy(other)
      +  super
      +  @stubs = other.stubs.dup
      +  @preload = other.preload.dup
      +  @processors = other.processors.dup
      +  @path_reader = other.path_reader.dup
      +  @prerequired = other.prerequired.dup
      +  @compiler_options = other.compiler_options.dup
      +  @missing_require_severity = other.missing_require_severity.to_sym
      +  @processed = other.processed.dup
      +  @scheduler = other.scheduler.dup.tap { |i| i.builder = self }
      +end
      +
      +
      + +
      +

      + + #output_extensionObject + + + + + +

      +
      +

      Output extension, to be used by runners. At least Node.JS switches +to ESM mode only if the extension is "mjs"

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +187
      +188
      +189
      +190
      +191
      +192
      +193
      +
      +
      # File 'opal/lib/opal/builder.rb', line 187
      +
      +def output_extension
      +  if esm?
      +    'mjs'
      +  else
      +    'js'
      +  end
      +end
      +
      +
      + +
      +

      + + #process_require(rel_path, autoloads, options) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +163
      +164
      +165
      +166
      +167
      +168
      +
      +
      # File 'opal/lib/opal/builder.rb', line 163
      +
      +def process_require(rel_path, autoloads, options)
      +  return if already_processed.include?(rel_path)
      +  already_processed << rel_path
      +  asset = process_require_threadsafely(rel_path, autoloads, options)
      +  processed << asset if asset
      +end
      +
      +
      + +
      +

      + + #process_require_threadsafely(rel_path, autoloads, options) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +160
      +161
      +
      +
      # File 'opal/lib/opal/builder.rb', line 141
      +
      +def process_require_threadsafely(rel_path, autoloads, options)
      +  return if prerequired.include?(rel_path)
      +
      +  autoload = autoloads.include? rel_path
      +
      +  source = stub?(rel_path) ? '' : read(rel_path, autoload)
      +
      +  # The handling is delegated to the runtime
      +  return if source.nil?
      +
      +  abs_path = expand_path(rel_path)
      +  rel_path = expand_ext(rel_path)
      +  asset = processor_for(source, rel_path, abs_path, autoload, options.merge(requirable: true))
      +  process_requires(
      +    rel_path,
      +    asset.requires + tree_requires(asset, abs_path),
      +    asset.autoloads,
      +    options
      +  )
      +  asset
      +end
      +
      +
      + +
      +

      + + #source_for(path) ⇒ Object + + + + + +

      +
      +

      Retrieve the source for a given path the same way #build would do.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +96
      +97
      +98
      +
      +
      # File 'opal/lib/opal/builder.rb', line 96
      +
      +def source_for(path)
      +  read(path, false)
      +end
      +
      +
      + +
      +

      + + #source_mapObject + + + + + +

      + + + + +
      +
      +
      +
      +133
      +134
      +135
      +
      +
      # File 'opal/lib/opal/builder.rb', line 133
      +
      +def source_map
      +  ::Opal::SourceMap::Index.new(processed.map(&:source_map), join: "\n")
      +end
      +
      +
      + +
      +

      + + #to_sObject + + + + + +

      + + + + +
      +
      +
      +
      +129
      +130
      +131
      +
      +
      # File 'opal/lib/opal/builder.rb', line 129
      +
      +def to_s
      +  processed.map(&:to_s).join("\n")
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Builder/MissingRequire.html b/docs/api/v1.8.2/lib/Opal/Builder/MissingRequire.html new file mode 100644 index 00000000..d42f4466 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Builder/MissingRequire.html @@ -0,0 +1,126 @@ + + + + + + + Exception: Opal::Builder::MissingRequire + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::Builder::MissingRequire + + + +

      +
      + +
      +
      Inherits:
      +
      + LoadError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder.rb
      +
      + +
      + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Builder/ProcessorNotFound.html b/docs/api/v1.8.2/lib/Opal/Builder/ProcessorNotFound.html new file mode 100644 index 00000000..263146bd --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Builder/ProcessorNotFound.html @@ -0,0 +1,126 @@ + + + + + + + Exception: Opal::Builder::ProcessorNotFound + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::Builder::ProcessorNotFound + + + +

      +
      + +
      +
      Inherits:
      +
      + LoadError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder.rb
      +
      + +
      + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors.html new file mode 100644 index 00000000..5f12da6f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors.html @@ -0,0 +1,117 @@ + + + + + + + Module: Opal::BuilderProcessors + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::BuilderProcessors + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: ERBProcessor, JsProcessor, OpalERBProcessor, Processor, RubyERBProcessor, RubyProcessor + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors/ERBProcessor.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/ERBProcessor.html new file mode 100644 index 00000000..dfd720b4 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/ERBProcessor.html @@ -0,0 +1,237 @@ + + + + + + + Class: Opal::BuilderProcessors::ERBProcessor + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderProcessors::ERBProcessor + + + +

      +
      + +
      +
      Inherits:
      +
      + Processor + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + +

      Overview

      +
      +

      This handler is for files named ".js.erb", which ought to +first get preprocessed via ERB, then served verbatim as JS.

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

      Instance Attribute Summary

      + +

      Attributes inherited from Processor

      +

      #abs_path, #autoloads, #filename, #options, #required_trees, #requires

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Processor

      +

      handles, #initialize, #mark_as_required, match?, match_regexp, #to_s

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::BuilderProcessors::Processor

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #sourceObject + + + + + +

      + + + + +
      +
      +
      +
      +168
      +169
      +170
      +171
      +172
      +173
      +174
      +175
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 168
      +
      +def source
      +  erb = ::ERB.new(@source.to_s)
      +  erb.filename = @abs_path
      +
      +  result = erb.result
      +  module_name = ::Opal::Compiler.module_name(@filename)
      +  "Opal.modules[#{module_name.inspect}] = function() {#{result}};"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor.html new file mode 100644 index 00000000..2db9dc43 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor.html @@ -0,0 +1,294 @@ + + + + + + + Class: Opal::BuilderProcessors::JsProcessor + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderProcessors::JsProcessor + + + +

      +
      + +
      +
      Inherits:
      +
      + Processor + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: ManualFragment + + +

      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Processor

      +

      #abs_path, #autoloads, #filename, #options, #required_trees, #requires

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Processor

      +

      handles, #initialize, #mark_as_required, match?, match_regexp, #to_s

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::BuilderProcessors::Processor

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #sourceObject + + + + + +

      + + + + +
      +
      +
      +
      +69
      +70
      +71
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 69
      +
      +def source
      +  @source.to_s + mark_as_required(@filename)
      +end
      +
      +
      + +
      +

      + + #source_mapObject + + + + + +

      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 57
      +
      +def source_map
      +  @source_map ||= begin
      +    manual_fragments = source.each_line.with_index.map do |line_source, index|
      +      column = line_source.index(/\S/)
      +      line = index + 1
      +      ManualFragment.new(line, column, line_source, nil)
      +    end
      +
      +    ::Opal::SourceMap::File.new(manual_fragments, filename, source)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor/ManualFragment.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor/ManualFragment.html new file mode 100644 index 00000000..9bb26ce2 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/JsProcessor/ManualFragment.html @@ -0,0 +1,476 @@ + + + + + + + Class: Opal::BuilderProcessors::JsProcessor::ManualFragment + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderProcessors::JsProcessor::ManualFragment + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #code ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute code.

        +
        + +
      • + + +
      • + + + #column ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute column.

        +
        + +
      • + + +
      • + + + #line ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute line.

        +
        + +
      • + + +
      • + + + #source_map_name ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute source_map_name.

        +
        + +
      • + + +
      + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #codeObject + + + + + +

      +
      +

      Returns the value of attribute code

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of code

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 55
      +
      +def code
      +  @code
      +end
      +
      +
      + + + +
      +

      + + #columnObject + + + + + +

      +
      +

      Returns the value of attribute column

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of column

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 55
      +
      +def column
      +  @column
      +end
      +
      +
      + + + +
      +

      + + #lineObject + + + + + +

      +
      +

      Returns the value of attribute line

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of line

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 55
      +
      +def line
      +  @line
      +end
      +
      +
      + + + +
      +

      + + #source_map_nameObject + + + + + +

      +
      +

      Returns the value of attribute source_map_name

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of source_map_name

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 55
      +
      +def source_map_name
      +  @source_map_name
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors/OpalERBProcessor.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/OpalERBProcessor.html new file mode 100644 index 00000000..3059dbd7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/OpalERBProcessor.html @@ -0,0 +1,309 @@ + + + + + + + Class: Opal::BuilderProcessors::OpalERBProcessor + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderProcessors::OpalERBProcessor + + + +

      +
      + +
      +
      Inherits:
      +
      + RubyProcessor + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + +

      Overview

      +
      +

      This handler is for files named ".opalerb", which ought to +first get compiled to Ruby code using ERB, then with Opal. +Unlike below processors, OpalERBProcessor can be used to +compile templates, which will in turn output HTML. Take +a look at docs/templates.md to understand this subsystem +better.

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

      Instance Attribute Summary

      + +

      Attributes inherited from Processor

      +

      #abs_path, #autoloads, #filename, #options, #required_trees, #source

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from RubyProcessor

      +

      #autoloads, #cache_key, #compiled, #compiler_for, match?, #required_trees, #source, #source_map

      + + + + + + + + + +

      Methods inherited from Processor

      +

      handles, #mark_as_required, match?, match_regexp, #to_s

      +
      +

      Constructor Details

      + +
      +

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

      +
      +

      Returns a new instance of OpalERBProcessor.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +128
      +129
      +130
      +131
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 128
      +
      +def initialize(*args)
      +  super
      +  @source = prepare(@source, @filename)
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #requiresObject + + + + + +

      + + + + +
      +
      +
      +
      +133
      +134
      +135
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 133
      +
      +def requires
      +  ['erb'] + super
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors/Processor.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/Processor.html new file mode 100644 index 00000000..e30ce577 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/Processor.html @@ -0,0 +1,1116 @@ + + + + + + + Class: Opal::BuilderProcessors::Processor + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderProcessors::Processor + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      ERBProcessor, JsProcessor, RubyProcessor

      +
      + + + + +

      Class Attribute Summary collapse

      +
        + +
      • + + + .extensions ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute extensions.

        +
        + +
      • + + +
      + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #abs_path ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute abs_path.

        +
        + +
      • + + +
      • + + + #autoloads ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute autoloads.

        +
        + +
      • + + +
      • + + + #filename ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute filename.

        +
        + +
      • + + +
      • + + + #options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute options.

        +
        + +
      • + + +
      • + + + #required_trees ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute required_trees.

        +
        + +
      • + + +
      • + + + #requires ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute requires.

        +
        + +
      • + + +
      • + + + #source ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute source.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(source, filename, abs_path = nil, options = {}) ⇒ Processor + + + + + +

      +
      +

      Returns a new instance of Processor.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 9
      +
      +def initialize(source, filename, abs_path = nil, options = {})
      +  options = abs_path if abs_path.is_a? Hash
      +
      +  source += "\n" unless source.end_with?("\n")
      +  @source, @filename, @abs_path, @options = source, filename, abs_path, options.dup
      +  @cache = @options.delete(:cache) { Opal.cache }
      +  @requires = []
      +  @required_trees = []
      +  @autoloads = []
      +end
      +
      +
      + +
      + +
      +

      Class Attribute Details

      + + + +
      +

      + + .extensionsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute extensions.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 26
      +
      +def extensions
      +  @extensions
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #abs_pathObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute abs_path.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 19
      +
      +def abs_path
      +  @abs_path
      +end
      +
      +
      + + + +
      +

      + + #autoloadsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute autoloads.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 19
      +
      +def autoloads
      +  @autoloads
      +end
      +
      +
      + + + +
      +

      + + #filenameObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute filename.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 19
      +
      +def filename
      +  @filename
      +end
      +
      +
      + + + +
      +

      + + #optionsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 19
      +
      +def options
      +  @options
      +end
      +
      +
      + + + +
      +

      + + #required_treesObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute required_trees.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 19
      +
      +def required_trees
      +  @required_trees
      +end
      +
      +
      + + + +
      +

      + + #requiresObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute requires.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 19
      +
      +def requires
      +  @requires
      +end
      +
      +
      + + + +
      +

      + + #sourceObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute source.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 19
      +
      +def source
      +  @source
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .handles(*extensions) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 28
      +
      +def handles(*extensions)
      +  @extensions = extensions
      +  matches = extensions.join('|')
      +  matches = "(#{matches})" unless extensions.size == 1
      +  @match_regexp = Regexp.new "\\.#{matches}#{REGEXP_END}"
      +
      +  ::Opal::Builder.register_processor(self, extensions)
      +  nil
      +end
      +
      +
      + +
      +

      + + .match?(other) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 38
      +
      +def match?(other)
      +  other.is_a?(String) && other.match(match_regexp)
      +end
      +
      +
      + +
      +

      + + .match_regexpObject + + + + + +

      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 42
      +
      +def match_regexp
      +  @match_regexp || raise(NotImplementedError)
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #mark_as_required(filename) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +47
      +48
      +49
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 47
      +
      +def mark_as_required(filename)
      +  "Opal.loaded([#{filename.to_s.inspect}]);"
      +end
      +
      +
      + +
      +

      + + #to_sObject + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 21
      +
      +def to_s
      +  source.to_s
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyERBProcessor.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyERBProcessor.html new file mode 100644 index 00000000..098cf41b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyERBProcessor.html @@ -0,0 +1,258 @@ + + + + + + + Class: Opal::BuilderProcessors::RubyERBProcessor + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderProcessors::RubyERBProcessor + + + +

      +
      + +
      +
      Inherits:
      +
      + RubyProcessor + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + +

      Overview

      +
      +

      This handler is for files named ".rb.erb", which ought to +first get preprocessed via ERB, then via Opal.

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

      Instance Attribute Summary

      + +

      Attributes inherited from Processor

      +

      #abs_path, #autoloads, #filename, #options, #required_trees, #requires, #source

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from RubyProcessor

      +

      #autoloads, #cache_key, #compiler_for, match?, #required_trees, #requires, #source, #source_map

      + + + + + + + + + +

      Methods inherited from Processor

      +

      handles, #initialize, #mark_as_required, match?, match_regexp, #to_s

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::BuilderProcessors::Processor

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compiledObject + + + + + +

      + + + + +
      +
      +
      +
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +160
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 149
      +
      +def compiled
      +  @compiled ||= begin
      +    erb = ::ERB.new(@source.to_s)
      +    erb.filename = @abs_path
      +
      +    @source = erb.result
      +
      +    compiler = compiler_for(@source, file: @filename)
      +    compiler.compile
      +    compiler
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyProcessor.html b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyProcessor.html new file mode 100644 index 00000000..6813f1b2 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderProcessors/RubyProcessor.html @@ -0,0 +1,683 @@ + + + + + + + Class: Opal::BuilderProcessors::RubyProcessor + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderProcessors::RubyProcessor + + + +

      +
      + +
      +
      Inherits:
      +
      + Processor + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_processors.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      OpalERBProcessor, RubyERBProcessor

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Processor

      +

      #abs_path, #filename, #options

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Processor

      +

      handles, #initialize, #mark_as_required, match_regexp, #to_s

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::BuilderProcessors::Processor

      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .match?(other) ⇒ Boolean + + + + + +

      +
      +

      Also catch a files with missing extensions and nil.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +114
      +115
      +116
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 114
      +
      +def self.match?(other)
      +  super || File.extname(other.to_s) == ''
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #autoloadsObject + + + + + +

      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 109
      +
      +def autoloads
      +  compiled.autoloads
      +end
      +
      +
      + +
      +

      + + #cache_keyObject + + + + + +

      + + + + +
      +
      +
      +
      +93
      +94
      +95
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 93
      +
      +def cache_key
      +  [self.class, @filename, @source, @options]
      +end
      +
      +
      + +
      +

      + + #compiledObject + + + + + +

      + + + + +
      +
      +
      +
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 85
      +
      +def compiled
      +  @compiled ||= Opal::Cache.fetch(@cache, cache_key) do
      +    compiler = compiler_for(@source, file: @filename)
      +    compiler.compile
      +    compiler
      +  end
      +end
      +
      +
      + +
      +

      + + #compiler_for(source, options = {}) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +97
      +98
      +99
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 97
      +
      +def compiler_for(source, options = {})
      +  ::Opal::Compiler.new(source, @options.merge(options))
      +end
      +
      +
      + +
      +

      + + #required_treesObject + + + + + +

      + + + + +
      +
      +
      +
      +105
      +106
      +107
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 105
      +
      +def required_trees
      +  compiled.required_trees
      +end
      +
      +
      + +
      +

      + + #requiresObject + + + + + +

      + + + + +
      +
      +
      +
      +101
      +102
      +103
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 101
      +
      +def requires
      +  compiled.requires
      +end
      +
      +
      + +
      +

      + + #sourceObject + + + + + +

      + + + + +
      +
      +
      +
      +77
      +78
      +79
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 77
      +
      +def source
      +  compiled.result
      +end
      +
      +
      + +
      +

      + + #source_mapObject + + + + + +

      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +
      +
      # File 'opal/lib/opal/builder_processors.rb', line 81
      +
      +def source_map
      +  compiled.source_map
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderScheduler.html b/docs/api/v1.8.2/lib/Opal/BuilderScheduler.html new file mode 100644 index 00000000..d3c896b9 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderScheduler.html @@ -0,0 +1,297 @@ + + + + + + + Class: Opal::BuilderScheduler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderScheduler + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_scheduler.rb,
      + opal/lib/opal/builder_scheduler/prefork.rb,
      opal/lib/opal/builder_scheduler/sequential.rb
      +
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      Prefork, Sequential

      +
      +

      Defined Under Namespace

      +

      + + + + + Classes: Prefork, Sequential + + +

      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #builder ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute builder.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(builder) ⇒ BuilderScheduler + + + + + +

      +
      +

      Returns a new instance of BuilderScheduler.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/builder_scheduler.rb', line 7
      +
      +def initialize(builder)
      +  @builder = builder
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #builderObject + + + + + +

      +
      +

      Returns the value of attribute builder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +
      +
      # File 'opal/lib/opal/builder_scheduler.rb', line 11
      +
      +def builder
      +  @builder
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork.html b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork.html new file mode 100644 index 00000000..68c288d4 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork.html @@ -0,0 +1,261 @@ + + + + + + + Class: Opal::BuilderScheduler::Prefork + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderScheduler::Prefork + + + +

      +
      + +
      +
      Inherits:
      +
      + Opal::BuilderScheduler + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_scheduler/prefork.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: OrderCorrector + + + + Classes: Fork, ForkSet + + +

      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Opal::BuilderScheduler

      +

      #builder

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Opal::BuilderScheduler

      +

      #initialize

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::BuilderScheduler

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #process_requires(rel_path, requires, autoloads, options) ⇒ Object + + + + + +

      +
      +

      We hook into the process_requires method

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 10
      +
      +def process_requires(rel_path, requires, autoloads, options)
      +  return if requires.empty?
      +
      +  if @in_fork
      +    io = @in_fork
      +    io.send(:new_requires, rel_path, requires, autoloads, options)
      +  else
      +    processed = prefork_reactor(rel_path, requires, autoloads, options)
      +
      +    processed = OrderCorrector.correct_order(processed, requires, builder)
      +
      +    builder.processed.append(*processed)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/Fork.html b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/Fork.html new file mode 100644 index 00000000..3c189da8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/Fork.html @@ -0,0 +1,875 @@ + + + + + + + Class: Opal::BuilderScheduler::Prefork::Fork + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderScheduler::Prefork::Fork + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_scheduler/prefork.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(forkset) ⇒ Fork + + + + + +

      +
      +

      Returns a new instance of Fork.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 133
      +
      +def initialize(forkset)
      +  @parent_read, @child_write = IO.pipe(binmode: true)
      +  @child_read, @parent_write = IO.pipe(binmode: true)
      +  @forkset = forkset
      +  @in_fork = false
      +
      +  @pid = fork do
      +    @in_fork = true
      +
      +    begin
      +      @parent_read.close
      +      @parent_write.close
      +
      +      yield(self)
      +    rescue => error
      +      send(:exception, error)
      +    ensure
      +      send(:close) unless write_io.closed?
      +      @child_write.close
      +    end
      +  end
      +
      +  @child_read.close
      +  @child_write.close
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #closeObject + + + + + +

      + + + + +
      +
      +
      +
      +159
      +160
      +161
      +162
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 159
      +
      +def close
      +  send(:close)
      +  @parent_write.close
      +end
      +
      +
      + +
      +

      + + #eof?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +190
      +191
      +192
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 190
      +
      +def eof?
      +  write_io.closed?
      +end
      +
      +
      + +
      +

      + + #fork?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 178
      +
      +def fork?
      +  @in_fork
      +end
      +
      +
      + +
      +

      + + #goodbyeObject + + + + + +

      + + + + +
      +
      +
      +
      +164
      +165
      +166
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 164
      +
      +def goodbye
      +  read_io.close unless read_io.closed?
      +end
      +
      +
      + +
      +

      + + #read_ioObject + + + + + +

      + + + + +
      +
      +
      +
      +182
      +183
      +184
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 182
      +
      +def read_io
      +  fork? ? @child_read : @parent_read
      +end
      +
      +
      + +
      +

      + + #recvObject + + + + + +

      + + + + +
      +
      +
      +
      +198
      +199
      +200
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 198
      +
      +def recv
      +  recv_message(read_io)
      +end
      +
      +
      + +
      +

      + + #recv_message(io) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +173
      +174
      +175
      +176
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 173
      +
      +def recv_message(io)
      +  length, = *io.read(8).unpack('Q')
      +  Marshal.load(io.read(length)) # rubocop:disable Security/MarshalLoad
      +end
      +
      +
      + +
      +

      + + #send(*msg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +194
      +195
      +196
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 194
      +
      +def send(*msg)
      +  send_message(write_io, msg)
      +end
      +
      +
      + +
      +

      + + #send_message(io, msg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +168
      +169
      +170
      +171
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 168
      +
      +def send_message(io, msg)
      +  msg = Marshal.dump(msg)
      +  io.write([msg.length].pack('Q') + msg)
      +end
      +
      +
      + +
      +

      + + #waitObject + + + + + +

      + + + + +
      +
      +
      +
      +202
      +203
      +204
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 202
      +
      +def wait
      +  Process.waitpid(@pid, Process::WNOHANG)
      +end
      +
      +
      + +
      +

      + + #write_ioObject + + + + + +

      + + + + +
      +
      +
      +
      +186
      +187
      +188
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 186
      +
      +def write_io
      +  fork? ? @child_write : @parent_write
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/ForkSet.html b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/ForkSet.html new file mode 100644 index 00000000..165faa56 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/ForkSet.html @@ -0,0 +1,534 @@ + + + + + + + Class: Opal::BuilderScheduler::Prefork::ForkSet + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderScheduler::Prefork::ForkSet + + + +

      +
      + +
      +
      Inherits:
      +
      + Array + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_scheduler/prefork.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(count, &block) ⇒ ForkSet + + + + + +

      +
      +

      Returns a new instance of ForkSet.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 76
      +
      +def initialize(count, &block)
      +  super([])
      +
      +  @count, @block = count, block
      +
      +  create_fork
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #closeObject + + + + + +

      + + + + +
      +
      +
      +
      +123
      +124
      +125
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 123
      +
      +def close
      +  each(&:close)
      +end
      +
      +
      + +
      +

      + + #create_forkObject + + + + + +

      + + + + +
      +
      +
      +
      +115
      +116
      +117
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 115
      +
      +def create_fork
      +  self << Fork.new(self, &@block)
      +end
      +
      +
      + +
      +

      + + #from_io(io, type) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +119
      +120
      +121
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 119
      +
      +def from_io(io, type)
      +  find { |i| i.__send__(type) == io }
      +end
      +
      +
      + +
      +

      + + #get_events(queue_length) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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 'opal/lib/opal/builder_scheduler/prefork.rb', line 84
      +
      +def get_events(queue_length)
      +  # Wait for anything to happen:
      +  # - Either any of our workers return some data
      +  # - Or any workers become ready to receive data
      +  #   - But only if we have enough work for them
      +  ios = IO.select(
      +    map(&:read_io),
      +    sample(queue_length).map(&:write_io),
      +    []
      +  )
      +  return [[], []] unless ios
      +
      +  events = ios[0].map do |io|
      +    io = from_io(io, :read_io)
      +    [io, *io.recv]
      +  end
      +
      +  idles = ios[1].map do |io|
      +    from_io(io, :write_io)
      +  end
      +
      +  # Progressively create forks, because we may not need all
      +  # the workers at the time. The number 6 was picked due to
      +  # some trial and error on a Ryzen machine.
      +  #
      +  # Do note that prefork may happen more than once.
      +  create_fork if length < @count && rand(6) == 1
      +
      +  [events, idles]
      +end
      +
      +
      + +
      +

      + + #waitObject + + + + + +

      + + + + +
      +
      +
      +
      +127
      +128
      +129
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 127
      +
      +def wait
      +  each(&:wait)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/OrderCorrector.html b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/OrderCorrector.html new file mode 100644 index 00000000..ae1f3073 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Prefork/OrderCorrector.html @@ -0,0 +1,354 @@ + + + + + + + Module: Opal::BuilderScheduler::Prefork::OrderCorrector + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::BuilderScheduler::Prefork::OrderCorrector + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_scheduler/prefork.rb
      +
      + +
      + +

      Overview

      +
      +

      Prefork is not deterministic. This module corrects an order of processed +files so that it would be exactly the same as if building sequentially. +While for Ruby files it usually isn't a problem, because the real order +stems from how Opal.modules array is accessed, the JavaScript files +are executed verbatim and their order may be important. Also, having +deterministic output is always a good thing.

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

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .build_require_order_array(requires, requires_hash, built_for = Set.new) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 61
      +
      +def build_require_order_array(requires, requires_hash, built_for = Set.new)
      +  array = []
      +  requires.each do |name|
      +    next if built_for.include?(name)
      +    built_for << name
      +
      +    asset_requires = requires_hash[name]
      +    array += build_require_order_array(asset_requires, requires_hash, built_for) if asset_requires
      +    array << name
      +  end
      +  array
      +end
      +
      +
      + +
      +

      + + .correct_order(processed, requires, builder) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 36
      +
      +def correct_order(processed, requires, builder)
      +  # Let's build a hash that maps a filename to an array of files it requires
      +  requires_hash = processed.to_h do |i|
      +    [i.filename, expand_requires(i.requires, builder)]
      +  end
      +  # Let's build an array with a correct order of requires
      +  order_array = build_require_order_array(expand_requires(requires, builder), requires_hash)
      +  # If a key is duplicated, remove the last duplicate
      +  order_array = order_array.uniq
      +  # Create a hash from this array: [a,b,c] => [a => 0, b => 1, c => 2]
      +  order_hash = order_array.each_with_index.to_h
      +  # Let's return a processed array that has elements in the order provided
      +  processed.sort_by do |asset|
      +    # If a filename isn't present somehow in our hash, let's put it at the end
      +    order_hash[asset.filename] || order_array.length
      +  end
      +end
      +
      +
      + +
      +

      + + .expand_requires(requires, builder) ⇒ Object + + + + + +

      +
      +

      Expand a requires array, so that the requires filenames will be +matching BuilderProcessor#. Builder needs to be passed so that +we can access an expand_ext function from its context.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +
      +
      # File 'opal/lib/opal/builder_scheduler/prefork.rb', line 57
      +
      +def expand_requires(requires, builder)
      +  requires.map { |i| builder.expand_ext(i) }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Sequential.html b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Sequential.html new file mode 100644 index 00000000..d9133464 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/BuilderScheduler/Sequential.html @@ -0,0 +1,220 @@ + + + + + + + Class: Opal::BuilderScheduler::Sequential + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::BuilderScheduler::Sequential + + + +

      +
      + +
      +
      Inherits:
      +
      + Opal::BuilderScheduler + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/builder_scheduler/sequential.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Opal::BuilderScheduler

      +

      #builder

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Opal::BuilderScheduler

      +

      #initialize

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::BuilderScheduler

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #process_requires(rel_path, requires, autoloads, options) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/builder_scheduler/sequential.rb', line 6
      +
      +def process_requires(rel_path, requires, autoloads, options)
      +  requires.map { |r| builder.process_require(r, autoloads, options) }
      +rescue Builder::MissingRequire => error
      +  raise error, "A file required by #{rel_path.inspect} wasn't found.\n#{error.message}", error.backtrace
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CLI.html b/docs/api/v1.8.2/lib/Opal/CLI.html new file mode 100644 index 00000000..4ee34673 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CLI.html @@ -0,0 +1,2602 @@ + + + + + + + Class: Opal::CLI + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CLI + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: Evals + + +

      + + + + +

      Class Attribute Summary collapse

      +
        + +
      • + + + .stdout ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute stdout.

        +
        + +
      • + + +
      + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #argv ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute argv.

        +
        + +
      • + + +
      • + + + #compiler_options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute compiler_options.

        +
        + +
      • + + +
      • + + + #debug ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute debug.

        +
        + +
      • + + +
      • + + + #evals ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute evals.

        +
        + +
      • + + +
      • + + + #exit_status ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute exit_status.

        +
        + +
      • + + +
      • + + + #file ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute file.

        +
        + +
      • + + +
      • + + + #filename ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute filename.

        +
        + +
      • + + +
      • + + + #gems ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute gems.

        +
        + +
      • + + +
      • + + + #lib_only ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute lib_only.

        +
        + +
      • + + +
      • + + + #load_paths ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute load_paths.

        +
        + +
      • + + +
      • + + + #missing_require_severity ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute missing_require_severity.

        +
        + +
      • + + +
      • + + + #no_cache ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute no_cache.

        +
        + +
      • + + +
      • + + + #no_exit ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute no_exit.

        +
        + +
      • + + +
      • + + + #options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute options.

        +
        + +
      • + + +
      • + + + #output ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute output.

        +
        + +
      • + + +
      • + + + #preload ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute preload.

        +
        + +
      • + + +
      • + + + #rbrequires ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute rbrequires.

        +
        + +
      • + + +
      • + + + #requires ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute requires.

        +
        + +
      • + + +
      • + + + #runner_options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute runner_options.

        +
        + +
      • + + +
      • + + + #stdin ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute stdin.

        +
        + +
      • + + +
      • + + + #stubs ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute stubs.

        +
        + +
      • + + +
      • + + + #verbose ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute verbose.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(options = nil) ⇒ CLI + + + + + +

      +
      +

      Returns a new instance of CLI.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +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
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +
      +
      # File 'opal/lib/opal/cli.rb', line 25
      +
      +def initialize(options = nil)
      +  options ||= {}
      +
      +  # Runner
      +  @runner_type    = options.delete(:runner)         || :nodejs
      +  @runner_options = options.delete(:runner_options) || {}
      +
      +  @options     = options
      +  @sexp        = options.delete(:sexp)
      +  @repl        = options.delete(:repl)
      +  @no_exit     = options.delete(:no_exit)
      +  @lib_only    = options.delete(:lib_only)
      +  @argv        = options.delete(:argv)       { [] }
      +  @evals       = options.delete(:evals)      { [] }
      +  @load_paths  = options.delete(:load_paths) { [] }
      +  @gems        = options.delete(:gems)       { [] }
      +  @stubs       = options.delete(:stubs)      { [] }
      +  @preload     = options.delete(:preload)    { [] }
      +  @output      = options.delete(:output)     { self.class.stdout || $stdout }
      +  @verbose     = options.delete(:verbose)    { false }
      +  @debug       = options.delete(:debug)      { false }
      +  @requires    = options.delete(:requires)   { [] }
      +  @rbrequires  = options.delete(:rbrequires) { [] }
      +  @no_cache    = options.delete(:no_cache)   { false }
      +  @stdin       = options.delete(:stdin)      { $stdin }
      +
      +  @debug_source_map = options.delete(:debug_source_map) { false }
      +
      +  @missing_require_severity = options.delete(:missing_require_severity) { Opal::Config.missing_require_severity }
      +
      +  @requires.unshift('opal') unless options.delete(:skip_opal_require)
      +
      +  @compiler_options = compiler_option_names.map do |option|
      +    key = option.to_sym
      +    next unless options.key? key
      +    value = options.delete(key)
      +    [key, value]
      +  end.compact.to_h
      +
      +  if @lib_only
      +    raise ArgumentError, 'no libraries to compile' if @requires.empty?
      +    raise ArgumentError, "can't accept evals, file, or extra arguments in `library only` mode" if @argv.any? || @evals.any?
      +  elsif @evals.any?
      +    @filename = '-e'
      +    @file = Evals.new(@evals.join("\n"))
      +  elsif @argv.first && @argv.first != '-'
      +    @filename = @argv.shift
      +    @file = File.open(@filename)
      +  else
      +    @filename = @argv.shift || '-'
      +    @file = @stdin
      +  end
      +
      +  raise ArgumentError, "unknown options: #{options.inspect}" unless @options.empty?
      +end
      +
      +
      + +
      + +
      +

      Class Attribute Details

      + + + +
      +

      + + .stdoutObject + + + + + +

      +
      +

      Returns the value of attribute stdout.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +
      +
      # File 'opal/lib/opal/cli.rb', line 16
      +
      +def stdout
      +  @stdout
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #argvObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute argv.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def argv
      +  @argv
      +end
      +
      +
      + + + +
      +

      + + #compiler_optionsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute compiler_options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def compiler_options
      +  @compiler_options
      +end
      +
      +
      + + + +
      +

      + + #debugObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute debug.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def debug
      +  @debug
      +end
      +
      +
      + + + +
      +

      + + #evalsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute evals.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def evals
      +  @evals
      +end
      +
      +
      + + + +
      +

      + + #exit_statusObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute exit_status.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +116
      +117
      +118
      +
      +
      # File 'opal/lib/opal/cli.rb', line 116
      +
      +def exit_status
      +  @exit_status
      +end
      +
      +
      + + + +
      +

      + + #fileObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute file.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def file
      +  @file
      +end
      +
      +
      + + + +
      +

      + + #filenameObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute filename.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def filename
      +  @filename
      +end
      +
      +
      + + + +
      +

      + + #gemsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute gems.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def gems
      +  @gems
      +end
      +
      +
      + + + +
      +

      + + #lib_onlyObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute lib_only.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def lib_only
      +  @lib_only
      +end
      +
      +
      + + + +
      +

      + + #load_pathsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute load_paths.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def load_paths
      +  @load_paths
      +end
      +
      +
      + + + +
      +

      + + #missing_require_severityObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute missing_require_severity.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def missing_require_severity
      +  @missing_require_severity
      +end
      +
      +
      + + + +
      +

      + + #no_cacheObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute no_cache.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def no_cache
      +  @no_cache
      +end
      +
      +
      + + + +
      +

      + + #no_exitObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute no_exit.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def no_exit
      +  @no_exit
      +end
      +
      +
      + + + +
      +

      + + #optionsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def options
      +  @options
      +end
      +
      +
      + + + +
      +

      + + #outputObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute output.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def output
      +  @output
      +end
      +
      +
      + + + +
      +

      + + #preloadObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute preload.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def preload
      +  @preload
      +end
      +
      +
      + + + +
      +

      + + #rbrequiresObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute rbrequires.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def rbrequires
      +  @rbrequires
      +end
      +
      +
      + + + +
      +

      + + #requiresObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute requires.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def requires
      +  @requires
      +end
      +
      +
      + + + +
      +

      + + #runner_optionsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute runner_options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def runner_options
      +  @runner_options
      +end
      +
      +
      + + + +
      +

      + + #stdinObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute stdin.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def stdin
      +  @stdin
      +end
      +
      +
      + + + +
      +

      + + #stubsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute stubs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def stubs
      +  @stubs
      +end
      +
      +
      + + + +
      +

      + + #verboseObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute verbose.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli.rb', line 10
      +
      +def verbose
      +  @verbose
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compiler_option_namesObject + + + + + +

      + + + + +
      +
      +
      +
      +181
      +182
      +183
      +184
      +185
      +186
      +187
      +188
      +189
      +190
      +191
      +192
      +193
      +194
      +195
      +
      +
      # File 'opal/lib/opal/cli.rb', line 181
      +
      +def compiler_option_names
      +  %w[
      +    method_missing
      +    arity_check
      +    dynamic_require_severity
      +    source_map_enabled
      +    irb_enabled
      +    inline_operators
      +    enable_source_location
      +    enable_file_source_embed
      +    use_strict
      +    parse_comments
      +    esm
      +  ]
      +end
      +
      +
      + +
      +

      + + #create_builderObject + + + + + +

      + + + + +
      +
      +
      +
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +
      +
      # File 'opal/lib/opal/cli.rb', line 118
      +
      +def create_builder
      +  builder = Opal::Builder.new(
      +    stubs: stubs,
      +    compiler_options: compiler_options,
      +    missing_require_severity: missing_require_severity,
      +  )
      +
      +  # --no-cache
      +  builder.cache = Opal::Cache::NullCache.new if no_cache
      +
      +  # --include
      +  builder.append_paths(*load_paths)
      +
      +  # --gem
      +  gems.each { |gem_name| builder.use_gem gem_name }
      +
      +  # --require
      +  requires.each { |required| builder.build(required, requirable: true, load: true) }
      +
      +  # --preload
      +  preload.each { |path| builder.build_require(path) }
      +
      +  # --verbose
      +  builder.build_str '$VERBOSE = true', '(flags)', no_export: true if verbose
      +
      +  # --debug
      +  builder.build_str '$DEBUG = true', '(flags)', no_export: true if debug
      +
      +  # --eval / stdin / file
      +  source = evals_or_file_source
      +  builder.build_str(source, filename) if source
      +
      +  # --no-exit
      +  builder.build_str '::Kernel.exit', '(exit)', no_export: true unless no_exit
      +
      +  builder
      +end
      +
      +
      + +
      +

      + + #debug_source_mapObject + + + + + +

      + + + + +
      +
      +
      +
      +165
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +174
      +175
      +176
      +177
      +178
      +179
      +
      +
      # File 'opal/lib/opal/cli.rb', line 165
      +
      +def debug_source_map
      +  source = evals_or_file_source or return # rubocop:disable Style/AndOr
      +
      +  compiler = Opal::Compiler.new(source, file: filename, **compiler_options)
      +
      +  compiler.compile
      +
      +  b64 = [
      +    compiler.result,
      +    compiler.source_map.to_json,
      +    evals_or_file_source,
      +  ].map { |i| Base64.strict_encode64(i) }.join(',')
      +
      +  output.puts "https://sokra.github.io/source-map-visualization/#base64,#{b64}"
      +end
      +
      +
      + +
      +

      + + #evals_or_file_sourceObject + + + + + +

      +
      +

      Internal: Yields a string of source code and the proper filename for either + evals, stdin or a filepath.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +211
      +212
      +213
      +214
      +215
      +216
      +217
      +218
      +219
      +220
      +
      +
      # File 'opal/lib/opal/cli.rb', line 199
      +
      +def evals_or_file_source
      +  return if lib_only # --library
      +  return @cached_content if @cached_content
      +
      +  unless file.tty?
      +    begin
      +      file.rewind
      +      can_read_again = true
      +    rescue Errno::ESPIPE # rubocop:disable Lint/HandleExceptions
      +      # noop
      +    end
      +  end
      +
      +  if @cached_content.nil? || can_read_again
      +    # On MacOS file.read is not enough to pick up changes, probably due to some
      +    # cache or buffer, unclear if coming from ruby or the OS.
      +    content = File.file?(file) ? File.read(file) : file.read
      +  end
      +
      +  @cached_content ||= content unless can_read_again
      +  content
      +end
      +
      +
      + +
      +

      + + #runObject + + + + + +

      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +
      +
      # File 'opal/lib/opal/cli.rb', line 81
      +
      +def run
      +  return show_sexp if @sexp
      +  return debug_source_map if @debug_source_map
      +  return run_repl if @repl
      +
      +  rbrequires.each { |file| require file }
      +
      +  runner = self.runner
      +
      +  # Some runners may need to use a dynamic builder, that is,
      +  # a builder that will try to build the entire package every time
      +  # a page is loaded - for example a Server runner that needs to
      +  # rerun if files are changed.
      +  builder = proc { create_builder }
      +
      +  @exit_status = runner.call(
      +    options: runner_options,
      +    output: output,
      +    argv: argv,
      +    builder: builder,
      +  )
      +end
      +
      +
      + +
      +

      + + #run_replObject + + + + + +

      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +112
      +113
      +114
      +
      +
      # File 'opal/lib/opal/cli.rb', line 109
      +
      +def run_repl
      +  require 'opal/repl'
      +
      +  repl = REPL.new
      +  repl.run(argv)
      +end
      +
      +
      + +
      +

      + + #runnerObject + + + + + +

      + + + + +
      +
      +
      +
      +104
      +105
      +106
      +107
      +
      +
      # File 'opal/lib/opal/cli.rb', line 104
      +
      +def runner
      +  CliRunners[@runner_type] ||
      +    raise(ArgumentError, "unknown runner: #{@runner_type.inspect}")
      +end
      +
      +
      + +
      +

      + + #show_sexpObject + + + + + +

      + + + + +
      +
      +
      +
      +156
      +157
      +158
      +159
      +160
      +161
      +162
      +163
      +
      +
      # File 'opal/lib/opal/cli.rb', line 156
      +
      +def show_sexp
      +  source = evals_or_file_source or return # rubocop:disable Style/AndOr
      +
      +  buffer = ::Opal::Parser::SourceBuffer.new(filename)
      +  buffer.source = source
      +  sexp = Opal::Parser.default_parser.parse(buffer)
      +  output.puts sexp.inspect
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CLI/Evals.html b/docs/api/v1.8.2/lib/Opal/CLI/Evals.html new file mode 100644 index 00000000..ff4b5878 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CLI/Evals.html @@ -0,0 +1,195 @@ + + + + + + + Class: Opal::CLI::Evals + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CLI::Evals + + + +

      +
      + +
      +
      Inherits:
      +
      + StringIO + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #to_pathObject + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/cli.rb', line 20
      +
      +def to_path
      +  '-e'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CLIOptions.html b/docs/api/v1.8.2/lib/Opal/CLIOptions.html new file mode 100644 index 00000000..713e04e7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CLIOptions.html @@ -0,0 +1,704 @@ + + + + + + + Class: Opal::CLIOptions + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CLIOptions + + + +

      +
      + +
      +
      Inherits:
      +
      + OptionParser + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_options.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute options.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initializeCLIOptions + + + + + +

      +
      +

      Returns a new instance of CLIOptions.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +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
      +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
      +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
      +
      +
      # File 'opal/lib/opal/cli_options.rb', line 8
      +
      +def initialize
      +  super
      +  @options = {}
      +
      +  self.banner = 'Usage: opal [options] -- [programfile]'
      +
      +  separator ''
      +
      +  on('--repl', 'Run the Opal REPL') do
      +    options[:repl] = true
      +  end
      +
      +  on('-v', '--verbose', 'print version number, then turn on verbose mode') do
      +    print_version
      +    exit if ARGV.empty?
      +    options[:verbose] = true
      +  end
      +
      +  on('--verbose', 'turn on verbose mode (set $VERBOSE to true)') do
      +    options[:verbose] = true
      +  end
      +
      +  on('-d', '--debug', 'turn on debug mode (set $DEBUG to true)') do
      +    options[:debug] = true
      +  end
      +
      +  on('--version', 'Print the version') do
      +    print_version
      +    exit
      +  end
      +
      +  on('-h', '--help', 'Show this message') do
      +    puts self
      +    exit
      +  end
      +
      +  section 'Basic Options:'
      +
      +  on('-e', '--eval SOURCE', String,
      +    'One line of script. Several -e\'s allowed. Omit [programfile]'
      +  ) do |source|
      +    options[:evals] ||= []
      +    options[:evals] << source
      +  end
      +
      +  on('-r', '--require LIBRARY', String,
      +    'Require the library before executing your script'
      +  ) do |library|
      +    options[:requires] ||= []
      +    options[:requires] << library
      +  end
      +
      +  on('-q', '--rbrequire LIBRARY', String,
      +    'Require the library in Ruby context before compiling'
      +  ) do |library|
      +    options[:rbrequires] ||= []
      +    options[:rbrequires] << library
      +  end
      +
      +  on('-I', '--include DIR', 'Append a load path (may be used more than once)') do |i|
      +    options[:load_paths] ||= []
      +    options[:load_paths] << i
      +  end
      +
      +  on('-s', '--stub FILE', String, 'Stubbed files will be compiled as empty files') do |stub|
      +    options[:stubs] ||= []
      +    options[:stubs] << stub
      +  end
      +
      +  on('-p', '--preload FILE', String, 'Preloaded files will be prepared for dynamic requires') do |stub|
      +    options[:preload] ||= []
      +    options[:preload] << stub
      +  end
      +
      +  on('-g', '--gem GEM_NAME', String, 'Adds the specified GEM_NAME to Opal\'s load path.') do |g|
      +    options[:gems] ||= []
      +    options[:gems] << g
      +  end
      +
      +  section 'Running Options:'
      +
      +  on('-R', '--runner RUNNER', Opal::CliRunners.to_h.keys, 'Choose the runner:', "nodejs (default), #{(Opal::CliRunners.to_h.keys - %i[nodejs compiler]).join(', ')}") do |runner|
      +    options[:runner] = runner.to_sym
      +  end
      +
      +  on('--server-port PORT', 'Set the port for the server runner (default port: 3000)') do |port|
      +    options[:runner_options] ||= {}
      +    options[:runner_options][:port] = port.to_i
      +  end
      +
      +  on('--runner-options JSON', 'Set options specific to the selected runner as a JSON string (e.g. port for server)') do |json_options|
      +    require 'json'
      +    runner_options = JSON.parse(json_options, symbolize_names: true)
      +    options[:runner_options] ||= {}
      +    options[:runner_options].merge!(runner_options)
      +  end
      +
      +  section 'Builder Options:'
      +
      +  on('-c', '--compile', 'Compile to JavaScript') do
      +    options[:runner] = :compiler
      +  end
      +
      +  on('-o', '--output FILE', 'Output JavaScript to FILE') do |file|
      +    options[:output] = File.open(file, 'w')
      +  end
      +
      +  on('-P', '--map FILE', 'Output source map to FILE') do |file|
      +    options[:runner_options] ||= {}
      +    options[:runner_options][:map_file] = file
      +  end
      +
      +  on('--no-source-map', "Don't append source map to a compiled file") do
      +    options[:runner_options] ||= {}
      +    options[:runner_options][:no_source_map] = true
      +  end
      +
      +  on('--watch', 'Run the compiler in foreground, recompiling every filesystem change') do
      +    options[:runner_options] ||= {}
      +    options[:runner_options][:watch] = true
      +  end
      +
      +  on('--no-cache', 'Disable filesystem cache') do
      +    options[:no_cache] = true
      +  end
      +
      +  on('-L', '--library', 'Compile only required libraries. Omit [programfile] and [-e]. Assumed [-cOE].') do
      +    options[:lib_only] = true
      +    options[:no_exit] = true
      +    options[:compile] = true
      +    options[:skip_opal_require] = true
      +  end
      +
      +  on('-O', '--no-opal', 'Disable implicit `require "opal"`') do
      +    options[:skip_opal_require] = true
      +  end
      +
      +  on('-E', '--no-exit', 'Do not append a Kernel#exit at the end of file') do
      +    options[:no_exit] = true
      +  end
      +
      +  section 'Compiler Options:'
      +
      +  on('--use-strict', 'Enables JavaScript\'s strict mode (i.e., adds \'use strict\'; statement)') do
      +    options[:use_strict] = true
      +  end
      +
      +  on('--esm', 'Wraps compiled bundle as for ES6 module') do
      +    options[:esm] = true
      +  end
      +
      +  on('-A', '--arity-check', 'Enable arity check') do
      +    options[:arity_check] = true
      +  end
      +
      +  dynamic_require_levels = %w[error warning ignore]
      +  on('-D', '--dynamic-require LEVEL', dynamic_require_levels,
      +    'Set level of dynamic require severity.',
      +    "(default: error, values: #{dynamic_require_levels.join(', ')})"
      +  ) do |level|
      +    options[:dynamic_require_severity] = level.to_sym
      +  end
      +
      +  missing_require_levels = %w[error warning ignore]
      +  on('--missing-require LEVEL', missing_require_levels,
      +    'Set level of missing require severity.',
      +    "(default: error, values: #{missing_require_levels.join(', ')})"
      +  ) do |level|
      +    options[:missing_require_severity] = level.to_sym
      +  end
      +
      +  on('--enable-source-location', 'Compiles source location for each method definition.') do
      +    options[:enable_source_location] = true
      +  end
      +
      +  on('--parse-comments', 'Compiles comments for each method definition.') do
      +    options[:parse_comments] = true
      +  end
      +
      +  on('--enable-file-source-embed', 'Embeds file sources to be accessed by applications.') do
      +    options[:enable_file_source_embed] = true
      +  end
      +
      +  on('--irb', 'Enable IRB var mode') do
      +    options[:irb] = true
      +  end
      +
      +  on('-M', '--no-method-missing', 'Disable method missing') do
      +    options[:method_missing] = false
      +  end
      +
      +  on('-F', '--file FILE', 'Set filename for compiled code') do |file|
      +    options[:file] = file
      +  end
      +
      +  on('-V', '(deprecated; always enabled) Enable inline Operators') do
      +    warn '* -V is deprecated and has no effect'
      +    options[:inline_operators] = true
      +  end
      +
      +  section 'Debug Options:'
      +
      +  on('--sexp', 'Show Sexps') do
      +    options[:sexp] = true
      +  end
      +
      +  on('--debug-source-map', 'Debug source map') do
      +    options[:debug_source_map] = true
      +  end
      +
      +  separator ''
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #optionsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +221
      +222
      +223
      +
      +
      # File 'opal/lib/opal/cli_options.rb', line 221
      +
      +def options
      +  @options
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Cache.html b/docs/api/v1.8.2/lib/Opal/Cache.html new file mode 100644 index 00000000..7c631861 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Cache.html @@ -0,0 +1,332 @@ + + + + + + + Module: Opal::Cache + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Cache + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cache.rb,
      + opal/lib/opal/cache/file_cache.rb
      +
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: FileCache, NullCache + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .digest(string) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +
      +
      # File 'opal/lib/opal/cache.rb', line 61
      +
      +def digest(string)
      +  ::Digest::SHA256.hexdigest(string)[-32..-1].to_i(16).to_s(36)
      +end
      +
      +
      + +
      +

      + + .fetch(cache, key, &block) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +
      +
      # File 'opal/lib/opal/cache.rb', line 33
      +
      +def fetch(cache, key, &block)
      +  # Extension to the Sprockets API of Cache, if a cache responds
      +  # to #fetch, then we call it instead of using #get and #set.
      +  return cache.fetch(key, &block) if cache.respond_to? :fetch
      +
      +  key = digest(key.join('/')) + '-' + runtime_key
      +
      +  data = cache.get(key)
      +
      +  data || begin
      +            compiler = yield
      +            cache.set(key, compiler) unless compiler.dynamic_cache_result
      +            compiler
      +          end
      +end
      +
      +
      + +
      +

      + + .runtime_keyObject + + + + + +

      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +
      +
      # File 'opal/lib/opal/cache.rb', line 49
      +
      +def runtime_key
      +  @runtime_key ||= begin
      +    files = Opal.dependent_files
      +
      +    digest [
      +      files.sort.map { |f| "#{f}:#{File.size(f)}:#{File.mtime(f).to_f}" },
      +      RUBY_VERSION,
      +      RUBY_PATCHLEVEL
      +    ].join('/')
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Cache/FileCache.html b/docs/api/v1.8.2/lib/Opal/Cache/FileCache.html new file mode 100644 index 00000000..df8c70bb --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Cache/FileCache.html @@ -0,0 +1,584 @@ + + + + + + + Class: Opal::Cache::FileCache + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Cache::FileCache + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cache/file_cache.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(dir: nil, max_size: nil) ⇒ FileCache + + + + + +

      +
      +

      Returns a new instance of FileCache.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +
      +
      # File 'opal/lib/opal/cache/file_cache.rb', line 9
      +
      +def initialize(dir: nil, max_size: nil)
      +  @dir = dir || self.class.find_dir
      +  # Store at most 32MB of cache - de facto this 32MB is larger,
      +  # as we don't account for inode size for instance. In fact, it's
      +  # about 50M. Also we run this check before anything runs, so things
      +  # may go up to 64M or even larger.
      +  @max_size = max_size || 32 * 1024 * 1024
      +
      +  tidy_up_cache
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .dir_writable?(*paths) ⇒ Boolean + + + + + +

      +
      +

      Check if we can robustly mkdir_p a directory.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +
      +
      # File 'opal/lib/opal/cache/file_cache.rb', line 82
      +
      +def self.dir_writable?(*paths)
      +  return false unless File.exist?(paths.first)
      +
      +  until paths.empty?
      +    dir = File.expand_path(paths.shift, dir)
      +    ok = File.directory?(dir) && File.writable?(dir) if File.exist?(dir)
      +  end
      +
      +  dir if ok
      +end
      +
      +
      + +
      +

      + + .find_dirObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/cache/file_cache.rb', line 93
      +
      +def self.find_dir
      +  @find_dir ||= case
      +                # Try to write cache into a directory pointed by an environment variable if present
      +                when dir = ENV['OPAL_CACHE_DIR']
      +                  FileUtils.mkdir_p(dir)
      +                  dir
      +                # Otherwise, we write to the place where Opal is installed...
      +                # I don't think it's a good location to store cache, so many things can go wrong.
      +                # when dir = dir_writable?(Opal.gem_dir, '..', 'tmp', 'cache')
      +                #   FileUtils.mkdir_p(dir)
      +                #   FileUtils.chmod(0o700, dir)
      +                #   dir
      +                # Otherwise, ~/.cache/opal...
      +                when dir = dir_writable?(Dir.home, '.cache', 'opal')
      +                  FileUtils.mkdir_p(dir)
      +                  FileUtils.chmod(0o700, dir)
      +                  dir
      +                # Only /tmp is writable... or isn't it?
      +                when (dir = dir_writable?('/tmp', "opal-cache-#{ENV['USER']}")) && File.sticky?('/tmp')
      +                  FileUtils.mkdir_p(dir)
      +                  FileUtils.chmod(0o700, dir)
      +                  dir
      +                # No way... we can't write anywhere...
      +                else
      +                  warn "Couldn't find a writable path to store Opal cache. " \
      +                       'Try setting OPAL_CACHE_DIR environment variable'
      +                  nil
      +                end
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #get(key) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +
      +
      # File 'opal/lib/opal/cache/file_cache.rb', line 39
      +
      +def get(key)
      +  file = cache_filename_for(key)
      +
      +  if File.exist?(file)
      +    FileUtils.touch(file)
      +    out = File.binread(file)
      +    out = Zlib.gunzip(out)
      +    Marshal.load(out) # rubocop:disable Security/MarshalLoad
      +  end
      +rescue Zlib::GzipFile::Error
      +  nil
      +end
      +
      +
      + +
      +

      + + #set(key, data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/cache/file_cache.rb', line 20
      +
      +def set(key, data)
      +  file = cache_filename_for(key)
      +  out = Marshal.dump(data)
      +
      +  # Sometimes `Zlib::BufError` gets raised, unsure why, makes no sense, possibly
      +  # some race condition (see https://github.com/ruby/zlib/issues/49).
      +  # Limit the number of retries to avoid infinite loops.
      +  retries = 5
      +  begin
      +    out = Zlib.gzip(out, level: 9)
      +  rescue Zlib::BufError
      +    warn "\n[Opal]: Zlib::BufError; retrying (#{retries} retries left)"
      +    retries -= 1
      +    retry if retries > 0
      +  end
      +
      +  File.binwrite(file, out)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Cache/NullCache.html b/docs/api/v1.8.2/lib/Opal/Cache/NullCache.html new file mode 100644 index 00000000..e6977420 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Cache/NullCache.html @@ -0,0 +1,192 @@ + + + + + + + Class: Opal::Cache::NullCache + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Cache::NullCache + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cache.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #fetchObject + + + + + +

      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/cache.rb', line 26
      +
      +def fetch(*)
      +  yield
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners.html b/docs/api/v1.8.2/lib/Opal/CliRunners.html new file mode 100644 index 00000000..be4cc3c6 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners.html @@ -0,0 +1,586 @@ + + + + + + + Module: Opal::CliRunners + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::CliRunners + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners.rb,
      + opal/lib/opal/cli_runners/gjs.rb,
      opal/lib/opal/cli_runners/deno.rb,
      opal/lib/opal/cli_runners/chrome.rb,
      opal/lib/opal/cli_runners/nodejs.rb,
      opal/lib/opal/cli_runners/safari.rb,
      opal/lib/opal/cli_runners/server.rb,
      opal/lib/opal/cli_runners/firefox.rb,
      opal/lib/opal/cli_runners/nashorn.rb,
      opal/lib/opal/cli_runners/quickjs.rb,
      opal/lib/opal/cli_runners/mini_racer.rb,
      opal/lib/opal/cli_runners/applescript.rb
      +
      +
      + +
      + +

      Overview

      +
      +

      Opal::CliRunners is the register in which JavaScript runners can be +defined for use by Opal::CLI. Runners will be called via the #call +method and passed a Hash containing the following keys:

      + +
        +
      • options: a hash of options for the runner
      • +
      • output: an IO-like object responding to #write and #puts
      • +
      • argv: is the arguments vector coming from the CLI that is being +forwarded to the program
      • +
      • builder: a proc returning a new instance of Opal::Builder so it +can be re-created and pick up the most up-to-date sources
      • +
      + +

      Runners can be registered using #register_runner(name, runner).

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Applescript, Chrome, Compiler, Deno, Firefox, Gjs, MiniRacer, Nashorn, Nodejs, Quickjs, RunnerError, Safari, Server + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .[](name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +
      +
      # File 'opal/lib/opal/cli_runners.rb', line 32
      +
      +def self.[](name)
      +  @register[name.to_sym]&.call
      +end
      +
      +
      + +
      +

      + + .[]=(name, runner) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/cli_runners.rb', line 37
      +
      +def self.[]=(name, runner)
      +  warn "Overwriting Opal CLI runner: #{name}" if @register.key? name.to_sym
      +
      +  @register[name.to_sym] = runner
      +end
      +
      +
      + +
      +

      + + .alias_runner(new_name, old_name) ⇒ Object + + + + + +

      +
      +

      Alias a runner name

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/cli_runners.rb', line 68
      +
      +def self.alias_runner(new_name, old_name)
      +  self[new_name.to_sym] = -> { self[old_name.to_sym] }
      +
      +  nil
      +end
      +
      +
      + +
      +

      + + .register_runner(name, runner, path = nil) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + name + + + (Symbol) + + + + — +

        the name at which the runner can be reached

        +
        + +
      • + +
      • + + runner + + + (#call) + + + + — +

        a callable object that will act as the "runner"

        +
        + +
      • + +
      • + + runner + + + (Symbol) + + + + — +

        a constant name that once autoloaded will point to +a callable.

        +
        + +
      • + +
      • + + path + + + (nil, String) + + + (defaults to: nil) + + + — +

        a path for setting up autoload on the constant

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +
      +
      # File 'opal/lib/opal/cli_runners.rb', line 53
      +
      +def self.register_runner(name, runner, path = nil)
      +  autoload runner, path if path
      +
      +  @runners.push(runner.to_s)
      +
      +  if runner.respond_to? :call
      +    self[name] = -> { runner }
      +  else
      +    self[name] = -> { const_get(runner) }
      +  end
      +
      +  nil
      +end
      +
      +
      + +
      +

      + + .registered_runnersObject + + + + + +

      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/cli_runners.rb', line 26
      +
      +def self.registered_runners
      +  @runners
      +end
      +
      +
      + +
      +

      + + .to_hObject + + + + + +

      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/cli_runners.rb', line 44
      +
      +def self.to_h
      +  @register
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript.html new file mode 100644 index 00000000..bc549267 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript.html @@ -0,0 +1,220 @@ + + + + + + + Class: Opal::CliRunners::Applescript + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Applescript + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/applescript.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: MissingAppleScript, MissingJavaScriptSupport + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/cli_runners/applescript.rb', line 8
      +
      +def self.call(data)
      +  unless system('which osalang > /dev/null')
      +    raise MissingJavaScriptSupport, 'JavaScript Automation is only supported by OS X Yosemite and above.'
      +  end
      +
      +  SystemRunner.call(data) do |tempfile|
      +    tempfile.puts "'';" # OSAScript will output the last thing
      +    ['osascript', '-l', 'JavaScript', tempfile.path, *data[:argv]]
      +  end
      +rescue Errno::ENOENT
      +  raise MissingAppleScript, 'AppleScript is only available on Mac OS X.'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingAppleScript.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingAppleScript.html new file mode 100644 index 00000000..2230b9a5 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingAppleScript.html @@ -0,0 +1,134 @@ + + + + + + + Exception: Opal::CliRunners::Applescript::MissingAppleScript + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::Applescript::MissingAppleScript + + + +

      +
      + +
      +
      Inherits:
      +
      + RunnerError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/applescript.rb
      +
      + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingJavaScriptSupport.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingJavaScriptSupport.html new file mode 100644 index 00000000..6aaa12c8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Applescript/MissingJavaScriptSupport.html @@ -0,0 +1,134 @@ + + + + + + + Exception: Opal::CliRunners::Applescript::MissingJavaScriptSupport + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::Applescript::MissingJavaScriptSupport + + + +

      +
      + +
      +
      Inherits:
      +
      + RunnerError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/applescript.rb
      +
      + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Chrome.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Chrome.html new file mode 100644 index 00000000..5291350b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Chrome.html @@ -0,0 +1,636 @@ + + + + + + + Class: Opal::CliRunners::Chrome + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Chrome + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/chrome.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      SCRIPT_PATH = + +
      +
      File.expand_path('chrome_cdp_interface.rb', __dir__).freeze
      + +
      DEFAULT_CHROME_HOST = + +
      +
      'localhost'
      + +
      DEFAULT_CHROME_PORT = + +
      +
      9222
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #builder ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute builder.

        +
        + +
      • + + +
      • + + + #exit_status ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute exit_status.

        +
        + +
      • + + +
      • + + + #output ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute output.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(data) ⇒ Chrome + + + + + +

      +
      +

      Returns a new instance of Chrome.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/cli_runners/chrome.rb', line 23
      +
      +def initialize(data)
      +  argv = data[:argv]
      +  if argv && argv.any?
      +    warn "warning: ARGV is not supported by the Chrome runner #{argv.inspect}"
      +  end
      +
      +  options  = data[:options]
      +  @output  = options.fetch(:output, $stdout)
      +  @builder = data[:builder].call
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #builderObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute builder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/cli_runners/chrome.rb', line 34
      +
      +def builder
      +  @builder
      +end
      +
      +
      + + + +
      +

      + + #exit_statusObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute exit_status.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/cli_runners/chrome.rb', line 34
      +
      +def exit_status
      +  @exit_status
      +end
      +
      +
      + + + +
      +

      + + #outputObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute output.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/cli_runners/chrome.rb', line 34
      +
      +def output
      +  @output
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/cli_runners/chrome.rb', line 18
      +
      +def self.call(data)
      +  runner = new(data)
      +  runner.run
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #runObject + + + + + +

      + + + + +
      +
      +
      +
      +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 'opal/lib/opal/cli_runners/chrome.rb', line 36
      +
      +def run
      +  mktmpdir do |dir|
      +    with_chrome_server do
      +      prepare_files_in(dir)
      +
      +      env = {
      +        'CHROME_HOST' => chrome_host,
      +        'CHROME_PORT' => chrome_port.to_s,
      +        'NODE_PATH' => File.join(__dir__, 'node_modules'),
      +        'OPAL_CDP_EXT' => builder.output_extension
      +      }
      +
      +      cmd = [
      +        RbConfig.ruby,
      +        "#{__dir__}/../../../exe/opal",
      +        '--no-exit',
      +        '-I', __dir__,
      +        '-r', 'source-map-support-node',
      +        SCRIPT_PATH,
      +        dir
      +      ]
      +
      +      Kernel.exec(env, *cmd)
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Compiler.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Compiler.html new file mode 100644 index 00000000..c1389897 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Compiler.html @@ -0,0 +1,1046 @@ + + + + + + + Class: Opal::CliRunners::Compiler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Compiler + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/compiler.rb
      +
      + +
      + +

      Overview

      +
      +

      The compiler runner will just output the compiled JavaScript

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

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(data) ⇒ Compiler + + + + + +

      +
      +

      Returns a new instance of Compiler.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 11
      +
      +def initialize(data)
      +  @options         = data[:options] || {}
      +  @builder_factory = data.fetch(:builder)
      +  @map_file        = @options[:map_file]
      +  @output          = data.fetch(:output)
      +  @watch           = @options[:watch]
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 7
      +
      +def self.call(data)
      +  new(data).start
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 19
      +
      +def compile
      +  builder = @builder_factory.call
      +  compiled_source = builder.to_s
      +  compiled_source += "\n" + builder.source_map.to_data_uri_comment unless @options[:no_source_map]
      +
      +  rewind_output if @watch
      +
      +  @output.puts compiled_source
      +  @output.flush
      +
      +  File.write(@map_file, builder.source_map.to_json) if @map_file
      +
      +  builder
      +end
      +
      +
      + +
      +

      + + #compile_noraiseObject + + + + + +

      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 34
      +
      +def compile_noraise
      +  compile
      +rescue StandardError, Opal::SyntaxError => e
      +  $stderr.puts "* Compilation failed: #{e.message}"
      +  nil
      +end
      +
      +
      + +
      +

      + + #fail_no_listen!Object + + + + + +

      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 61
      +
      +def fail_no_listen!
      +  abort <<~ERROR
      +    --watch mode requires the `listen` gem present. Please try to run:
      +
      +        gem install listen
      +
      +    Or if you are using bundler, add listen to your Gemfile.
      +  ERROR
      +end
      +
      +
      + +
      +

      + + #fail_unrewindable!Object + + + + + +

      + + + + +
      +
      +
      +
      +54
      +55
      +56
      +57
      +58
      +59
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 54
      +
      +def fail_unrewindable!
      +  abort <<~ERROR
      +    You have specified --watch, but for watch to work, you must specify an
      +    --output file.
      +  ERROR
      +end
      +
      +
      + +
      +

      + + #files_to_directoriesObject + + + + + +

      + + + + +
      +
      +
      +
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 118
      +
      +def files_to_directories
      +  directories = @files.map { |file| File.dirname(file) }.uniq
      +
      +  previous_dir = nil
      +  # Only get the topmost directories
      +  directories = directories.sort.map do |dir|
      +    if previous_dir && dir.start_with?(previous_dir + '/')
      +      nil
      +    else
      +      previous_dir = dir
      +    end
      +  end
      +
      +  directories.compact
      +end
      +
      +
      + +
      +

      + + #on_code_change(modified) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 98
      +
      +def on_code_change(modified)
      +  if !(modified & @opal_deps).empty?
      +    $stderr.puts "* Modified core Opal files: #{modified.join(', ')}; reexecuting"
      +    reexec
      +  elsif !modified.all? { |file| @directories.any? { |dir| file.start_with?(dir + '/') } }
      +    $stderr.puts "* New unwatched files: #{modified.join(', ')}; reexecuting"
      +    reexec
      +  end
      +
      +  $stderr.puts "* Modified code: #{modified.join(', ')}; rebuilding"
      +
      +  builder = compile_noraise
      +
      +  # Ignore the bad compilation
      +  if builder
      +    code_deps = builder.dependent_files
      +    @files = @opal_deps + code_deps
      +  end
      +end
      +
      +
      + +
      +

      + + #reexecObject + + + + + +

      + + + + +
      +
      +
      +
      +94
      +95
      +96
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 94
      +
      +def reexec
      +  Process.kill('USR2', Process.pid)
      +end
      +
      +
      + +
      +

      + + #rewind_outputObject + + + + + +

      + + + + +
      +
      +
      +
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 41
      +
      +def rewind_output
      +  if !@output.is_a?(File) || @output.tty?
      +    fail_unrewindable!
      +  else
      +    begin
      +      @output.rewind
      +      @output.truncate(0)
      +    rescue Errno::ESPIPE
      +      fail_unrewindable!
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #startObject + + + + + +

      + + + + +
      +
      +
      +
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 143
      +
      +def start
      +  if @watch
      +    watch_compile
      +  else
      +    compile
      +  end
      +
      +  0
      +end
      +
      +
      + +
      +

      + + #watch_compileObject + + + + + +

      + + + + +
      +
      +
      +
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 71
      +
      +def watch_compile
      +  begin
      +    require 'listen'
      +  rescue LoadError
      +    fail_no_listen!
      +  end
      +
      +  @opal_deps = Opal.dependent_files
      +
      +  builder = compile
      +  code_deps = builder.dependent_files
      +  @files = @opal_deps + code_deps
      +  @code_listener = watch_files
      +  @code_listener.start
      +
      +  $stderr.puts "* Opal v#{Opal::VERSION} successfully compiled your program in --watch mode"
      +
      +  sleep
      +rescue Interrupt
      +  $stderr.puts '* Stopping watcher...'
      +  @code_listener.stop
      +end
      +
      +
      + +
      +

      + + #watch_filesObject + + + + + +

      + + + + +
      +
      +
      +
      +134
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +
      +
      # File 'opal/lib/opal/cli_runners/compiler.rb', line 134
      +
      +def watch_files
      +  @directories = files_to_directories
      +
      +  Listen.to(*@directories, ignore!: []) do |modified, added, removed|
      +    our_modified = @files & (modified + added + removed)
      +    on_code_change(our_modified) unless our_modified.empty?
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Deno.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Deno.html new file mode 100644 index 00000000..fbe96127 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Deno.html @@ -0,0 +1,228 @@ + + + + + + + Class: Opal::CliRunners::Deno + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Deno + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/deno.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: MissingDeno + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +
      +
      # File 'opal/lib/opal/cli_runners/deno.rb', line 11
      +
      +def self.call(data)
      +  argv = data[:argv].dup.to_a
      +
      +  SystemRunner.call(data) do |tempfile|
      +    [
      +      'deno',
      +      'run',
      +      '--allow-read',
      +      '--allow-write',
      +      tempfile.path,
      +      *argv
      +    ]
      +  end
      +rescue Errno::ENOENT
      +  raise MissingDeno, 'Please install Deno to be able to run Opal scripts.'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Deno/MissingDeno.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Deno/MissingDeno.html new file mode 100644 index 00000000..0e5f2f31 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Deno/MissingDeno.html @@ -0,0 +1,134 @@ + + + + + + + Exception: Opal::CliRunners::Deno::MissingDeno + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::Deno::MissingDeno + + + +

      +
      + +
      +
      Inherits:
      +
      + RunnerError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/deno.rb
      +
      + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Firefox.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Firefox.html new file mode 100644 index 00000000..144f4cc1 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Firefox.html @@ -0,0 +1,650 @@ + + + + + + + Class: Opal::CliRunners::Firefox + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Firefox + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/firefox.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      SCRIPT_PATH = + +
      +
      File.expand_path('firefox_cdp_interface.rb', __dir__).freeze
      + +
      DEFAULT_CHROME_HOST = + +
      +
      'localhost'
      + +
      DEFAULT_CHROME_PORT = +
      +
      +

      makes sure it doesn't accidentally connect to a lingering chrome

      + + +
      +
      +
      + + +
      +
      +
      9333
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #builder ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute builder.

        +
        + +
      • + + +
      • + + + #exit_status ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute exit_status.

        +
        + +
      • + + +
      • + + + #output ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute output.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(data) ⇒ Firefox + + + + + +

      +
      +

      Returns a new instance of Firefox.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/cli_runners/firefox.rb', line 26
      +
      +def initialize(data)
      +  builder = data[:builder].call
      +  options = data[:options]
      +  argv    = data[:argv]
      +
      +  if argv && argv.any?
      +    warn "warning: ARGV is not supported by the Firefox runner #{argv.inspect}"
      +  end
      +
      +  @output  = options.fetch(:output, $stdout)
      +  @builder = builder
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #builderObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute builder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/cli_runners/firefox.rb', line 39
      +
      +def builder
      +  @builder
      +end
      +
      +
      + + + +
      +

      + + #exit_statusObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute exit_status.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/cli_runners/firefox.rb', line 39
      +
      +def exit_status
      +  @exit_status
      +end
      +
      +
      + + + +
      +

      + + #outputObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute output.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/cli_runners/firefox.rb', line 39
      +
      +def output
      +  @output
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/cli_runners/firefox.rb', line 21
      +
      +def self.call(data)
      +  runner = new(data)
      +  runner.run
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #runObject + + + + + +

      + + + + +
      +
      +
      +
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +
      +
      # File 'opal/lib/opal/cli_runners/firefox.rb', line 41
      +
      +def run
      +  mktmpdir do |dir|
      +    with_firefox_server do
      +      prepare_files_in(dir)
      +
      +      env = {
      +        'CHROME_HOST' => chrome_host,
      +        'CHROME_PORT' => chrome_port.to_s,
      +        'NODE_PATH' => File.join(__dir__, 'node_modules')
      +      }
      +      env['OPAL_CDP_EXT'] = builder.output_extension
      +
      +      cmd = [
      +        RbConfig.ruby,
      +        "#{__dir__}/../../../exe/opal",
      +        '--no-exit',
      +        '-I', __dir__,
      +        '-r', 'source-map-support-node',
      +        SCRIPT_PATH,
      +        dir
      +      ]
      +
      +      Kernel.exec(env, *cmd)
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Gjs.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Gjs.html new file mode 100644 index 00000000..370f8b28 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Gjs.html @@ -0,0 +1,232 @@ + + + + + + + Class: Opal::CliRunners::Gjs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Gjs + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/gjs.rb
      +
      + +
      + +

      Overview

      +
      +

      Gjs is GNOME's JavaScript runtime based on Mozilla SpiderMonkey

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: MissingGjs + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/cli_runners/gjs.rb', line 11
      +
      +def self.call(data)
      +  exe = ENV['GJS_PATH'] || 'gjs'
      +  builder = data[:builder].call
      +
      +  opts = Shellwords.shellwords(ENV['GJS_OPTS'] || '')
      +  opts.unshift('-m') if builder.esm?
      +
      +  SystemRunner.call(data.merge(builder: -> { builder })) do |tempfile|
      +    [exe, *opts, tempfile.path, *data[:argv]]
      +  end
      +rescue Errno::ENOENT
      +  raise MissingGjs, 'Please install Gjs to be able to run Opal scripts.'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Gjs/MissingGjs.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Gjs/MissingGjs.html new file mode 100644 index 00000000..2bad199b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Gjs/MissingGjs.html @@ -0,0 +1,134 @@ + + + + + + + Exception: Opal::CliRunners::Gjs::MissingGjs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::Gjs::MissingGjs + + + +

      +
      + +
      +
      Inherits:
      +
      + RunnerError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/gjs.rb
      +
      + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/MiniRacer.html b/docs/api/v1.8.2/lib/Opal/CliRunners/MiniRacer.html new file mode 100644 index 00000000..44390704 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/MiniRacer.html @@ -0,0 +1,293 @@ + + + + + + + Class: Opal::CliRunners::MiniRacer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::MiniRacer + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/mini_racer.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'opal/lib/opal/cli_runners/mini_racer.rb', line 9
      +
      +def self.call(data)
      +  ::MiniRacer::Platform.set_flags! :harmony
      +
      +  builder = data.fetch(:builder).call
      +  output = data.fetch(:output)
      +  # TODO: pass it
      +  argv = data.fetch(:argv)
      +
      +  # MiniRacer doesn't like to fork. Let's build Opal first
      +  # in a forked environment.
      +  code = builder.to_s + "\n" + builder.source_map.to_data_uri_comment
      +
      +  v8 = ::MiniRacer::Context.new
      +  v8.attach('prompt', ->(_msg = '') { $stdin.gets&.chomp })
      +  v8.attach('console.log', ->(i) { output.print(i); output.flush })
      +  v8.attach('console.warn', ->(i) { $stderr.print(i); $stderr.flush })
      +  v8.attach('crypto.randomBytes', method(:random_bytes).to_proc)
      +  v8.attach('opalminiracer.exit', ->(status) { Kernel.exit(status) })
      +  v8.attach('opalminiracer.argv', argv)
      +
      +  v8.eval(code)
      +end
      +
      +
      + +
      +

      + + .random_bytes(bytes) ⇒ Object + + + + + +

      +
      +

      A polyfill so that SecureRandom works in repl correctly.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +
      +
      # File 'opal/lib/opal/cli_runners/mini_racer.rb', line 33
      +
      +def self.random_bytes(bytes)
      +  ::SecureRandom.bytes(bytes).split('').map(&:ord)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn.html new file mode 100644 index 00000000..dc487c6c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn.html @@ -0,0 +1,218 @@ + + + + + + + Class: Opal::CliRunners::Nashorn + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Nashorn + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/nashorn.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: MissingNashorn + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/cli_runners/nashorn.rb', line 9
      +
      +def self.call(data)
      +  # Allow to change path if using GraalVM, see:
      +  # https://github.com/graalvm/graaljs/blob/master/docs/user/NashornMigrationGuide.md#launcher-name-js
      +  exe = ENV['NASHORN_PATH'] || 'jjs'
      +
      +  SystemRunner.call(data) do |tempfile|
      +    [exe, tempfile.path, *data[:argv]]
      +  end
      +rescue Errno::ENOENT
      +  raise MissingNashorn, 'Please install JDK or GraalVM to be able to run Opal scripts.'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn/MissingNashorn.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn/MissingNashorn.html new file mode 100644 index 00000000..5972c687 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Nashorn/MissingNashorn.html @@ -0,0 +1,134 @@ + + + + + + + Exception: Opal::CliRunners::Nashorn::MissingNashorn + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::Nashorn::MissingNashorn + + + +

      +
      + +
      +
      Inherits:
      +
      + RunnerError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/nashorn.rb
      +
      + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs.html new file mode 100644 index 00000000..83bb06c7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs.html @@ -0,0 +1,334 @@ + + + + + + + Class: Opal::CliRunners::Nodejs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Nodejs + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/nodejs.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: MissingNodeJS + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      NODE_PATH = +
      +
      +

      We can't rely on Opal.gem_dir for now...

      + + +
      +
      +
      + + +
      +
      +
      File.expand_path('../stdlib/nodejs/node_modules', ::Opal.gem_dir)
      + +
      DIR = + +
      +
      __dir__
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/cli_runners/nodejs.rb', line 20
      +
      +def self.call(data)
      +  (data[:options] ||= {})[:env] = { 'NODE_PATH' => node_modules }
      +
      +  argv = data[:argv].dup.to_a
      +  argv.unshift('--') if argv.any?
      +
      +  opts = Shellwords.shellwords(ENV['NODE_OPTS'] || '')
      +
      +  SystemRunner.call(data) do |tempfile|
      +    [
      +      'node',
      +      '--require', "#{DIR}/source-map-support-node",
      +      *opts,
      +      tempfile.path,
      +      *argv
      +    ]
      +  end
      +rescue Errno::ENOENT
      +  raise MissingNodeJS, 'Please install Node.js to be able to run Opal scripts.'
      +end
      +
      +
      + +
      +

      + + .node_modulesObject + + + + + +

      +
      +

      Ensure stdlib node_modules is among NODE_PATHs

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/cli_runners/nodejs.rb', line 42
      +
      +def self.node_modules
      +  ENV['NODE_PATH'].to_s.split(OS.env_sep).tap do |paths|
      +    paths << NODE_PATH unless paths.include? NODE_PATH
      +  end.join(OS.env_sep)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs/MissingNodeJS.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs/MissingNodeJS.html new file mode 100644 index 00000000..46523603 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Nodejs/MissingNodeJS.html @@ -0,0 +1,134 @@ + + + + + + + Exception: Opal::CliRunners::Nodejs::MissingNodeJS + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::Nodejs::MissingNodeJS + + + +

      +
      + +
      +
      Inherits:
      +
      + RunnerError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/nodejs.rb
      +
      + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs.html new file mode 100644 index 00000000..eede6d8d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs.html @@ -0,0 +1,229 @@ + + + + + + + Class: Opal::CliRunners::Quickjs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Quickjs + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/quickjs.rb
      +
      + +
      + +

      Overview

      +
      +

      QuickJS is Fabrice Bellard's minimalistic JavaScript engine +https://github.com/bellard/quickjs

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: MissingQuickjs + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/cli_runners/quickjs.rb', line 12
      +
      +def self.call(data)
      +  exe = ENV['QJS_PATH'] || 'qjs'
      +
      +  opts = Shellwords.shellwords(ENV['QJS_OPTS'] || '')
      +
      +  SystemRunner.call(data) do |tempfile|
      +    [exe, '--std', *opts, tempfile.path, *data[:argv]]
      +  end
      +rescue Errno::ENOENT
      +  raise MissingQuickjs, 'Please install QuickJS to be able to run Opal scripts.'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs/MissingQuickjs.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs/MissingQuickjs.html new file mode 100644 index 00000000..4a0a1b9c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Quickjs/MissingQuickjs.html @@ -0,0 +1,134 @@ + + + + + + + Exception: Opal::CliRunners::Quickjs::MissingQuickjs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::Quickjs::MissingQuickjs + + + +

      +
      + +
      +
      Inherits:
      +
      + RunnerError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/quickjs.rb
      +
      + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/RunnerError.html b/docs/api/v1.8.2/lib/Opal/CliRunners/RunnerError.html new file mode 100644 index 00000000..5dd85a54 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/RunnerError.html @@ -0,0 +1,130 @@ + + + + + + + Exception: Opal::CliRunners::RunnerError + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CliRunners::RunnerError + + + +

      +
      + +
      +
      Inherits:
      +
      + StandardError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners.rb
      +
      + +
      + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Safari.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Safari.html new file mode 100644 index 00000000..626929d7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Safari.html @@ -0,0 +1,654 @@ + + + + + + + Class: Opal::CliRunners::Safari + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Safari + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/safari.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      EXECUTION_TIMEOUT = +
      +
      +

      seconds

      + + +
      +
      +
      + + +
      +
      +
      600
      + +
      DEFAULT_SAFARI_DRIVER_HOST = + +
      +
      'localhost'
      + +
      DEFAULT_SAFARI_DRIVER_PORT = +
      +
      +

      in addition safari_driver_port + 1 is used for the http server

      + + +
      +
      +
      + + +
      +
      +
      9444
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #builder ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute builder.

        +
        + +
      • + + +
      • + + + #exit_status ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute exit_status.

        +
        + +
      • + + +
      • + + + #output ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute output.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(data) ⇒ Safari + + + + + +

      +
      +

      Returns a new instance of Safari.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/cli_runners/safari.rb', line 24
      +
      +def initialize(data)
      +  argv = data[:argv]
      +  if argv && argv.any?
      +    warn "warning: ARGV is not supported by the Safari runner #{argv.inspect}"
      +  end
      +
      +  options  = data[:options]
      +  @output  = options.fetch(:output, $stdout)
      +  @builder = data[:builder].call
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #builderObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute builder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/cli_runners/safari.rb', line 35
      +
      +def builder
      +  @builder
      +end
      +
      +
      + + + +
      +

      + + #exit_statusObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute exit_status.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/cli_runners/safari.rb', line 35
      +
      +def exit_status
      +  @exit_status
      +end
      +
      +
      + + + +
      +

      + + #outputObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute output.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/cli_runners/safari.rb', line 35
      +
      +def output
      +  @output
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/cli_runners/safari.rb', line 19
      +
      +def self.call(data)
      +  runner = new(data)
      +  runner.run
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #runObject + + + + + +

      + + + + +
      +
      +
      +
      +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 'opal/lib/opal/cli_runners/safari.rb', line 37
      +
      +def run
      +  mktmpdir do |dir|
      +    with_http_server(dir) do |http_port, server_thread|
      +      with_safari_driver do
      +        prepare_files_in(dir)
      +
      +        # Safaridriver commands are very limitied, for supported commands see:
      +        # https://developer.apple.com/documentation/webkit/macos_webdriver_commands_for_safari_12_and_later
      +        Net::HTTP.start(safari_driver_host, safari_driver_port) do |con|
      +          con.read_timeout = EXECUTION_TIMEOUT
      +          res = con.post('/session', { capabilities: { browserName: 'Safari' } }.to_json, 'Content-Type' => 'application/json')
      +          session_id = JSON.parse(res.body).dig('value', 'sessionId')
      +          if session_id
      +            session_path = "/session/#{session_id}"
      +            con.post("#{session_path}/url", { url: "http://#{safari_driver_host}:#{http_port}/index.html" }.to_json, 'Content-Type' => 'application/json')
      +            server_thread.join(EXECUTION_TIMEOUT)
      +          else
      +            STDERR.puts "Could not create session: #{res.body}"
      +          end
      +        end
      +        0
      +      end
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Server.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Server.html new file mode 100644 index 00000000..3c507a65 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Server.html @@ -0,0 +1,950 @@ + + + + + + + Class: Opal::CliRunners::Server + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Server + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/server.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: App + + +

      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #argv ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute argv.

        +
        + +
      • + + +
      • + + + #builder ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute builder.

        +
        + +
      • + + +
      • + + + #output ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute output.

        +
        + +
      • + + +
      • + + + #port ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute port.

        +
        + +
      • + + +
      • + + + #server ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute server.

        +
        + +
      • + + +
      • + + + #static_folder ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute static_folder.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(data) ⇒ Server + + + + + +

      +
      +

      Returns a new instance of Server.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 14
      +
      +def initialize(data)
      +  options = data[:options] || {}
      +  @builder = data[:builder]
      +
      +  @argv = data[:argv] || []
      +
      +  @output = data[:output] || $stdout
      +
      +  @port = options.fetch(:port, ENV['OPAL_CLI_RUNNERS_SERVER_PORT'] || 3000).to_i
      +
      +  @static_folder = options[:static_folder] || ENV['OPAL_CLI_RUNNERS_SERVER_STATIC_FOLDER']
      +  @static_folder = @static_folder == true ? 'public' : @static_folder
      +  @static_folder = File.expand_path(@static_folder) if @static_folder
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #argvObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute argv.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 29
      +
      +def argv
      +  @argv
      +end
      +
      +
      + + + +
      +

      + + #builderObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute builder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 29
      +
      +def builder
      +  @builder
      +end
      +
      +
      + + + +
      +

      + + #outputObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute output.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 29
      +
      +def output
      +  @output
      +end
      +
      +
      + + + +
      +

      + + #portObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute port.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 29
      +
      +def port
      +  @port
      +end
      +
      +
      + + + +
      +

      + + #serverObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute server.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 29
      +
      +def server
      +  @server
      +end
      +
      +
      + + + +
      +

      + + #static_folderObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute static_folder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 29
      +
      +def static_folder
      +  @static_folder
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .call(data) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 8
      +
      +def self.call(data)
      +  runner = new(data)
      +  runner.run
      +  runner.exit_status
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #build_app(builder) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 53
      +
      +def build_app(builder)
      +  app = App.new(builder: builder, main: 'cli-runner')
      +
      +  if static_folder
      +    not_found = [404, {}, []]
      +    app = Rack::Cascade.new(
      +      [
      +        Rack::Static.new(->(_) { not_found }, urls: [''], root: static_folder),
      +        app
      +      ],
      +    )
      +  end
      +
      +  app
      +end
      +
      +
      + +
      +

      + + #exit_statusObject + + + + + +

      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 49
      +
      +def exit_status
      +  nil
      +end
      +
      +
      + +
      +

      + + #runObject + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 31
      +
      +def run
      +  unless argv.empty?
      +    raise ArgumentError, 'Program arguments are not supported on the Server runner'
      +  end
      +
      +  require 'rack'
      +  require 'logger'
      +
      +  app = build_app(builder)
      +
      +  @server = Rack::Server.start(
      +    app:       app,
      +    Port:      port,
      +    AccessLog: [],
      +    Logger:    Logger.new(output),
      +  )
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CliRunners/Server/App.html b/docs/api/v1.8.2/lib/Opal/CliRunners/Server/App.html new file mode 100644 index 00000000..cd8eb740 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CliRunners/Server/App.html @@ -0,0 +1,287 @@ + + + + + + + Class: Opal::CliRunners::Server::App + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::CliRunners::Server::App + + + +

      +
      + +
      +
      Inherits:
      +
      + SimpleServer + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/cli_runners/server.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from SimpleServer

      +

      SimpleServer::NotFound

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from SimpleServer

      +

      #index_path, #main

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from SimpleServer

      +

      #append_path, #cache_invalidator, #call, #call_index, #call_js, #fetch_asset, #javascript_include_tag

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(options = {}) ⇒ App + + + + + +

      +
      +

      Returns a new instance of App.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 70
      +
      +def initialize(options = {})
      +  @builder = options.fetch(:builder)
      +  super
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #builder(_) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +75
      +76
      +77
      +
      +
      # File 'opal/lib/opal/cli_runners/server.rb', line 75
      +
      +def builder(_)
      +  @builder.call
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/CompilationError.html b/docs/api/v1.8.2/lib/Opal/CompilationError.html new file mode 100644 index 00000000..81680d05 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/CompilationError.html @@ -0,0 +1,216 @@ + + + + + + + Exception: Opal::CompilationError + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::CompilationError + + + +

      +
      + +
      +
      Inherits:
      +
      + Error + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/errors.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      ParsingError

      +
      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #location ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute location.

        +
        + +
      • + + +
      + + + + + + + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #locationObject + + + + + +

      +
      +

      Returns the value of attribute location.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/errors.rb', line 21
      +
      +def location
      +  @location
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Compiler.html b/docs/api/v1.8.2/lib/Opal/Compiler.html new file mode 100644 index 00000000..10790b3b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Compiler.html @@ -0,0 +1,4807 @@ + + + + + + + Class: Opal::Compiler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Compiler + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Nodes::Closure::CompilerSupport
      +
      + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/compiler.rb
      +
      + +
      + +

      Overview

      +
      +

      Compiler is the main class used to compile ruby to javascript code. +This class uses Parser to gather the sexp syntax tree for the ruby +code, and then uses Node to step through the sexp to generate valid +javascript.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      Opal::Compiler.new("ruby code").compile
      +# => "javascript code"
      + + +

      Accessing result

      +

      + +
      compiler = Opal::Compiler.new("ruby_code")
      +compiler.compile
      +compiler.result # => "javascript code"
      + + +

      Source Maps

      +

      + +
      compiler = Opal::Compiler.new("")
      +compiler.compile
      +compiler.source_map # => #<SourceMap:>
      + +
      + + +
      + +

      + Constant Summary + collapse +

      + +
      + +
      INDENT = +
      +
      +

      Generated code gets indented with two spaces on each scope

      + + +
      +
      +
      + + +
      +
      +
      '  '
      + +
      COMPARE = +
      +
      +

      All compare method nodes - used to optimize performance of +math comparisons

      + + +
      +
      +
      + + +
      +
      +
      %w[< > <= >=].freeze
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #case_stmt ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Current case_stmt.

        +
        + +
      • + + +
      • + + + #comments ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Comments from the source code.

        +
        + +
      • + + +
      • + + + #dynamic_cache_result ⇒ Object + + + + + + + + + + + + + + + + +

        Set if some rewritter caused a dynamic cache result, meaning it's not fit to be cached.

        +
        + +
      • + + +
      • + + + #eof_content ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Any content in END special construct.

        +
        + +
      • + + +
      • + + + #fragments ⇒ Array + + + + + + + + + readonly + + + + + + + + + +

        All [Opal::Fragment] used to produce result.

        +
        + +
      • + + +
      • + + + #magic_comments ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Magic comment flags extracted from the leading comments.

        +
        + +
      • + + +
      • + + + #method_calls ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Method calls made in this file.

        +
        + +
      • + + +
      • + + + #result ⇒ String + + + + + + + + + readonly + + + + + + + + + +

        The compiled ruby code.

        +
        + +
      • + + +
      • + + + #scope ⇒ Object + + + + + + + + + + + + + + + + +

        Current scope.

        +
        + +
      • + + +
      • + + + #source ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Access the source code currently processed.

        +
        + +
      • + + +
      • + + + #top_scope ⇒ Object + + + + + + + + + + + + + + + + +

        Top scope.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods included from Nodes::Closure::CompilerSupport

      +

      #closure_stack

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(source, options = {}) ⇒ Compiler + + + + + +

      +
      +

      Returns a new instance of Compiler.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +281
      +282
      +283
      +284
      +285
      +286
      +287
      +288
      +289
      +290
      +291
      +292
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 281
      +
      +def initialize(source, options = {})
      +  @source = source
      +  @indent = ''
      +  @unique = 0
      +  @options = options
      +  @comments = Hash.new([])
      +  @case_stmt = nil
      +  @method_calls = Set.new
      +  @option_values = {}
      +  @magic_comments = {}
      +  @dynamic_cache_result = false
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #case_stmtObject (readonly) + + + + + +

      +
      +

      Current case_stmt

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +260
      +261
      +262
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 260
      +
      +def case_stmt
      +  @case_stmt
      +end
      +
      +
      + + + +
      +

      + + #commentsObject (readonly) + + + + + +

      +
      +

      Comments from the source code

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +266
      +267
      +268
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 266
      +
      +def comments
      +  @comments
      +end
      +
      +
      + + + +
      +

      + + #dynamic_cache_resultObject + + + + + +

      +
      +

      Set if some rewritter caused a dynamic cache result, meaning it's not +fit to be cached

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +279
      +280
      +281
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 279
      +
      +def dynamic_cache_result
      +  @dynamic_cache_result
      +end
      +
      +
      + + + +
      +

      + + #eof_contentObject (readonly) + + + + + +

      +
      +

      Any content in END special construct

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +263
      +264
      +265
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 263
      +
      +def eof_content
      +  @eof_content
      +end
      +
      +
      + + + +
      +

      + + #fragmentsArray (readonly) + + + + + +

      +
      +

      Returns all [Opal::Fragment] used to produce result.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Array) + + + + — +

        all [Opal::Fragment] used to produce result

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +251
      +252
      +253
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 251
      +
      +def fragments
      +  @fragments
      +end
      +
      +
      + + + +
      +

      + + #magic_commentsObject (readonly) + + + + + +

      +
      +

      Magic comment flags extracted from the leading comments

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +272
      +273
      +274
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 272
      +
      +def magic_comments
      +  @magic_comments
      +end
      +
      +
      + + + +
      +

      + + #method_callsObject (readonly) + + + + + +

      +
      +

      Method calls made in this file

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +269
      +270
      +271
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 269
      +
      +def method_calls
      +  @method_calls
      +end
      +
      +
      + + + +
      +

      + + #resultString (readonly) + + + + + +

      +
      +

      Returns The compiled ruby code.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (String) + + + + — +

        The compiled ruby code

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +248
      +249
      +250
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 248
      +
      +def result
      +  @result
      +end
      +
      +
      + + + +
      +

      + + #scopeObject + + + + + +

      +
      +

      Current scope

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +254
      +255
      +256
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 254
      +
      +def scope
      +  @scope
      +end
      +
      +
      + + + +
      +

      + + #sourceObject (readonly) + + + + + +

      +
      +

      Access the source code currently processed

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +275
      +276
      +277
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 275
      +
      +def source
      +  @source
      +end
      +
      +
      + + + +
      +

      + + #top_scopeObject + + + + + +

      +
      +

      Top scope

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +257
      +258
      +259
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 257
      +
      +def top_scope
      +  @top_scope
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .compiler_option(name, config = {}) ⇒ Object + + + + + +

      +
      +

      Defines a compiler option.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + as: + + + (Hash) + + + + — +

        a customizable set of options

        +
        + +
      • + +
      • + + default: + + + (Hash) + + + + — +

        a customizable set of options

        +
        + +
      • + +
      • + + magic_comment: + + + (Hash) + + + + — +

        a customizable set of options

        +
        + +
      • + +
      + + + + + + + + +
      + + + + +
      +
      +
      +
      +72
      +73
      +74
      +75
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 72
      +
      +def self.compiler_option(name, config = {})
      +  method_name = config.fetch(:as, name)
      +  define_method(method_name) { option_value(name, config) }
      +end
      +
      +
      + +
      +

      + + .module_name(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +63
      +64
      +65
      +66
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 63
      +
      +def self.module_name(path)
      +  path = File.join(File.dirname(path), File.basename(path).split('.').first)
      +  Pathname(path).cleanpath.to_s
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #arity_check?Boolean + + + + + +

      +
      +

      adds an arity check to every method definition

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +122
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 122
      +
      +compiler_option :arity_check, default: false, as: :arity_check?
      +
      +
      + +
      +

      + + #async_awaitObject + + + + + +

      +
      +

      Enable async/await support and optionally enable auto-await.

      + +

      Use either true, false, an Array of Symbols, a String containing names +to auto-await separated by a comma or a Regexp.

      + +

      Auto-await awaits provided methods by default as if .await was added to +them automatically.

      + +

      By default, the support is disabled (set to false).

      + +

      If the config value is not set to false, any calls to #await will be +translated to ES8 await keyword which makes the scope return a Promise +and a containing scope will be async (instead of a value, it will return +a Promise).

      + +

      If the config value is an array, or a String separated by a comma, +auto-await is also enabled.

      + +

      A member of this collection can contain a wildcard character * in which +case all methods containing a given substring will be awaited.

      + +

      It can be used as a magic comment, examples:

      + +
      # await: true
      +# await: *await*
      +# await: *await*, sleep, gets
      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +245
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 245
      +
      +compiler_option :await, default: false, as: :async_await, magic_comment: true
      +
      +
      + +
      +

      + + #async_await_before_typecastingObject + + + + + +

      +
      +

      Enable async/await support and optionally enable auto-await.

      + +

      Use either true, false, an Array of Symbols, a String containing names +to auto-await separated by a comma or a Regexp.

      + +

      Auto-await awaits provided methods by default as if .await was added to +them automatically.

      + +

      By default, the support is disabled (set to false).

      + +

      If the config value is not set to false, any calls to #await will be +translated to ES8 await keyword which makes the scope return a Promise +and a containing scope will be async (instead of a value, it will return +a Promise).

      + +

      If the config value is an array, or a String separated by a comma, +auto-await is also enabled.

      + +

      A member of this collection can contain a wildcard character * in which +case all methods containing a given substring will be awaited.

      + +

      It can be used as a magic comment, examples:

      + +
      # await: true
      +# await: *await*
      +# await: *await*, sleep, gets
      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +357
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 357
      +
      +compiler_option :await, default: false, as: :async_await, magic_comment: true
      +
      +
      + +
      +

      + + #async_await_set_to_regexp(set) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +377
      +378
      +379
      +380
      +381
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 377
      +
      +def async_await_set_to_regexp(set)
      +  set = set.map { |name| Regexp.escape(name.to_s).gsub('\*', '.*?') }
      +  set = set.join('|')
      +  /^(#{set})$/
      +end
      +
      +
      + +
      +

      + + #autoloadsObject + + + + + +

      +
      +

      An array of things (requires, trees) which don't need to success in +loading compile-time.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +540
      +541
      +542
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 540
      +
      +def autoloads
      +  @autoloads ||= []
      +end
      +
      +
      + +
      +

      + + #backtick_javascript?Object + + + + + +

      +
      +

      Allows use of a backtick operator (and %x{}`) to embed verbatim JavaScript. +If false, backtick operator will

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +195
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 195
      +
      +compiler_option :backtick_javascript, default: nil, as: :backtick_javascript?, magic_comment: true
      +
      +
      + +
      +

      + + #backtick_javascript_or_warn?Boolean + + + + + +

      +
      +

      Warn about impending compatibility break

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +211
      +212
      +213
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 198
      +
      +def backtick_javascript_or_warn?
      +  case backtick_javascript?
      +  when true
      +    true
      +  when nil
      +    @backtick_javascript_warned ||= begin
      +      warning 'Backtick operator usage interpreted as intent to embed JavaScript; this code will ' \
      +              'break in Opal 2.0; add a magic comment: `# backtick_javascript: true`'
      +      true
      +    end
      +
      +    true
      +  when false
      +    false
      +  end
      +end
      +
      +
      + +
      +

      + + #compileString + + + + + +

      +
      +

      Compile some ruby code to a string.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (String) + + + + — +

        javascript code

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +297
      +298
      +299
      +300
      +301
      +302
      +303
      +304
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 297
      +
      +def compile
      +  parse
      +
      +  @fragments = re_raise_with_location { process(@sexp).flatten }
      +  @fragments << fragment("\n", nil, s(:newline)) unless @fragments.last.code.end_with?("\n")
      +
      +  @result = @fragments.map(&:code).join('')
      +end
      +
      +
      + +
      +

      + + #dynamic_require_severityObject + + + + + +

      +
      +

      how to handle dynamic requires (:error, :warning, :ignore)

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +140
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 140
      +
      +compiler_option :dynamic_require_severity, default: :ignore, valid_values: %i[error warning ignore]
      +
      +
      + +
      +

      + + #enable_file_source_embed?Object + + + + + +

      +
      +

      Embeds source code along compiled files

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +179
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 179
      +
      +compiler_option :enable_file_source_embed, default: false, as: :enable_file_source_embed?
      +
      +
      + +
      +

      + + #enable_source_location?Object + + + + + +

      +
      +

      Adds source_location for every method definition

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +174
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 174
      +
      +compiler_option :enable_source_location, default: false, as: :enable_source_location?
      +
      +
      + +
      +

      + + #error(msg, line = nil) ⇒ Object + + + + + +

      +
      +

      This is called when a parsing/processing error occurs. This +method simply appends the filename and curent line number onto +the message and raises it.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +386
      +387
      +388
      +389
      +390
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 386
      +
      +def error(msg, line = nil)
      +  error = ::Opal::SyntaxError.new(msg)
      +  error.location = Opal::OpalBacktraceLocation.new(file, line)
      +  raise error
      +end
      +
      +
      + +
      +

      + + #esm?Object + + + + + +

      +
      +

      Encourage ESM semantics, eg. exporting run result

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +155
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 155
      +
      +compiler_option :esm, default: false, as: :esm?
      +
      +
      + +
      +

      + + #fileString + + + + + +

      +
      +

      The filename to use for compiling this code. Used for FILE directives +as well as finding relative require()

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (String) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +108
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 108
      +
      +compiler_option :file, default: '(file)'
      +
      +
      + +
      +

      + + #fragment(str, scope, sexp = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +423
      +424
      +425
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 423
      +
      +def fragment(str, scope, sexp = nil)
      +  Fragment.new(str, scope, sexp)
      +end
      +
      +
      + +
      +

      + + #freezing?Boolean + + + + + +

      +
      +
      Deprecated.
      +

      stubs out #freeze and #frozen?

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +130
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 130
      +
      +compiler_option :freezing, default: true, as: :freezing?
      +
      +
      + +
      +

      + + #handle_block_given_call(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +629
      +630
      +631
      +632
      +633
      +634
      +635
      +636
      +637
      +638
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 629
      +
      +def handle_block_given_call(sexp)
      +  @scope.uses_block!
      +  if @scope.block_name
      +    fragment("(#{@scope.block_name} !== nil)", scope, sexp)
      +  elsif (scope = @scope.find_parent_def) && scope.block_name
      +    fragment("(#{scope.block_name} !== nil)", scope, sexp)
      +  else
      +    fragment('false', scope, sexp)
      +  end
      +end
      +
      +
      + +
      +

      + + #handlersObject + + + + + +

      + + + + +
      +
      +
      +
      +523
      +524
      +525
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 523
      +
      +def handlers
      +  @handlers ||= Opal::Nodes::Base.handlers
      +end
      +
      +
      + +
      +

      + + #helper(name) ⇒ Object + + + + + +

      +
      +

      Use the given helper

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +458
      +459
      +460
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 458
      +
      +def helper(name)
      +  helpers << name
      +end
      +
      +
      + +
      +

      + + #helpersSet<Symbol> + + + + + +

      +
      +

      Any helpers required by this file. Used by Nodes::Top to reference +runtime helpers that are needed. These are used to minify resulting +javascript by keeping a reference to helpers used.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Set<Symbol>) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +347
      +348
      +349
      +350
      +351
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 347
      +
      +def helpers
      +  @helpers ||= Set.new(
      +    magic_comments[:helpers].to_s.split(',').map { |h| h.strip.to_sym }
      +  )
      +end
      +
      +
      + +
      +

      + + #in_caseObject + + + + + +

      + + + + +
      +
      +
      +
      +497
      +498
      +499
      +500
      +501
      +502
      +503
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 497
      +
      +def in_case
      +  return unless block_given?
      +  old = @case_stmt
      +  @case_stmt = {}
      +  yield
      +  @case_stmt = old
      +end
      +
      +
      + +
      +

      + + #in_whileObject + + + + + +

      +
      +

      Used when we enter a while statement. This pushes onto the current +scope's while stack so we know how to handle break, next etc.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +489
      +490
      +491
      +492
      +493
      +494
      +495
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 489
      +
      +def in_while
      +  return unless block_given?
      +  @while_loop = @scope.push_while
      +  result = yield
      +  @scope.pop_while
      +  result
      +end
      +
      +
      + +
      +

      + + #in_while?Boolean + + + + + +

      +
      +

      Returns true if the parser is curently handling a while sexp, +false otherwise.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +507
      +508
      +509
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 507
      +
      +def in_while?
      +  @scope.in_while?
      +end
      +
      +
      + +
      +

      + + #indentObject + + + + + +

      +
      +

      To keep code blocks nicely indented, this will yield a block after +adding an extra layer of indent, and then returning the resulting +code after reverting the indent.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +465
      +466
      +467
      +468
      +469
      +470
      +471
      +472
      +473
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 465
      +
      +def indent
      +  indent = @indent
      +  @indent += INDENT
      +  @space = "\n#{@indent}"
      +  res = yield
      +  @indent = indent
      +  @space = "\n#{@indent}"
      +  res
      +end
      +
      +
      + +
      +

      + + #inline_operators?Object + + + + + +

      +
      +

      are operators compiled inline

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +167
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 167
      +
      +compiler_option :inline_operators, default: true, as: :inline_operators?
      +
      +
      + +
      +

      + + #irb?Object + + + + + +

      +
      +

      compile top level local vars with support for irb style vars

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +135
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 135
      +
      +compiler_option :irb, default: false, as: :irb?
      +
      +
      + +
      +

      + + #load?Object + + + + + +

      +
      +

      Instantly load a requirable module

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +150
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 150
      +
      +compiler_option :load, default: false, as: :load?
      +
      +
      + +
      +

      + + #marshal_dumpObject + + + + + +

      +
      +

      Marshalling for cache shortpath

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +641
      +642
      +643
      +644
      +645
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 641
      +
      +def marshal_dump
      +  [@options, @option_values, @source_map ||= source_map.cache,
      +   @magic_comments, @result,
      +   @required_trees, @requires, @autoloads]
      +end
      +
      +
      + +
      +

      + + #marshal_load(src) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +647
      +648
      +649
      +650
      +651
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 647
      +
      +def marshal_load(src)
      +  @options, @option_values, @source_map,
      +  @magic_comments, @result,
      +  @required_trees, @requires, @autoloads = src
      +end
      +
      +
      + +
      +

      + + #method_missing?Boolean + + + + + +

      +
      +

      adds method stubs for all used methods in file

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +115
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 115
      +
      +compiler_option :method_missing, default: true, as: :method_missing?
      +
      +
      + +
      +

      + + #no_export?Object + + + + + +

      +
      +

      Don't export this compile, even if ESM mode is enabled. We use +this internally in CLI, so that even if ESM output is desired, +we would only have one default export.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +162
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 162
      +
      +compiler_option :no_export, default: false, as: :no_export?
      +
      +
      + +
      +

      + + #option_value(name, config) ⇒ Object + + + + + +

      +
      +

      Fetches and memoizes the value for an option.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 78
      +
      +def option_value(name, config)
      +  return @option_values[name] if @option_values.key? name
      +
      +  default_value = config[:default]
      +  valid_values  = config[:valid_values]
      +  magic_comment = config[:magic_comment]
      +
      +  value = @options.fetch(name, default_value)
      +
      +  if magic_comment && @magic_comments.key?(name)
      +    value = @magic_comments.fetch(name)
      +  end
      +
      +  if valid_values && !valid_values.include?(value)
      +    raise(
      +      ArgumentError,
      +      "invalid value #{value.inspect} for option #{name.inspect} " \
      +      "(valid values: #{valid_values.inspect})"
      +    )
      +  end
      +
      +  @option_values[name] = value
      +end
      +
      +
      + +
      +

      + + #parseObject + + + + + +

      + + + + +
      +
      +
      +
      +306
      +307
      +308
      +309
      +310
      +311
      +312
      +313
      +314
      +315
      +316
      +317
      +318
      +319
      +320
      +321
      +322
      +323
      +324
      +325
      +326
      +327
      +328
      +329
      +330
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 306
      +
      +def parse
      +  @buffer = ::Opal::Parser::SourceBuffer.new(file, 1)
      +  @buffer.source = @source
      +
      +  @parser = Opal::Parser.default_parser
      +
      +  sexp, comments, tokens = re_raise_with_location { @parser.tokenize(@buffer) }
      +
      +  kind = case
      +         when requirable?
      +           :require
      +         when eval?
      +           :eval
      +         else
      +           :main
      +         end
      +
      +  @sexp = sexp.tap { |i| i.meta[:kind] = kind }
      +
      +  first_node = sexp.children.first if sexp.children.first.location
      +
      +  @comments = ::Parser::Source::Comment.associate_locations(first_node, comments)
      +  @magic_comments = MagicComments.parse(first_node, comments)
      +  @eof_content = EofContent.new(tokens, @source).eof
      +end
      +
      +
      + +
      +

      + + #parse_comments?Object + + + + + +

      +
      +

      Adds comments for every method definition

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +189
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 189
      +
      +compiler_option :parse_comments, default: false, as: :parse_comments?
      +
      +
      + +
      +

      + + #parser_indentObject + + + + + +

      +
      +

      Instances of Scope can use this to determine the current +scope indent. The indent is used to keep generated code easily +readable.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +414
      +415
      +416
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 414
      +
      +def parser_indent
      +  @indent
      +end
      +
      +
      + +
      +

      + + #process(sexp, level = :expr) ⇒ Object + + + + + +

      +
      +

      Process the given sexp by creating a node instance, based on its type, +and compiling it to fragments.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +513
      +514
      +515
      +516
      +517
      +518
      +519
      +520
      +521
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 513
      +
      +def process(sexp, level = :expr)
      +  return fragment('', scope) if sexp.nil?
      +
      +  if handler = handlers[sexp.type]
      +    return handler.new(sexp, level, self).compile_to_fragments
      +  else
      +    error "Unsupported sexp: #{sexp.type}"
      +  end
      +end
      +
      +
      + +
      +

      + + #re_raise_with_locationObject + + + + + +

      + + + + +
      +
      +
      +
      +392
      +393
      +394
      +395
      +396
      +397
      +398
      +399
      +400
      +401
      +402
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 392
      +
      +def re_raise_with_location
      +  yield
      +rescue StandardError, ::Opal::SyntaxError => error
      +  opal_location = ::Opal.opal_location_from_error(error)
      +  opal_location.path = file
      +  opal_location.label ||= @source.lines[opal_location.line.to_i - 1].strip
      +  new_error = ::Opal::SyntaxError.new(error.message)
      +  new_error.set_backtrace error.backtrace
      +  ::Opal.add_opal_location_to_error(opal_location, new_error)
      +  raise new_error
      +end
      +
      +
      + +
      +

      + + #record_method_call(mid) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +353
      +354
      +355
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 353
      +
      +def record_method_call(mid)
      +  @method_calls << mid
      +end
      +
      +
      + +
      +

      + + #requirable?Object + + + + + +

      +
      +

      Prepare the code for future requires

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +145
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 145
      +
      +compiler_option :requirable, default: false, as: :requirable?
      +
      +
      + +
      +

      + + #required_treesObject + + + + + +

      +
      +

      An array of trees required in this file +(typically by calling #require_tree)

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +534
      +535
      +536
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 534
      +
      +def required_trees
      +  @required_trees ||= []
      +end
      +
      +
      + +
      +

      + + #requiresObject + + + + + +

      +
      +

      An array of requires used in this file

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +528
      +529
      +530
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 528
      +
      +def requires
      +  @requires ||= []
      +end
      +
      +
      + +
      +

      + + #returns(sexp) ⇒ Object + + + + + +

      +
      +

      The last sexps in method bodies, for example, need to be returned +in the compiled javascript. Due to syntax differences between +javascript any ruby, some sexps need to be handled specially. For +example, if statemented cannot be returned in javascript, so +instead the "truthy" and "falsy" parts of the if statement both +need to be returned instead.

      + +

      Sexps that need to be returned are passed to this method, and the +alterned/new sexps are returned and should be used instead. Most +sexps can just be added into a s(:return) sexp, so that is the +default action if no special case is required.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +555
      +556
      +557
      +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
      +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
      +611
      +612
      +613
      +614
      +615
      +616
      +617
      +618
      +619
      +620
      +621
      +622
      +623
      +624
      +625
      +626
      +627
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 555
      +
      +def returns(sexp)
      +  return returns s(:nil) unless sexp
      +
      +  case sexp.type
      +  when :undef
      +    # undef :method_name always returns nil
      +    returns sexp.updated(:begin, [sexp, s(:nil)])
      +  when :break, :next, :redo, :retry
      +    sexp
      +  when :yield
      +    sexp.updated(:returnable_yield, nil)
      +  when :when
      +    *when_sexp, then_sexp = *sexp
      +    sexp.updated(nil, [*when_sexp, returns(then_sexp)])
      +  when :rescue
      +    body_sexp, *resbodies, else_sexp = *sexp
      +
      +    resbodies = resbodies.map do |resbody|
      +      returns(resbody)
      +    end
      +
      +    if else_sexp
      +      else_sexp = returns(else_sexp)
      +    end
      +
      +    sexp.updated(
      +      nil, [
      +        returns(body_sexp),
      +        *resbodies,
      +        else_sexp
      +      ]
      +    )
      +  when :resbody
      +    klass, lvar, body = *sexp
      +    sexp.updated(nil, [klass, lvar, returns(body)])
      +  when :ensure
      +    rescue_sexp, ensure_body = *sexp
      +    sexp = sexp.updated(nil, [returns(rescue_sexp), ensure_body])
      +    sexp.updated(:js_return, [sexp])
      +  when :begin, :kwbegin
      +    # Wrapping last expression with s(:js_return, ...)
      +    *rest, last = *sexp
      +    sexp.updated(nil, [*rest, returns(last)])
      +  when :while, :until, :while_post, :until_post
      +    sexp
      +  when :return, :js_return, :returnable_yield
      +    sexp
      +  when :xstr
      +    if backtick_javascript_or_warn?
      +      sexp.updated(nil, [s(:js_return, *sexp.children)])
      +    else
      +      sexp
      +    end
      +  when :if
      +    cond, true_body, false_body = *sexp
      +    sexp.updated(
      +      nil, [
      +        cond,
      +        returns(true_body),
      +        returns(false_body)
      +      ]
      +    ).tap { |s| s.meta[:returning] = true }
      +  else
      +    if sexp.type == :send && sexp.children[1] == :debugger
      +      # debugger is a statement, so it doesn't return a value
      +      # and returning it is invalid. Therefore we update it
      +      # to do `debugger; return nil`.
      +      sexp.updated(:begin, [sexp, s(:js_return, s(:nil))])
      +    else
      +      sexp.updated(:js_return, [sexp])
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #s(type, *children) ⇒ Object + + + + + +

      +
      +

      Create a new sexp using the given parts.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +419
      +420
      +421
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 419
      +
      +def s(type, *children)
      +  ::Opal::AST::Node.new(type, children)
      +end
      +
      +
      + +
      +

      + + #source_mapOpal::SourceMap + + + + + +

      +
      +

      Returns a source map that can be used in the browser to map back to +original ruby code.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + source_file + + + (String) + + + + — +

        optional source_file to reference ruby source

        +
        + +
      • + +
      + +

      Returns:

      + + +
      + + + + +
      +
      +
      +
      +337
      +338
      +339
      +340
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 337
      +
      +def source_map
      +  # We only use @source_map if compiler is cached.
      +  @source_map || ::Opal::SourceMap::File.new(@fragments, file, @source, @result)
      +end
      +
      +
      + +
      +

      + + #unique_temp(name) ⇒ Object + + + + + +

      +
      +

      Used to generate a unique id name per file. These are used +mainly to name method bodies for methods that use blocks.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +429
      +430
      +431
      +432
      +433
      +434
      +435
      +436
      +437
      +438
      +439
      +440
      +441
      +442
      +443
      +444
      +445
      +446
      +447
      +448
      +449
      +450
      +451
      +452
      +453
      +454
      +455
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 429
      +
      +def unique_temp(name)
      +  name = name.to_s
      +  if name && !name.empty?
      +    name = name
      +           .to_s
      +           .gsub('<=>', '$lt_eq_gt')
      +           .gsub('===', '$eq_eq_eq')
      +           .gsub('==', '$eq_eq')
      +           .gsub('=~', '$eq_tilde')
      +           .gsub('!~', '$excl_tilde')
      +           .gsub('!=', '$not_eq')
      +           .gsub('<=', '$lt_eq')
      +           .gsub('>=', '$gt_eq')
      +           .gsub('=', '$eq')
      +           .gsub('?', '$ques')
      +           .gsub('!', '$excl')
      +           .gsub('/', '$slash')
      +           .gsub('%', '$percent')
      +           .gsub('+', '$plus')
      +           .gsub('-', '$minus')
      +           .gsub('<', '$lt')
      +           .gsub('>', '$gt')
      +           .gsub(/[^\w\$]/, '$')
      +  end
      +  unique = (@unique += 1)
      +  "#{'$' unless name.start_with?('$')}#{name}$#{unique}"
      +end
      +
      +
      + +
      +

      + + #use_strict?Object + + + + + +

      +
      +

      Enables JavaScript's strict mode (i.e., adds 'use strict'; statement)

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +184
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 184
      +
      +compiler_option :use_strict, default: false, as: :use_strict?, magic_comment: true
      +
      +
      + +
      +

      + + #warning(msg, line = nil) ⇒ Object + + + + + +

      +
      +

      This is called when a parsing/processing warning occurs. This +method simply appends the filename and curent line number onto +the message and issues a warning.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +407
      +408
      +409
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 407
      +
      +def warning(msg, line = nil)
      +  warn "warning: #{msg} -- #{file}:#{line}"
      +end
      +
      +
      + +
      +

      + + #with_tempObject + + + + + +

      +
      +

      Temporary varibales will be needed from time to time in the +generated code, and this method will assign (or reuse) on +while the block is yielding, and queue it back up once it is +finished. Variables are queued once finished with to save the +numbers of variables needed at runtime.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +480
      +481
      +482
      +483
      +484
      +485
      +
      +
      # File 'opal/lib/opal/compiler.rb', line 480
      +
      +def with_temp
      +  tmp = @scope.new_temp
      +  res = yield tmp
      +  @scope.queue_temp tmp
      +  res
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Config.html b/docs/api/v1.8.2/lib/Opal/Config.html new file mode 100644 index 00000000..126408f7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Config.html @@ -0,0 +1,1502 @@ + + + + + + + Module: Opal::Config + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Config + + + +

      +
      + + + + +
      +
      Extended by:
      +
      Config
      +
      + + + + + + +
      +
      Included in:
      +
      Config
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/config.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #compiler_options ⇒ Hash + + + + + + + + + + + + + +

        The configuration for Opal::Compiler.

        +
        + +
      • + + +
      • + + + #config ⇒ Hash + + + + + + + + + + + + + +

        The current configuration, defaults to #default_config.

        +
        + +
      • + + +
      • + + + #default_config ⇒ Hash + + + + + + + + + + + + + +

        The default configuration.

        +
        + +
      • + + +
      • + + + #reset! ⇒ void + + + + + + + + + + + + + +

        Resets the config to its default value.

        +
        + +
      • + + +
      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #arity_check_enabledtrue, false + + + + + +

      +
      +

      Enable arity check on the arguments passed to methods, procs and lambdas.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +89
      +
      +
      # File 'opal/lib/opal/config.rb', line 89
      +
      +config_option :arity_check_enabled, false, compiler_option: :arity_check
      +
      +
      + + + +
      +

      + + #const_missing_enabledtrue, false + + + + + +

      +
      +

      Enable const_missing support.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +84
      +
      +
      # File 'opal/lib/opal/config.rb', line 84
      +
      +config_option :const_missing_enabled, true, compiler_option: :const_missing
      +
      +
      + + + +
      +

      + + #dynamic_require_severity:error, ... + + + + + +

      +
      +

      Set the error severity for when a require can't be parsed at compile time.

      + +
        +
      • :error will raise an error at compile time
      • +
      • :warning will print a warning on stderr at compile time
      • +
      • :ignore will skip the require silently at compile time
      • +
      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      # Opal code
      +require "foo" + some_dynamic_value
      + +
      + +

      Returns:

      +
        + +
      • + + + (:error, :warning, :ignore) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +112
      +
      +
      # File 'opal/lib/opal/config.rb', line 112
      +
      +config_option :dynamic_require_severity, :warning, compiler_option: :dynamic_require_severity, valid_values: %i[error warning ignore]
      +
      +
      + + + +
      +

      + + #enable_file_source_embedtrue, false + + + + + +

      +
      +

      Enable embedding source code to be read by applications.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +150
      +
      +
      # File 'opal/lib/opal/config.rb', line 150
      +
      +config_option :enable_file_source_embed, false, compiler_option: :enable_file_source_embed
      +
      +
      + + + +
      +

      + + #enable_source_locationtrue, false + + + + + +

      +
      +

      Enable source location embedded for methods and procs.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +145
      +
      +
      # File 'opal/lib/opal/config.rb', line 145
      +
      +config_option :enable_source_location, false, compiler_option: :enable_source_location
      +
      +
      + + + +
      +

      + + #esmtrue, false + + + + + +

      +
      +

      Build ECMAScript modules, instead of legacy JS

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +99
      +
      +
      # File 'opal/lib/opal/config.rb', line 99
      +
      +config_option :esm, false, compiler_option: :esm
      +
      +
      + + + +
      +

      + + #freezing_stubs_enabledtrue, false + + + + + +

      +
      +

      Add stubs for methods related to freezing objects (for compatibility).

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +94
      +
      +
      # File 'opal/lib/opal/config.rb', line 94
      +
      +config_option :freezing_stubs_enabled, true, compiler_option: :freezing
      +
      +
      + + + +
      +

      + + #inline_operators_enabledtrue, false + + + + + +

      +
      +

      Enable for inline operators optimizations.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +135
      +
      +
      # File 'opal/lib/opal/config.rb', line 135
      +
      +config_option :inline_operators_enabled, true, compiler_option: :inline_operators
      +
      +
      + + + +
      +

      + + #irb_enabledtrue, false + + + + + +

      +
      +

      Enable IRB support for making local variables across multiple compilations.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +130
      +
      +
      # File 'opal/lib/opal/config.rb', line 130
      +
      +config_option :irb_enabled, false, compiler_option: :irb
      +
      +
      + + + +
      +

      + + #method_missing_enabledtrue, false + + + + + +

      +
      +

      Enable method_missing support.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +79
      +
      +
      # File 'opal/lib/opal/config.rb', line 79
      +
      +config_option :method_missing_enabled, true, compiler_option: :method_missing
      +
      +
      + + + +
      +

      + + #missing_require_severity:error, ... + + + + + +

      +
      +

      Set the error severity for when a required file can't be found at build time.

      + +
        +
      • :error will raise an error at compile time
      • +
      • :warning will print a warning on stderr at compile time
      • +
      • :ignore will skip the require silently at compile time
      • +
      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      # Opal code
      +require "some_non_existen_file"
      + +
      + +

      Returns:

      +
        + +
      • + + + (:error, :warning, :ignore) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +125
      +
      +
      # File 'opal/lib/opal/config.rb', line 125
      +
      +config_option :missing_require_severity, :error, valid_values: %i[error warning ignore]
      +
      +
      + + + +
      +

      + + #source_map_enabledtrue, false + + + + + +

      +
      +

      Enable source maps support.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (true, false) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +140
      +
      +
      # File 'opal/lib/opal/config.rb', line 140
      +
      +config_option :source_map_enabled, true
      +
      +
      + + + +
      +

      + + #stubbed_filesSet + + + + + +

      +
      +

      A set of stubbed files that will be marked as loaded and skipped during +compilation. The value is expected to be mutated but it's ok to replace +it.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Set) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +157
      +
      +
      # File 'opal/lib/opal/config.rb', line 157
      +
      +config_option :stubbed_files, -> { Set.new }, valid_values: [Set]
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compiler_optionsHash + + + + + +

      +
      +

      Returns the configuration for Opal::Compiler.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Hash) + + + + — +

        the configuration for Opal::Compiler

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +
      +
      # File 'opal/lib/opal/config.rb', line 55
      +
      +def compiler_options
      +  compiler_options = {}
      +  config_options.each do |name, options|
      +    compiler_option_name = options.fetch(:compiler)
      +    compiler_options[compiler_option_name] = config.fetch(name)
      +  end
      +  compiler_options
      +end
      +
      +
      + +
      +

      + + #configHash + + + + + +

      +
      +

      Returns the current configuration, defaults to #default_config.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Hash) + + + + — +

        the current configuration, defaults to #default_config

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +65
      +66
      +67
      +
      +
      # File 'opal/lib/opal/config.rb', line 65
      +
      +def config
      +  @config ||= default_config
      +end
      +
      +
      + +
      +

      + + #default_configHash + + + + + +

      +
      +

      Returns the default configuration.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Hash) + + + + — +

        the default configuration

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/config.rb', line 44
      +
      +def default_config
      +  default_config = {}
      +  config_options.each do |name, options|
      +    default_value = options.fetch(:default)
      +    default_value = Proc === default_value ? default_value.call : default_value
      +    default_config[name] = default_value
      +  end
      +  default_config
      +end
      +
      +
      + +
      +

      + + #reset!void + + + + + +

      +
      +

      This method returns an undefined value.

      Resets the config to its default value

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +72
      +73
      +74
      +
      +
      # File 'opal/lib/opal/config.rb', line 72
      +
      +def reset!
      +  @config = nil
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Deprecations.html b/docs/api/v1.8.2/lib/Opal/Deprecations.html new file mode 100644 index 00000000..002d054c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Deprecations.html @@ -0,0 +1,269 @@ + + + + + + + Module: Opal::Deprecations + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Deprecations + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      Opal
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/deprecations.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #raise_on_deprecationObject + + + + + +

      +
      +

      Returns the value of attribute raise_on_deprecation.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +5
      +6
      +7
      +
      +
      # File 'opal/lib/opal/deprecations.rb', line 5
      +
      +def raise_on_deprecation
      +  @raise_on_deprecation
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #deprecation(message) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/deprecations.rb', line 7
      +
      +def deprecation(message)
      +  message = "DEPRECATION WARNING: #{message}"
      +  if defined?(@raise_on_deprecation) && @raise_on_deprecation
      +    raise message
      +  else
      +    warn message
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/ERB.html b/docs/api/v1.8.2/lib/Opal/ERB.html new file mode 100644 index 00000000..bf78a451 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/ERB.html @@ -0,0 +1,270 @@ + + + + + + + Module: Opal::ERB + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::ERB + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/erb.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: Compiler + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .compile(source, file_name = '(erb)') ⇒ String + + + + + +

      +
      +

      Compile ERB code into javascript.

      + +

      [Opal::ERB] can be used to compile [ERB] templates into javascript code. +This module uses the [Opal::Compiler] internally.

      + +

      Compiled templates, when run in a javascript environment, will appear +under the Template namespace, and can be accessed as:

      + +
      Template['template_name'] # => template instance
      +
      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      
      +source = "<div><%= @content %></div>"
      +
      +Opal::ERB.compile source, "my_template.erb"
      + +
      +

      Parameters:

      +
        + +
      • + + source + + + (String) + + + + — +

        erb content

        +
        + +
      • + +
      • + + file_name + + + (String) + + + (defaults to: '(erb)') + + + — +

        filename for reference in template

        +
        + +
      • + +
      + +

      Returns:

      +
        + +
      • + + + (String) + + + + — +

        javascript code

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/erb.rb', line 27
      +
      +def self.compile(source, file_name = '(erb)')
      +  Compiler.new(source, file_name).compile
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/ERB/Compiler.html b/docs/api/v1.8.2/lib/Opal/ERB/Compiler.html new file mode 100644 index 00000000..dfe1cf29 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/ERB/Compiler.html @@ -0,0 +1,629 @@ + + + + + + + Class: Opal::ERB::Compiler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::ERB::Compiler + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/erb.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      BLOCK_EXPR = + +
      +
      /\s+(do|\{)(\s*\|[^|]*\|)?\s*\Z/.freeze
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(source, file_name = '(erb)') ⇒ Compiler + + + + + +

      +
      +

      Returns a new instance of Compiler.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/erb.rb', line 34
      +
      +def initialize(source, file_name = '(erb)')
      +  @source, @file_name, @result = source, file_name, source
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/erb.rb', line 50
      +
      +def compile
      +  Opal.compile prepared_source
      +end
      +
      +
      + +
      +

      + + #find_code(result) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +78
      +79
      +
      +
      # File 'opal/lib/opal/erb.rb', line 74
      +
      +def find_code(result)
      +  result.gsub(/<%([\s\S]+?)%>/) do
      +    inner = Regexp.last_match(1).gsub(/\\"/, '"')
      +    "\")\n#{inner}\noutput_buffer.append(\""
      +  end
      +end
      +
      +
      + +
      +

      + + #find_contents(result) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/erb.rb', line 62
      +
      +def find_contents(result)
      +  result.gsub(/<%=([\s\S]+?)%>/) do
      +    inner = Regexp.last_match(1).gsub(/\\'/, "'").gsub(/\\"/, '"')
      +
      +    if inner =~ BLOCK_EXPR
      +      "\")\noutput_buffer.append= #{inner}\noutput_buffer.append(\""
      +    else
      +      "\")\noutput_buffer.append=(#{inner})\noutput_buffer.append(\""
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #fix_quotes(result) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +54
      +55
      +56
      +
      +
      # File 'opal/lib/opal/erb.rb', line 54
      +
      +def fix_quotes(result)
      +  result.gsub '"', '\\"'
      +end
      +
      +
      + +
      +

      + + #prepared_sourceObject + + + + + +

      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +
      +
      # File 'opal/lib/opal/erb.rb', line 38
      +
      +def prepared_source
      +  @prepared_source ||= begin
      +    source = @source
      +    source = fix_quotes(source)
      +    source = find_contents(source)
      +    source = find_code(source)
      +    source = wrap_compiled(source)
      +    source = require_erb(source)
      +    source
      +  end
      +end
      +
      +
      + +
      +

      + + #require_erb(result) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +58
      +59
      +60
      +
      +
      # File 'opal/lib/opal/erb.rb', line 58
      +
      +def require_erb(result)
      +  'require "erb";' + result
      +end
      +
      +
      + +
      +

      + + #wrap_compiled(result) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +84
      +
      +
      # File 'opal/lib/opal/erb.rb', line 81
      +
      +def wrap_compiled(result)
      +  path = @file_name.sub(/\.opalerb#{REGEXP_END}/, '')
      +  "Template.new('#{path}') do |output_buffer|\noutput_buffer.append(\"#{result}\")\noutput_buffer.join\nend\n"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/EofContent.html b/docs/api/v1.8.2/lib/Opal/EofContent.html new file mode 100644 index 00000000..e1bcccf9 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/EofContent.html @@ -0,0 +1,309 @@ + + + + + + + Class: Opal::EofContent + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::EofContent + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/eof_content.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      DATA_SEPARATOR = + +
      +
      "__END__\n"
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(tokens, source) ⇒ EofContent + + + + + +

      +
      +

      Returns a new instance of EofContent.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/eof_content.rb', line 7
      +
      +def initialize(tokens, source)
      +  @tokens = tokens
      +  @source = source
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #eofObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/eof_content.rb', line 12
      +
      +def eof
      +  return nil if @tokens.empty?
      +
      +  eof_content = @source[last_token_position..-1]
      +  return nil unless eof_content
      +
      +  # On Windows token position is off a bit, because Parser does not seem to compensate for \r\n
      +  # The first eof_content line on Windows may be for example "end\r\n"
      +  # Must match for it and \r\n and \n
      +  eof_content = eof_content.lines.drop_while { |line| /\A.*\r?\n?\z/.match?(line) && !line.start_with?('__END__') }
      +
      +  if /\A__END__\r?\n?\z/.match?(eof_content[0])
      +    eof_content = eof_content[1..-1] || []
      +    eof_content.join
      +  elsif eof_content == ['__END__']
      +    ''
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Error.html b/docs/api/v1.8.2/lib/Opal/Error.html new file mode 100644 index 00000000..132be8b6 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Error.html @@ -0,0 +1,140 @@ + + + + + + + Exception: Opal::Error + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::Error + + + +

      +
      + +
      +
      Inherits:
      +
      + StandardError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/errors.rb
      +
      + +
      + +

      Overview

      +
      +

      Generic Opal error

      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      CompilationError, GemNotFound

      +
      + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Fragment.html b/docs/api/v1.8.2/lib/Opal/Fragment.html new file mode 100644 index 00000000..0d499a32 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Fragment.html @@ -0,0 +1,955 @@ + + + + + + + Class: Opal::Fragment + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Fragment + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/fragment.rb
      +
      + +
      + +

      Overview

      +
      +

      A fragment holds a string of generated javascript that will be written +to the destination. It also keeps hold of the original sexp from which +it was generated. Using this sexp, when writing fragments in order, a +mapping can be created of the original location => target location, +aka, source-maps!

      + +

      These are generated by nodes, so will not have to create directly.

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

      Instance Attribute Summary collapse

      +
        + +
      • + + + #code ⇒ String + + + + + + + + + readonly + + + + + + + + + +

        String of javascript this fragment holds.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(code, scope, sexp = nil) ⇒ Fragment + + + + + +

      +
      +

      Create fragment with javascript code and optional original [Opal::Sexp].

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + code + + + (String) + + + + — +

        javascript code

        +
        + +
      • + +
      • + + sexp + + + (Opal::Sexp) + + + (defaults to: nil) + + + — +

        sexp used for creating fragment

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 20
      +
      +def initialize(code, scope, sexp = nil)
      +  @code = code.to_s
      +  @sexp = sexp
      +  @scope = scope
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #codeString (readonly) + + + + + +

      +
      +

      String of javascript this fragment holds

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (String) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 14
      +
      +def code
      +  @code
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #columnInteger? + + + + + +

      +
      +

      Original column this fragment was created from

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Integer, nil) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +127
      +128
      +129
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 127
      +
      +def column
      +  location&.column
      +end
      +
      +
      + +
      +

      + + #inspectObject + + + + + +

      +
      +

      Inspect the contents of this fragment, f("fooo")

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 27
      +
      +def inspect
      +  "f(#{@code.inspect})"
      +end
      +
      +
      + +
      +

      + + #lineInteger? + + + + + +

      +
      +

      Original line this fragment was created from

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Integer, nil) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +121
      +122
      +123
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 121
      +
      +def line
      +  location&.line
      +end
      +
      +
      + +
      +

      + + #locationObject + + + + + +

      + + + + +
      +
      +
      +
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 95
      +
      +def location
      +  case
      +  when !@sexp
      +    nil
      +  when @sexp.type == :send
      +    loc = @sexp.loc
      +    if loc.respond_to? :dot # a>.b || a>+b / >a / a>[b]
      +      loc.dot || loc.selector
      +    elsif loc.respond_to? :operator # a >|= b
      +      loc.operator
      +    else
      +      @sexp
      +    end
      +  when @sexp.type == :iter
      +    if loc.respond_to? :begin
      +      @sexp.loc.begin # [1,2].each >{ }
      +    else
      +      @sexp
      +    end
      +  else
      +    @sexp
      +  end
      +end
      +
      +
      + +
      +

      + + #skip_source_map?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +131
      +132
      +133
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 131
      +
      +def skip_source_map?
      +  @sexp == false
      +end
      +
      +
      + +
      +

      + + #source_map_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +89
      +90
      +91
      +92
      +93
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 89
      +
      +def source_map_name
      +  return nil unless @sexp
      +
      +  source_map_name_for(@sexp)
      +end
      +
      +
      + +
      +

      + + #source_map_name_for(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +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
      +
      +
      # File 'opal/lib/opal/fragment.rb', line 31
      +
      +def source_map_name_for(sexp)
      +  case sexp.type
      +  when :top
      +    case sexp.meta[:kind]
      +    when :require
      +      '<top (required)>'
      +    when :eval
      +      '(eval)'
      +    when :main
      +      '<main>'
      +    end
      +  when :begin, :newline, :js_return
      +    source_map_name_for(@scope.sexp) if @scope
      +  when :iter
      +    scope = @scope
      +    iters = 1
      +    while scope
      +      if scope.class == Nodes::IterNode
      +        iters += 1
      +        scope = scope.parent
      +      else
      +        break
      +      end
      +    end
      +    level = " (#{iters} levels)" if iters > 1
      +    "block#{level} in #{source_map_name_for(scope.sexp)}"
      +  when :self
      +    'self'
      +  when :module
      +    const, = *sexp
      +    "<module:#{source_map_name_for(const)}>"
      +  when :class
      +    const, = *sexp
      +    "<class:#{source_map_name_for(const)}>"
      +  when :const
      +    scope, name = *sexp
      +    if !scope || scope.type == :cbase
      +      name.to_s
      +    else
      +      "#{source_map_name_for(scope)}::#{name}"
      +    end
      +  when :int
      +    sexp.children.first
      +  when :def
      +    sexp.children.first
      +  when :defs
      +    sexp.children[1]
      +  when :send
      +    sexp.children[1]
      +  when :lvar, :lvasgn, :lvdeclare, :ivar, :ivasgn, :gvar, :cvar, :cvasgn, :gvars, :gvasgn, :arg
      +    sexp.children.first
      +  when :str, :xstr # Inside xstr - JS calls
      +    source_map_name_for(@scope.sexp)
      +  else
      +    # nil
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/GemNotFound.html b/docs/api/v1.8.2/lib/Opal/GemNotFound.html new file mode 100644 index 00000000..1c6a131c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/GemNotFound.html @@ -0,0 +1,325 @@ + + + + + + + Exception: Opal::GemNotFound + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::GemNotFound + + + +

      +
      + +
      +
      Inherits:
      +
      + Error + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/errors.rb
      +
      + +
      + +

      Overview

      +
      +

      raised if Gem not found in Opal#use_gem

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

      Instance Attribute Summary collapse

      +
        + +
      • + + + #gem_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        name of gem that not found.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

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

      Constructor Details

      + +
      +

      + + #initialize(gem_name) ⇒ GemNotFound + + + + + +

      +
      +

      Returns a new instance of GemNotFound.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + gem_name + + + (String) + + + + — +

        name of gem that not found

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +
      +
      # File 'opal/lib/opal/errors.rb', line 14
      +
      +def initialize(gem_name)
      +  @gem_name = gem_name
      +  super("can't find gem #{gem_name}")
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #gem_nameObject (readonly) + + + + + +

      +
      +

      name of gem that not found

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +
      +
      # File 'opal/lib/opal/errors.rb', line 11
      +
      +def gem_name
      +  @gem_name
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Hike.html b/docs/api/v1.8.2/lib/Opal/Hike.html new file mode 100644 index 00000000..4a2616a7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Hike.html @@ -0,0 +1,127 @@ + + + + + + + Module: Opal::Hike + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Hike + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/hike.rb
      +
      + +
      + +

      Overview

      +
      +

      Taken from hike v1.2.3

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Index, Trail + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Hike/Index.html b/docs/api/v1.8.2/lib/Opal/Hike/Index.html new file mode 100644 index 00000000..39b29203 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Hike/Index.html @@ -0,0 +1,761 @@ + + + + + + + Class: Opal::Hike::Index + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Hike::Index + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/hike.rb
      +
      + +
      + +

      Overview

      +
      +

      Index is an internal cached variant of Trail. It assumes the +file system does not change between find calls. All stat and +entries calls are cached for the lifetime of the Index object.

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

      Instance Attribute Summary collapse

      +
        + +
      • + + + #extensions ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Index#extensions is an immutable collection of extensions.

        +
        + +
      • + + +
      • + + + #paths ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Index#paths is an immutable collection of Pathnames.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(root, paths, extensions) ⇒ Index + + + + + +

      +
      +

      Index.new is an internal method. Instead of constructing it +directly, create a Trail and call Trail#index.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +
      +
      # File 'opal/lib/opal/hike.rb', line 41
      +
      +def initialize(root, paths, extensions)
      +  @root = root
      +
      +  # Freeze is used here so an error is throw if a mutator method
      +  # is called on the array. Mutating `@paths`, `@extensions`
      +  # would have unpredictable results.
      +  @paths      = paths.dup.freeze
      +  @extensions = extensions.dup.freeze
      +  @pathnames  = paths.map { |path| Pathname.new(path) }
      +
      +  @stats    = {}
      +  @entries  = {}
      +  @patterns = {}
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #extensionsObject (readonly) + + + + + +

      +
      +

      Index#extensions is an immutable collection of extensions.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/hike.rb', line 37
      +
      +def extensions
      +  @extensions
      +end
      +
      +
      + + + +
      +

      + + #pathsObject (readonly) + + + + + +

      +
      +

      Index#paths is an immutable collection of Pathnames.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/hike.rb', line 34
      +
      +def paths
      +  @paths
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #entries(path) ⇒ Object + + + + + +

      +
      +

      A cached version of Dir.entries that filters out . files and +~ swap files. Returns an empty Array if the directory does +not exist.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +
      +
      # File 'opal/lib/opal/hike.rb', line 86
      +
      +def entries(path)
      +  @entries[path.to_s] ||= begin
      +    pathname = Pathname.new(path)
      +    if pathname.directory?
      +      pathname.entries.reject { |entry| entry.to_s =~ /^\.|~$|^\#.*\#$/ }.sort
      +    else
      +      []
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #find(logical_path) ⇒ Object + + + + + +

      +
      +

      The real implementation of find. Trail#find generates a one +time index and delegates here.

      + +

      See Trail#find for usage.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +
      +
      # File 'opal/lib/opal/hike.rb', line 70
      +
      +def find(logical_path)
      +  base_path = Pathname.new(@root)
      +  logical_path = Pathname.new(logical_path.sub(/^\//, ''))
      +
      +  if logical_path.to_s =~ %r{^\.\.?/}
      +    find_in_base_path(logical_path, base_path) { |path| return path }
      +  else
      +    find_in_paths(logical_path) { |path| return path }
      +  end
      +
      +  nil
      +end
      +
      +
      + +
      +

      + + #indexObject + + + + + +

      +
      +

      Index#index returns self to be compatable with the Trail interface.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +
      +
      # File 'opal/lib/opal/hike.rb', line 62
      +
      +def index
      +  self
      +end
      +
      +
      + +
      +

      + + #rootObject + + + + + +

      +
      +

      Index#root returns root path as a String. This attribute is immutable.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +
      +
      # File 'opal/lib/opal/hike.rb', line 57
      +
      +def root
      +  @root.to_s
      +end
      +
      +
      + +
      +

      + + #stat(path) ⇒ Object + + + + + +

      +
      +

      A cached version of File.stat. Returns nil if the file does +not exist.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +
      +
      # File 'opal/lib/opal/hike.rb', line 99
      +
      +def stat(path)
      +  key = path.to_s
      +  if @stats.key?(key)
      +    @stats[key]
      +  elsif File.exist?(path)
      +    @stats[key] = File.stat(path)
      +  else
      +    @stats[key] = nil
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Hike/Trail.html b/docs/api/v1.8.2/lib/Opal/Hike/Trail.html new file mode 100644 index 00000000..5571f0e5 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Hike/Trail.html @@ -0,0 +1,877 @@ + + + + + + + Class: Opal::Hike::Trail + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Hike::Trail + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/hike.rb
      +
      + +
      + +

      Overview

      +
      +

      Trail is the public container class for holding paths and extensions.

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

      Instance Attribute Summary collapse

      +
        + +
      • + + + #extensions ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Trail#extensions is a mutable Extensions collection.

        +
        + +
      • + + +
      • + + + #paths ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Trail#paths is a mutable Paths collection.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(root = '.') ⇒ Trail + + + + + +

      +
      +

      A Trail accepts an optional root path that defaults to your +current working directory. Any relative paths added to +Trail#paths will expanded relative to the root.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +217
      +218
      +219
      +220
      +221
      +
      +
      # File 'opal/lib/opal/hike.rb', line 217
      +
      +def initialize(root = '.')
      +  @root       = Pathname.new(root).expand_path
      +  @paths      = []
      +  @extensions = []
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #extensionsObject (readonly) + + + + + +

      +
      +

      Trail#extensions is a mutable Extensions collection.

      + +
      trail = Hike::Trail.new
      +trail.paths.push "~/Projects/hike/lib"
      +trail.extensions.push ".rb"
      +
      + +

      Extensions allow you to find files by just their name omitting +their extension. Is similar to Ruby's require mechanism that +allows you to require files with specifiying foo.rb.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +212
      +213
      +214
      +
      +
      # File 'opal/lib/opal/hike.rb', line 212
      +
      +def extensions
      +  @extensions
      +end
      +
      +
      + + + +
      +

      + + #pathsObject (readonly) + + + + + +

      +
      +

      Trail#paths is a mutable Paths collection.

      + +
      trail = Hike::Trail.new
      +trail.paths.push "~/Projects/hike/lib", "~/Projects/hike/test"
      +
      + +

      The order of the paths is significant. Paths in the beginning of +the collection will be checked first. In the example above, +~/Projects/hike/lib/hike.rb would shadow the existent of +~/Projects/hike/test/hike.rb.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +201
      +202
      +203
      +
      +
      # File 'opal/lib/opal/hike.rb', line 201
      +
      +def paths
      +  @paths
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #append_extensions(*extensions) ⇒ Object + + + + + +

      +
      +

      Append extension to Extensions collection

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +234
      +235
      +236
      +
      +
      # File 'opal/lib/opal/hike.rb', line 234
      +
      +def append_extensions(*extensions)
      +  @extensions.concat(extensions.map { |e| normalize_extension(e) })
      +end
      +
      +
      + +
      +

      + + #append_paths(*paths) ⇒ Object + + + + + +

      +
      +

      Append path to Paths collection

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +229
      +230
      +231
      +
      +
      # File 'opal/lib/opal/hike.rb', line 229
      +
      +def append_paths(*paths)
      +  @paths.concat(paths.map { |p| normalize_path(p) })
      +end
      +
      +
      + +
      +

      + + #entries(path) ⇒ Object + + + + + +

      +
      +

      Trail#entries is equivalent to Dir#entries. It is not +recommend to use this method for general purposes. It exists for +parity with Index#entries.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +272
      +273
      +274
      +275
      +276
      +277
      +278
      +279
      +
      +
      # File 'opal/lib/opal/hike.rb', line 272
      +
      +def entries(path)
      +  pathname = Pathname.new(path)
      +  if pathname.directory?
      +    pathname.entries.reject { |entry| entry.to_s =~ /^\.|~$|^\#.*\#$/ }.sort
      +  else
      +    []
      +  end
      +end
      +
      +
      + +
      +

      + + #find(*args, &block) ⇒ Object + + + + + +

      +
      +

      Trail#find returns a the expand path for a logical path in the +path collection.

      + +
      trail = Hike::Trail.new "~/Projects/hike"
      +trail.extensions.push ".rb"
      +trail.paths.push "lib", "test"
      +
      +trail.find "hike/trail"
      +# => "~/Projects/hike/lib/hike/trail.rb"
      +
      +trail.find "test_trail"
      +# => "~/Projects/hike/test/test_trail.rb"
      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +251
      +252
      +253
      +
      +
      # File 'opal/lib/opal/hike.rb', line 251
      +
      +def find(*args, &block)
      +  index.find(*args, &block)
      +end
      +
      +
      + +
      +

      + + #indexObject + + + + + +

      +
      +

      Trail#index returns an Index object that has the same +interface as Trail. An Index is a cached Trail object that +does not update when the file system changes. If you are +confident that you are not making changes the paths you are +searching, index will avoid excess system calls.

      + +
      index = trail.index
      +index.find "hike/trail"
      +index.find "test_trail"
      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +265
      +266
      +267
      +
      +
      # File 'opal/lib/opal/hike.rb', line 265
      +
      +def index
      +  Index.new(root, paths, extensions)
      +end
      +
      +
      + +
      +

      + + #rootObject + + + + + +

      +
      +

      Trail#root returns root path as a String. This attribute is immutable.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +224
      +225
      +226
      +
      +
      # File 'opal/lib/opal/hike.rb', line 224
      +
      +def root
      +  @root.to_s
      +end
      +
      +
      + +
      +

      + + #stat(path) ⇒ Object + + + + + +

      +
      +

      Trail#stat is equivalent to File#stat. It is not +recommend to use this method for general purposes. It exists for +parity with Index#stat.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +284
      +285
      +286
      +287
      +288
      +289
      +290
      +
      +
      # File 'opal/lib/opal/hike.rb', line 284
      +
      +def stat(path)
      +  if File.exist?(path)
      +    File.stat(path.to_s)
      +  else
      +    # nil
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/MagicComments.html b/docs/api/v1.8.2/lib/Opal/MagicComments.html new file mode 100644 index 00000000..d601bc27 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/MagicComments.html @@ -0,0 +1,245 @@ + + + + + + + Module: Opal::MagicComments + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::MagicComments + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/magic_comments.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      MAGIC_COMMENT_RE = + +
      +
      /\A# *(\w+) *: *(\S+.*?) *$/.freeze
      + +
      EMACS_MAGIC_COMMENT_RE = + +
      +
      /\A# *-\*- *(\w+) *: *(\S+.*?) *-\*- *$/.freeze
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .parse(sexp, comments) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/magic_comments.rb', line 7
      +
      +def self.parse(sexp, comments)
      +  flags = {}
      +
      +  # We have an upper limit at the first line of code
      +  if sexp
      +    first_line = sexp.loc.line
      +    comments = comments.take(first_line)
      +  end
      +
      +  comments.each do |comment|
      +    next if first_line && comment.loc.line >= first_line
      +
      +    if (parts = comment.text.scan(MAGIC_COMMENT_RE)).any? ||
      +       (parts = comment.text.scan(EMACS_MAGIC_COMMENT_RE)).any?
      +      parts.each do |key, value|
      +        flags[key.to_sym] =
      +          case value
      +          when 'true' then true
      +          when 'false' then false
      +          else value
      +          end
      +      end
      +    end
      +  end
      +
      +  flags
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes.html b/docs/api/v1.8.2/lib/Opal/Nodes.html new file mode 100644 index 00000000..ac514429 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes.html @@ -0,0 +1,121 @@ + + + + + + + Module: Opal::Nodes + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Nodes + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/if.rb,
      + opal/lib/opal/nodes/def.rb,
      opal/lib/opal/nodes/top.rb,
      opal/lib/opal/nodes/args.rb,
      opal/lib/opal/nodes/base.rb,
      opal/lib/opal/nodes/call.rb,
      opal/lib/opal/nodes/defs.rb,
      opal/lib/opal/nodes/hash.rb,
      opal/lib/opal/nodes/iter.rb,
      opal/lib/opal/nodes/array.rb,
      opal/lib/opal/nodes/class.rb,
      opal/lib/opal/nodes/logic.rb,
      opal/lib/opal/nodes/masgn.rb,
      opal/lib/opal/nodes/scope.rb,
      opal/lib/opal/nodes/super.rb,
      opal/lib/opal/nodes/while.rb,
      opal/lib/opal/nodes/yield.rb,
      opal/lib/opal/nodes/lambda.rb,
      opal/lib/opal/nodes/module.rb,
      opal/lib/opal/nodes/rescue.rb,
      opal/lib/opal/nodes/arglist.rb,
      opal/lib/opal/nodes/closure.rb,
      opal/lib/opal/nodes/defined.rb,
      opal/lib/opal/nodes/helpers.rb,
      opal/lib/opal/nodes/literal.rb,
      opal/lib/opal/nodes/args/arg.rb,
      opal/lib/opal/nodes/x_string.rb,
      opal/lib/opal/nodes/constants.rb,
      opal/lib/opal/nodes/variables.rb,
      opal/lib/opal/nodes/definitions.rb,
      opal/lib/opal/nodes/call_special.rb,
      opal/lib/opal/nodes/args/fake_arg.rb,
      opal/lib/opal/nodes/node_with_args.rb,
      opal/lib/opal/nodes/args/parameters.rb,
      opal/lib/opal/nodes/singleton_class.rb,
      opal/lib/opal/nodes/args/arity_check.rb,
      opal/lib/opal/nodes/args/extract_kwarg.rb,
      opal/lib/opal/nodes/args/extract_kwargs.rb,
      opal/lib/opal/nodes/args/extract_optarg.rb,
      opal/lib/opal/nodes/args/extract_restarg.rb,
      opal/lib/opal/nodes/args/extract_kwoptarg.rb,
      opal/lib/opal/nodes/args/extract_post_arg.rb,
      opal/lib/opal/nodes/args/extract_block_arg.rb,
      opal/lib/opal/nodes/args/extract_kwrestarg.rb,
      opal/lib/opal/nodes/args/prepare_post_args.rb,
      opal/lib/opal/nodes/args/initialize_iterarg.rb,
      opal/lib/opal/nodes/args/extract_post_optarg.rb,
      opal/lib/opal/nodes/node_with_args/shortcuts.rb,
      opal/lib/opal/nodes/args/initialize_shadowarg.rb,
      opal/lib/opal/nodes/args/ensure_kwargs_are_kwargs.rb
      +
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: Args, Helpers + + + + Classes: AliasNode, ArglistNode, ArgsNode, ArityCheckNode, ArrayNode, BackRefNode, Base, BaseFlipFlop, BaseSuperNode, BaseYieldNode, BeginNode, BlockPassNode, BreakNode, CallNode, CbaseNode, ClassNode, ClassVarAssignNode, ClassVariableNode, Closure, ComplexNode, ConstAssignNode, ConstNode, DefNode, DefinedNode, DefinedSuperNode, DefsNode, DynamicStringNode, DynamicSymbolNode, EFlipFlop, EnsureNode, ExclusiveRangeNode, GlobalAssignNode, GlobalVariableNode, HashNode, IFlipFlop, IfNode, InclusiveRangeNode, InstanceAssignNode, InstanceVariableNode, IterArityCheckNode, IterNode, JSReturnNode, JSTempNode, JsAttrAsgnNode, JsAttrNode, JsCallNode, KwBeginNode, KwSplatNode, LambdaNode, LocalAssignNode, LocalDeclareNode, LocalVariableNode, MassAssignNode, Match3Node, MatchCurrentLineNode, ModuleNode, NextNode, NodeWithArgs, NthrefNode, NumericNode, RangeNode, RationalNode, RedoNode, RegexpNode, ResBodyNode, RescueNode, RetryNode, ReturnNode, ReturnableYieldNode, ScopeNode, SelfNode, SingletonClassNode, SplatNode, StringNode, SuperNode, SymbolNode, TopNode, UndefNode, UntilNode, UntilPostNode, ValueNode, WhileNode, WhilePostNode, XStringNode, YieldNode, ZsuperNode + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/AliasNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/AliasNode.html new file mode 100644 index 00000000..e712216c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/AliasNode.html @@ -0,0 +1,271 @@ + + + + + + + Class: Opal::Nodes::AliasNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::AliasNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/definitions.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/nodes/definitions.rb', line 24
      +
      +def compile
      +  # We only need to check one type, because parser otherwise denies invalid expressions
      +  case new_name.type
      +  when :gvar # This is a gvar alias: alias $a $b
      +    helper :alias_gvar
      +    new_name_str = new_name.children.first.to_s[1..-1].inspect
      +    old_name_str = old_name.children.first.to_s[1..-1].inspect
      +    push '$alias_gvar(', new_name_str, ', ', old_name_str, ')'
      +  when :dsym, :sym # This is a method alias: alias a b
      +    helper :alias
      +    compiler.record_method_call old_name.children.last if old_name.type == :sym
      +
      +    push "$alias(#{scope.self}, ", expr(new_name), ', ', expr(old_name), ')'
      +  else # Nothing else is available, but just in case, drop an error
      +    error "Opal doesn't know yet how to alias with #{new_name.type}"
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ArglistNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ArglistNode.html new file mode 100644 index 00000000..ef130a32 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ArglistNode.html @@ -0,0 +1,333 @@ + + + + + + + Class: Opal::Nodes::ArglistNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ArglistNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/arglist.rb
      +
      + +
      + +

      Overview

      +
      +

      FIXME: needs rewrite

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/arglist.rb', line 11
      +
      +def compile
      +  code, work = [], []
      +
      +  children.each do |current|
      +    splat = current.type == :splat
      +    arg = expr(current)
      +
      +    if splat
      +      if work.empty?
      +        if code.empty?
      +          code << arg
      +        else
      +          code << fragment('.concat(') << arg << fragment(')')
      +        end
      +      else
      +        if code.empty?
      +          code << fragment('[') << work << fragment(']')
      +        else
      +          code << fragment('.concat([') << work << fragment('])')
      +        end
      +
      +        code << fragment('.concat(') << arg << fragment(')')
      +      end
      +
      +      work = []
      +    else
      +      work << fragment(', ') unless work.empty?
      +      work << arg
      +    end
      +  end
      +
      +  unless work.empty?
      +    join = work
      +
      +    if code.empty?
      +      code = join
      +    else
      +      code << fragment('.concat([') << join << fragment('])')
      +    end
      +  end
      +
      +  push(*code)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args.html new file mode 100644 index 00000000..18884d2c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args.html @@ -0,0 +1,119 @@ + + + + + + + Module: Opal::Nodes::Args + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Nodes::Args + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/arg.rb,
      + opal/lib/opal/nodes/args/fake_arg.rb,
      opal/lib/opal/nodes/args/parameters.rb,
      opal/lib/opal/nodes/args/extract_kwarg.rb,
      opal/lib/opal/nodes/args/extract_kwargs.rb,
      opal/lib/opal/nodes/args/extract_optarg.rb,
      opal/lib/opal/nodes/args/extract_restarg.rb,
      opal/lib/opal/nodes/args/extract_kwoptarg.rb,
      opal/lib/opal/nodes/args/extract_post_arg.rb,
      opal/lib/opal/nodes/args/extract_block_arg.rb,
      opal/lib/opal/nodes/args/extract_kwrestarg.rb,
      opal/lib/opal/nodes/args/prepare_post_args.rb,
      opal/lib/opal/nodes/args/initialize_iterarg.rb,
      opal/lib/opal/nodes/args/extract_post_optarg.rb,
      opal/lib/opal/nodes/args/initialize_shadowarg.rb,
      opal/lib/opal/nodes/args/ensure_kwargs_are_kwargs.rb
      +
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: ArgNode, EnsureKwargsAreKwargs, ExtractBlockarg, ExtractKwarg, ExtractKwargs, ExtractKwoptarg, ExtractKwrestarg, ExtractOptargNode, ExtractPostArg, ExtractPostOptarg, ExtractRestarg, FakeArgNode, InitializeIterarg, InitializeShadowarg, Parameters, PreparePostArgs + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ArgNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ArgNode.html new file mode 100644 index 00000000..ee0433f4 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ArgNode.html @@ -0,0 +1,257 @@ + + + + + + + Class: Opal::Nodes::Args::ArgNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ArgNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/arg.rb
      +
      + +
      + +

      Overview

      +
      +

      Compiles a single inline required argument +def m(a); end + ^

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +18
      +
      +
      # File 'opal/lib/opal/nodes/args/arg.rb', line 15
      +
      +def compile
      +  scope.add_arg name
      +  push name.to_s
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/EnsureKwargsAreKwargs.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/EnsureKwargsAreKwargs.html new file mode 100644 index 00000000..7bab65cf --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/EnsureKwargsAreKwargs.html @@ -0,0 +1,260 @@ + + + + + + + Class: Opal::Nodes::Args::EnsureKwargsAreKwargs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::EnsureKwargsAreKwargs + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/ensure_kwargs_are_kwargs.rb
      +
      + +
      + +

      Overview

      +
      +

      A utility node responsible for compiling +a runtime validation for kwargs.

      + +

      This node is used for both inline and post-kwargs

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/nodes/args/ensure_kwargs_are_kwargs.rb', line 16
      +
      +def compile
      +  helper :ensure_kwargs
      +
      +  push '$kwargs = $ensure_kwargs($kwargs)'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractBlockarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractBlockarg.html new file mode 100644 index 00000000..86e8def3 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractBlockarg.html @@ -0,0 +1,264 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractBlockarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractBlockarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_block_arg.rb
      +
      + +
      + +

      Overview

      +
      +

      Compiles extraction of the block argument +def m(&block); end + ^^^^^^

      + +

      This node doesn't exist in the original AST, +InlineArgs rewriter creates it to simplify compilation

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_block_arg.rb', line 18
      +
      +def compile
      +  scope.uses_block!
      +  scope.add_arg name
      +
      +  scope.prepare_block(name)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwarg.html new file mode 100644 index 00000000..19731def --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwarg.html @@ -0,0 +1,271 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractKwarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractKwarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_kwarg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for extracting a single +required keyword argument from $kwargs

      + +

      $kwargs always exist (as argument when inlining is possible +and as a local variable when it's not)

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_kwarg.rb', line 18
      +
      +def compile
      +  key_name = @sexp.meta[:arg_name]
      +  scope.used_kwargs << key_name
      +
      +  add_temp lvar_name
      +
      +  helper :get_kwarg
      +
      +  push "#{lvar_name} = $get_kwarg($kwargs, #{key_name.to_s.inspect})"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwargs.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwargs.html new file mode 100644 index 00000000..b5577cef --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwargs.html @@ -0,0 +1,268 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractKwargs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractKwargs + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_kwargs.rb
      +
      + +
      + +

      Overview

      +
      +

      A utility node responsible for extracting +post-kwargs from post-arguments.

      + +

      This node is used when kwargs cannot be inlined: + def m(a = 1, kw:); end

      + +

      This node is NOT used when kwargs can be inlined: + def m(a, kw:); end

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_kwargs.rb', line 20
      +
      +def compile
      +  add_temp '$kwargs'
      +
      +  helper :extract_kwargs
      +
      +  push '$kwargs = $extract_kwargs($post_args)'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwoptarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwoptarg.html new file mode 100644 index 00000000..ec6dd0a1 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwoptarg.html @@ -0,0 +1,277 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractKwoptarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractKwoptarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_kwoptarg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for extracting a single +optional keyword argument from $kwargs

      + +

      $kwargs always exist (as argument when inlining is possible +and as a local variable when it's not)

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_kwoptarg.rb', line 18
      +
      +def compile
      +  helper :hash_get
      +  key_name = @sexp.meta[:arg_name]
      +  scope.used_kwargs << key_name
      +
      +  add_temp lvar_name
      +
      +  line "#{lvar_name} = $hash_get($kwargs, #{key_name.to_s.inspect});"
      +
      +  return if default_value.children[1] == :undefined
      +
      +  push "if (#{lvar_name} == null) #{lvar_name} = ", expr(default_value)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwrestarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwrestarg.html new file mode 100644 index 00000000..7f570bae --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractKwrestarg.html @@ -0,0 +1,333 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractKwrestarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractKwrestarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_kwrestarg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for extracting a single +splat keyword argument from $kwargs

      + +

      $kwargs always exist (as argument when inlining is possible +and as a local variable when it's not)

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_kwrestarg.rb', line 18
      +
      +def compile
      +  # def m(**)
      +  # arguments are assigned to `$kw_rest_arg` for super call
      +  name = self.name || '$kw_rest_arg'
      +
      +  add_temp name
      +
      +  helper :kwrestargs
      +
      +  push "#{name} = $kwrestargs($kwargs, #{used_kwargs})"
      +end
      +
      +
      + +
      +

      + + #used_kwargsObject + + + + + +

      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_kwrestarg.rb', line 30
      +
      +def used_kwargs
      +  args = scope.used_kwargs.map do |arg_name|
      +    "'#{arg_name}': true"
      +  end
      +
      +  "{#{args.join ','}}"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractOptargNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractOptargNode.html new file mode 100644 index 00000000..2c93af1b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractOptargNode.html @@ -0,0 +1,268 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractOptargNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractOptargNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_optarg.rb
      +
      + +
      + +

      Overview

      +
      +

      Compiles extraction of a single inline optional argument +def m(a = 1); end + ^^^^^

      + +

      This node doesn't exist in the original AST, +InlineArgs rewriter creates it to simplify compilation

      + +

      Sometimes the argument can't be inlined. +In such cases InlineArgs rewriter replaces + s(:optarg, :arg_name, ...default value...) +to: + s(:fakearg) + s(:extract_post_optarg, :arg_name, ...default value...)

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_optarg.rb', line 25
      +
      +def compile
      +  return if default_value.children[1] == :undefined
      +
      +  push "if (#{name} == null) #{name} = ", expr(default_value)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostArg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostArg.html new file mode 100644 index 00000000..b93fc85f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostArg.html @@ -0,0 +1,262 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractPostArg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractPostArg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_post_arg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for extracting a single +required post-argument from $post_args

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_post_arg.rb', line 15
      +
      +def compile
      +  add_temp name
      +
      +  line "#{name} = $post_args.shift();"
      +
      +  push "if (#{name} == null) #{name} = nil"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostOptarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostOptarg.html new file mode 100644 index 00000000..3d5a50b0 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractPostOptarg.html @@ -0,0 +1,275 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractPostOptarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractPostOptarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_post_optarg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for extracting a single +optional post-argument

      + +

      args_to_keep is the number of required post-arguments

      + +

      def m(a = 1, b, c, d); end +becomes something like: + if post_args.length > 3 + a = post_args[0] + post_args = post_args[1..-1] + end

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_post_optarg.rb', line 24
      +
      +def compile
      +  add_temp name
      +
      +  line "if ($post_args.length > #{args_to_keep}) #{name} = $post_args.shift();"
      +
      +  return if default_value.children[1] == :undefined
      +
      +  push "if (#{name} == null) #{name} = ", expr(default_value)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractRestarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractRestarg.html new file mode 100644 index 00000000..f07d4a98 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/ExtractRestarg.html @@ -0,0 +1,282 @@ + + + + + + + Class: Opal::Nodes::Args::ExtractRestarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::ExtractRestarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/extract_restarg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for extracting a splat argument from post-arguments

      + +

      args_to_keep is the number of required post-arguments

      + +

      def m(*a, b, c, d); end +becomes something like: + a = post_args[0..-3] + post_args = post_args[-3..-1]

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +
      +
      # File 'opal/lib/opal/nodes/args/extract_restarg.rb', line 21
      +
      +def compile
      +  # def m(*)
      +  # arguments are assigned to `$rest_arg` for super call
      +  name = self.name || '$rest_arg'
      +
      +  add_temp name
      +
      +  if args_to_keep == 0
      +    # no post-args, we are free to grab everything
      +    push "#{name} = $post_args"
      +  else
      +    push "#{name} = $post_args.splice(0, $post_args.length - #{args_to_keep})"
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/FakeArgNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/FakeArgNode.html new file mode 100644 index 00000000..ba674396 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/FakeArgNode.html @@ -0,0 +1,263 @@ + + + + + + + Class: Opal::Nodes::Args::FakeArgNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::FakeArgNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/fake_arg.rb
      +
      + +
      + +

      Overview

      +
      +

      Compiles a fake argument produced by the InlineArgs rewriter.

      + +

      This argument represents an argument from the +Ruby code that gets initialized later in the function body.

      + +

      def m(a = 1, b); end + ^

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/nodes/args/fake_arg.rb', line 18
      +
      +def compile
      +  name = scope.next_temp
      +  scope.add_arg name
      +  push name
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeIterarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeIterarg.html new file mode 100644 index 00000000..8dd431c3 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeIterarg.html @@ -0,0 +1,260 @@ + + + + + + + Class: Opal::Nodes::Args::InitializeIterarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::InitializeIterarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/initialize_iterarg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for initializing a single +required block arg

      + +

      proc { |a| }

      + +

      Procs don't have arity checking and code like + proc { |a| }.call +must return nil

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/nodes/args/initialize_iterarg.rb', line 20
      +
      +def compile
      +  push "if (#{name} == null) #{name} = nil"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeShadowarg.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeShadowarg.html new file mode 100644 index 00000000..b10da013 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/InitializeShadowarg.html @@ -0,0 +1,259 @@ + + + + + + + Class: Opal::Nodes::Args::InitializeShadowarg + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::InitializeShadowarg + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/initialize_shadowarg.rb
      +
      + +
      + +

      Overview

      +
      +

      This node is responsible for initializing a shadow arg

      + +

      proc { |;a| }

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/nodes/args/initialize_shadowarg.rb', line 16
      +
      +def compile
      +  scope.locals << name
      +  scope.add_arg(name)
      +  push "#{name} = nil"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/Parameters.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/Parameters.html new file mode 100644 index 00000000..3015b524 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/Parameters.html @@ -0,0 +1,819 @@ + + + + + + + Class: Opal::Nodes::Args::Parameters + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::Parameters + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/parameters.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(args) ⇒ Parameters + + + + + +

      +
      +

      Returns a new instance of Parameters.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 7
      +
      +def initialize(args)
      +  @args = args.children
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_arg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 19
      +
      +def on_arg(arg)
      +  arg_name = arg.meta[:arg_name]
      +  %{['req', '#{arg_name}']}
      +end
      +
      +
      + +
      +

      + + #on_blockarg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +65
      +66
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 62
      +
      +def on_blockarg(arg)
      +  arg_name = arg.meta[:arg_name]
      +  arg_name = :& if arg_name == :fwd_block_arg
      +  %{['block', '#{arg_name}']}
      +end
      +
      +
      + +
      +

      + + #on_kwarg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +43
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 43
      +
      +def on_kwarg(arg)
      +  arg_name = arg.meta[:arg_name]
      +  %{['keyreq', '#{arg_name}']}
      +end
      +
      +
      + +
      +

      + + #on_kwnilarg(_arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 68
      +
      +def on_kwnilarg(_arg)
      +  %{['nokey']}
      +end
      +
      +
      + +
      +

      + + #on_kwoptarg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +51
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 48
      +
      +def on_kwoptarg(arg)
      +  arg_name = arg.meta[:arg_name]
      +  %{['key', '#{arg_name}']}
      +end
      +
      +
      + +
      +

      + + #on_kwrestarg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 53
      +
      +def on_kwrestarg(arg)
      +  arg_name = arg.meta[:arg_name]
      +  if arg_name
      +    %{['keyrest', '#{arg_name}']}
      +  else
      +    %{['keyrest']}
      +  end
      +end
      +
      +
      + +
      +

      + + #on_mlhs(_arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 24
      +
      +def on_mlhs(_arg)
      +  %{['req']}
      +end
      +
      +
      + +
      +

      + + #on_optarg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 28
      +
      +def on_optarg(arg)
      +  arg_name = arg.meta[:arg_name]
      +  %{['opt', '#{arg_name}']}
      +end
      +
      +
      + +
      +

      + + #on_restarg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 33
      +
      +def on_restarg(arg)
      +  arg_name = arg.meta[:arg_name]
      +  if arg_name
      +    arg_name = :* if arg_name == :fwd_rest_arg
      +    %{['rest', '#{arg_name}']}
      +  else
      +    %{['rest']}
      +  end
      +end
      +
      +
      + +
      +

      + + #on_shadowarg(_arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +72
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 72
      +
      +def on_shadowarg(_arg); end
      +
      +
      + +
      +

      + + #to_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'opal/lib/opal/nodes/args/parameters.rb', line 11
      +
      +def to_code
      +  stringified_parameters = @args.map do |arg|
      +    public_send(:"on_#{arg.type}", arg)
      +  end
      +
      +  "[#{stringified_parameters.compact.join(', ')}]"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Args/PreparePostArgs.html b/docs/api/v1.8.2/lib/Opal/Nodes/Args/PreparePostArgs.html new file mode 100644 index 00000000..1a4b49d7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Args/PreparePostArgs.html @@ -0,0 +1,270 @@ + + + + + + + Class: Opal::Nodes::Args::PreparePostArgs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Args::PreparePostArgs + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/prepare_post_args.rb
      +
      + +
      + +

      Overview

      +
      +

      A utility node responsible for preparing +post-argument for :extract_post_* nodes

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/nodes/args/prepare_post_args.rb', line 14
      +
      +def compile
      +  add_temp '$post_args'
      +
      +  helper :slice
      +
      +  if offset == 0
      +    push "$post_args = $slice(arguments)"
      +  else
      +    push "$post_args = $slice(arguments, #{offset})"
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ArgsNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ArgsNode.html new file mode 100644 index 00000000..df152878 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ArgsNode.html @@ -0,0 +1,249 @@ + + + + + + + Class: Opal::Nodes::ArgsNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ArgsNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/nodes/args.rb', line 28
      +
      +def compile
      +  children.each_with_index do |arg, idx|
      +    push ', ' if idx != 0
      +    push process(arg)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ArityCheckNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ArityCheckNode.html new file mode 100644 index 00000000..6d63393f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ArityCheckNode.html @@ -0,0 +1,908 @@ + + + + + + + Class: Opal::Nodes::ArityCheckNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ArityCheckNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/arity_check.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      IterArityCheckNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeArityCheckNode + + + + + +

      +
      +

      Returns a new instance of ArityCheckNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 12
      +
      +def initialize(*)
      +  super
      +
      +  arguments = Rewriters::Arguments.new(args_node.children)
      +
      +  @args      = arguments.args
      +  @optargs   = arguments.optargs
      +  @restarg   = arguments.restarg
      +  @postargs  = arguments.postargs
      +  @kwargs    = arguments.kwargs
      +  @kwoptargs = arguments.kwoptargs
      +  @kwrestarg = arguments.kwrestarg
      +  @kwnilarg  = arguments.kwnilarg
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #all_argsObject + + + + + +

      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 44
      +
      +def all_args
      +  @all_args ||= [*@args, *@optargs, @restarg, *@postargs, *kwargs].compact
      +end
      +
      +
      + +
      +

      + + #arityObject + + + + + +

      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 76
      +
      +def arity
      +  if @restarg || @optargs.any? || has_only_optional_kwargs?
      +    negative_arity
      +  else
      +    positive_arity
      +  end
      +end
      +
      +
      + +
      +

      + + #arity_checksObject + + + + + +

      +
      +

      Returns an array of JS conditions for raising and argument +error caused by arity check

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 50
      +
      +def arity_checks
      +  return @arity_checks if defined?(@arity_checks)
      +
      +  arity = all_args.size
      +  arity -= @optargs.size
      +
      +  arity -= 1 if @restarg
      +
      +  arity -= kwargs.size
      +
      +  arity = -arity - 1 if !@optargs.empty? || !kwargs.empty? || @restarg
      +
      +  @arity_checks = []
      +
      +  if arity < 0 # splat or opt args
      +    min_arity = -(arity + 1)
      +    max_arity = all_args.size
      +    @arity_checks << "$arity < #{min_arity}" if min_arity > 0
      +    @arity_checks << "$arity > #{max_arity}" unless @restarg
      +  else
      +    @arity_checks << "$arity !== #{arity}"
      +  end
      +
      +  @arity_checks
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 27
      +
      +def compile
      +  scope.arity = arity
      +
      +  return unless compiler.arity_check?
      +
      +  unless arity_checks.empty?
      +    helper :ac
      +    meth = scope.mid.to_s.inspect
      +    line 'var $arity = arguments.length;'
      +    push " if (#{arity_checks.join(' || ')}) { $ac($arity, #{arity}, this, #{meth}); }"
      +  end
      +end
      +
      +
      + +
      +

      + + #has_only_optional_kwargs?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 109
      +
      +def has_only_optional_kwargs?
      +  kwargs.any? && kwargs.all? { |arg| %i[kwoptarg kwrestarg].include?(arg.type) }
      +end
      +
      +
      + +
      +

      + + #has_required_kwargs?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +113
      +114
      +115
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 113
      +
      +def has_required_kwargs?
      +  kwargs.any? { |arg| arg.type == :kwarg }
      +end
      +
      +
      + +
      +

      + + #kwargsObject + + + + + +

      + + + + +
      +
      +
      +
      +40
      +41
      +42
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 40
      +
      +def kwargs
      +  [*@kwargs, *@kwoptargs, @kwrestarg].compact
      +end
      +
      +
      + +
      +

      + + #negative_arityObject + + + + + +

      + + + + +
      +
      +
      +
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 84
      +
      +def negative_arity
      +  required_plain_args = all_args.select do |arg|
      +    %i[arg mlhs].include?(arg.type)
      +  end
      +
      +  result = required_plain_args.size
      +
      +  if has_required_kwargs?
      +    result += 1
      +  end
      +
      +  result = -result - 1
      +
      +  result
      +end
      +
      +
      + +
      +

      + + #positive_arityObject + + + + + +

      + + + + +
      +
      +
      +
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 100
      +
      +def positive_arity
      +  result = all_args.size
      +
      +  result -= kwargs.size
      +  result += 1 if kwargs.any?
      +
      +  result
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ArrayNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ArrayNode.html new file mode 100644 index 00000000..11bd7835 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ArrayNode.html @@ -0,0 +1,325 @@ + + + + + + + Class: Opal::Nodes::ArrayNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ArrayNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/array.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/array.rb', line 10
      +
      +def compile
      +  return push('[]') if children.empty?
      +
      +  code, work = [], []
      +
      +  children.each do |child|
      +    splat = child.type == :splat
      +    part  = expr(child)
      +
      +    if splat
      +      if work.empty?
      +        if code.empty?
      +          code << fragment('[].concat(') << part << fragment(')')
      +        else
      +          code << fragment('.concat(') << part << fragment(')')
      +        end
      +      else
      +        if code.empty?
      +          code << fragment('[') << work << fragment(']')
      +        else
      +          code << fragment('.concat([') << work << fragment('])')
      +        end
      +
      +        code << fragment('.concat(') << part << fragment(')')
      +      end
      +      work = []
      +    else
      +      work << fragment(', ') unless work.empty?
      +      work << part
      +    end
      +  end
      +
      +  unless work.empty?
      +    join = [fragment('['), work, fragment(']')]
      +
      +    if code.empty?
      +      code = join
      +    else
      +      code.push([fragment('.concat('), join, fragment(')')])
      +    end
      +  end
      +
      +  push code
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/BackRefNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/BackRefNode.html new file mode 100644 index 00000000..fd55ee6a --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/BackRefNode.html @@ -0,0 +1,464 @@ + + + + + + + Class: Opal::Nodes::BackRefNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::BackRefNode + + + +

      +
      + +
      +
      Inherits:
      +
      + GlobalVariableNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + +

      Overview

      +
      +

      back_ref can be: +$` +$' +$& +$+ (currently unsupported)

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from GlobalVariableNode

      +

      #var_name

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 121
      +
      +def compile
      +  helper :gvars
      +
      +  case var_name
      +  when '&'
      +    handle_global_match
      +  when "'"
      +    handle_post_match
      +  when '`'
      +    handle_pre_match
      +  when '+'
      +    super
      +  else
      +    raise NotImplementedError
      +  end
      +end
      +
      +
      + +
      +

      + + #handle_global_matchObject + + + + + +

      + + + + +
      +
      +
      +
      +138
      +139
      +140
      +141
      +142
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 138
      +
      +def handle_global_match
      +  with_temp do |tmp|
      +    push "((#{tmp} = $gvars['~']) === nil ? nil : #{tmp}['$[]'](0))"
      +  end
      +end
      +
      +
      + +
      +

      + + #handle_post_matchObject + + + + + +

      + + + + +
      +
      +
      +
      +150
      +151
      +152
      +153
      +154
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 150
      +
      +def handle_post_match
      +  with_temp do |tmp|
      +    push "((#{tmp} = $gvars['~']) === nil ? nil : #{tmp}.$post_match())"
      +  end
      +end
      +
      +
      + +
      +

      + + #handle_pre_matchObject + + + + + +

      + + + + +
      +
      +
      +
      +144
      +145
      +146
      +147
      +148
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 144
      +
      +def handle_pre_match
      +  with_temp do |tmp|
      +    push "((#{tmp} = $gvars['~']) === nil ? nil : #{tmp}.$pre_match())"
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Base.html b/docs/api/v1.8.2/lib/Opal/Nodes/Base.html new file mode 100644 index 00000000..37fb2885 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Base.html @@ -0,0 +1,2932 @@ + + + + + + + Class: Opal::Nodes::Base + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Base + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Closure::NodeSupport, Helpers
      +
      + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/base.rb
      +
      + +
      + + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #compiler ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute compiler.

        +
        + +
      • + + +
      • + + + #sexp ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute sexp.

        +
        + +
      • + + +
      • + + + #type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute type.

        +
        + +
      • + + +
      + + + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(sexp, level, compiler) ⇒ Base + + + + + +

      +
      +

      Returns a new instance of Base.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 36
      +
      +def initialize(sexp, level, compiler)
      +  @sexp = sexp
      +  @type = sexp.type
      +  @level = level
      +  @compiler = compiler
      +  @compiler.top_scope ||= self
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #compilerObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute compiler.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 34
      +
      +def compiler
      +  @compiler
      +end
      +
      +
      + + + +
      +

      + + #sexpObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute sexp.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 34
      +
      +def sexp
      +  @sexp
      +end
      +
      +
      + + + +
      +

      + + #typeObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute type.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 34
      +
      +def type
      +  @type
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .children(*names) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 22
      +
      +def self.children(*names)
      +  names.each_with_index do |name, idx|
      +    define_method(name) do
      +      @sexp.children[idx]
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + .handle(*types) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 16
      +
      +def self.handle(*types)
      +  types.each do |type|
      +    Base.handlers[type] = self
      +  end
      +end
      +
      +
      + +
      +

      + + .handlersObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 12
      +
      +def self.handlers
      +  @handlers ||= {}
      +end
      +
      +
      + +
      +

      + + .truthy_optimize?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 30
      +
      +def self.truthy_optimize?
      +  false
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #add_gvar(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +143
      +144
      +145
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 143
      +
      +def add_gvar(name)
      +  scope.add_scope_gvar name
      +end
      +
      +
      + +
      +

      + + #add_ivar(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +139
      +140
      +141
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 139
      +
      +def add_ivar(name)
      +  scope.add_scope_ivar name
      +end
      +
      +
      + +
      +

      + + #add_local(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +135
      +136
      +137
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 135
      +
      +def add_local(name)
      +  scope.add_scope_local name.to_sym
      +end
      +
      +
      + +
      +

      + + #add_temp(temp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +147
      +148
      +149
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 147
      +
      +def add_temp(temp)
      +  scope.add_scope_temp temp
      +end
      +
      +
      + +
      +

      + + #childrenObject + + + + + +

      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 44
      +
      +def children
      +  @sexp.children
      +end
      +
      +
      + +
      +

      + + #class_variable_ownerObject + + + + + +

      + + + + +
      +
      +
      +
      +207
      +208
      +209
      +210
      +211
      +212
      +213
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 207
      +
      +def class_variable_owner
      +  if scope
      +    "#{scope.nesting}[#{class_variable_owner_nesting_level}]"
      +  else
      +    'Opal.Object'
      +  end
      +end
      +
      +
      + +
      +

      + + #class_variable_owner_nesting_levelObject + + + + + +

      + + + + +
      +
      +
      +
      +191
      +192
      +193
      +194
      +195
      +196
      +197
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 191
      +
      +def class_variable_owner_nesting_level
      +  cvar_scope = scope
      +  nesting_level = 0
      +
      +  while cvar_scope && !cvar_scope.class_scope?
      +    # Needs only `class << self`, `module`, and `class`
      +    # can increase nesting, but `class` & `module` are
      +    # covered by `class_scope?`.
      +    nesting_level += 1 if cvar_scope.sclass?
      +
      +    cvar_scope = cvar_scope.parent
      +  end
      +
      +  nesting_level
      +end
      +
      +
      + +
      +

      + + #commentsObject + + + + + +

      + + + + +
      +
      +
      +
      +215
      +216
      +217
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 215
      +
      +def comments
      +  compiler.comments[@sexp.loc]
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 56
      +
      +def compile
      +  raise 'Not Implemented'
      +end
      +
      +
      + +
      +

      + + #compile_to_fragmentsObject + + + + + +

      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 48
      +
      +def compile_to_fragments
      +  return @fragments if defined?(@fragments)
      +
      +  @fragments = []
      +  compile
      +  @fragments
      +end
      +
      +
      + +
      +

      + + #error(msg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +83
      +84
      +85
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 83
      +
      +def error(msg)
      +  @compiler.error msg
      +end
      +
      +
      + +
      +

      + + #expr(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +115
      +116
      +117
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 115
      +
      +def expr(sexp)
      +  @compiler.process sexp, :expr
      +end
      +
      +
      + +
      +

      + + #expr?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +99
      +100
      +101
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 99
      +
      +def expr?
      +  @level == :expr
      +end
      +
      +
      + +
      +

      + + #expr_or_empty(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +131
      +132
      +133
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 131
      +
      +def expr_or_empty(sexp)
      +  sexp && sexp.type != :nil ? expr(sexp) : ''
      +end
      +
      +
      + +
      +

      + + #expr_or_nil(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +127
      +128
      +129
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 127
      +
      +def expr_or_nil(sexp)
      +  sexp ? expr(sexp) : 'nil'
      +end
      +
      +
      + +
      +

      + + #fragment(str, loc: true) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +79
      +80
      +81
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 79
      +
      +def fragment(str, loc: true)
      +  Opal::Fragment.new str, scope, loc && @sexp
      +end
      +
      +
      + +
      +

      + + #has_rescue_else?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +167
      +168
      +169
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 167
      +
      +def has_rescue_else?
      +  scope.has_rescue_else?
      +end
      +
      +
      + +
      +

      + + #helper(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +151
      +152
      +153
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 151
      +
      +def helper(name)
      +  @compiler.helper name
      +end
      +
      +
      + +
      +

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

      + + + + +
      +
      +
      +
      +171
      +172
      +173
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 171
      +
      +def in_ensure(&block)
      +  scope.in_ensure(&block)
      +end
      +
      +
      + +
      +

      + + #in_ensure?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +175
      +176
      +177
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 175
      +
      +def in_ensure?
      +  scope.in_ensure?
      +end
      +
      +
      + +
      +

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

      + + + + +
      +
      +
      +
      +179
      +180
      +181
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 179
      +
      +def in_resbody(&block)
      +  scope.in_resbody(&block)
      +end
      +
      +
      + +
      +

      + + #in_resbody?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +183
      +184
      +185
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 183
      +
      +def in_resbody?
      +  scope.in_resbody?
      +end
      +
      +
      + +
      +

      + + #in_rescue(node, &block) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +187
      +188
      +189
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 187
      +
      +def in_rescue(node, &block)
      +  scope.in_rescue(node, &block)
      +end
      +
      +
      + +
      +

      + + #in_while?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +159
      +160
      +161
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 159
      +
      +def in_while?
      +  @compiler.in_while?
      +end
      +
      +
      + +
      +

      + + #process(sexp, level = :expr) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +111
      +112
      +113
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 111
      +
      +def process(sexp, level = :expr)
      +  @compiler.process sexp, level
      +end
      +
      +
      + +
      +

      + + #push(*strs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +60
      +61
      +62
      +63
      +64
      +65
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 60
      +
      +def push(*strs)
      +  strs.each do |str|
      +    str = fragment(str) if str.is_a?(String)
      +    @fragments << str
      +  end
      +end
      +
      +
      + +
      +

      + + #recv(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +119
      +120
      +121
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 119
      +
      +def recv(sexp)
      +  @compiler.process sexp, :recv
      +end
      +
      +
      + +
      +

      + + #recv?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +103
      +104
      +105
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 103
      +
      +def recv?
      +  @level == :recv
      +end
      +
      +
      + +
      +

      + + #s(type, *children) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +95
      +96
      +97
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 95
      +
      +def s(type, *children)
      +  ::Opal::AST::Node.new(type, children, location: @sexp.loc)
      +end
      +
      +
      + +
      +

      + + #scopeObject + + + + + +

      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 87
      +
      +def scope
      +  @compiler.scope
      +end
      +
      +
      + +
      +

      + + #source_locationObject + + + + + +

      + + + + +
      +
      +
      +
      +219
      +220
      +221
      +222
      +223
      +224
      +225
      +226
      +227
      +228
      +229
      +230
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 219
      +
      +def source_location
      +  expr = @sexp.loc.expression
      +  if expr.respond_to? :source_buffer
      +    file = expr.source_buffer.name
      +    file = "<internal:#{file}>" if file.start_with?("corelib/")
      +    file = "<js:#{file}>" if file.end_with?(".js")
      +  else
      +    file = "(eval)"
      +  end
      +  line = @sexp.loc.line
      +  "['#{file}', #{line}]"
      +end
      +
      +
      + +
      +

      + + #stmt(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +123
      +124
      +125
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 123
      +
      +def stmt(sexp)
      +  @compiler.process sexp, :stmt
      +end
      +
      +
      + +
      +

      + + #stmt?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +107
      +108
      +109
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 107
      +
      +def stmt?
      +  @level == :stmt
      +end
      +
      +
      + +
      +

      + + #top_scopeObject + + + + + +

      + + + + +
      +
      +
      +
      +91
      +92
      +93
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 91
      +
      +def top_scope
      +  @compiler.top_scope
      +end
      +
      +
      + +
      +

      + + #unshift(*strs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +67
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 67
      +
      +def unshift(*strs)
      +  strs.reverse_each do |str|
      +    str = fragment(str) if str.is_a?(String)
      +    @fragments.unshift str
      +  end
      +end
      +
      +
      + +
      +

      + + #while_loopObject + + + + + +

      + + + + +
      +
      +
      +
      +163
      +164
      +165
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 163
      +
      +def while_loop
      +  @compiler.instance_variable_get(:@while_loop)
      +end
      +
      +
      + +
      +

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

      + + + + +
      +
      +
      +
      +155
      +156
      +157
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 155
      +
      +def with_temp(&block)
      +  @compiler.with_temp(&block)
      +end
      +
      +
      + +
      +

      + + #wrap(pre, post) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +
      +
      # File 'opal/lib/opal/nodes/base.rb', line 74
      +
      +def wrap(pre, post)
      +  unshift pre
      +  push post
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/BaseFlipFlop.html b/docs/api/v1.8.2/lib/Opal/Nodes/BaseFlipFlop.html new file mode 100644 index 00000000..530bde56 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/BaseFlipFlop.html @@ -0,0 +1,299 @@ + + + + + + + Class: Opal::Nodes::BaseFlipFlop + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::BaseFlipFlop + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/if.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      EFlipFlop, IFlipFlop

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 398
      +
      +def compile
      +  helper :truthy
      +
      +  func_name = top_scope.new_temp
      +  flip_flop_state = "#{func_name}.$$ff"
      +
      +  # Start function definition, checking and initializing it if necessary
      +  push "(#{func_name} = #{func_name} || function(_start_func, _end_func){"
      +
      +  # If flip flop state is not defined, set it to false
      +  push "  var flip_flop = #{flip_flop_state} || false;"
      +
      +  # If flip flop state is false, call the 'start_condition' function and store its truthy result into flip flop state
      +  push "  if (!flip_flop) #{flip_flop_state} = flip_flop = $truthy(_start_func());"
      +
      +  # If flip flop state is true, call the 'end_condition' function and set flip flop state to false if 'end_condition' is truthy
      +  push "  #{excl}if (flip_flop && $truthy(_end_func())) #{flip_flop_state} = false;"
      +
      +  # Return current state of flip flop
      +  push "  return flip_flop;"
      +
      +  # End function definition
      +  push "})("
      +
      +  # Call the function with 'start_condition' and 'end_condition' arguments wrapped in functions to ensure correct binding and delay evaluation
      +  push "  function() { ", stmt(compiler.returns(start_condition)), " },"
      +  push "  function() { ", stmt(compiler.returns(end_condition)), " }"
      +  push ")"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/BaseSuperNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/BaseSuperNode.html new file mode 100644 index 00000000..1e7c6f27 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/BaseSuperNode.html @@ -0,0 +1,386 @@ + + + + + + + Class: Opal::Nodes::BaseSuperNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::BaseSuperNode + + + +

      +
      + +
      +
      Inherits:
      +
      + CallNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/super.rb
      +
      + +
      + +

      Overview

      +
      +

      This base class is used just to child the find_super_dispatcher method +body. This is then used by actual super calls, or a defined?(super) style +call.

      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      DefinedSuperNode, SuperNode

      +
      + + + +

      Constant Summary

      + +

      Constants inherited + from CallNode

      +

      CallNode::OPERATORS, CallNode::SPECIALS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from CallNode

      +

      #arglist, #iter, #meth, #recvr

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from CallNode

      +

      add_special, #compile

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeBaseSuperNode + + + + + +

      +
      +

      Returns a new instance of BaseSuperNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 11
      +
      +def initialize(*)
      +  super
      +  args = *@sexp
      +  *rest, last_child = *args
      +
      +  if last_child && %i[iter block_pass].include?(last_child.type)
      +    @iter = last_child
      +    args = rest
      +  else
      +    @iter = s(:js_tmp, 'null')
      +  end
      +
      +  @arglist = s(:arglist, *args)
      +  @recvr = s(:self)
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compile_using_sendObject + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 27
      +
      +def compile_using_send
      +  helper :send2
      +
      +  push '$send2('
      +  compile_receiver
      +  compile_method_body
      +  compile_method_name
      +  compile_arguments
      +  compile_block_pass
      +  push ')'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/BaseYieldNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/BaseYieldNode.html new file mode 100644 index 00000000..67031eb5 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/BaseYieldNode.html @@ -0,0 +1,499 @@ + + + + + + + Class: Opal::Nodes::BaseYieldNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::BaseYieldNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/yield.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      ReturnableYieldNode, YieldNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compile_callObject + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/nodes/yield.rb', line 8
      +
      +def compile_call
      +  yielding_scope = find_yielding_scope
      +
      +  yielding_scope.uses_block!
      +  yielding_scope.block_name ||= '$yield'
      +
      +  block_name = yielding_scope.block_name
      +
      +  if yields_single_arg?(children)
      +    push expr(children.first)
      +    wrap "Opal.yield1(#{block_name}, ", ')'
      +  else
      +    push expr(s(:arglist, *children))
      +
      +    if uses_splat?(children)
      +      wrap "Opal.yieldX(#{block_name}, ", ')'
      +    else
      +      wrap "Opal.yieldX(#{block_name}, [", '])'
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #find_yielding_scopeObject + + + + + +

      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/nodes/yield.rb', line 30
      +
      +def find_yielding_scope
      +  working = scope
      +  while working
      +    if working.block_name || working.def?
      +      break
      +    end
      +    working = working.parent
      +  end
      +
      +  working
      +end
      +
      +
      + +
      +

      + + #uses_splat?(children) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +
      +
      # File 'opal/lib/opal/nodes/yield.rb', line 46
      +
      +def uses_splat?(children)
      +  children.any? { |child| child.type == :splat }
      +end
      +
      +
      + +
      +

      + + #yields_single_arg?(children) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +
      +
      # File 'opal/lib/opal/nodes/yield.rb', line 42
      +
      +def yields_single_arg?(children)
      +  !uses_splat?(children) && children.size == 1
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/BeginNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/BeginNode.html new file mode 100644 index 00000000..812b1763 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/BeginNode.html @@ -0,0 +1,585 @@ + + + + + + + Class: Opal::Nodes::BeginNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::BeginNode + + + +

      +
      + +
      +
      Inherits:
      +
      + ScopeNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/definitions.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      KwBeginNode

      +
      + + +

      + Constant Summary + collapse +

      + +
      + +
      COMPLEX_CHILDREN = + +
      +
      %i[while while_post until until_post js_return].freeze
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::ScopeNode

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'opal/lib/opal/nodes/definitions.rb', line 46
      +
      +def compile
      +  return push 'nil' if children.empty?
      +
      +  if stmt?
      +    compile_children(children, @level)
      +  elsif simple_children?
      +    compile_inline_children(children, @level)
      +    wrap '(', ')' if children.size > 1
      +  elsif children.size == 1
      +    compile_inline_children(returned_children, @level)
      +  else
      +    in_closure do
      +      compile_children(returned_children, @level)
      +    end
      +
      +    if scope.parent&.await_encountered
      +      wrap '(await (async function() {', '})())'
      +    else
      +      wrap '(function() {', '})()'
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_children(children, level) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +80
      +81
      +82
      +83
      +84
      +
      +
      # File 'opal/lib/opal/nodes/definitions.rb', line 80
      +
      +def compile_children(children, level)
      +  children.each do |child|
      +    line process(child, level), fragment(';', loc: false)
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_inline_children(children, level) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +
      +
      # File 'opal/lib/opal/nodes/definitions.rb', line 94
      +
      +def compile_inline_children(children, level)
      +  processed_children = children.map do |child|
      +    process(child, level)
      +  end
      +
      +  processed_children.reject(&:empty?).each_with_index do |child, idx|
      +    push fragment(', ', loc: false) unless idx == 0
      +    push child
      +  end
      +end
      +
      +
      + +
      +

      + + #returned_childrenObject + + + + + +

      + + + + +
      +
      +
      +
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +
      +
      # File 'opal/lib/opal/nodes/definitions.rb', line 69
      +
      +def returned_children
      +  @returned_children ||= begin
      +    *rest, last_child = *children
      +    if last_child
      +      rest + [compiler.returns(last_child)]
      +    else
      +      [s(:nil)]
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #simple_children?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +88
      +89
      +90
      +91
      +92
      +
      +
      # File 'opal/lib/opal/nodes/definitions.rb', line 88
      +
      +def simple_children?
      +  children.none? do |child|
      +    COMPLEX_CHILDREN.include?(child.type)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/BlockPassNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/BlockPassNode.html new file mode 100644 index 00000000..c0be648d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/BlockPassNode.html @@ -0,0 +1,243 @@ + + + + + + + Class: Opal::Nodes::BlockPassNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::BlockPassNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +133
      +134
      +135
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 133
      +
      +def compile
      +  push expr(s(:send, value, :to_proc, s(:arglist)))
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/BreakNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/BreakNode.html new file mode 100644 index 00000000..0e329f86 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/BreakNode.html @@ -0,0 +1,243 @@ + + + + + + + Class: Opal::Nodes::BreakNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::BreakNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 31
      +
      +def compile
      +  thrower(:break, value)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/CallNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/CallNode.html new file mode 100644 index 00000000..f5738ecb --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/CallNode.html @@ -0,0 +1,767 @@ + + + + + + + Class: Opal::Nodes::CallNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::CallNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/call.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      BaseSuperNode, JsCallNode

      +
      +

      Defined Under Namespace

      +

      + + + + + Classes: DependencyResolver + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      SPECIALS = + +
      +
      {}
      + +
      OPERATORS = +
      +
      +

      Operators that get optimized by compiler

      + + +
      +
      +
      + + +
      +
      +
      { :+ => :plus, :- => :minus, :* => :times, :/ => :divide,
      +:< => :lt, :<= => :le, :> => :gt, :>= => :ge }.freeze
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #arglist ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute arglist.

        +
        + +
      • + + +
      • + + + #iter ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute iter.

        +
        + +
      • + + +
      • + + + #meth ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute meth.

        +
        + +
      • + + +
      • + + + #recvr ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute recvr.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeCallNode + + + + + +

      +
      +

      Returns a new instance of CallNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 25
      +
      +def initialize(*)
      +  super
      +  @recvr, @meth, *args = *@sexp
      +
      +  *rest, last_arg = *args
      +
      +  if last_arg && %i[iter block_pass].include?(last_arg.type)
      +    @iter = last_arg
      +    args = rest
      +  else
      +    @iter = nil
      +  end
      +
      +  @arglist = s(:arglist, *args)
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #arglistObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute arglist.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 12
      +
      +def arglist
      +  @arglist
      +end
      +
      +
      + + + +
      +

      + + #iterObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute iter.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 12
      +
      +def iter
      +  @iter
      +end
      +
      +
      + + + +
      +

      + + #methObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute meth.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 12
      +
      +def meth
      +  @meth
      +end
      +
      +
      + + + +
      +

      + + #recvrObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute recvr.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 12
      +
      +def recvr
      +  @recvr
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .add_special(name, options = {}, &handler) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 20
      +
      +def self.add_special(name, options = {}, &handler)
      +  SPECIALS[name] = options
      +  define_method("handle_#{name}", &handler)
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 41
      +
      +def compile
      +  # handle some methods specially
      +  # some special methods need to skip compilation, so we pass the default as a block
      +  handle_special do
      +    compiler.record_method_call meth
      +
      +    with_wrapper do
      +      if using_eval?
      +        # if trying to access an lvar in eval or irb mode
      +        compile_eval_var
      +      elsif using_irb?
      +        # if trying to access an lvar in irb mode
      +        compile_irb_var
      +      else
      +        default_compile
      +      end
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/CallNode/DependencyResolver.html b/docs/api/v1.8.2/lib/Opal/Nodes/CallNode/DependencyResolver.html new file mode 100644 index 00000000..0c52c3fe --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/CallNode/DependencyResolver.html @@ -0,0 +1,453 @@ + + + + + + + Class: Opal::Nodes::CallNode::DependencyResolver + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::CallNode::DependencyResolver + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/call.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(compiler, sexp, missing_dynamic_require = nil) ⇒ DependencyResolver + + + + + +

      +
      +

      Returns a new instance of DependencyResolver.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +496
      +497
      +498
      +499
      +500
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 496
      +
      +def initialize(compiler, sexp, missing_dynamic_require = nil)
      +  @compiler = compiler
      +  @sexp = sexp
      +  @missing_dynamic_require = missing_dynamic_require || @compiler.dynamic_require_severity
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #expand_path(path, base = '') ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +544
      +545
      +546
      +547
      +548
      +549
      +550
      +551
      +552
      +553
      +554
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 544
      +
      +def expand_path(path, base = '')
      +  "#{base}/#{path}".split('/').each_with_object([]) do |part, p|
      +    if part == ''
      +      # we had '//', so ignore
      +    elsif part == '..'
      +      p.pop
      +    else
      +      p << part
      +    end
      +  end.join '/'
      +end
      +
      +
      + +
      +

      + + #handle_part(sexp, missing_dynamic_require = @missing_dynamic_require) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +506
      +507
      +508
      +509
      +510
      +511
      +512
      +513
      +514
      +515
      +516
      +517
      +518
      +519
      +520
      +521
      +522
      +523
      +524
      +525
      +526
      +527
      +528
      +529
      +530
      +531
      +532
      +533
      +534
      +535
      +536
      +537
      +538
      +539
      +540
      +541
      +542
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 506
      +
      +def handle_part(sexp, missing_dynamic_require = @missing_dynamic_require)
      +  if sexp
      +    case sexp.type
      +    when :str
      +      return sexp.children[0]
      +    when :dstr
      +      return sexp.children.map { |i| handle_part i }.join
      +    when :begin
      +      return handle_part sexp.children[0] if sexp.children.length == 1
      +    when :send
      +      recv, meth, *args = sexp.children
      +
      +      parts = args.map { |s| handle_part(s, :ignore) }
      +
      +      return nil if parts.include? nil
      +
      +      if recv.is_a?(::Opal::AST::Node) && recv.type == :const && recv.children.last == :File
      +        if meth == :expand_path
      +          return expand_path(*parts)
      +        elsif meth == :join
      +          return expand_path parts.join('/')
      +        elsif meth == :dirname
      +          return expand_path parts[0].split('/')[0...-1].join('/')
      +        end
      +      elsif meth == :__dir__
      +        return File.dirname(Opal::Compiler.module_name(@compiler.file))
      +      end
      +    end
      +  end
      +
      +  case missing_dynamic_require
      +  when :error
      +    @compiler.error 'Cannot handle dynamic require', @sexp.line
      +  when :warning
      +    @compiler.warning 'Cannot handle dynamic require', @sexp.line
      +  end
      +end
      +
      +
      + +
      +

      + + #resolveObject + + + + + +

      + + + + +
      +
      +
      +
      +502
      +503
      +504
      +
      +
      # File 'opal/lib/opal/nodes/call.rb', line 502
      +
      +def resolve
      +  handle_part @sexp
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/CbaseNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/CbaseNode.html new file mode 100644 index 00000000..4915f096 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/CbaseNode.html @@ -0,0 +1,254 @@ + + + + + + + Class: Opal::Nodes::CbaseNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::CbaseNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/constants.rb
      +
      + +
      + +

      Overview

      +
      +

      ::CONST +s(:const, s(:cbase), :CONST)

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'opal/lib/opal/nodes/constants.rb', line 56
      +
      +def compile
      +  push "'::'"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ClassNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ClassNode.html new file mode 100644 index 00000000..d468b829 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ClassNode.html @@ -0,0 +1,381 @@ + + + + + + + Class: Opal::Nodes::ClassNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ClassNode + + + +

      +
      + +
      +
      Inherits:
      +
      + ModuleNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/class.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::ScopeNode

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/class.rb', line 12
      +
      +def compile
      +  name, base = name_and_base
      +  helper :klass
      +
      +  if body.nil?
      +    # Simplified compile for empty body
      +    if stmt?
      +      unshift '$klass(', base, ', ', super_code, ", '#{name}')"
      +    else
      +      unshift '($klass(', base, ', ', super_code, ", '#{name}'), nil)"
      +    end
      +  else
      +    line "  var self = $klass($base, $super, '#{name}');"
      +    in_scope do
      +      scope.name = name
      +      in_closure(Closure::MODULE | Closure::JS_FUNCTION) do
      +        compile_body
      +      end
      +    end
      +
      +    if await_encountered
      +      await_begin = '(await '
      +      await_end = ')'
      +      async = 'async '
      +      parent.await_encountered = true
      +    else
      +      await_begin, await_end, async = '', '', ''
      +    end
      +
      +    unshift "#{await_begin}(#{async}function($base, $super#{', $parent_nesting' if @define_nesting}) {"
      +    line '})(', base, ', ', super_code, "#{', ' + scope.nesting if @define_nesting})#{await_end}"
      +  end
      +end
      +
      +
      + +
      +

      + + #super_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +
      +
      # File 'opal/lib/opal/nodes/class.rb', line 46
      +
      +def super_code
      +  sup ? expr(sup) : 'null'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ClassVarAssignNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ClassVarAssignNode.html new file mode 100644 index 00000000..9fb4b393 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ClassVarAssignNode.html @@ -0,0 +1,247 @@ + + + + + + + Class: Opal::Nodes::ClassVarAssignNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ClassVarAssignNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +215
      +216
      +217
      +218
      +219
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 215
      +
      +def compile
      +  helper :class_variable_set
      +
      +  push "$class_variable_set(#{class_variable_owner}, '#{name}', ", expr(value), ')'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ClassVariableNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ClassVariableNode.html new file mode 100644 index 00000000..75ab5172 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ClassVariableNode.html @@ -0,0 +1,261 @@ + + + + + + + Class: Opal::Nodes::ClassVariableNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ClassVariableNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +196
      +197
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 196
      +
      +def compile
      +  helper :class_variable_get
      +
      +  tolerant = false
      +  # We should be tolerant of expressions like: def x; @@notexist; 0; end
      +  # (NB: Shouldn't we actually optimize them out?)
      +  tolerant = true if stmt?
      +  # We should be tolerant of expressions like: @@notexist ||= 6
      +  # (those are handled with logical_operator_assignment)
      +
      +  push "$class_variable_get(#{class_variable_owner}, '#{name}', #{tolerant.inspect})"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Closure.html b/docs/api/v1.8.2/lib/Opal/Nodes/Closure.html new file mode 100644 index 00000000..af55914f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Closure.html @@ -0,0 +1,971 @@ + + + + + + + Class: Opal::Nodes::Closure + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Closure + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/closure.rb
      +
      + +
      + +

      Overview

      +
      +

      This module takes care of providing information about the +closure stack that we have for the nodes during compile time. +This is not a typical node.

      + +

      Also, while loops are not closures per se, this module also +takes a note about them.

      + +

      Then we can use this information for control flow like +generating breaks, nexts, returns.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + Modules: CompilerSupport, NodeSupport + + + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      NONE = + +
      +
      0
      + +
      ANY = + +
      +
      0xffffffff
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #catchers ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute catchers.

        +
        + +
      • + + +
      • + + + #node ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute node.

        +
        + +
      • + + +
      • + + + #parent ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute parent.

        +
        + +
      • + + +
      • + + + #throwers ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute throwers.

        +
        + +
      • + + +
      • + + + #type ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute type.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(node, type, parent) ⇒ Closure + + + + + +

      +
      +

      Returns a new instance of Closure.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +49
      +50
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 46
      +
      +def initialize(node, type, parent)
      +  @node, @type, @parent = node, type, parent
      +  @catchers = []
      +  @throwers = {}
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #catchersObject + + + + + +

      +
      +

      Returns the value of attribute catchers.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 70
      +
      +def catchers
      +  @catchers
      +end
      +
      +
      + + + +
      +

      + + #nodeObject + + + + + +

      +
      +

      Returns the value of attribute node.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 70
      +
      +def node
      +  @node
      +end
      +
      +
      + + + +
      +

      + + #parentObject + + + + + +

      +
      +

      Returns the value of attribute parent.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 70
      +
      +def parent
      +  @parent
      +end
      +
      +
      + + + +
      +

      + + #throwersObject + + + + + +

      +
      +

      Returns the value of attribute throwers.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 70
      +
      +def throwers
      +  @throwers
      +end
      +
      +
      + + + +
      +

      + + #typeObject + + + + + +

      +
      +

      Returns the value of attribute type.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 70
      +
      +def type
      +  @type
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .add_type(name, value) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 19
      +
      +def self.add_type(name, value)
      +  const_set(name, value)
      +  @types[name] = value
      +end
      +
      +
      + +
      +

      + + .type_inspect(type) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 24
      +
      +def self.type_inspect(type)
      +  @types.reject do |_name, value|
      +    (type & value) == 0
      +  end.map(&:first).join("|")
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #inspectObject + + + + + +

      + + + + +
      +
      +
      +
      +66
      +67
      +68
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 66
      +
      +def inspect
      +  "#<Closure #{Closure.type_inspect(type)} #{@node.class}>"
      +end
      +
      +
      + +
      +

      + + #is?(type) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 62
      +
      +def is?(type)
      +  (@type & type) != 0
      +end
      +
      +
      + +
      +

      + + #register_catcher(type = :return) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +52
      +53
      +54
      +55
      +56
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 52
      +
      +def register_catcher(type = :return)
      +  @catchers << type unless @catchers.include? type
      +
      +  "$t_#{type}"
      +end
      +
      +
      + +
      +

      + + #register_thrower(type, id) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +58
      +59
      +60
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 58
      +
      +def register_thrower(type, id)
      +  @throwers[type] = id
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Closure/CompilerSupport.html b/docs/api/v1.8.2/lib/Opal/Nodes/Closure/CompilerSupport.html new file mode 100644 index 00000000..ba026495 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Closure/CompilerSupport.html @@ -0,0 +1,181 @@ + + + + + + + Module: Opal::Nodes::Closure::CompilerSupport + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Nodes::Closure::CompilerSupport + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      Compiler
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/closure.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #closure_stackObject + + + + + +

      + + + + +
      +
      +
      +
      +252
      +253
      +254
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 252
      +
      +def closure_stack
      +  @closure_stack ||= []
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Closure/NodeSupport.html b/docs/api/v1.8.2/lib/Opal/Nodes/Closure/NodeSupport.html new file mode 100644 index 00000000..9eb5ff04 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Closure/NodeSupport.html @@ -0,0 +1,984 @@ + + + + + + + Module: Opal::Nodes::Closure::NodeSupport + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Nodes::Closure::NodeSupport + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      Base
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/closure.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #closure ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute closure.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #closureObject + + + + + +

      +
      +

      Returns the value of attribute closure.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +79
      +80
      +81
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 79
      +
      +def closure
      +  @closure
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #closure_is?(type) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +202
      +203
      +204
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 202
      +
      +def closure_is?(type)
      +  @closure.is?(type)
      +end
      +
      +
      + +
      +

      + + #compile_catcherObject + + + + + +

      +
      +

      Generate a catcher if thrower has been used

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 207
      +
      +def compile_catcher
      +  catchers = @closure.catchers
      +
      +  return if catchers.empty?
      +
      +  helper :thrower
      +
      +  catchers_without_eval_return = catchers.grep_v(:eval_return)
      +
      +  push "} catch($e) {"
      +  indent do
      +    catchers.each do |type|
      +      case type
      +      when :eval_return
      +        line "if ($e === Opal.t_eval_return) return $e.$v;"
      +      else
      +        line "if ($e === $t_#{type}) return $e.$v;"
      +      end
      +    end
      +    line "throw $e;"
      +  end
      +  line "}"
      +
      +  unless catchers_without_eval_return.empty?
      +    push " finally {", *catchers_without_eval_return.map { |type| "$t_#{type}.is_orphan = true;" }, "}"
      +  end
      +
      +  unshift "return " if closure_is? SEND
      +
      +  unless catchers_without_eval_return.empty?
      +    unshift "var ", catchers_without_eval_return.map { |type| "$t_#{type} = $thrower('#{type}')" }.join(", "), "; "
      +  end
      +  unshift "try { "
      +
      +  unless closure_is? JS_FUNCTION
      +    if scope.await_encountered
      +      wrap "(await (async function(){", "})())"
      +    else
      +      wrap "(function(){", "})()"
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #generate_thrower(type, closure, value) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +102
      +103
      +104
      +105
      +106
      +107
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 102
      +
      +def generate_thrower(type, closure, value)
      +  id = closure.register_catcher(type)
      +  closure.register_thrower(type, id)
      +  push id, '.$throw(', expr_or_nil(value), ', ', scope.identify!, '.$$is_lambda)'
      +  id
      +end
      +
      +
      + +
      +

      + + #generate_thrower_without_catcher(type, closure, value) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 109
      +
      +def generate_thrower_without_catcher(type, closure, value)
      +  helper :thrower
      +
      +  if closure.throwers.key? type
      +    id = closure.throwers[type]
      +  else
      +    id = compiler.unique_temp('t_')
      +    parent_scope = closure.node.scope&.parent || top_scope
      +    parent_scope.add_scope_temp("#{id} = $thrower('#{type}')")
      +    closure.register_thrower(type, id)
      +  end
      +  push id, '.$throw(', expr_or_nil(value), ', ', scope.identify!, '.$$is_lambda)'
      +  id
      +end
      +
      +
      + +
      +

      + + #in_closure(type = JS_FUNCTION) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +88
      +89
      +90
      +91
      +92
      +93
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 88
      +
      +def in_closure(type = JS_FUNCTION)
      +  closure = push_closure(type)
      +  out = yield closure
      +  pop_closure
      +  out
      +end
      +
      +
      + +
      +

      + + #pop_closureObject + + + + + +

      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +84
      +85
      +86
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 81
      +
      +def pop_closure
      +  compile_catcher
      +  @compiler.closure_stack.pop
      +  last = @compiler.closure_stack.last
      +  @closure = last if last&.node == self
      +end
      +
      +
      + +
      +

      + + #push_closure(type = JS_FUNCTION) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +73
      +74
      +75
      +76
      +77
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 73
      +
      +def push_closure(type = JS_FUNCTION)
      +  closure = Closure.new(self, type, select_closure)
      +  @compiler.closure_stack << closure
      +  @closure = closure
      +end
      +
      +
      + +
      +

      + + #select_closure(type = ANY, break_after: NONE) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +95
      +96
      +97
      +98
      +99
      +100
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 95
      +
      +def select_closure(type = ANY, break_after: NONE)
      +  @compiler.closure_stack.reverse.find do |i|
      +    break if (i.type & break_after) != 0
      +    (i.type & type) != 0
      +  end
      +end
      +
      +
      + +
      +

      + + #thrower(type, value = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +152
      +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
      +187
      +188
      +189
      +190
      +191
      +192
      +193
      +194
      +195
      +196
      +197
      +198
      +199
      +200
      +
      +
      # File 'opal/lib/opal/nodes/closure.rb', line 124
      +
      +def thrower(type, value = nil)
      +  case type
      +  when :return
      +    thrower_closure = select_closure(DEF, break_after: MODULE | TOP)
      +    last_closure = select_closure(JS_FUNCTION)
      +
      +    if !thrower_closure
      +      iter_closure = select_closure(ITER, break_after: DEF | MODULE | TOP)
      +      if iter_closure
      +        generate_thrower_without_catcher(:return, iter_closure, value)
      +      elsif compiler.eval?
      +        push 'Opal.t_eval_return.$throw(', expr_or_nil(value), ', false)'
      +      else
      +        error 'Invalid return'
      +      end
      +    elsif thrower_closure == last_closure
      +      push 'return ', expr_or_nil(value)
      +    else
      +      id = generate_thrower(:return, thrower_closure, value)
      +      # Additionally, register our thrower on the surrounding iter, if present
      +      iter_closure = select_closure(ITER, break_after: DEF | MODULE | TOP)
      +      iter_closure.register_thrower(:return, id) if iter_closure
      +    end
      +  when :eval_return
      +    thrower_closure = select_closure(DEF | LAMBDA, break_after: MODULE | TOP)
      +
      +    if thrower_closure
      +      thrower_closure.register_catcher(:eval_return)
      +    end
      +  when :next, :redo
      +    thrower_closure = select_closure(ITER | LOOP_INSIDE, break_after: DEF | MODULE | TOP)
      +    last_closure = select_closure(JS_FUNCTION | JS_LOOP_INSIDE)
      +
      +    if !thrower_closure
      +      error 'Invalid next'
      +    elsif thrower_closure == last_closure
      +      if thrower_closure.is? LOOP_INSIDE
      +        push 'continue'
      +      elsif thrower_closure.is? ITER | LAMBDA
      +        push 'return ', expr_or_nil(value)
      +      end
      +    else
      +      generate_thrower(:next, thrower_closure, value)
      +    end
      +  when :break
      +    thrower_closure = select_closure(SEND | LAMBDA | LOOP, break_after: DEF | MODULE | TOP)
      +    last_closure = select_closure(JS_FUNCTION | JS_LOOP)
      +
      +    if !thrower_closure
      +      iter_closure = select_closure(ITER, break_after: DEF | MODULE | TOP)
      +      if iter_closure
      +        generate_thrower_without_catcher(:break, iter_closure, value)
      +      else
      +        error 'Invalid break'
      +      end
      +    elsif thrower_closure == last_closure
      +      if thrower_closure.is? JS_FUNCTION | LAMBDA
      +        push 'return ', expr_or_nil(value)
      +      elsif thrower_closure.is? LOOP
      +        push 'break'
      +      end
      +    else
      +      generate_thrower(:break, thrower_closure, value)
      +    end
      +  when :retry
      +    thrower_closure = select_closure(RESCUE_RETRIER, break_after: DEF | MODULE | TOP)
      +    last_closure = select_closure(JS_LOOP_INSIDE)
      +
      +    if !thrower_closure
      +      error 'Invalid retry'
      +    elsif thrower_closure == last_closure
      +      push 'continue'
      +    else
      +      generate_thrower(:retry, thrower_closure, value)
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ComplexNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ComplexNode.html new file mode 100644 index 00000000..29d53d55 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ComplexNode.html @@ -0,0 +1,254 @@ + + + + + + + Class: Opal::Nodes::ComplexNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ComplexNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + +

      Overview

      +
      +

      0b1110i -> s(:complex, (0+14i)) +-0b1110i -> s(:complex, (0-14i))

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +364
      +365
      +366
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 364
      +
      +def compile
      +  push "#{top_scope.absolute_const}('Complex').$new(#{value.real}, #{value.imag})"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ConstAssignNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ConstAssignNode.html new file mode 100644 index 00000000..1237ec31 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ConstAssignNode.html @@ -0,0 +1,255 @@ + + + + + + + Class: Opal::Nodes::ConstAssignNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ConstAssignNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/constants.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +
      +
      # File 'opal/lib/opal/nodes/constants.rb', line 66
      +
      +def compile
      +  helper :const_set
      +
      +  if base
      +    push '$const_set(', expr(base), ", '#{name}', ", expr(value), ')'
      +  else
      +    push "$const_set(#{scope.nesting}[0], '#{name}', ", expr(value), ')'
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ConstNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ConstNode.html new file mode 100644 index 00000000..20fa3c71 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ConstNode.html @@ -0,0 +1,449 @@ + + + + + + + Class: Opal::Nodes::ConstNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ConstNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/constants.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      OPTIMIZED_ACCESS_CONSTS = + +
      +
      %i[
      +  BasicObject Object Module Class Opal Kernel NilClass
      +].freeze
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Opal::Nodes::Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Opal::Nodes::Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/nodes/constants.rb', line 12
      +
      +def compile
      +  if magical_data_const?
      +    push('$__END__')
      +  elsif optimized_access?
      +    helper :"#{name}"
      +    push "$#{name}"
      +  elsif const_scope == s(:cbase)
      +    push "#{top_scope.absolute_const}('#{name}')"
      +  elsif const_scope
      +    push "#{top_scope.absolute_const}(", recv(const_scope), ", '#{name}')"
      +  elsif compiler.eval?
      +    push "#{scope.relative_access}('#{name}')"
      +  else
      +    push "#{scope.relative_access}('#{name}')"
      +  end
      +end
      +
      +
      + +
      +

      + + #magical_data_const?Boolean + + + + + +

      +
      +

      Ruby has a magical const DATA +that should be processed in a different way:

      + +
        +
      1. When current file contains END in the end of the file +DATA const should be resolved to the string located after END
      2. +
      3. When current file doesn't have END section +DATA const should be resolved to a regular ::DATA constant
      4. +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/nodes/constants.rb', line 35
      +
      +def magical_data_const?
      +  const_scope.nil? && name == :DATA && compiler.eof_content
      +end
      +
      +
      + +
      +

      + + #optimized_access?Boolean + + + + + +

      +
      +

      For a certain case of calls like ::Opal.coerce_to? we can +optimize the calls. We can be sure they are defined from the +beginning.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +
      +
      # File 'opal/lib/opal/nodes/constants.rb', line 46
      +
      +def optimized_access?
      +  const_scope == s(:cbase) && OPTIMIZED_ACCESS_CONSTS.include?(name)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/DefNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/DefNode.html new file mode 100644 index 00000000..9e8bab84 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/DefNode.html @@ -0,0 +1,571 @@ + + + + + + + Class: Opal::Nodes::DefNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::DefNode + + + +

      +
      + +
      +
      Inherits:
      +
      + NodeWithArgs + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/def.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      DefsNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from NodeWithArgs

      +

      #arity, #original_args, #used_kwargs

      + + + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from NodeWithArgs

      +

      #arity_check_node, #compile_arity_check, #compile_block_arg, #compile_body_or_shortcut, define_shortcut, #initialize, #parameters_code, shortcuts_for, #simple_value?

      + + + + + + + + + +

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::NodeWithArgs

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #comments_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +90
      +91
      +92
      +
      +
      # File 'opal/lib/opal/nodes/def.rb', line 90
      +
      +def comments_code
      +  '[' + comments.map { |comment| comment.text.inspect }.join(', ') + ']'
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/def.rb', line 12
      +
      +def compile
      +  compile_body_or_shortcut
      +
      +  blockopts = {}
      +
      +  blockopts["$$arity"] = arity if arity < 0
      +
      +  if compiler.arity_check?
      +    blockopts["$$parameters"] = parameters_code
      +  end
      +
      +  if compiler.parse_comments?
      +    blockopts["$$comments"] = comments_code
      +  end
      +
      +  if compiler.enable_source_location?
      +    blockopts["$$source_location"] = source_location
      +  end
      +
      +  if blockopts.keys == ["$$arity"]
      +    push ", #{arity}"
      +  elsif !blockopts.empty?
      +    push ', {', blockopts.map { |k, v| "#{k}: #{v}" }.join(', '), '}'
      +  end
      +
      +  wrap_with_definition
      +
      +  scope.nesting if @define_nesting
      +  scope.relative_access if @define_relative_access
      +end
      +
      +
      + +
      +

      + + #compile_bodyObject + + + + + +

      + + + + +
      +
      +
      +
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +
      +
      # File 'opal/lib/opal/nodes/def.rb', line 43
      +
      +def compile_body
      +  inline_params = nil
      +  scope_name = nil
      +
      +  in_scope do
      +    scope.mid = mid
      +    scope.defs = true if @sexp.type == :defs
      +
      +    scope.identify!
      +    scope_name = scope.identity
      +
      +    # Setting a default block name (later can be overwritten by a blockarg)
      +    scope.block_name = '$yield'
      +
      +    inline_params = process(inline_args)
      +
      +    in_closure(Closure::DEF | Closure::JS_FUNCTION) do
      +      stmt_code = stmt(compiler.returns(stmts))
      +
      +      compile_block_arg
      +
      +      add_temp 'self = this' if @define_self
      +
      +      compile_arity_check
      +
      +      unshift "\n#{current_indent}", scope.to_vars
      +
      +      line stmt_code
      +    end
      +  end
      +
      +  unshift ') {'
      +  unshift(inline_params)
      +  unshift "function #{scope_name}("
      +  if await_encountered
      +    unshift "async "
      +  end
      +  line '}'
      +end
      +
      +
      + +
      +

      + + #wrap_with_definitionObject + + + + + +

      + + + + +
      +
      +
      +
      +83
      +84
      +85
      +86
      +87
      +88
      +
      +
      # File 'opal/lib/opal/nodes/def.rb', line 83
      +
      +def wrap_with_definition
      +  helper :def
      +  wrap "$def(#{scope.self}, '$#{mid}', ", ')'
      +
      +  unshift "\n#{current_indent}" unless expr?
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/DefinedNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/DefinedNode.html new file mode 100644 index 00000000..87fb45f5 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/DefinedNode.html @@ -0,0 +1,1271 @@ + + + + + + + Class: Opal::Nodes::DefinedNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::DefinedNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/defined.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 12
      +
      +def compile
      +  case value.type
      +  when :self, :nil, :false, :true
      +    push value.type.to_s.inspect
      +  when :lvasgn, :ivasgn, :gvasgn, :cvasgn, :casgn, :op_asgn, :or_asgn, :and_asgn
      +    push "'assignment'"
      +  when :lvar
      +    push "'local-variable'"
      +  when :begin
      +    if value.children.size == 1 && value.children[0].type == :masgn
      +      push "'assignment'"
      +    else
      +      push "'expression'"
      +    end
      +  when :send
      +    compile_defined_send(value)
      +    wrap '(', " ? 'method' : nil)"
      +  when :ivar
      +    compile_defined_ivar(value)
      +    wrap '(', " ? 'instance-variable' : nil)"
      +  when :zsuper, :super
      +    compile_defined_super
      +  when :yield
      +    compile_defined_yield
      +    wrap '(', " ? 'yield' : nil)"
      +  when :xstr
      +    compile_defined_xstr(value)
      +  when :const
      +    compile_defined_const(value)
      +    wrap '(', " ? 'constant' : nil)"
      +  when :cvar
      +    compile_defined_cvar(value)
      +    wrap '(', " ? 'class variable' : nil)"
      +  when :gvar
      +    compile_defined_gvar(value)
      +    wrap '(', " ? 'global-variable' : nil)"
      +  when :back_ref
      +    compile_defined_back_ref
      +    wrap '(', " ? 'global-variable' : nil)"
      +  when :nth_ref
      +    compile_defined_nth_ref
      +    wrap '(', " ? 'global-variable' : nil)"
      +  when :array
      +    compile_defined_array(value)
      +    wrap '(', " ? 'expression' : nil)"
      +  else
      +    push "'expression'"
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_defined(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 62
      +
      +def compile_defined(node)
      +  type = node.type
      +
      +  if respond_to? "compile_defined_#{type}"
      +    __send__("compile_defined_#{type}", node)
      +  else
      +    node_tmp = scope.new_temp
      +    push "(#{node_tmp} = ", expr(node), ')'
      +    node_tmp
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_defined_array(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +215
      +216
      +217
      +218
      +219
      +220
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 215
      +
      +def compile_defined_array(node)
      +  node.children.each_with_index do |child, idx|
      +    push ' && ' unless idx == 0
      +    compile_defined(child)
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_defined_back_refObject + + + + + +

      + + + + +
      +
      +
      +
      +200
      +201
      +202
      +203
      +204
      +205
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 200
      +
      +def compile_defined_back_ref
      +  helper :gvars
      +  back_ref_temp = scope.new_temp
      +  push "(#{back_ref_temp} = $gvars['~'], #{back_ref_temp} != null && #{back_ref_temp} !== nil)"
      +  back_ref_temp
      +end
      +
      +
      + +
      +

      + + #compile_defined_const(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +174
      +175
      +176
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 162
      +
      +def compile_defined_const(node)
      +  const_scope, const_name = *node
      +
      +  const_tmp = scope.new_temp
      +
      +  if const_scope.nil?
      +    push "(#{const_tmp} = #{scope.relative_access}('#{const_name}', 'skip_raise'))"
      +  elsif const_scope == s(:cbase)
      +    push "(#{const_tmp} = #{top_scope.absolute_const}('::', '#{const_name}', 'skip_raise'))"
      +  else
      +    const_scope_tmp = compile_defined(const_scope)
      +    push " && (#{const_tmp} = #{top_scope.absolute_const}(#{const_scope_tmp}, '#{const_name}', 'skip_raise'))"
      +  end
      +  const_tmp
      +end
      +
      +
      + +
      +

      + + #compile_defined_cvar(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +181
      +182
      +183
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 178
      +
      +def compile_defined_cvar(node)
      +  cvar_name, _ = *node
      +  cvar_tmp = scope.new_temp
      +  push "(#{cvar_tmp} = #{class_variable_owner}.$$cvars['#{cvar_name}'], #{cvar_tmp} != null)"
      +  cvar_tmp
      +end
      +
      +
      + +
      +

      + + #compile_defined_gvar(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +185
      +186
      +187
      +188
      +189
      +190
      +191
      +192
      +193
      +194
      +195
      +196
      +197
      +198
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 185
      +
      +def compile_defined_gvar(node)
      +  helper :gvars
      +
      +  name = node.children[0].to_s[1..-1]
      +  gvar_temp = scope.new_temp
      +
      +  if %w[~ !].include? name
      +    push "(#{gvar_temp} = ", expr(node), ' || true)'
      +  else
      +    push "(#{gvar_temp} = $gvars[#{name.inspect}], #{gvar_temp} != null)"
      +  end
      +
      +  gvar_temp
      +end
      +
      +
      + +
      +

      + + #compile_defined_ivar(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 135
      +
      +def compile_defined_ivar(node)
      +  name = node.children[0].to_s[1..-1]
      +  # FIXME: this check should be positive for ivars initialized as nil too.
      +  # Since currently all known ivars are inialized to nil in the constructor
      +  # we can't tell if it was the user that put nil and made the ivar #defined?
      +  # or not.
      +  tmp = scope.new_temp
      +  push "(#{tmp} = #{scope.self}['#{name}'], #{tmp} != null && #{tmp} !== nil)"
      +
      +  tmp
      +end
      +
      +
      + +
      +

      + + #compile_defined_nth_refObject + + + + + +

      + + + + +
      +
      +
      +
      +207
      +208
      +209
      +210
      +211
      +212
      +213
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 207
      +
      +def compile_defined_nth_ref
      +  helper :gvars
      +
      +  nth_ref_tmp = scope.new_temp
      +  push "(#{nth_ref_tmp} = $gvars['~'], #{nth_ref_tmp} != null && #{nth_ref_tmp} != nil)"
      +  nth_ref_tmp
      +end
      +
      +
      + +
      +

      + + #compile_defined_send(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 94
      +
      +def compile_defined_send(node)
      +  recv, method_name, *args = *node
      +  mid = mid_to_jsid(method_name.to_s)
      +
      +  if recv
      +    recv_code = compile_defined(recv)
      +    push ' && '
      +
      +    if recv.type == :send
      +      recv_code = compile_send_recv_doesnt_raise(recv_code)
      +      push ' && '
      +    end
      +
      +    recv_tmp = scope.new_temp
      +    push "(#{recv_tmp} = ", recv_code, ", #{recv_tmp}) && "
      +  else
      +    recv_tmp = scope.self
      +  end
      +
      +  recv_value_tmp = scope.new_temp
      +  push "(#{recv_value_tmp} = #{recv_tmp}) && "
      +
      +  meth_tmp = scope.new_temp
      +  push "(((#{meth_tmp} = #{recv_value_tmp}#{mid}) && !#{meth_tmp}.$$stub)"
      +
      +  push " || #{recv_value_tmp}['$respond_to_missing?']('#{method_name}'))"
      +
      +  args.each do |arg|
      +    case arg.type
      +    when :block_pass
      +      # ignoring
      +    else
      +      push ' && '
      +      compile_defined(arg)
      +    end
      +  end
      +
      +  wrap '(', ')'
      +  "#{meth_tmp}()"
      +end
      +
      +
      + +
      +

      + + #compile_defined_superObject + + + + + +

      + + + + +
      +
      +
      +
      +147
      +148
      +149
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 147
      +
      +def compile_defined_super
      +  push expr s(:defined_super)
      +end
      +
      +
      + +
      +

      + + #compile_defined_xstr(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +158
      +159
      +160
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 158
      +
      +def compile_defined_xstr(node)
      +  push '(typeof(', expr(node), ') !== "undefined")'
      +end
      +
      +
      + +
      +

      + + #compile_defined_yieldObject + + + + + +

      + + + + +
      +
      +
      +
      +151
      +152
      +153
      +154
      +155
      +156
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 151
      +
      +def compile_defined_yield
      +  scope.uses_block!
      +  block_name = scope.block_name || scope.find_parent_def.block_name
      +  push "(#{block_name} != null && #{block_name} !== nil)"
      +  block_name
      +end
      +
      +
      + +
      +

      + + #compile_send_recv_doesnt_raise(recv_code) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +90
      +91
      +92
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 90
      +
      +def compile_send_recv_doesnt_raise(recv_code)
      +  wrap_with_try_catch(recv_code)
      +end
      +
      +
      + +
      +

      + + #wrap_with_try_catch(code) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +
      +
      # File 'opal/lib/opal/nodes/defined.rb', line 74
      +
      +def wrap_with_try_catch(code)
      +  returning_tmp = scope.new_temp
      +
      +  push "(#{returning_tmp} = (function() { try {"
      +  push "  return #{code};"
      +  push '} catch ($err) {'
      +  push '  if (Opal.rescue($err, [Opal.Exception])) {'
      +  push '    try {'
      +  push '      return false;'
      +  push '    } finally { Opal.pop_exception($err); }'
      +  push '  } else { throw $err; }'
      +  push '}})())'
      +
      +  returning_tmp
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/DefinedSuperNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/DefinedSuperNode.html new file mode 100644 index 00000000..22a98864 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/DefinedSuperNode.html @@ -0,0 +1,390 @@ + + + + + + + Class: Opal::Nodes::DefinedSuperNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::DefinedSuperNode + + + +

      +
      + +
      +
      Inherits:
      +
      + BaseSuperNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/super.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from CallNode

      +

      CallNode::OPERATORS, CallNode::SPECIALS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from CallNode

      +

      #arglist, #iter, #meth, #recvr

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from BaseSuperNode

      +

      #compile_using_send, #initialize

      + + + + + + + + + +

      Methods inherited from CallNode

      +

      add_special, #initialize

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::BaseSuperNode

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #allow_stubsObject + + + + + +

      + + + + +
      +
      +
      +
      +107
      +108
      +109
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 107
      +
      +def allow_stubs
      +  'false'
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +115
      +116
      +117
      +118
      +119
      +120
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 115
      +
      +def compile
      +  compile_receiver
      +  compile_method_body
      +
      +  wrap '((', ') != null ? "super" : nil)'
      +end
      +
      +
      + +
      +

      + + #defined_check_paramObject + + + + + +

      + + + + +
      +
      +
      +
      +111
      +112
      +113
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 111
      +
      +def defined_check_param
      +  'true'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/DefsNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/DefsNode.html new file mode 100644 index 00000000..58e99495 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/DefsNode.html @@ -0,0 +1,296 @@ + + + + + + + Class: Opal::Nodes::DefsNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::DefsNode + + + +

      +
      + +
      +
      Inherits:
      +
      + DefNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/defs.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from NodeWithArgs

      +

      #arity, #original_args, #used_kwargs

      + + + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from DefNode

      +

      #comments_code, #compile, #compile_body

      + + + + + + + + + +

      Methods inherited from NodeWithArgs

      +

      #arity_check_node, #compile_arity_check, #compile_block_arg, #compile_body_or_shortcut, define_shortcut, #initialize, #parameters_code, shortcuts_for, #simple_value?

      + + + + + + + + + +

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::NodeWithArgs

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #wrap_with_definitionObject + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/nodes/defs.rb', line 11
      +
      +def wrap_with_definition
      +  helper :defs
      +  unshift '$defs(', expr(recvr), ", '$#{mid}', "
      +  push ')'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/DynamicStringNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/DynamicStringNode.html new file mode 100644 index 00000000..73b3229c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/DynamicStringNode.html @@ -0,0 +1,287 @@ + + + + + + + Class: Opal::Nodes::DynamicStringNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::DynamicStringNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      DynamicSymbolNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +261
      +262
      +263
      +264
      +265
      +266
      +267
      +268
      +269
      +270
      +271
      +272
      +273
      +274
      +275
      +276
      +277
      +278
      +279
      +280
      +281
      +282
      +283
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 261
      +
      +def compile
      +  if children.length > 1 && children.first.type == :str
      +    skip_empty = true
      +  else
      +    push '""'
      +  end
      +
      +  children.each do |part|
      +    if skip_empty
      +      skip_empty = false
      +    else
      +      push ' + '
      +    end
      +
      +    if part.type == :str
      +      push expr(part)
      +    else
      +      push '(', expr(part), ')'
      +    end
      +
      +    wrap '(', ')' if recv?
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/DynamicSymbolNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/DynamicSymbolNode.html new file mode 100644 index 00000000..125a6ba4 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/DynamicSymbolNode.html @@ -0,0 +1,187 @@ + + + + + + + Class: Opal::Nodes::DynamicSymbolNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::DynamicSymbolNode + + + +

      +
      + +
      +
      Inherits:
      +
      + DynamicStringNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + + + + + + + +

      Method Summary

      + +

      Methods inherited from DynamicStringNode

      +

      #compile

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/EFlipFlop.html b/docs/api/v1.8.2/lib/Opal/Nodes/EFlipFlop.html new file mode 100644 index 00000000..f826a44b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/EFlipFlop.html @@ -0,0 +1,267 @@ + + + + + + + Class: Opal::Nodes::EFlipFlop + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::EFlipFlop + + + +

      +
      + +
      +
      Inherits:
      +
      + BaseFlipFlop + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/if.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #excl ⇒ Object + + + + + + + + + + + + + +

        Exclusive flip flop, check 'end_condition' in the next iteration after 'start_condition' is truthy.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Methods inherited from BaseFlipFlop

      +

      #compile

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #exclObject + + + + + +

      +
      +

      Exclusive flip flop, check 'end_condition' in the next iteration after 'start_condition' is truthy

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +442
      +443
      +444
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 442
      +
      +def excl
      +  "else "
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/EnsureNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/EnsureNode.html new file mode 100644 index 00000000..cb6b1c98 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/EnsureNode.html @@ -0,0 +1,657 @@ + + + + + + + Class: Opal::Nodes::EnsureNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::EnsureNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/rescue.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #body_sexpObject + + + + + +

      + + + + +
      +
      +
      +
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 65
      +
      +def body_sexp
      +  if wrap_in_closure?
      +    compiler.returns(begn)
      +  else
      +    begn
      +  end
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +62
      +63
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 12
      +
      +def compile
      +  push_closure if wrap_in_closure?
      +
      +  push 'try {'
      +
      +  in_ensure do
      +    line stmt(body_sexp)
      +  end
      +
      +  line '} finally {'
      +
      +  indent do
      +    if has_rescue_else?
      +      # $no_errors indicates thate there were no error raised
      +      unshift 'var $no_errors = true; '
      +
      +      # when there's a begin;rescue;else;ensure;end statement,
      +      # ruby returns a result of the 'else' branch
      +      # but invokes it before 'ensure'.
      +      # so, here we
      +      # 1. save the result of calling else to $rescue_else_result
      +      # 2. call ensure
      +      # 2. return $rescue_else_result
      +      line 'var $rescue_else_result;'
      +      line 'if ($no_errors) { '
      +      indent do
      +        line '$rescue_else_result = (function() {'
      +        indent do
      +          line stmt(rescue_else_code)
      +        end
      +        line '})();'
      +      end
      +      line '}'
      +      line compiler.process(ensr_sexp, @level)
      +      line 'if ($no_errors) { return $rescue_else_result; }'
      +    else
      +      line compiler.process(ensr_sexp, @level)
      +    end
      +  end
      +
      +  line '}'
      +
      +  pop_closure if wrap_in_closure?
      +
      +  if wrap_in_closure?
      +    if scope.await_encountered
      +      wrap '(await (async function() { ', '; })())'
      +    else
      +      wrap '(function() { ', '; })()'
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #ensr_sexpObject + + + + + +

      + + + + +
      +
      +
      +
      +73
      +74
      +75
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 73
      +
      +def ensr_sexp
      +  ensr || s(:nil)
      +end
      +
      +
      + +
      +

      + + #has_rescue_else?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 87
      +
      +def has_rescue_else?
      +  @sexp.meta[:has_rescue_else]
      +end
      +
      +
      + +
      +

      + + #rescue_else_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +84
      +85
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 81
      +
      +def rescue_else_code
      +  rescue_else_code = scope.rescue_else_sexp
      +  rescue_else_code = compiler.returns(rescue_else_code) unless stmt?
      +  rescue_else_code
      +end
      +
      +
      + +
      +

      + + #wrap_in_closure?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +77
      +78
      +79
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 77
      +
      +def wrap_in_closure?
      +  recv? || expr? || has_rescue_else?
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ExclusiveRangeNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ExclusiveRangeNode.html new file mode 100644 index 00000000..2fb0b1e4 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ExclusiveRangeNode.html @@ -0,0 +1,314 @@ + + + + + + + Class: Opal::Nodes::ExclusiveRangeNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ExclusiveRangeNode + + + +

      +
      + +
      +
      Inherits:
      +
      + RangeNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from RangeNode

      +

      RangeNode::SIMPLE_CHILDREN_TYPES

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from RangeNode

      +

      #compile, #compile_inline?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compile_inlineObject + + + + + +

      + + + + +
      +
      +
      +
      +336
      +337
      +338
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 336
      +
      +def compile_inline
      +  push '$range(', expr_or_nil(start), ', ', expr_or_nil(finish), ', true)'
      +end
      +
      +
      + +
      +

      + + #compile_range_initializeObject + + + + + +

      + + + + +
      +
      +
      +
      +340
      +341
      +342
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 340
      +
      +def compile_range_initialize
      +  push 'Opal.Range.$new(', expr_or_nil(start), ',', expr_or_nil(finish), ', true)'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/GlobalAssignNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/GlobalAssignNode.html new file mode 100644 index 00000000..afedee86 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/GlobalAssignNode.html @@ -0,0 +1,305 @@ + + + + + + + Class: Opal::Nodes::GlobalAssignNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::GlobalAssignNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 166
      +
      +def compile
      +  helper :gvars
      +  name = property var_name
      +  push "$gvars#{name} = "
      +  push expr(value)
      +
      +  wrap '(', ')' if (recv? || expr?) && value
      +end
      +
      +
      + +
      +

      + + #var_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +162
      +163
      +164
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 162
      +
      +def var_name
      +  name.to_s[1..-1]
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/GlobalVariableNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/GlobalVariableNode.html new file mode 100644 index 00000000..2a2fbc20 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/GlobalVariableNode.html @@ -0,0 +1,307 @@ + + + + + + + Class: Opal::Nodes::GlobalVariableNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::GlobalVariableNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      BackRefNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 104
      +
      +def compile
      +  helper :gvars
      +
      +  name = property var_name
      +  add_gvar name
      +  push "$gvars#{name}"
      +end
      +
      +
      + +
      +

      + + #var_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +100
      +101
      +102
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 100
      +
      +def var_name
      +  name.to_s[1..-1]
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/HashNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/HashNode.html new file mode 100644 index 00000000..1b5b81aa --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/HashNode.html @@ -0,0 +1,840 @@ + + + + + + + Class: Opal::Nodes::HashNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::HashNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/hash.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #has_kwsplat ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute has_kwsplat.

        +
        + +
      • + + +
      • + + + #keys ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute keys.

        +
        + +
      • + + +
      • + + + #values ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute values.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeHashNode + + + + + +

      +
      +

      Returns a new instance of HashNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 12
      +
      +def initialize(*)
      +  super
      +  @has_kwsplat = false
      +  @keys = []
      +  @values = []
      +
      +  children.each do |child|
      +    case child.type
      +    when :kwsplat
      +      @has_kwsplat = true
      +    when :pair
      +      @keys << child.children[0]
      +      @values << child.children[1]
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #has_kwsplatObject + + + + + +

      +
      +

      Returns the value of attribute has_kwsplat.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 10
      +
      +def has_kwsplat
      +  @has_kwsplat
      +end
      +
      +
      + + + +
      +

      + + #keysObject + + + + + +

      +
      +

      Returns the value of attribute keys.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 10
      +
      +def keys
      +  @keys
      +end
      +
      +
      + + + +
      +

      + + #valuesObject + + + + + +

      +
      +

      Returns the value of attribute values.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 10
      +
      +def values
      +  @values
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 33
      +
      +def compile
      +  if has_kwsplat
      +    compile_merge
      +  else
      +    compile_hash
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_hashObject + + + + + +

      +
      +

      Compiles a hash without kwsplats +with simple or complex keys.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 76
      +
      +def compile_hash
      +  children.each_with_index do |pair, idx|
      +    key, value = pair.children
      +    push ', ' unless idx == 0
      +    if %i[sym str].include?(key.type)
      +      push "[#{key.children[0].to_s.inspect}", ', ', expr(value), ']'
      +    else
      +      push '[', expr(key), ', ', expr(value), ']'
      +    end
      +  end
      +
      +  if keys.empty?
      +    push '(new Map())'
      +  elsif simple_keys?
      +    wrap '(new Map([', ']))'
      +  else
      +    helper :hash_rehash
      +    wrap '$hash_rehash(new Map([', ']))'
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_mergeObject + + + + + +

      +
      +

      Compiles hashes containing kwsplats inside. +hash like { *{ nested: 1 }, a: 1, *{ nested: 2} } +should be compiled to +{ nested: 1}.merge(a: 1).merge(nested: 2) +Each kwsplat overrides previosly defined keys +Hash k/v pairs override previously defined kwsplat values

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 47
      +
      +def compile_merge
      +  result, seq = [], []
      +
      +  children.each do |child|
      +    if child.type == :kwsplat
      +      unless seq.empty?
      +        result << expr(s(:hash, *seq))
      +      end
      +      result << expr(child)
      +      seq = []
      +    else
      +      seq << child
      +    end
      +  end
      +  unless seq.empty?
      +    result << expr(s(:hash, *seq))
      +  end
      +
      +  result.each_with_index do |fragment, idx|
      +    if idx == 0
      +      push fragment
      +    else
      +      push '.$merge(', fragment, ')'
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #simple_keys?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 29
      +
      +def simple_keys?
      +  keys.all? { |key| %i[sym str int].include?(key.type) }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Helpers.html b/docs/api/v1.8.2/lib/Opal/Nodes/Helpers.html new file mode 100644 index 00000000..98bbcc34 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Helpers.html @@ -0,0 +1,772 @@ + + + + + + + Module: Opal::Nodes::Helpers + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Nodes::Helpers + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      Base
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/helpers.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #current_indentObject + + + + + +

      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 33
      +
      +def current_indent
      +  compiler.parser_indent
      +end
      +
      +
      + +
      +

      + + #empty_lineObject + + + + + +

      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 42
      +
      +def empty_line
      +  push fragment("\n", loc: false)
      +end
      +
      +
      + +
      +

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

      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 29
      +
      +def indent(&block)
      +  compiler.indent(&block)
      +end
      +
      +
      + +
      +

      + + #js_truthy(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 46
      +
      +def js_truthy(sexp)
      +  if optimize = js_truthy_optimize(sexp)
      +    return optimize
      +  end
      +
      +  helper :truthy
      +  [fragment('$truthy('), expr(sexp), fragment(')')]
      +end
      +
      +
      + +
      +

      + + #js_truthy_optimize(sexp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 55
      +
      +def js_truthy_optimize(sexp)
      +  case sexp.type
      +  when :send
      +    receiver, mid, *args = *sexp
      +    receiver_handler_class = receiver && compiler.handlers[receiver.type]
      +
      +    # Only operator calls on the truthy_optimize? node classes should be optimized.
      +    # Monkey patch method calls might return 'self'/aka a bridged instance and need
      +    # the nil check - see discussion at https://github.com/opal/opal/pull/1097
      +    allow_optimization_on_type = Compiler::COMPARE.include?(mid.to_s) &&
      +                                 receiver_handler_class &&
      +                                 receiver_handler_class.truthy_optimize?
      +
      +    if allow_optimization_on_type ||
      +       mid == :block_given?
      +      expr(sexp)
      +    elsif args.count == 1
      +      case mid
      +      when :==
      +        helper :eqeq
      +        compiler.record_method_call mid
      +        [fragment('$eqeq('), expr(receiver), fragment(', '), expr(args.first), fragment(')')]
      +      when :===
      +        helper :eqeqeq
      +        compiler.record_method_call mid
      +        [fragment('$eqeqeq('), expr(receiver), fragment(', '), expr(args.first), fragment(')')]
      +      when :!=
      +        helper :neqeq
      +        compiler.record_method_call mid
      +        [fragment('$neqeq('), expr(receiver), fragment(', '), expr(args.first), fragment(')')]
      +      end
      +    elsif args.count == 0
      +      case mid
      +      when :!
      +        helper :not
      +        compiler.record_method_call mid
      +        [fragment('$not('), expr(receiver), fragment(')')]
      +      end
      +    end
      +  when :begin
      +    if sexp.children.count == 1
      +      js_truthy_optimize(sexp.children.first)
      +    end
      +  when :if
      +    _test, true_body, false_body = *sexp
      +    if true_body == s(:true)
      +      # Ensure we recurse the js_truthy call on the `false_body` of the if `expr`.
      +      # This transforms an expression like:
      +      #
      +      # $truthy($truthy(a) || b)
      +      #
      +      # Into:
      +      #
      +      # $truthy(a) || $truthy(b)
      +      sexp.meta[:do_js_truthy_on_false_body] = true
      +      expr(sexp)
      +    elsif false_body == s(:false)
      +      sexp.meta[:do_js_truthy_on_true_body] = true
      +      expr(sexp)
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #line(*strs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 37
      +
      +def line(*strs)
      +  push fragment("\n#{current_indent}", loc: false)
      +  push(*strs)
      +end
      +
      +
      + +
      +

      + + #mid_to_jsid(mid) ⇒ Object + + + + + +

      +
      +

      Converts a ruby method name into its javascript equivalent for +a method/function call. All ruby method names get prefixed with +a '$', and if the name is a valid javascript identifier, it will +have a '.' prefix (for dot-calling), otherwise it will be +wrapped in brackets to use reference notation calling.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 21
      +
      +def mid_to_jsid(mid)
      +  if %r{\=|\+|\-|\*|\/|\!|\?|<|\>|\&|\||\^|\%|\~|\[|`} =~ mid.to_s
      +    "['$#{mid}']"
      +  else
      +    '.$' + mid
      +  end
      +end
      +
      +
      + +
      +

      + + #property(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 8
      +
      +def property(name)
      +  valid_name?(name) ? ".#{name}" : "[#{name.inspect}]"
      +end
      +
      +
      + +
      +

      + + #valid_name?(name) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/helpers.rb', line 12
      +
      +def valid_name?(name)
      +  Opal::Rewriters::JsReservedWords.valid_name?(name)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/IFlipFlop.html b/docs/api/v1.8.2/lib/Opal/Nodes/IFlipFlop.html new file mode 100644 index 00000000..065cf164 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/IFlipFlop.html @@ -0,0 +1,267 @@ + + + + + + + Class: Opal::Nodes::IFlipFlop + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::IFlipFlop + + + +

      +
      + +
      +
      Inherits:
      +
      + BaseFlipFlop + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/if.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #excl ⇒ Object + + + + + + + + + + + + + +

        Inclusive flip flop, check 'end_condition' in the same iteration when 'start_condition' is truthy.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Methods inherited from BaseFlipFlop

      +

      #compile

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #exclObject + + + + + +

      +
      +

      Inclusive flip flop, check 'end_condition' in the same iteration when 'start_condition' is truthy

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +433
      +434
      +435
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 433
      +
      +def excl
      +  ""
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/IfNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/IfNode.html new file mode 100644 index 00000000..c9680207 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/IfNode.html @@ -0,0 +1,1962 @@ + + + + + + + Class: Opal::Nodes::IfNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::IfNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/if.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      SWITCH_TEST_MATCH = +
      +
      +

      Matches: case some_value_or_expression; when 123 +Captures: [s(:int, 123), "$ret_or_1", s(:send, nil, :some_value_or_expression))]

      + + +
      +
      +
      + + +
      +
      +
      AST::Matcher.new do
      +  s(:send,
      +    cap(s(%i[float int sym str true false nil], :*)),
      +    :===,
      +    s(:lvasgn, cap(:*), cap(:*))
      +  )
      +end
      + +
      SWITCH_TEST_MATCH_CONTINUED = +
      +
      +

      Matches: case some_value_or_expression; when 123, 456; end +Captures: [ + s(:int, 123), + "$ret_or_1", + s(:send, nil, :some_value_or_expression)), + …here we delegate to either SWITCH_BRANCH_TEST_MATCH or SWITCH_BRANCH_TEST_MATCH_CONTINUED +]

      + + +
      +
      +
      + + +
      +
      +
      AST::Matcher.new do
      +  s(:if,
      +    s(:send,
      +      cap(s(%i[float int sym str true false nil], :*)),
      +      :===,
      +      s(:lvasgn, cap(:*), cap(:*))
      +    ),
      +    s(:true),
      +    cap(:*)
      +  )
      +end
      + +
      SWITCH_BRANCH_TEST_MATCH = +
      +
      +

      Matches: when 456 (from case foo; when 123; when 456; end) +Captures: [s(:int, 456), "$ret_or_1"]

      + + +
      +
      +
      + + +
      +
      +
      AST::Matcher.new do
      +  s(:send,
      +    cap(s(%i[float int sym str true false nil], :*)),
      +    :===,
      +    s(:js_tmp, cap(:*))
      +  )
      +end
      + +
      SWITCH_BRANCH_TEST_MATCH_CONTINUED = +
      +
      +

      Matches: when 456 +Captures: [ + s(:int, 789), + "$ret_or_1", + …here we delegate to either SWITCH_BRANCH_TEST_MATCH or SWITCH_BRANCH_TEST_MATCH_CONTINUED +]

      + + +
      +
      +
      + + +
      +
      +
      AST::Matcher.new do
      +  s(:if,
      +    s(:send,
      +      cap(s(%i[float int sym str true false nil], :*)),
      +      :===,
      +      s(:js_tmp, cap(:*))
      +    ),
      +    s(:true),
      +    cap(:*)
      +  )
      +end
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 13
      +
      +def compile
      +  if should_compile_as_simple_expression?
      +    if true_body == s(:true)
      +      compile_with_binary_or
      +    elsif false_body == s(:false)
      +      compile_with_binary_and
      +    else
      +      compile_with_ternary
      +    end
      +  elsif could_become_switch?
      +    compile_with_switch
      +  else
      +    compile_with_if
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_switch_case(test) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +365
      +366
      +367
      +368
      +369
      +370
      +371
      +372
      +373
      +374
      +375
      +376
      +377
      +378
      +379
      +380
      +381
      +382
      +383
      +384
      +385
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 365
      +
      +def compile_switch_case(test)
      +  line "case ", expr(test), ":"
      +  if @switch_additional_rules
      +    @switch_additional_rules.each do |rule|
      +      line "case ", expr(rule), ":"
      +    end
      +  end
      +  indent do
      +    line stmt(true_body)
      +    line "break;" if !true_body || !returning?(true_body)
      +  end
      +  if false_body
      +    if false_body.meta[:switch_default]
      +      compile_switch_default
      +    elsif false_body.meta[:switch_child]
      +      push stmt(false_body)
      +    end
      +  else
      +    push stmt(s(:nil))
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_switch_defaultObject + + + + + +

      + + + + +
      +
      +
      +
      +387
      +388
      +389
      +390
      +391
      +392
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 387
      +
      +def compile_switch_default
      +  line "default:"
      +  indent do
      +    line stmt(false_body)
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_with_binary_andObject + + + + + +

      + + + + +
      +
      +
      +
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 130
      +
      +def compile_with_binary_and
      +  if sexp.meta[:do_js_truthy_on_true_body]
      +    truthy = js_truthy(true_body || s(:nil))
      +  else
      +    truthy = expr(true_body || s(:nil))
      +  end
      +
      +  push '('
      +  push js_truthy(test), ' && '
      +  push '(', truthy, ')'
      +  push ')'
      +end
      +
      +
      + +
      +

      + + #compile_with_binary_orObject + + + + + +

      + + + + +
      +
      +
      +
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 143
      +
      +def compile_with_binary_or
      +  if sexp.meta[:do_js_truthy_on_false_body]
      +    falsy = js_truthy(false_body || s(:nil))
      +  else
      +    falsy = expr(false_body || s(:nil))
      +  end
      +
      +  push '('
      +  push js_truthy(test), ' || '
      +  push '(', falsy, ')'
      +  push ')'
      +end
      +
      +
      + +
      +

      + + #compile_with_ifObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 29
      +
      +def compile_with_if
      +  push_closure if expects_expression?
      +
      +  truthy = self.truthy
      +  falsy = self.falsy
      +
      +  if falsy && !truthy
      +    # Let's optimize a little bit `unless` calls.
      +    push 'if (!', js_truthy(test), ') {'
      +    falsy, truthy = truthy, falsy
      +  else
      +    push 'if (', js_truthy(test), ') {'
      +  end
      +
      +  # skip if-body if no truthy sexp
      +  indent { line stmt(truthy) } if truthy
      +
      +  if falsy
      +    if falsy.type == :if
      +      line '} else ', stmt(falsy)
      +    else
      +      line '} else {'
      +      indent do
      +        line stmt(falsy)
      +      end
      +
      +      line '}'
      +    end
      +  else
      +    line '}'
      +
      +    # This resolution isn't finite. Let's ensure this block
      +    # always return something if we expect a return
      +    line 'return nil;' if expects_expression?
      +  end
      +
      +  pop_closure if expects_expression?
      +
      +  if expects_expression?
      +    return_kw = 'return ' if returning_if?
      +
      +    if scope.await_encountered
      +      wrap "#{return_kw}(await (async function() {", '})())'
      +    else
      +      wrap "#{return_kw}(function() {", '})()'
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_with_switchObject + + + + + +

      + + + + +
      +
      +
      +
      +346
      +347
      +348
      +349
      +350
      +351
      +352
      +353
      +354
      +355
      +356
      +357
      +358
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 346
      +
      +def compile_with_switch
      +  if sexp.meta[:switch_child]
      +    @switch_variable = sexp.meta[:switch_variable]
      +    @switch_additional_rules = sexp.meta[:switch_additional_rules]
      +    compile_switch_case(sexp.meta[:switch_test])
      +  else
      +    line "switch (", expr(@switch_first_test), ".valueOf()) {"
      +    indent do
      +      compile_switch_case(@switch_test)
      +    end
      +    line "}"
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_with_ternaryObject + + + + + +

      + + + + +
      +
      +
      +
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 112
      +
      +def compile_with_ternary
      +  truthy = true_body
      +  falsy = false_body
      +
      +  push '('
      +
      +  push js_truthy(test), ' ? '
      +
      +  push '(', expr(truthy || s(:nil)), ') : '
      +  if !falsy || falsy.type == :if
      +    push expr(falsy || s(:nil))
      +  else
      +    push '(', expr(falsy || s(:nil)), ')'
      +  end
      +
      +  push ')'
      +end
      +
      +
      + +
      +

      + + #could_become_switch?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +254
      +255
      +256
      +257
      +258
      +259
      +260
      +261
      +262
      +263
      +264
      +265
      +266
      +267
      +268
      +269
      +270
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 254
      +
      +def could_become_switch?
      +  return false if expects_expression?
      +
      +  return true if sexp.meta[:switch_child]
      +
      +  test_match = SWITCH_TEST_MATCH.match(test) || SWITCH_TEST_MATCH_CONTINUED.match(test)
      +  return false unless test_match
      +  @switch_test, @switch_variable, @switch_first_test, additional_rules = *test_match
      +
      +  additional_rules = handle_additional_switch_rules(additional_rules)
      +  return false unless additional_rules # It's ok for them to be empty, but false denotes a mismatch
      +  @switch_additional_rules = additional_rules
      +
      +  return false unless valid_switch_body?(true_body)
      +
      +  could_become_switch_branch?(false_body)
      +end
      +
      +
      + +
      +

      + + #could_become_switch_branch?(body) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +286
      +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
      +314
      +315
      +316
      +317
      +318
      +319
      +320
      +321
      +322
      +323
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 286
      +
      +def could_become_switch_branch?(body)
      +  if !body
      +    return true
      +  elsif body.type != :if
      +    if valid_switch_body?(body)
      +      body.meta[:switch_default] = true
      +      return true
      +    end
      +    return false
      +  end
      +
      +  test, true_body, false_body = *body
      +
      +  test_match = SWITCH_BRANCH_TEST_MATCH.match(test) || SWITCH_BRANCH_TEST_MATCH_CONTINUED.match(test)
      +  unless test_match
      +    if valid_switch_body?(body, true)
      +      body.meta[:switch_default] = true
      +      return true
      +    end
      +  end
      +  switch_test, switch_variable, additional_rules = *test_match
      +
      +  switch_additional_rules = handle_additional_switch_rules(additional_rules)
      +  return false unless switch_additional_rules # It's ok for them to be empty, but false denotes a mismatch
      +
      +  return false unless switch_variable == @switch_variable
      +
      +  return false unless valid_switch_body?(true_body)
      +  return false unless could_become_switch_branch?(false_body)
      +
      +  body.meta.merge!(switch_child: true,
      +                   switch_test: switch_test,
      +                   switch_variable: @switch_variable,
      +                   switch_additional_rules: switch_additional_rules
      +  )
      +
      +  true
      +end
      +
      +
      + +
      +

      + + #expects_expression?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +98
      +99
      +100
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 98
      +
      +def expects_expression?
      +  expr? || recv?
      +end
      +
      +
      + +
      +

      + + #falsyObject + + + + + +

      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 86
      +
      +def falsy
      +  returnify(false_body)
      +end
      +
      +
      + +
      +

      + + #handle_additional_switch_rules(additional_rules) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +272
      +273
      +274
      +275
      +276
      +277
      +278
      +279
      +280
      +281
      +282
      +283
      +284
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 272
      +
      +def handle_additional_switch_rules(additional_rules)
      +  switch_additional_rules = []
      +  while additional_rules
      +    match = SWITCH_BRANCH_TEST_MATCH.match(additional_rules) || SWITCH_BRANCH_TEST_MATCH_CONTINUED.match(additional_rules)
      +    return false unless match
      +
      +    switch_test, switch_variable, additional_rules = *match
      +    return false unless switch_variable == @switch_variable
      +
      +    switch_additional_rules << switch_test
      +  end
      +  switch_additional_rules
      +end
      +
      +
      + +
      +

      + + #returnify(body) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 90
      +
      +def returnify(body)
      +  if expects_expression? && body
      +    compiler.returns(body)
      +  else
      +    body
      +  end
      +end
      +
      +
      + +
      +

      + + #returning?(body) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +360
      +361
      +362
      +363
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 360
      +
      +def returning?(body)
      +  %i[return js_return next].include?(body.type) ||
      +    (body.type == :begin && %i[return js_return next].include?(body.children.last.type))
      +end
      +
      +
      + +
      +

      + + #returning_if?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +78
      +79
      +80
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 78
      +
      +def returning_if?
      +  @sexp.meta[:returning]
      +end
      +
      +
      + +
      +

      + + #should_compile_as_simple_expression?Boolean + + + + + +

      +
      +

      There was a particular case in the past, that when we +expected an expression from if, we always had to closure +it. This produced an ugly code that was hard to minify. +This addition tries to make a few cases compiled with +a ternary operator instead and possibly a binary operator +even?

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +108
      +109
      +110
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 108
      +
      +def should_compile_as_simple_expression?
      +  expects_expression? && simple?(true_body) && simple?(false_body)
      +end
      +
      +
      + +
      +

      + + #simple?(body) ⇒ Boolean + + + + + +

      +
      +

      Let's ensure there are no control flow statements inside.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +157
      +158
      +159
      +160
      +161
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 157
      +
      +def simple?(body)
      +  case body
      +  when AST::Node
      +    case body.type
      +    when :return, :js_return, :break, :next, :redo, :retry
      +      false
      +    when :xstr
      +      XStringNode.single_line?(
      +        XStringNode.strip_empty_children(body.children)
      +      )
      +    else
      +      body.children.all? { |i| simple?(i) }
      +    end
      +  else
      +    true
      +  end
      +end
      +
      +
      + +
      +

      + + #truthyObject + + + + + +

      + + + + +
      +
      +
      +
      +82
      +83
      +84
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 82
      +
      +def truthy
      +  returnify(true_body)
      +end
      +
      +
      + +
      +

      + + #valid_switch_body?(body, check_variable = false) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +325
      +326
      +327
      +328
      +329
      +330
      +331
      +332
      +333
      +334
      +335
      +336
      +337
      +338
      +339
      +340
      +341
      +342
      +343
      +344
      +
      +
      # File 'opal/lib/opal/nodes/if.rb', line 325
      +
      +def valid_switch_body?(body, check_variable = false)
      +  case body
      +  when AST::Node
      +    case body.type
      +    when :break, :redo, :retry
      +      false
      +    when :iter, :while
      +      # Don't traverse the iters or whiles!
      +      true
      +    else
      +      body.children.all? { |i| valid_switch_body?(i, check_variable) }
      +    end
      +  when @switch_variable
      +    # Perhaps we ended abruptly and we lack a $ret_or variable... but sometimes
      +    # we can ignore this.
      +    !check_variable
      +  else
      +    true
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/InclusiveRangeNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/InclusiveRangeNode.html new file mode 100644 index 00000000..76e26a66 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/InclusiveRangeNode.html @@ -0,0 +1,314 @@ + + + + + + + Class: Opal::Nodes::InclusiveRangeNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::InclusiveRangeNode + + + +

      +
      + +
      +
      Inherits:
      +
      + RangeNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from RangeNode

      +

      RangeNode::SIMPLE_CHILDREN_TYPES

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from RangeNode

      +

      #compile, #compile_inline?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compile_inlineObject + + + + + +

      + + + + +
      +
      +
      +
      +324
      +325
      +326
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 324
      +
      +def compile_inline
      +  push '$range(', expr_or_nil(start), ', ', expr_or_nil(finish), ', false)'
      +end
      +
      +
      + +
      +

      + + #compile_range_initializeObject + + + + + +

      + + + + +
      +
      +
      +
      +328
      +329
      +330
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 328
      +
      +def compile_range_initialize
      +  push 'Opal.Range.$new(', expr_or_nil(start), ', ', expr_or_nil(finish), ', false)'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/InstanceAssignNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/InstanceAssignNode.html new file mode 100644 index 00000000..c4ee2652 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/InstanceAssignNode.html @@ -0,0 +1,303 @@ + + + + + + + Class: Opal::Nodes::InstanceAssignNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::InstanceAssignNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 86
      +
      +def compile
      +  name = property(var_name)
      +  push "#{scope.self}#{name} = "
      +  push expr(value)
      +
      +  wrap '(', ')' if (recv? || expr?) && value
      +end
      +
      +
      + +
      +

      + + #var_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +82
      +83
      +84
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 82
      +
      +def var_name
      +  name.to_s[1..-1]
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/InstanceVariableNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/InstanceVariableNode.html new file mode 100644 index 00000000..b8becb87 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/InstanceVariableNode.html @@ -0,0 +1,299 @@ + + + + + + + Class: Opal::Nodes::InstanceVariableNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::InstanceVariableNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +74
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 70
      +
      +def compile
      +  name = property(var_name)
      +  add_ivar name
      +  push "#{scope.self}#{name}"
      +end
      +
      +
      + +
      +

      + + #var_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +66
      +67
      +68
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 66
      +
      +def var_name
      +  name.to_s[1..-1]
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/IterArityCheckNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/IterArityCheckNode.html new file mode 100644 index 00000000..efcdff18 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/IterArityCheckNode.html @@ -0,0 +1,310 @@ + + + + + + + Class: Opal::Nodes::IterArityCheckNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::IterArityCheckNode + + + +

      +
      + +
      +
      Inherits:
      +
      + ArityCheckNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/args/arity_check.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from ArityCheckNode

      +

      #all_args, #arity, #arity_checks, #has_only_optional_kwargs?, #has_required_kwargs?, #initialize, #kwargs, #negative_arity, #positive_arity

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::ArityCheckNode

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +
      +
      # File 'opal/lib/opal/nodes/args/arity_check.rb', line 121
      +
      +def compile
      +  scope.arity = arity
      +
      +  return unless compiler.arity_check?
      +
      +  unless arity_checks.empty?
      +    parent_scope = scope
      +    until parent_scope.def? || parent_scope.class_scope? || parent_scope.top?
      +      parent_scope = parent_scope.parent
      +    end
      +
      +    context =
      +      if parent_scope.top?
      +        "'<main>'"
      +      elsif parent_scope.def?
      +        "'#{parent_scope.mid}'"
      +      elsif parent_scope.class?
      +        "'<class:#{parent_scope.name}>'"
      +      elsif parent_scope.module?
      +        "'<module:#{parent_scope.name}>'"
      +      end
      +
      +    identity = scope.identity
      +
      +    line "if (#{identity}.$$is_lambda || #{identity}.$$define_meth) {"
      +    line '  var $arity = arguments.length;'
      +    line "  if (#{arity_checks.join(' || ')}) { Opal.block_ac($arity, #{arity}, #{context}); }"
      +    line '}'
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/IterNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/IterNode.html new file mode 100644 index 00000000..49d67174 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/IterNode.html @@ -0,0 +1,877 @@ + + + + + + + Class: Opal::Nodes::IterNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::IterNode + + + +

      +
      + +
      +
      Inherits:
      +
      + NodeWithArgs + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/iter.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from NodeWithArgs

      +

      #arity, #original_args, #used_kwargs

      + + + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from NodeWithArgs

      +

      #compile_arity_check, #compile_body_or_shortcut, define_shortcut, #initialize, #parameters_code, shortcuts_for, #simple_value?

      + + + + + + + + + +

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::NodeWithArgs

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #arity_check_nodeObject + + + + + +

      + + + + +
      +
      +
      +
      +135
      +136
      +137
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 135
      +
      +def arity_check_node
      +  s(:iter_arity_check, original_args)
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 12
      +
      +def compile
      +  is_lambda! if scope.lambda_definition?
      +
      +  compile_body_or_shortcut
      +
      +  blockopts = {}
      +  blockopts["$$arity"] = arity if arity < 0
      +  blockopts["$$s"] = scope.self if @define_self
      +  blockopts["$$brk"] = @closure.throwers[:break] if @closure&.throwers&.key? :break
      +  blockopts["$$ret"] = @closure.throwers[:return] if @closure&.throwers&.key? :return
      +
      +  if compiler.arity_check?
      +    blockopts["$$parameters"] = parameters_code
      +  end
      +
      +  if compiler.enable_source_location?
      +    blockopts["$$source_location"] = source_location
      +  end
      +
      +  # MRI expands a passed argument if the block:
      +  # 1. takes a single argument that is an array
      +  # 2. has more that one argument
      +  # With a few exceptions:
      +  # 1. mlhs arg: if a block takes |(a, b)| argument
      +  # 2. trailing ',' in the arg list (|a, |)
      +  # This flag on the method indicates that a block has a top level mlhs argument
      +  # which means that we have to expand passed array explicitly in runtime.
      +  if has_top_level_mlhs_arg?
      +    blockopts["$$has_top_level_mlhs_arg"] = "true"
      +  end
      +
      +  if has_trailing_comma_in_args?
      +    blockopts["$$has_trailing_comma_in_args"] = "true"
      +  end
      +
      +  if blockopts.keys == ["$$arity"]
      +    push ", #{arity}"
      +  elsif !blockopts.empty?
      +    push ', {', blockopts.map { |k, v| "#{k}: #{v}" }.join(', '), '}'
      +  end
      +
      +  scope.nesting if @define_nesting
      +  scope.relative_access if @define_relative_access
      +end
      +
      +
      + +
      +

      + + #compile_block_argObject + + + + + +

      + + + + +
      +
      +
      +
      +90
      +91
      +92
      +93
      +94
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 90
      +
      +def compile_block_arg
      +  if block_arg
      +    scope.prepare_block
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_bodyObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 57
      +
      +def compile_body
      +  inline_params = nil
      +
      +  to_vars = identity = body_code = nil
      +
      +  in_scope do
      +    identity = scope.identify!
      +
      +    inline_params = process(inline_args)
      +
      +    compile_arity_check
      +
      +    in_closure(Closure::JS_FUNCTION | Closure::ITER | (@is_lambda ? Closure::LAMBDA : 0)) do
      +      body_code = stmt(returned_body)
      +
      +      add_temp "self = #{identity}.$$s == null ? this : #{identity}.$$s" if @define_self
      +
      +      to_vars = scope.to_vars
      +
      +      line body_code
      +    end
      +  end
      +
      +  unshift to_vars
      +
      +  if await_encountered
      +    unshift "async function #{identity}(", inline_params, '){'
      +  else
      +    unshift "function #{identity}(", inline_params, '){'
      +  end
      +  push '}'
      +end
      +
      +
      + +
      +

      + + #extract_underscore_argsObject + + + + + +

      + + + + +
      +
      +
      +
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 96
      +
      +def extract_underscore_args
      +  valid_args = []
      +  caught_blank_argument = false
      +
      +  args.children.each do |arg|
      +    arg_name = arg.children.first
      +    if arg_name == :_
      +      unless caught_blank_argument
      +        caught_blank_argument = true
      +        valid_args << arg
      +      end
      +    else
      +      valid_args << arg
      +    end
      +  end
      +
      +  @sexp = @sexp.updated(
      +    nil, [
      +      args.updated(nil, valid_args),
      +      stmts
      +    ]
      +  )
      +end
      +
      +
      + +
      +

      + + #has_top_level_mlhs_arg?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +124
      +125
      +126
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 124
      +
      +def has_top_level_mlhs_arg?
      +  original_args.children.any? { |arg| arg.type == :mlhs }
      +end
      +
      +
      + +
      +

      + + #has_trailing_comma_in_args?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +128
      +129
      +130
      +131
      +132
      +133
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 128
      +
      +def has_trailing_comma_in_args?
      +  if original_args.loc && original_args.loc.expression
      +    args_source = original_args.loc.expression.source
      +    args_source.match(/,\s*\|/)
      +  end
      +end
      +
      +
      + +
      +

      + + #returned_bodyObject + + + + + +

      + + + + +
      +
      +
      +
      +120
      +121
      +122
      +
      +
      # File 'opal/lib/opal/nodes/iter.rb', line 120
      +
      +def returned_body
      +  compiler.returns(stmts || s(:nil))
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/JSReturnNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/JSReturnNode.html new file mode 100644 index 00000000..692af1b1 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/JSReturnNode.html @@ -0,0 +1,245 @@ + + + + + + + Class: Opal::Nodes::JSReturnNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::JSReturnNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +112
      +113
      +114
      +115
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 112
      +
      +def compile
      +  push 'return '
      +  push expr(value)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/JSTempNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/JSTempNode.html new file mode 100644 index 00000000..2e021227 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/JSTempNode.html @@ -0,0 +1,243 @@ + + + + + + + Class: Opal::Nodes::JSTempNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::JSTempNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +123
      +124
      +125
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 123
      +
      +def compile
      +  push value.to_s
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/JsAttrAsgnNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/JsAttrAsgnNode.html new file mode 100644 index 00000000..98ddb5b1 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/JsAttrAsgnNode.html @@ -0,0 +1,254 @@ + + + + + + + Class: Opal::Nodes::JsAttrAsgnNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::JsAttrAsgnNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/call_special.rb
      +
      + +
      + +

      Overview

      +
      +

      recvr.JS[:prop] = value +=> recvr.prop = value

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/nodes/call_special.rb', line 26
      +
      +def compile
      +  push recv(recvr), '[', expr(property), '] = ', expr(value)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/JsAttrNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/JsAttrNode.html new file mode 100644 index 00000000..8200a84f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/JsAttrNode.html @@ -0,0 +1,254 @@ + + + + + + + Class: Opal::Nodes::JsAttrNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::JsAttrNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/call_special.rb
      +
      + +
      + +

      Overview

      +
      +

      recvr.JS[:prop] +=> recvr.prop

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/nodes/call_special.rb', line 14
      +
      +def compile
      +  push recv(recvr), '[', expr(property), ']'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/JsCallNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/JsCallNode.html new file mode 100644 index 00000000..913fb68f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/JsCallNode.html @@ -0,0 +1,458 @@ + + + + + + + Class: Opal::Nodes::JsCallNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::JsCallNode + + + +

      +
      + +
      +
      Inherits:
      +
      + CallNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/call_special.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from CallNode

      +

      CallNode::OPERATORS, CallNode::SPECIALS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from CallNode

      +

      #arglist, #iter, #meth, #recvr

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from CallNode

      +

      add_special

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeJsCallNode + + + + + +

      +
      +

      Returns a new instance of JsCallNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +
      +
      # File 'opal/lib/opal/nodes/call_special.rb', line 34
      +
      +def initialize(*)
      +  super
      +
      +  # For .JS. call we pass a block
      +  # as a plain JS callback
      +  if @iter
      +    @arglist = @arglist << @iter
      +  end
      +  @iter = nil
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +45
      +46
      +47
      +
      +
      # File 'opal/lib/opal/nodes/call_special.rb', line 45
      +
      +def compile
      +  default_compile
      +end
      +
      +
      + +
      +

      + + #compile_using_sendObject + + + + + +

      + + + + +
      +
      +
      +
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +
      +
      # File 'opal/lib/opal/nodes/call_special.rb', line 53
      +
      +def compile_using_send
      +  push recv(receiver_sexp), method_jsid, '.apply(null'
      +  compile_arguments
      +  if iter
      +    push '.concat(', expr(iter), ')'
      +  end
      +  push ')'
      +end
      +
      +
      + +
      +

      + + #method_jsidObject + + + + + +

      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +
      +
      # File 'opal/lib/opal/nodes/call_special.rb', line 49
      +
      +def method_jsid
      +  ".#{meth}"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/KwBeginNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/KwBeginNode.html new file mode 100644 index 00000000..5e973fff --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/KwBeginNode.html @@ -0,0 +1,211 @@ + + + + + + + Class: Opal::Nodes::KwBeginNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::KwBeginNode + + + +

      +
      + +
      +
      Inherits:
      +
      + BeginNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/definitions.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from BeginNode

      +

      BeginNode::COMPLEX_CHILDREN

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + + + + + + + +

      Method Summary

      + +

      Methods inherited from BeginNode

      +

      #compile, #compile_children, #compile_inline_children, #returned_children, #simple_children?

      + + + + + + + + + +

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::ScopeNode

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/KwSplatNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/KwSplatNode.html new file mode 100644 index 00000000..17a9d3b0 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/KwSplatNode.html @@ -0,0 +1,243 @@ + + + + + + + Class: Opal::Nodes::KwSplatNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::KwSplatNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/hash.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +102
      +103
      +104
      +
      +
      # File 'opal/lib/opal/nodes/hash.rb', line 102
      +
      +def compile
      +  push 'Opal.to_hash(', expr(value), ')'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/LambdaNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/LambdaNode.html new file mode 100644 index 00000000..4fdb85bb --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/LambdaNode.html @@ -0,0 +1,251 @@ + + + + + + + Class: Opal::Nodes::LambdaNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::LambdaNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/lambda.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'opal/lib/opal/nodes/lambda.rb', line 11
      +
      +def compile
      +  helper :lambda
      +
      +  scope.defines_lambda do
      +    push '$lambda(', expr(iter), ')'
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/LocalAssignNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/LocalAssignNode.html new file mode 100644 index 00000000..67b03687 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/LocalAssignNode.html @@ -0,0 +1,337 @@ + + + + + + + Class: Opal::Nodes::LocalAssignNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::LocalAssignNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 35
      +
      +def compile
      +  if using_irb?
      +    push "Opal.irb_vars#{property var_name.to_s} = "
      +  else
      +    add_local var_name.to_s
      +
      +    push "#{var_name} = "
      +  end
      +
      +  push expr(value)
      +
      +  wrap '(', ')' if (recv? || expr?) && value
      +end
      +
      +
      + +
      +

      + + #using_irb?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 31
      +
      +def using_irb?
      +  compiler.irb? && scope.top?
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/LocalDeclareNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/LocalDeclareNode.html new file mode 100644 index 00000000..5b0e3fe7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/LocalDeclareNode.html @@ -0,0 +1,245 @@ + + + + + + + Class: Opal::Nodes::LocalDeclareNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::LocalDeclareNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +58
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 55
      +
      +def compile
      +  add_local(var_name.to_s)
      +  nil
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/LocalVariableNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/LocalVariableNode.html new file mode 100644 index 00000000..c213e083 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/LocalVariableNode.html @@ -0,0 +1,327 @@ + + + + + + + Class: Opal::Nodes::LocalVariableNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::LocalVariableNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 16
      +
      +def compile
      +  return push(var_name.to_s) unless using_irb?
      +
      +  with_temp do |tmp|
      +    push property(var_name.to_s)
      +    wrap "((#{tmp} = Opal.irb_vars", ") == null ? nil : #{tmp})"
      +  end
      +end
      +
      +
      + +
      +

      + + #using_irb?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 12
      +
      +def using_irb?
      +  compiler.irb? && scope.top?
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/MassAssignNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/MassAssignNode.html new file mode 100644 index 00000000..f3296287 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/MassAssignNode.html @@ -0,0 +1,538 @@ + + + + + + + Class: Opal::Nodes::MassAssignNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::MassAssignNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/masgn.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      SIMPLE_ASSIGNMENT = + +
      +
      %i[lvasgn ivasgn lvar gvasgn cdecl casgn].freeze
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'opal/lib/opal/nodes/masgn.rb', line 13
      +
      +def compile
      +  with_temp do |array|
      +    if rhs.type == :array
      +      push "#{array} = ", expr(rhs)
      +      rhs_len = rhs.children.any? { |c| c.type == :splat } ? nil : rhs.children.size
      +      compile_masgn(lhs.children, array, rhs_len)
      +      push ", #{array}" # a mass assignment evaluates to the RHS
      +    else
      +      helper :to_ary
      +      with_temp do |retval|
      +        push "#{retval} = ", expr(rhs)
      +        push ", #{array} = $to_ary(#{retval})"
      +        compile_masgn(lhs.children, array)
      +        push ", #{retval}"
      +      end
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_assignment(child, array, idx, len = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/masgn.rb', line 76
      +
      +def compile_assignment(child, array, idx, len = nil)
      +  assign =
      +    if !len || idx >= len
      +      s(:js_tmp, "(#{array}[#{idx}] == null ? nil : #{array}[#{idx}])")
      +    else
      +      s(:js_tmp, "#{array}[#{idx}]")
      +    end
      +
      +  part = child.updated
      +  if SIMPLE_ASSIGNMENT.include?(child.type)
      +    part = part.updated(nil, part.children + [assign])
      +  elsif child.type == :send
      +    part = part.updated(nil, part.children + [assign])
      +  elsif child.type == :attrasgn
      +    part.last << assign
      +  elsif child.type == :mlhs
      +    helper :to_ary
      +    # nested destructuring
      +    tmp = scope.new_temp
      +    push ", (#{tmp} = $to_ary(#{assign.children[0]})"
      +    compile_masgn(child.children, tmp)
      +    push ')'
      +    scope.queue_temp(tmp)
      +    return
      +  else
      +    raise "Bad child node in masgn LHS: #{child}. LHS: #{lhs}"
      +  end
      +
      +  push ', '
      +  push expr(part)
      +end
      +
      +
      + +
      +

      + + #compile_masgn(lhs_items, array, len = nil) ⇒ Object + + + + + +

      +
      +

      'len' is how many rhs items are we sure we have

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +
      +
      # File 'opal/lib/opal/nodes/masgn.rb', line 33
      +
      +def compile_masgn(lhs_items, array, len = nil)
      +  pre_splat  = lhs_items.take_while { |child| child.type != :splat }
      +  post_splat = lhs_items.drop(pre_splat.size)
      +
      +  pre_splat.each_with_index do |child, idx|
      +    compile_assignment(child, array, idx, len)
      +  end
      +
      +  unless post_splat.empty?
      +    splat = post_splat.shift
      +
      +    if post_splat.empty? # trailing splat
      +      if part = splat.children[0]
      +        helper :slice
      +        part = part.dup << s(:js_tmp, "$slice(#{array}, #{pre_splat.size})")
      +        push ', '
      +        push expr(part)
      +      end
      +    else
      +      tmp = scope.new_temp # end index for items consumed by splat
      +      push ", #{tmp} = #{array}.length - #{post_splat.size}"
      +      push ", #{tmp} = (#{tmp} < #{pre_splat.size}) ? #{pre_splat.size} : #{tmp}"
      +
      +      if part = splat.children[0]
      +        helper :slice
      +        part = part.dup << s(:js_tmp, "$slice(#{array}, #{pre_splat.size}, #{tmp})")
      +        push ', '
      +        push expr(part)
      +      end
      +
      +      post_splat.each_with_index do |child, idx|
      +        if idx == 0
      +          compile_assignment(child, array, tmp)
      +        else
      +          compile_assignment(child, array, "#{tmp} + #{idx}")
      +        end
      +      end
      +
      +      scope.queue_temp(tmp)
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/Match3Node.html b/docs/api/v1.8.2/lib/Opal/Nodes/Match3Node.html new file mode 100644 index 00000000..7a35594c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/Match3Node.html @@ -0,0 +1,290 @@ + + + + + + + Class: Opal::Nodes::Match3Node + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::Match3Node + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/call_special.rb
      +
      + +
      + +

      Overview

      +
      +

      Handles match_with_lvasgn nodes which represent matching a regular expression +with a right-hand side value and assigning the match result to a left-hand side variable.

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +
      +
      # File 'opal/lib/opal/nodes/call_special.rb', line 70
      +
      +def compile
      +  sexp = s(:send, lhs, :=~, rhs)
      +
      +  # Handle named matches like: /(?<abc>b)/ =~ 'b'
      +  if lhs.type == :regexp && lhs.children.first.type == :str
      +    names = extract_names(lhs)
      +
      +    unless names.empty?
      +      names_def = generate_names_definition
      +      names_assignments = generate_names_assignments(names)
      +
      +      sexp = if stmt?
      +               handle_statement(sexp, names_def, names_assignments)
      +             else
      +               handle_non_statement(sexp, names_def, names_assignments)
      +             end
      +    end
      +  end
      +
      +  push process(sexp, @level)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/MatchCurrentLineNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/MatchCurrentLineNode.html new file mode 100644 index 00000000..ca3dbb9f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/MatchCurrentLineNode.html @@ -0,0 +1,271 @@ + + + + + + + Class: Opal::Nodes::MatchCurrentLineNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::MatchCurrentLineNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + +

      Overview

      +
      +

      $_ = 'foo'; call if /foo/ +s(:if, s(:match_current_line, /foo/, true))

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #compile ⇒ Object + + + + + + + + + + + + + +

        Here we just convert it to ($_ =~ regexp) and let :send node to handle it.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      +
      +

      Here we just convert it to +($_ =~ regexp) +and let :send node to handle it

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +251
      +252
      +253
      +254
      +255
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 251
      +
      +def compile
      +  gvar_sexp = s(:gvar, :$_)
      +  send_node = s(:send, gvar_sexp, :=~, regexp)
      +  push expr(send_node)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ModuleNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ModuleNode.html new file mode 100644 index 00000000..e658b9fe --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ModuleNode.html @@ -0,0 +1,325 @@ + + + + + + + Class: Opal::Nodes::ModuleNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ModuleNode + + + +

      +
      + +
      +
      Inherits:
      +
      + ScopeNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/module.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      ClassNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::ScopeNode

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/module.rb', line 12
      +
      +def compile
      +  name, base = name_and_base
      +  helper :module
      +
      +  if body.nil?
      +    # Simplified compile for empty body
      +    if stmt?
      +      unshift '$module(', base, ", '#{name}')"
      +    else
      +      unshift '($module(', base, ", '#{name}'), nil)"
      +    end
      +  else
      +    line "  var self = $module($base, '#{name}');"
      +    in_scope do
      +      scope.name = name
      +      in_closure(Closure::MODULE | Closure::JS_FUNCTION) do
      +        compile_body
      +      end
      +    end
      +
      +    if await_encountered
      +      await_begin = '(await '
      +      await_end = ')'
      +      async = 'async '
      +      parent.await_encountered = true
      +    else
      +      await_begin, await_end, async = '', '', ''
      +    end
      +
      +    unshift "#{await_begin}(#{async}function($base#{', $parent_nesting' if @define_nesting}) {"
      +    line '})(', base, "#{', ' + scope.nesting if @define_nesting})#{await_end}"
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/NextNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/NextNode.html new file mode 100644 index 00000000..30218f5e --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/NextNode.html @@ -0,0 +1,309 @@ + + + + + + + Class: Opal::Nodes::NextNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::NextNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 10
      +
      +def compile
      +  thrower(:next, value)
      +end
      +
      +
      + +
      +

      + + #valueObject + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 14
      +
      +def value
      +  case children.size
      +  when 0
      +    s(:nil)
      +  when 1
      +    children.first
      +  else
      +    s(:array, *children)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs.html b/docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs.html new file mode 100644 index 00000000..8dac4183 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs.html @@ -0,0 +1,1024 @@ + + + + + + + Class: Opal::Nodes::NodeWithArgs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::NodeWithArgs + + + +

      +
      + +
      +
      Inherits:
      +
      + ScopeNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/node_with_args.rb,
      + opal/lib/opal/nodes/node_with_args/shortcuts.rb
      +
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      DefNode, IterNode

      +
      +

      Defined Under Namespace

      +

      + + + + + Classes: Shortcut + + +

      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #arity ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute arity.

        +
        + +
      • + + +
      • + + + #original_args ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute original_args.

        +
        + +
      • + + +
      • + + + #used_kwargs ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute used_kwargs.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeNodeWithArgs + + + + + +

      +
      +

      Returns a new instance of NodeWithArgs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 14
      +
      +def initialize(*)
      +  super
      +
      +  @original_args = @sexp.meta[:original_args]
      +  @used_kwargs = []
      +  @arity = 0
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #arityObject + + + + + +

      +
      +

      Returns the value of attribute arity.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 11
      +
      +def arity
      +  @arity
      +end
      +
      +
      + + + +
      +

      + + #original_argsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute original_args.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 12
      +
      +def original_args
      +  @original_args
      +end
      +
      +
      + + + +
      +

      + + #used_kwargsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute used_kwargs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 10
      +
      +def used_kwargs
      +  @used_kwargs
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .define_shortcut(name, **kwargs, &block) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 20
      +
      +def self.define_shortcut(name, **kwargs, &block)
      +  kwargs[:for] ||= :def
      +  @shortcuts << Shortcut.new(name, kwargs[:for], kwargs[:when], block)
      +end
      +
      +
      + +
      +

      + + .shortcuts_for(node_type) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 25
      +
      +def self.shortcuts_for(node_type)
      +  @shortcuts_for[node_type] ||=
      +    @shortcuts.select do |shortcut|
      +      [node_type, :*].include? shortcut.for
      +    end
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #arity_check_nodeObject + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 22
      +
      +def arity_check_node
      +  s(:arity_check, original_args)
      +end
      +
      +
      + +
      +

      + + #compile_arity_checkObject + + + + + +

      +
      +

      Returns code used in debug mode to check arity of method call

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 27
      +
      +def compile_arity_check
      +  push process(arity_check_node)
      +end
      +
      +
      + +
      +

      + + #compile_block_argObject + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 31
      +
      +def compile_block_arg
      +  if scope.uses_block?
      +    scope.prepare_block
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_body_or_shortcutObject + + + + + +

      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 32
      +
      +def compile_body_or_shortcut
      +  # The shortcuts don't check arity. If we want to check arity,
      +  # we can't use them.
      +  return compile_body if compiler.arity_check?
      +
      +  node_type = is_a?(DefNode) ? :def : :iter
      +
      +  NodeWithArgs.shortcuts_for(node_type).each do |shortcut|
      +    if shortcut.match?(self)
      +      if ENV['OPAL_DEBUG_SHORTCUTS']
      +        node_desc = node_type == :def ? "def #{mid}" : "iter"
      +        warn "* shortcut #{shortcut.name} used for #{node_desc}"
      +      end
      +
      +      return shortcut.compile(self)
      +    end
      +  end
      +
      +  compile_body
      +end
      +
      +
      + +
      +

      + + #parameters_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args.rb', line 37
      +
      +def parameters_code
      +  Args::Parameters.new(original_args).to_code
      +end
      +
      +
      + +
      +

      + + #simple_value?(node = stmts) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 61
      +
      +def simple_value?(node = stmts)
      +  %i[true false nil int float str sym].include?(node.type)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs/Shortcut.html b/docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs/Shortcut.html new file mode 100644 index 00000000..157840ca --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/NodeWithArgs/Shortcut.html @@ -0,0 +1,631 @@ + + + + + + + Class: Opal::Nodes::NodeWithArgs::Shortcut + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::NodeWithArgs::Shortcut + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/node_with_args/shortcuts.rb
      +
      + +
      + +

      Overview

      +
      +

      Shortcuts for the simplest kinds of methods

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

      Instance Attribute Summary collapse

      +
        + +
      • + + + #for ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute for.

        +
        + +
      • + + +
      • + + + #name ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute name.

        +
        + +
      • + + +
      • + + + #transform ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute transform.

        +
        + +
      • + + +
      • + + + #when ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute when.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #forObject + + + + + +

      +
      +

      Returns the value of attribute for

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of for

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 7
      +
      +def for
      +  @for
      +end
      +
      +
      + + + +
      +

      + + #nameObject + + + + + +

      +
      +

      Returns the value of attribute name

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of name

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 7
      +
      +def name
      +  @name
      +end
      +
      +
      + + + +
      +

      + + #transformObject + + + + + +

      +
      +

      Returns the value of attribute transform

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of transform

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 7
      +
      +def transform
      +  @transform
      +end
      +
      +
      + + + +
      +

      + + #whenObject + + + + + +

      +
      +

      Returns the value of attribute when

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +

        the current value of when

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 7
      +
      +def when
      +  @when
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compile(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 12
      +
      +def compile(node)
      +  node.helper name
      +  node.instance_exec(&transform)
      +end
      +
      +
      + +
      +

      + + #match?(node) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/nodes/node_with_args/shortcuts.rb', line 8
      +
      +def match?(node)
      +  node.instance_exec(&self.when)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/NthrefNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/NthrefNode.html new file mode 100644 index 00000000..744df00b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/NthrefNode.html @@ -0,0 +1,261 @@ + + + + + + + Class: Opal::Nodes::NthrefNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::NthrefNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/variables.rb
      +
      + +
      + +

      Overview

      +
      +

      $1 => s(:nth_ref, 1)

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +182
      +183
      +184
      +185
      +186
      +187
      +188
      +
      +
      # File 'opal/lib/opal/nodes/variables.rb', line 182
      +
      +def compile
      +  helper :gvars
      +
      +  with_temp do |tmp|
      +    push "((#{tmp} = $gvars['~']) === nil ? nil : #{tmp}['$[]'](#{index}))"
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/NumericNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/NumericNode.html new file mode 100644 index 00000000..b8763f5b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/NumericNode.html @@ -0,0 +1,334 @@ + + + + + + + Class: Opal::Nodes::NumericNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::NumericNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .truthy_optimize?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 37
      +
      +def self.truthy_optimize?
      +  true
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +35
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 32
      +
      +def compile
      +  push value.to_s
      +  wrap '(', ')' if recv?
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/RangeNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/RangeNode.html new file mode 100644 index 00000000..26bbfa02 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/RangeNode.html @@ -0,0 +1,503 @@ + + + + + + + Class: Opal::Nodes::RangeNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::RangeNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      ExclusiveRangeNode, InclusiveRangeNode

      +
      + + +

      + Constant Summary + collapse +

      + +
      + +
      SIMPLE_CHILDREN_TYPES = + +
      +
      %i[int float str sym].freeze
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +295
      +296
      +297
      +298
      +299
      +300
      +301
      +302
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 295
      +
      +def compile
      +  if compile_inline?
      +    helper :range
      +    compile_inline
      +  else
      +    compile_range_initialize
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_inlineObject + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +312
      +313
      +314
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 312
      +
      +def compile_inline
      +  raise NotImplementedError
      +end
      +
      +
      + +
      +

      + + #compile_inline?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +304
      +305
      +306
      +307
      +308
      +309
      +310
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 304
      +
      +def compile_inline?
      +  (
      +    !start || (start.type && SIMPLE_CHILDREN_TYPES.include?(start.type))
      +  ) && (
      +    !finish || (finish.type && SIMPLE_CHILDREN_TYPES.include?(finish.type))
      +  )
      +end
      +
      +
      + +
      +

      + + #compile_range_initializeObject + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +316
      +317
      +318
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 316
      +
      +def compile_range_initialize
      +  raise NotImplementedError
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/RationalNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/RationalNode.html new file mode 100644 index 00000000..fce60026 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/RationalNode.html @@ -0,0 +1,254 @@ + + + + + + + Class: Opal::Nodes::RationalNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::RationalNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + +

      Overview

      +
      +

      0b1111r -> s(:rational, (15/1)) +-0b1111r -> s(:rational, (-15/1))

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +352
      +353
      +354
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 352
      +
      +def compile
      +  push "#{top_scope.absolute_const}('Rational').$new(#{value.numerator}, #{value.denominator})"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/RedoNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/RedoNode.html new file mode 100644 index 00000000..b76c4e93 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/RedoNode.html @@ -0,0 +1,363 @@ + + + + + + + Class: Opal::Nodes::RedoNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::RedoNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 39
      +
      +def compile
      +  if in_while?
      +    compile_while
      +  elsif scope.iter?
      +    compile_iter
      +  else
      +    push 'REDO()'
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_iterObject + + + + + +

      + + + + +
      +
      +
      +
      +54
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 54
      +
      +def compile_iter
      +  helper :slice
      +  push "return #{scope.identity}.apply(null, $slice(arguments))"
      +end
      +
      +
      + +
      +

      + + #compile_whileObject + + + + + +

      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 49
      +
      +def compile_while
      +  push "#{while_loop[:redo_var]} = true;"
      +  thrower(:redo)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/RegexpNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/RegexpNode.html new file mode 100644 index 00000000..65bbc73d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/RegexpNode.html @@ -0,0 +1,892 @@ + + + + + + + Class: Opal::Nodes::RegexpNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::RegexpNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      SUPPORTED_FLAGS = + +
      + + +
      +
      +
      /[gimuy]/.freeze
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #flags ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute flags.

        +
        + +
      • + + +
      • + + + #value ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute value.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeRegexpNode + + + + + +

      +
      +

      Returns a new instance of RegexpNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +125
      +126
      +127
      +128
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 125
      +
      +def initialize(*)
      +  super
      +  extract_flags_and_value
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #flagsObject + + + + + +

      +
      +

      Returns the value of attribute flags.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +120
      +121
      +122
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 120
      +
      +def flags
      +  @flags
      +end
      +
      +
      + + + +
      +

      + + #valueObject + + + + + +

      +
      +

      Returns the value of attribute value.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +120
      +121
      +122
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 120
      +
      +def value
      +  @value
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 130
      +
      +def compile
      +  flags.select! do |flag|
      +    if SUPPORTED_FLAGS =~ flag
      +      true
      +    else
      +      compiler.warning "Skipping the '#{flag}' Regexp flag as it's not widely supported by JavaScript vendors."
      +      false
      +    end
      +  end
      +
      +  if value.type == :str
      +    compile_static_regexp
      +  else
      +    compile_dynamic_regexp
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_dynamic_regexpObject + + + + + +

      + + + + +
      +
      +
      +
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 147
      +
      +def compile_dynamic_regexp
      +  helper :regexp
      +
      +  push '$regexp(['
      +  value.children.each_with_index do |v, index|
      +    push ', ' unless index.zero?
      +    push expr(v)
      +  end
      +  push ']'
      +  push ", '#{flags.join}'" if flags.any?
      +  push ")"
      +end
      +
      +
      + +
      +

      + + #compile_static_regexpObject + + + + + +

      + + + + +
      +
      +
      +
      +160
      +161
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +174
      +175
      +176
      +177
      +178
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 160
      +
      +def compile_static_regexp
      +  value = self.value.children[0]
      +  case value
      +  when ''
      +    push('/(?:)/')
      +  when /\(\?[(<>#]|[*+?]\+/
      +    # Safari/WebKit will not execute javascript code if it contains a lookbehind literal RegExp
      +    # and they fail with "Syntax Error". This tricks their parser by disguising the literal RegExp
      +    # as string for the dynamic $regexp helper. Safari/Webkit will still fail to execute the RegExp,
      +    # but at least they will parse and run everything else.
      +    #
      +    # Also, let's compile a couple of more patterns into $regexp calls, as there are many syntax
      +    # errors in RubySpec when ran in reverse, while there shouldn't be (they should be catchable
      +    # errors) - at least since Node 17.
      +    static_as_dynamic(value)
      +  else
      +    push "#{Regexp.new(value).inspect}#{flags.join}"
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_flags_and_valueObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 190
      +
      +def extract_flags_and_value
      +  *values, flags_sexp = *children
      +  self.flags = flags_sexp.children.map(&:to_s)
      +
      +  self.value = if values.empty?
      +                 # empty regexp, we can process it inline
      +                 s(:str, '')
      +               elsif single_line?(values)
      +                 # simple plain regexp, we can put it inline
      +                 values[0]
      +               else
      +                 s(:dstr, *values)
      +               end
      +
      +  # trimming when //x provided
      +  # required by parser gem, but JS doesn't support 'x' flag
      +  if flags.include?('x')
      +    parts = value.children.map do |part|
      +      if part.is_a?(::Opal::AST::Node) && part.type == :str
      +        trimmed_value = part.children[0].gsub(/\A\s*\#.*/, '').gsub(/\s/, '')
      +        s(:str, trimmed_value)
      +      else
      +        part
      +      end
      +    end
      +
      +    self.value = value.updated(nil, parts)
      +    flags.delete('x')
      +  end
      +
      +  if value.type == :str
      +    # Replacing \A -> ^, \z -> $, required for the parser gem
      +    self.value = s(:str, value.children[0].gsub('\A', '^').gsub('\z', '$'))
      +  end
      +end
      +
      +
      + +
      +

      + + #raw_valueObject + + + + + +

      + + + + +
      +
      +
      +
      +226
      +227
      +228
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 226
      +
      +def raw_value
      +  self.value = @sexp.loc.expression.source
      +end
      +
      +
      + +
      +

      + + #static_as_dynamic(value) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +180
      +181
      +182
      +183
      +184
      +185
      +186
      +187
      +188
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 180
      +
      +def static_as_dynamic(value)
      +  helper :regexp
      +
      +  push '$regexp(["'
      +  push value.gsub('\\', '\\\\\\\\')
      +  push '"]'
      +  push ", '#{flags.join}'" if flags.any?
      +  push ")"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ResBodyNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ResBodyNode.html new file mode 100644 index 00000000..ccfedc5e --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ResBodyNode.html @@ -0,0 +1,381 @@ + + + + + + + Class: Opal::Nodes::ResBodyNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ResBodyNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/rescue.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +211
      +212
      +213
      +214
      +215
      +216
      +217
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 200
      +
      +def compile
      +  push 'if (Opal.rescue($err, ', expr(klasses), ')) {'
      +  indent do
      +    if lvar
      +      push expr(lvar.updated(nil, [*lvar.children, s(:js_tmp, '$err')]))
      +    end
      +
      +    # Need to ensure we clear the current exception out after the rescue block ends
      +    line 'try {'
      +    indent do
      +      in_resbody do
      +        line stmt(rescue_body)
      +      end
      +    end
      +    line '} finally { Opal.pop_exception($err); }'
      +  end
      +  line '}'
      +end
      +
      +
      + +
      +

      + + #klassesObject + + + + + +

      + + + + +
      +
      +
      +
      +219
      +220
      +221
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 219
      +
      +def klasses
      +  klasses_sexp || s(:array, s(:const, nil, :StandardError))
      +end
      +
      +
      + +
      +

      + + #rescue_bodyObject + + + + + +

      + + + + +
      +
      +
      +
      +223
      +224
      +225
      +226
      +227
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 223
      +
      +def rescue_body
      +  body_code = (body || s(:nil))
      +  body_code = compiler.returns(body_code) unless stmt?
      +  body_code
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/RescueNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/RescueNode.html new file mode 100644 index 00000000..4ee5591d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/RescueNode.html @@ -0,0 +1,646 @@ + + + + + + + Class: Opal::Nodes::RescueNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::RescueNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/rescue.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #body_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +171
      +172
      +173
      +174
      +175
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 171
      +
      +def body_code
      +  body_code = (body.nil? || body.type == :resbody ? s(:nil) : body)
      +  body_code = compiler.returns(body_code) unless stmt?
      +  body_code
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +160
      +161
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 97
      +
      +def compile
      +  scope.rescue_else_sexp = children[1..-1].detect { |sexp| sexp && sexp.type != :resbody }
      +  _has_rescue_handlers = false
      +
      +  if handle_rescue_else_manually?
      +    line 'var $no_errors = true;'
      +  end
      +
      +  closure_type = Closure::NONE
      +  closure_type |= Closure::JS_FUNCTION if expr? || recv?
      +  if has_retry?
      +    closure_type |= Closure::JS_LOOP        \
      +                 |  Closure::JS_LOOP_INSIDE \
      +                 |  Closure::RESCUE_RETRIER
      +  end
      +  push_closure(closure_type) if closure_type != Closure::NONE
      +
      +  in_rescue(self) do
      +    push 'try {'
      +    indent do
      +      line stmt(body_code)
      +    end
      +    line '} catch ($err) {'
      +
      +    indent do
      +      if has_rescue_else?
      +        line '$no_errors = false;'
      +      end
      +
      +      children[1..-1].each_with_index do |child, idx|
      +        # counting only rescue, ignoring rescue-else statement
      +        next unless child && child.type == :resbody
      +        _has_rescue_handlers = true
      +
      +        push ' else ' unless idx == 0
      +        line process(child, @level)
      +      end
      +
      +      # if no resbodys capture our error, then rethrow
      +      push ' else { throw $err; }'
      +    end
      +
      +    line '}'
      +
      +    if handle_rescue_else_manually?
      +      # here we must add 'finally' explicitly
      +      push 'finally {'
      +      indent do
      +        line 'if ($no_errors) { '
      +        indent do
      +          line stmt(rescue_else_code)
      +        end
      +        line '}'
      +      end
      +      push '}'
      +    end
      +  end
      +
      +  pop_closure if closure_type != Closure::NONE
      +
      +  wrap 'do { ', ' break; } while(1)' if has_retry?
      +
      +  # Wrap a try{} catch{} into a function
      +  # when it's an expression
      +  # or when there's a method call after begin;rescue;end
      +  if expr? || recv?
      +    if scope.await_encountered
      +      wrap '(await (async function() { ', '})())'
      +    else
      +      wrap '(function() { ', '})()'
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #handle_rescue_else_manually?Boolean + + + + + +

      +
      +

      Returns true when there's no 'ensure' statement + wrapping current rescue.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +186
      +187
      +188
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 186
      +
      +def handle_rescue_else_manually?
      +  !in_ensure? && has_rescue_else?
      +end
      +
      +
      + +
      +

      + + #has_retry?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +190
      +191
      +192
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 190
      +
      +def has_retry?
      +  @sexp.meta[:has_retry]
      +end
      +
      +
      + +
      +

      + + #rescue_else_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +177
      +178
      +179
      +180
      +181
      +
      +
      # File 'opal/lib/opal/nodes/rescue.rb', line 177
      +
      +def rescue_else_code
      +  rescue_else_code = scope.rescue_else_sexp
      +  rescue_else_code = compiler.returns(rescue_else_code) unless stmt?
      +  rescue_else_code
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/RetryNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/RetryNode.html new file mode 100644 index 00000000..c376062c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/RetryNode.html @@ -0,0 +1,243 @@ + + + + + + + Class: Opal::Nodes::RetryNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::RetryNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +82
      +83
      +84
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 82
      +
      +def compile
      +  thrower(:retry)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ReturnNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ReturnNode.html new file mode 100644 index 00000000..7a47ac2d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ReturnNode.html @@ -0,0 +1,307 @@ + + + + + + + Class: Opal::Nodes::ReturnNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ReturnNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +102
      +103
      +104
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 102
      +
      +def compile
      +  thrower(:return, return_val)
      +end
      +
      +
      + +
      +

      + + #return_valObject + + + + + +

      + + + + +
      +
      +
      +
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 92
      +
      +def return_val
      +  if value.nil?
      +    s(:nil)
      +  elsif children.size > 1
      +    s(:array, *children)
      +  else
      +    value
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ReturnableYieldNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ReturnableYieldNode.html new file mode 100644 index 00000000..401ba28f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ReturnableYieldNode.html @@ -0,0 +1,271 @@ + + + + + + + Class: Opal::Nodes::ReturnableYieldNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ReturnableYieldNode + + + +

      +
      + +
      +
      Inherits:
      +
      + BaseYieldNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/yield.rb
      +
      + +
      + +

      Overview

      +
      +

      Created by #returns() for when a yield statement should return +it's value (its last in a block etc).

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

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from BaseYieldNode

      +

      #compile_call, #find_yielding_scope, #uses_splat?, #yields_single_arg?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +64
      +65
      +66
      +67
      +68
      +
      +
      # File 'opal/lib/opal/nodes/yield.rb', line 64
      +
      +def compile
      +  compile_call
      +
      +  wrap 'return ', ';'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ScopeNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ScopeNode.html new file mode 100644 index 00000000..24e6ec37 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ScopeNode.html @@ -0,0 +1,4809 @@ + + + + + + + Class: Opal::Nodes::ScopeNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ScopeNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/scope.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      BeginNode, ModuleNode, NodeWithArgs, SingletonClassNode, TopNode

      +
      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #await_encountered ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute await_encountered.

        +
        + +
      • + + +
      • + + + #block_name ⇒ Object + + + + + + + + + + + + + + + + +

        The given block name for a def scope.

        +
        + +
      • + + +
      • + + + #catch_return ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute catch_return.

        +
        + +
      • + + +
      • + + + #defs ⇒ Object + + + + + + + + + + + + + + + + +

        true if singleton def, false otherwise.

        +
        + +
      • + + +
      • + + + #gvars ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute gvars.

        +
        + +
      • + + +
      • + + + #has_break ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute has_break.

        +
        + +
      • + + +
      • + + + #has_retry ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute has_retry.

        +
        + +
      • + + +
      • + + + #identity ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute identity.

        +
        + +
      • + + +
      • + + + #ivars ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute ivars.

        +
        + +
      • + + +
      • + + + #locals ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute locals.

        +
        + +
      • + + +
      • + + + #methods ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        used by modules to know what methods to donate to includees.

        +
        + +
      • + + +
      • + + + #mid ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute mid.

        +
        + +
      • + + +
      • + + + #name ⇒ Object + + + + + + + + + + + + + + + + +

        The class or module name if this scope is a class scope.

        +
        + +
      • + + +
      • + + + #parent ⇒ Object + + + + + + + + + + + + + + + + +

        Every scope can have a parent scope.

        +
        + +
      • + + +
      • + + + #rescue_else_sexp ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute rescue_else_sexp.

        +
        + +
      • + + +
      • + + + #scope_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute scope_name.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #helper, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeScopeNode + + + + + +

      +
      +

      Returns a new instance of ScopeNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 34
      +
      +def initialize(*)
      +  super
      +
      +  @locals   = []
      +  @temps    = []
      +  @args     = []
      +  @ivars    = []
      +  @gvars    = []
      +  @parent   = nil
      +  @queue    = []
      +  @unique   = 'a'
      +  @while_stack = []
      +  @identity = nil
      +  @defs     = nil
      +
      +  @methods = []
      +
      +  @uses_block = false
      +  @in_ensure = false
      +
      +  # used by classes to store all ivars used in direct def methods
      +  @proto_ivars = []
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #await_encounteredObject + + + + + +

      +
      +

      Returns the value of attribute await_encountered.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +419
      +420
      +421
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 419
      +
      +def await_encountered
      +  @await_encountered
      +end
      +
      +
      + + + +
      +

      + + #block_nameObject + + + + + +

      +
      +

      The given block name for a def scope

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 15
      +
      +def block_name
      +  @block_name
      +end
      +
      +
      + + + +
      +

      + + #catch_returnObject + + + + + +

      +
      +

      Returns the value of attribute catch_return.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 30
      +
      +def catch_return
      +  @catch_return
      +end
      +
      +
      + + + +
      +

      + + #defsObject + + + + + +

      +
      +

      true if singleton def, false otherwise

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 25
      +
      +def defs
      +  @defs
      +end
      +
      +
      + + + +
      +

      + + #gvarsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute gvars.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 20
      +
      +def gvars
      +  @gvars
      +end
      +
      +
      + + + +
      +

      + + #has_breakObject + + + + + +

      +
      +

      Returns the value of attribute has_break.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 30
      +
      +def has_break
      +  @has_break
      +end
      +
      +
      + + + +
      +

      + + #has_retryObject + + + + + +

      +
      +

      Returns the value of attribute has_retry.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 30
      +
      +def has_retry
      +  @has_retry
      +end
      +
      +
      + + + +
      +

      + + #identityObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute identity.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +277
      +278
      +279
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 277
      +
      +def identity
      +  @identity
      +end
      +
      +
      + + + +
      +

      + + #ivarsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute ivars.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 19
      +
      +def ivars
      +  @ivars
      +end
      +
      +
      + + + +
      +

      + + #localsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute locals.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 18
      +
      +def locals
      +  @locals
      +end
      +
      +
      + + + +
      +

      + + #methodsObject (readonly) + + + + + +

      +
      +

      used by modules to know what methods to donate to includees

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 28
      +
      +def methods
      +  @methods
      +end
      +
      +
      + + + +
      +

      + + #midObject + + + + + +

      +
      +

      Returns the value of attribute mid.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 22
      +
      +def mid
      +  @mid
      +end
      +
      +
      + + + +
      +

      + + #nameObject + + + + + +

      +
      +

      The class or module name if this scope is a class scope

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 12
      +
      +def name
      +  @name
      +end
      +
      +
      + + + +
      +

      + + #parentObject + + + + + +

      +
      +

      Every scope can have a parent scope

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 9
      +
      +def parent
      +  @parent
      +end
      +
      +
      + + + +
      +

      + + #rescue_else_sexpObject + + + + + +

      +
      +

      Returns the value of attribute rescue_else_sexp.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 32
      +
      +def rescue_else_sexp
      +  @rescue_else_sexp
      +end
      +
      +
      + + + +
      +

      + + #scope_nameObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute scope_name.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 17
      +
      +def scope_name
      +  @scope_name
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #accepts_using?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +365
      +366
      +367
      +368
      +369
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 365
      +
      +def accepts_using?
      +  # IterNode of a special kind of Module.new {} is accepted...
      +  # though we don't check for it that thoroughly.
      +  [TopNode, ModuleNode, ClassNode, IterNode].include? self.class
      +end
      +
      +
      + +
      +

      + + #add_arg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +172
      +173
      +174
      +175
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 172
      +
      +def add_arg(arg)
      +  @args << arg unless @args.include? arg
      +  arg
      +end
      +
      +
      + +
      +

      + + #add_proto_ivar(ivar) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +168
      +169
      +170
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 168
      +
      +def add_proto_ivar(ivar)
      +  @proto_ivars << ivar unless @proto_ivars.include? ivar
      +end
      +
      +
      + +
      +

      + + #add_scope_gvar(gvar) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +164
      +165
      +166
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 164
      +
      +def add_scope_gvar(gvar)
      +  @gvars << gvar unless @gvars.include? gvar
      +end
      +
      +
      + +
      +

      + + #add_scope_ivar(ivar) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +156
      +157
      +158
      +159
      +160
      +161
      +162
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 156
      +
      +def add_scope_ivar(ivar)
      +  if def_in_class?
      +    @parent.add_proto_ivar ivar
      +  else
      +    @ivars << ivar unless @ivars.include? ivar
      +  end
      +end
      +
      +
      + +
      +

      + + #add_scope_local(local) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +177
      +178
      +179
      +180
      +181
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 177
      +
      +def add_scope_local(local)
      +  return if has_local? local
      +
      +  @locals << local
      +end
      +
      +
      + +
      +

      + + #add_scope_temp(tmp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +194
      +195
      +196
      +197
      +198
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 194
      +
      +def add_scope_temp(tmp)
      +  return if has_temp?(tmp)
      +
      +  @temps.push(tmp)
      +end
      +
      +
      + +
      +

      + + #class?Boolean + + + + + +

      +
      +

      Returns true if this is strictly a class scope

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +73
      +74
      +75
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 73
      +
      +def class?
      +  @type == :class
      +end
      +
      +
      + +
      +

      + + #class_scope?Boolean + + + + + +

      +
      +

      Returns true if this scope is a class/module body scope

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 68
      +
      +def class_scope?
      +  @type == :class || @type == :module
      +end
      +
      +
      + +
      +

      + + #collect_refinements_temps(temps = []) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +371
      +372
      +373
      +374
      +375
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 371
      +
      +def collect_refinements_temps(temps = [])
      +  temps << @refinements_temp if @refinements_temp
      +  return parent.collect_refinements_temps(temps) if parent
      +  temps
      +end
      +
      +
      + +
      +

      + + #current_rescueObject + + + + + +

      + + + + +
      +
      +
      +
      +328
      +329
      +330
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 328
      +
      +def current_rescue
      +  @rescues.last
      +end
      +
      +
      + +
      +

      + + #def?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +96
      +97
      +98
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 96
      +
      +def def?
      +  @type == :def || @type == :defs
      +end
      +
      +
      + +
      +

      + + #def_in_class?Boolean + + + + + +

      +
      +

      Is this a normal def method directly inside a class? This is +used for optimizing ivars as we can set them to nil in the +class body

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +121
      +122
      +123
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 121
      +
      +def def_in_class?
      +  !@defs && @type == :def && @parent && @parent.class?
      +end
      +
      +
      + +
      +

      + + #defines_lambdaObject + + + + + +

      + + + + +
      +
      +
      +
      +108
      +109
      +110
      +111
      +112
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 108
      +
      +def defines_lambda
      +  @lambda_definition = true
      +  yield
      +  @lambda_definition = false
      +end
      +
      +
      + +
      +

      + + #find_parent_defObject + + + + + +

      + + + + +
      +
      +
      +
      +279
      +280
      +281
      +282
      +283
      +284
      +285
      +286
      +287
      +288
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 279
      +
      +def find_parent_def
      +  scope = self
      +  while scope = scope.parent
      +    if scope.def? || scope.lambda?
      +      return scope
      +    end
      +  end
      +
      +  nil
      +end
      +
      +
      + +
      +

      + + #gen_retry_idObject + + + + + +

      + + + + +
      +
      +
      +
      +360
      +361
      +362
      +363
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 360
      +
      +def gen_retry_id
      +  @next_retry_id ||= 'retry_0'
      +  @next_retry_id = @next_retry_id.succ
      +end
      +
      +
      + +
      +

      + + #has_local?(local) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +183
      +184
      +185
      +186
      +187
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 183
      +
      +def has_local?(local)
      +  return true if @locals.include?(local) || @args.include?(local) || @temps.include?(local)
      +  return @parent.has_local?(local) if @parent && @type == :iter
      +  false
      +end
      +
      +
      + +
      +

      + + #has_rescue_else?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +314
      +315
      +316
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 314
      +
      +def has_rescue_else?
      +  !rescue_else_sexp.nil?
      +end
      +
      +
      + +
      +

      + + #has_temp?(tmp) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +206
      +207
      +208
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 206
      +
      +def has_temp?(tmp)
      +  @temps.include? tmp
      +end
      +
      +
      + +
      +

      + + #identify!(name = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +255
      +256
      +257
      +258
      +259
      +260
      +261
      +262
      +263
      +264
      +265
      +266
      +267
      +268
      +269
      +270
      +271
      +272
      +273
      +274
      +275
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 255
      +
      +def identify!(name = nil)
      +  return @identity if @identity
      +
      +  if valid_name? mid
      +    # There are some special utf8 chars that can be used as valid JS
      +    # identifiers, some examples:
      +    #
      +    # utf8_pond = 'ⵌ'
      +    # utf8_question = 'ʔ̣'
      +    # utf8_exclamation 'ǃ'
      +    #
      +    # For now we're just using $$, to maintain compatibility with older IEs.
      +    @identity = "$$#{mid}"
      +  else
      +    # Parent scope is the defining module/class
      +    name ||= [(parent && (parent.name || parent.scope_name)), mid].compact.join('_')
      +    @identity = @compiler.unique_temp(name)
      +  end
      +
      +  @identity
      +end
      +
      +
      + +
      +

      + + #in_ensureObject + + + + + +

      + + + + +
      +
      +
      +
      +346
      +347
      +348
      +349
      +350
      +351
      +352
      +353
      +354
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 346
      +
      +def in_ensure
      +  return unless block_given?
      +
      +  @in_ensure = true
      +  result = yield
      +  @in_ensure = false
      +
      +  result
      +end
      +
      +
      + +
      +

      + + #in_ensure?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +356
      +357
      +358
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 356
      +
      +def in_ensure?
      +  @in_ensure
      +end
      +
      +
      + +
      +

      + + #in_resbodyObject + + + + + +

      + + + + +
      +
      +
      +
      +332
      +333
      +334
      +335
      +336
      +337
      +338
      +339
      +340
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 332
      +
      +def in_resbody
      +  return unless block_given?
      +
      +  @in_resbody = true
      +  result = yield
      +  @in_resbody = false
      +
      +  result
      +end
      +
      +
      + +
      +

      + + #in_resbody?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +342
      +343
      +344
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 342
      +
      +def in_resbody?
      +  @in_resbody
      +end
      +
      +
      + +
      +

      + + #in_rescue(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +318
      +319
      +320
      +321
      +322
      +323
      +324
      +325
      +326
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 318
      +
      +def in_rescue(node)
      +  @rescues ||= []
      +
      +  @rescues.push(node)
      +  result = yield
      +  @rescues.pop
      +
      +  result
      +end
      +
      +
      + +
      +

      + + #in_scopeObject + + + + + +

      + + + + +
      +
      +
      +
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 58
      +
      +def in_scope
      +  indent do
      +    @parent = compiler.scope
      +    compiler.scope = self
      +    yield self
      +    compiler.scope = @parent
      +  end
      +end
      +
      +
      + +
      +

      + + #in_while?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +242
      +243
      +244
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 242
      +
      +def in_while?
      +  !@while_stack.empty?
      +end
      +
      +
      + +
      +

      + + #is_lambda!Object + + + + + +

      +
      +

      rubocop:disable Naming/PredicateName

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +104
      +105
      +106
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 104
      +
      +def is_lambda! # rubocop:disable Naming/PredicateName
      +  @is_lambda = true
      +end
      +
      +
      + +
      +

      + + #iter?Boolean + + + + + +

      +
      +

      True if a block/iter scope

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +92
      +93
      +94
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 92
      +
      +def iter?
      +  @type == :iter
      +end
      +
      +
      + +
      +

      + + #lambda?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +100
      +101
      +102
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 100
      +
      +def lambda?
      +  iter? && @is_lambda
      +end
      +
      +
      + +
      +

      + + #lambda_definition?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +114
      +115
      +116
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 114
      +
      +def lambda_definition?
      +  @lambda_definition
      +end
      +
      +
      + +
      +

      + + #module?Boolean + + + + + +

      +
      +

      True if this is a module scope

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +78
      +79
      +80
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 78
      +
      +def module?
      +  @type == :module
      +end
      +
      +
      + +
      +

      + + #nestingObject + + + + + +

      +
      +

      Returns '$nesting', but also ensures we compile the nesting chain

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +396
      +397
      +398
      +399
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 396
      +
      +def nesting
      +  @define_nesting = true
      +  '$nesting'
      +end
      +
      +
      + +
      +

      + + #new_refinements_tempObject + + + + + +

      + + + + +
      +
      +
      +
      +377
      +378
      +379
      +380
      +381
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 377
      +
      +def new_refinements_temp
      +  var = compiler.unique_temp("$refn")
      +  add_scope_local(var)
      +  var
      +end
      +
      +
      + +
      +

      + + #new_tempObject + + + + + +

      + + + + +
      +
      +
      +
      +210
      +211
      +212
      +213
      +214
      +215
      +216
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 210
      +
      +def new_temp
      +  return @queue.pop unless @queue.empty?
      +
      +  tmp = next_temp
      +  @temps << tmp
      +  tmp
      +end
      +
      +
      + +
      +

      + + #next_tempObject + + + + + +

      + + + + +
      +
      +
      +
      +218
      +219
      +220
      +221
      +222
      +223
      +224
      +225
      +226
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 218
      +
      +def next_temp
      +  tmp = nil
      +  loop do
      +    tmp = "$#{@unique}"
      +    @unique = @unique.succ
      +    break unless has_local?(tmp)
      +  end
      +  tmp
      +end
      +
      +
      + +
      +

      + + #pop_whileObject + + + + + +

      + + + + +
      +
      +
      +
      +238
      +239
      +240
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 238
      +
      +def pop_while
      +  @while_stack.pop
      +end
      +
      +
      + +
      +

      + + #prepare_block(block_name = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +407
      +408
      +409
      +410
      +411
      +412
      +413
      +414
      +415
      +416
      +417
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 407
      +
      +def prepare_block(block_name = nil)
      +  scope_name = scope.identity
      +  self.block_name = block_name if block_name
      +
      +  add_temp "#{self.block_name} = #{scope_name}.$$p || nil"
      +
      +  unless @block_prepared
      +    line "#{scope_name}.$$p = null;"
      +    @block_prepared = true
      +  end
      +end
      +
      +
      + +
      +

      + + #prepend_scope_temp(tmp) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +200
      +201
      +202
      +203
      +204
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 200
      +
      +def prepend_scope_temp(tmp)
      +  return if has_temp?(tmp)
      +
      +  @temps.unshift(tmp)
      +end
      +
      +
      + +
      +

      + + #push_whileObject + + + + + +

      + + + + +
      +
      +
      +
      +232
      +233
      +234
      +235
      +236
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 232
      +
      +def push_while
      +  info = {}
      +  @while_stack.push info
      +  info
      +end
      +
      +
      + +
      +

      + + #queue_temp(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +228
      +229
      +230
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 228
      +
      +def queue_temp(name)
      +  @queue << name
      +end
      +
      +
      + +
      +

      + + #refinements_tempObject + + + + + +

      + + + + +
      +
      +
      +
      +383
      +384
      +385
      +386
      +387
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 383
      +
      +def refinements_temp
      +  prev, curr = @refinements_temp, new_refinements_temp
      +  @refinements_temp = curr
      +  [prev, curr]
      +end
      +
      +
      + +
      +

      + + #relative_accessObject + + + + + +

      +
      +

      Returns '$$', but also ensures we compile it

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +402
      +403
      +404
      +405
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 402
      +
      +def relative_access
      +  @define_relative_access = @define_nesting = true
      +  '$$'
      +end
      +
      +
      + +
      +

      + + #sclass?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +82
      +83
      +84
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 82
      +
      +def sclass?
      +  @type == :sclass
      +end
      +
      +
      + +
      +

      + + #scope_localsObject + + + + + +

      + + + + +
      +
      +
      +
      +189
      +190
      +191
      +192
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 189
      +
      +def scope_locals
      +  locals = @locals | @args | (@parent && @type == :iter ? @parent.scope_locals : [])
      +  locals.reject { |i| i.to_s.start_with?('$') }
      +end
      +
      +
      + +
      +

      + + #selfObject + + + + + +

      +
      +

      Returns 'self', but also ensures that the self variable is set

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +390
      +391
      +392
      +393
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 390
      +
      +def self
      +  @define_self = true
      +  'self'
      +end
      +
      +
      + +
      +

      + + #super_chainObject + + + + + +

      + + + + +
      +
      +
      +
      +290
      +291
      +292
      +293
      +294
      +295
      +296
      +297
      +298
      +299
      +300
      +301
      +302
      +303
      +304
      +305
      +306
      +307
      +308
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 290
      +
      +def super_chain
      +  chain, scope, defn, mid = [], self, 'null', 'null'
      +
      +  while scope
      +    if scope.type == :iter
      +      chain << scope.identify!
      +      scope = scope.parent if scope.parent
      +
      +    elsif %i[def defs].include?(scope.type)
      +      defn = scope.identify!
      +      mid  = "'#{scope.mid}'"
      +      break
      +    else
      +      break
      +    end
      +  end
      +
      +  [chain, defn, mid]
      +end
      +
      +
      + +
      +

      + + #to_varsObject + + + + + +

      +
      +

      Vars to use inside each scope

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 127
      +
      +def to_vars
      +  vars = @temps.dup
      +  vars.push(*@locals.map { |l| "#{l} = nil" })
      +
      +  iv = ivars.map do |ivar|
      +    "if (self#{ivar} == null) self#{ivar} = nil;\n"
      +  end
      +
      +  gv = gvars.map do |gvar|
      +    "if ($gvars#{gvar} == null) $gvars#{gvar} = nil;\n"
      +  end
      +
      +  if class? && !@proto_ivars.empty?
      +    vars << '$proto = self.$$prototype'
      +  end
      +
      +  indent = @compiler.parser_indent
      +  str  = vars.empty? ? '' : "var #{vars.join ', '};\n"
      +  str += "#{indent}#{iv.join indent}" unless ivars.empty?
      +  str += "#{indent}#{gv.join indent}" unless gvars.empty?
      +
      +  if class? && !@proto_ivars.empty?
      +    pvars = @proto_ivars.map { |i| "$proto#{i}" }.join(' = ')
      +    str = "#{str}\n#{indent}#{pvars} = nil;"
      +  end
      +
      +  fragment(str)
      +end
      +
      +
      + +
      +

      + + #top?Boolean + + + + + +

      +
      +

      Returns true if this is a top scope (main file body)

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 87
      +
      +def top?
      +  @type == :top
      +end
      +
      +
      + +
      +

      + + #uses_block!Object + + + + + +

      + + + + +
      +
      +
      +
      +246
      +247
      +248
      +249
      +250
      +251
      +252
      +253
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 246
      +
      +def uses_block!
      +  if @type == :iter && @parent
      +    @parent.uses_block!
      +  else
      +    @uses_block = true
      +    identify!
      +  end
      +end
      +
      +
      + +
      +

      + + #uses_block?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +310
      +311
      +312
      +
      +
      # File 'opal/lib/opal/nodes/scope.rb', line 310
      +
      +def uses_block?
      +  @uses_block
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/SelfNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/SelfNode.html new file mode 100644 index 00000000..de0e753f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/SelfNode.html @@ -0,0 +1,243 @@ + + + + + + + Class: Opal::Nodes::SelfNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::SelfNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 22
      +
      +def compile
      +  push scope.self
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/SingletonClassNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/SingletonClassNode.html new file mode 100644 index 00000000..1f088420 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/SingletonClassNode.html @@ -0,0 +1,285 @@ + + + + + + + Class: Opal::Nodes::SingletonClassNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::SingletonClassNode + + + +

      +
      + +
      +
      Inherits:
      +
      + ScopeNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/singleton_class.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::ScopeNode

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +
      +
      # File 'opal/lib/opal/nodes/singleton_class.rb', line 12
      +
      +def compile
      +  push '(function(self, $parent_nesting) {'
      +
      +  in_scope do
      +    body_stmt = stmt(compiler.returns(body))
      +
      +    add_temp '$nesting = [self].concat($parent_nesting)' if @define_nesting
      +    add_temp '$$ = Opal.$r($nesting)' if @define_relative_access
      +
      +    line scope.to_vars
      +    line body_stmt
      +  end
      +
      +  line '})(Opal.get_singleton_class(', recv(object), "), #{scope.nesting})"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/SplatNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/SplatNode.html new file mode 100644 index 00000000..b07d95b0 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/SplatNode.html @@ -0,0 +1,327 @@ + + + + + + + Class: Opal::Nodes::SplatNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::SplatNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/logic.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 69
      +
      +def compile
      +  if empty_splat?
      +    push '[]'
      +  else
      +    helper :to_a
      +    push '$to_a(', recv(value), ')'
      +  end
      +end
      +
      +
      + +
      +

      + + #empty_splat?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +65
      +66
      +67
      +
      +
      # File 'opal/lib/opal/nodes/logic.rb', line 65
      +
      +def empty_splat?
      +  value == s(:array)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/StringNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/StringNode.html new file mode 100644 index 00000000..b9bf8be6 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/StringNode.html @@ -0,0 +1,460 @@ + + + + + + + Class: Opal::Nodes::StringNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::StringNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      ESCAPE_CHARS = + +
      +
      {
      +  'a' => '\\u0007',
      +  'e' => '\\u001b'
      +}.freeze
      + +
      ESCAPE_REGEX = + +
      +
      /(\\+)([#{ ESCAPE_CHARS.keys.join('') }])/.freeze
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 64
      +
      +def compile
      +  string_value = value
      +
      +  sanitized_value = string_value.inspect.gsub(/\\u\{([0-9a-f]+)\}/) do
      +    code_point = Regexp.last_match(1).to_i(16)
      +    to_utf16(code_point)
      +  end
      +  push translate_escape_chars(sanitized_value)
      +
      +  if RUBY_ENGINE != 'opal'
      +    encoding = string_value.encoding
      +
      +    unless encoding == Encoding::UTF_8
      +      helper :enc
      +      wrap "$enc(", ", \"#{encoding.name}\")"
      +    end
      +  end
      +
      +  unless value.valid_encoding?
      +    helper :binary
      +    wrap "$binary(", ")"
      +  end
      +end
      +
      +
      + +
      +

      + + #to_utf16(code_point) ⇒ Object + + + + + +

      +
      + + +
      + + + + +
      +
      +
      +
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 89
      +
      +def to_utf16(code_point)
      +  ten_bits = 0b1111111111
      +  u = ->(code_unit) { '\\u' + code_unit.to_s(16).upcase }
      +
      +  return u.call(code_point) if code_point <= 0xFFFF
      +
      +  code_point -= 0x10000
      +
      +  # Shift right to get to most significant 10 bits
      +  lead_surrogate = 0xD800 + (code_point >> 10)
      +
      +  # Mask to get least significant 10 bits
      +  tail_surrogate = 0xDC00 + (code_point & ten_bits)
      +
      +  u.call(lead_surrogate) + u.call(tail_surrogate)
      +end
      +
      +
      + +
      +

      + + #translate_escape_chars(inspect_string) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 54
      +
      +def translate_escape_chars(inspect_string)
      +  inspect_string.gsub(ESCAPE_REGEX) do |original|
      +    if Regexp.last_match(1).length.even?
      +      original
      +    else
      +      Regexp.last_match(1).chop + ESCAPE_CHARS[Regexp.last_match(2)]
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/SuperNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/SuperNode.html new file mode 100644 index 00000000..74b7f3a8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/SuperNode.html @@ -0,0 +1,365 @@ + + + + + + + Class: Opal::Nodes::SuperNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::SuperNode + + + +

      +
      + +
      +
      Inherits:
      +
      + BaseSuperNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/super.rb
      +
      + +
      + +

      Overview

      +
      +

      super with explicit args

      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      ZsuperNode

      +
      + + + +

      Constant Summary

      + +

      Constants inherited + from CallNode

      +

      CallNode::OPERATORS, CallNode::SPECIALS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from CallNode

      +

      #arglist, #iter, #meth, #recvr

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from BaseSuperNode

      +

      #compile_using_send

      + + + + + + + + + +

      Methods inherited from CallNode

      +

      add_special

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeSuperNode + + + + + +

      +
      +

      Returns a new instance of SuperNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 127
      +
      +def initialize(*)
      +  super
      +
      +  if scope.def?
      +    scope.uses_block!
      +  end
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +135
      +136
      +137
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 135
      +
      +def compile
      +  compile_using_send
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/SymbolNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/SymbolNode.html new file mode 100644 index 00000000..f6c63bd1 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/SymbolNode.html @@ -0,0 +1,243 @@ + + + + + + + Class: Opal::Nodes::SymbolNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::SymbolNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +112
      +113
      +114
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 112
      +
      +def compile
      +  push value.to_s.inspect
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/TopNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/TopNode.html new file mode 100644 index 00000000..84ac6ac8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/TopNode.html @@ -0,0 +1,1093 @@ + + + + + + + Class: Opal::Nodes::TopNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::TopNode + + + +

      +
      + +
      +
      Inherits:
      +
      + ScopeNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/top.rb
      +
      + +
      + +

      Overview

      +
      +

      Generates code for an entire file, i.e. the base sexp

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

      Instance Attribute Summary

      + +

      Attributes inherited from ScopeNode

      +

      #await_encountered, #block_name, #catch_return, #defs, #gvars, #has_break, #has_retry, #identity, #ivars, #locals, #methods, #mid, #name, #parent, #rescue_else_sexp, #scope_name

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from ScopeNode

      +

      #accepts_using?, #add_arg, #add_proto_ivar, #add_scope_gvar, #add_scope_ivar, #add_scope_local, #add_scope_temp, #class?, #class_scope?, #collect_refinements_temps, #current_rescue, #def?, #def_in_class?, #defines_lambda, #find_parent_def, #gen_retry_id, #has_local?, #has_rescue_else?, #has_temp?, #identify!, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_scope, #in_while?, #initialize, #is_lambda!, #iter?, #lambda?, #lambda_definition?, #module?, #nesting, #new_refinements_temp, #new_temp, #next_temp, #pop_while, #prepare_block, #prepend_scope_temp, #push_while, #queue_temp, #refinements_temp, #relative_access, #sclass?, #scope_locals, #self, #super_chain, #to_vars, #top?, #uses_block!, #uses_block?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::ScopeNode

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #absolute_constObject + + + + + +

      +
      +

      Returns '$$$', but also ensures that the '$$$' variable is set

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +117
      +118
      +119
      +120
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 117
      +
      +def absolute_const
      +  @define_absolute_const = true
      +  '$$$'
      +end
      +
      +
      + +
      +

      + + #add_file_source_embedObject + + + + + +

      + + + + +
      +
      +
      +
      +152
      +153
      +154
      +155
      +156
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 152
      +
      +def add_file_source_embed
      +  filename = compiler.file
      +  source = compiler.source
      +  unshift "Opal.file_sources[#{filename.to_json}] = #{source.to_json};\n"
      +end
      +
      +
      + +
      +

      + + #add_used_helpersObject + + + + + +

      + + + + +
      +
      +
      +
      +128
      +129
      +130
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 128
      +
      +def add_used_helpers
      +  compiler.helpers.to_a.reverse_each { |h| prepend_scope_temp "$#{h} = Opal.#{h}" }
      +end
      +
      +
      + +
      +

      + + #closingObject + + + + + +

      + + + + +
      +
      +
      +
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 94
      +
      +def closing
      +  if compiler.requirable?
      +    line "};\n"
      +
      +    if compiler.load?
      +      # Opal.load normalizes the path, so that we can't
      +      # require absolute paths from CLI. For other cases
      +      # we can expect the module names to be normalized
      +      # already.
      +      line "Opal.load_normalized(#{module_name});"
      +    end
      +  elsif compiler.eval?
      +    line "})(Opal, self);"
      +  else
      +    line "});\n"
      +  end
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 16
      +
      +def compile
      +  compiler.top_scope = self
      +  compiler.dynamic_cache_result = true if sexp.meta[:dynamic_cache_result]
      +
      +  push version_comment
      +
      +  helper :return_val if compiler.eof_content
      +
      +  if body == s(:nil)
      +    # A shortpath for empty (stub?) modules.
      +    if compiler.requirable? || compiler.esm? || compiler.eval?
      +      unshift 'Opal.return_val(Opal.nil); '
      +      definition
      +    else
      +      unshift 'Opal.nil; '
      +    end
      +  else
      +    in_scope do
      +      line '"use strict";' if compiler.use_strict?
      +
      +      body_code = in_closure(Closure::JS_FUNCTION | Closure::TOP) do
      +        stmt(stmts)
      +      end
      +      body_code = [body_code] unless body_code.is_a?(Array)
      +
      +      if compiler.eval?
      +        add_temp '$nesting = self.$$is_a_module ? [self] : [self.$$class]' if @define_nesting
      +      else
      +        add_temp 'self = Opal.top' if @define_self
      +        add_temp '$nesting = []' if @define_nesting
      +      end
      +      add_temp '$$ = Opal.$r($nesting)' if @define_relative_access
      +
      +      add_temp 'nil = Opal.nil'
      +      add_temp '$$$ = Opal.$$$' if @define_absolute_const
      +
      +      add_used_helpers
      +      line scope.to_vars
      +
      +      compile_method_stubs
      +      compile_irb_vars
      +      compile_end_construct
      +
      +      line body_code
      +    end
      +
      +    opening
      +    definition
      +    closing
      +  end
      +
      +  add_file_source_embed if compiler.enable_file_source_embed?
      +end
      +
      +
      + +
      +

      + + #compile_end_constructObject + + + + + +

      +
      +

      Any special END content in code

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +141
      +142
      +143
      +144
      +145
      +146
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 141
      +
      +def compile_end_construct
      +  if content = compiler.eof_content
      +    line 'var $__END__ = Opal.Object.$new();'
      +    line "$__END__.$read = $return_val(#{content.inspect});"
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_irb_varsObject + + + + + +

      + + + + +
      +
      +
      +
      +122
      +123
      +124
      +125
      +126
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 122
      +
      +def compile_irb_vars
      +  if compiler.irb?
      +    line 'if (!Opal.irb_vars) { Opal.irb_vars = {}; }'
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_method_stubsObject + + + + + +

      + + + + +
      +
      +
      +
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 132
      +
      +def compile_method_stubs
      +  if compiler.method_missing?
      +    calls = compiler.method_calls
      +    stubs = calls.to_a.map(&:to_s).join(',')
      +    line "Opal.add_stubs('#{stubs}');" unless stubs.empty?
      +  end
      +end
      +
      +
      + +
      +

      + + #definitionObject + + + + + +

      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 74
      +
      +def definition
      +  if compiler.requirable?
      +    unshift "Opal.modules[#{module_name}] = "
      +  elsif compiler.esm? && !compiler.no_export?
      +    unshift 'export default '
      +  end
      +end
      +
      +
      + +
      +

      + + #module_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 70
      +
      +def module_name
      +  Opal::Compiler.module_name(compiler.file).inspect
      +end
      +
      +
      + +
      +

      + + #openingObject + + + + + +

      + + + + +
      +
      +
      +
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 82
      +
      +def opening
      +  async_prefix = "async " if await_encountered
      +
      +  if compiler.requirable?
      +    unshift "#{async_prefix}function(Opal) {"
      +  elsif compiler.eval?
      +    unshift "(#{async_prefix}function(Opal, self) {"
      +  else
      +    unshift "Opal.queue(#{async_prefix}function(Opal) {"
      +  end
      +end
      +
      +
      + +
      +

      + + #stmtsObject + + + + + +

      + + + + +
      +
      +
      +
      +112
      +113
      +114
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 112
      +
      +def stmts
      +  compiler.returns(body)
      +end
      +
      +
      + +
      +

      + + #version_commentObject + + + + + +

      + + + + +
      +
      +
      +
      +148
      +149
      +150
      +
      +
      # File 'opal/lib/opal/nodes/top.rb', line 148
      +
      +def version_comment
      +  "/* Generated by Opal #{Opal::VERSION} */"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/UndefNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/UndefNode.html new file mode 100644 index 00000000..d4a640cb --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/UndefNode.html @@ -0,0 +1,247 @@ + + + + + + + Class: Opal::Nodes::UndefNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::UndefNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/definitions.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/nodes/definitions.rb', line 12
      +
      +def compile
      +  children.each do |child|
      +    line "Opal.udef(#{scope.self}, '$' + ", expr(child), ');'
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/UntilNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/UntilNode.html new file mode 100644 index 00000000..eeb0c6ed --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/UntilNode.html @@ -0,0 +1,187 @@ + + + + + + + Class: Opal::Nodes::UntilNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::UntilNode + + + +

      +
      + +
      +
      Inherits:
      +
      + WhileNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/while.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + + + + + + + +

      Method Summary

      + +

      Methods inherited from WhileNode

      +

      #compile

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/UntilPostNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/UntilPostNode.html new file mode 100644 index 00000000..952e8ddc --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/UntilPostNode.html @@ -0,0 +1,195 @@ + + + + + + + Class: Opal::Nodes::UntilPostNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::UntilPostNode + + + +

      +
      + +
      +
      Inherits:
      +
      + WhilePostNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/while.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

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

      Method Summary

      + +

      Methods inherited from WhileNode

      +

      #compile

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ValueNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ValueNode.html new file mode 100644 index 00000000..239d12b4 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ValueNode.html @@ -0,0 +1,332 @@ + + + + + + + Class: Opal::Nodes::ValueNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ValueNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/literal.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .truthy_optimize?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 14
      +
      +def self.truthy_optimize?
      +  true
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/nodes/literal.rb', line 10
      +
      +def compile
      +  push type.to_s
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/WhileNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/WhileNode.html new file mode 100644 index 00000000..0735fb0d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/WhileNode.html @@ -0,0 +1,305 @@ + + + + + + + Class: Opal::Nodes::WhileNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::WhileNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/while.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      UntilNode, WhilePostNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/nodes/while.rb', line 12
      +
      +def compile
      +  test_code = js_truthy(test)
      +
      +  @redo_var = scope.new_temp if uses_redo?
      +
      +  compiler.in_while do
      +    while_loop[:closure] = true if wrap_in_closure?
      +    while_loop[:redo_var] = @redo_var
      +
      +    in_closure(Closure::LOOP | Closure::JS_LOOP | (wrap_in_closure? ? Closure::JS_FUNCTION : 0)) do
      +      in_closure(Closure::LOOP_INSIDE | Closure::JS_LOOP_INSIDE) do
      +        line(indent { stmt(body) })
      +      end
      +
      +      if uses_redo?
      +        compile_with_redo(test_code)
      +      else
      +        compile_without_redo(test_code)
      +      end
      +    end
      +  end
      +
      +  scope.queue_temp(@redo_var) if uses_redo?
      +
      +  if wrap_in_closure?
      +    if scope.await_encountered
      +      wrap '(await (async function() {', '; return nil; })())'
      +    else
      +      wrap '(function() {', '; return nil; })()'
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/WhilePostNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/WhilePostNode.html new file mode 100644 index 00000000..80ff2254 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/WhilePostNode.html @@ -0,0 +1,191 @@ + + + + + + + Class: Opal::Nodes::WhilePostNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::WhilePostNode + + + +

      +
      + +
      +
      Inherits:
      +
      + WhileNode + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/while.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      UntilPostNode

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + + + + + + + +

      Method Summary

      + +

      Methods inherited from WhileNode

      +

      #compile

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/XStringNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/XStringNode.html new file mode 100644 index 00000000..f9027d80 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/XStringNode.html @@ -0,0 +1,582 @@ + + + + + + + Class: Opal::Nodes::XStringNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::XStringNode + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/x_string.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .single_line?(children) ⇒ Boolean + + + + + +

      +
      +

      Check if there's only one child or if they're all part of +the same line (e.g. because of interpolations)

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/nodes/x_string.rb', line 48
      +
      +def self.single_line?(children)
      +  (children.size == 1) || children.none? do |c|
      +    c.type == :str && c.loc.expression.source.end_with?("\n")
      +  end
      +end
      +
      +
      + +
      +

      + + .strip_empty_children(children) ⇒ Object + + + + + +

      +
      +

      Will remove empty :str lines coming from cosmetic newlines in x-strings

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      # this will generate two additional empty
      +# children before and after `foo()`
      +%x{
      +  foo()
      +}
      + +
      + + +
      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/nodes/x_string.rb', line 62
      +
      +def self.strip_empty_children(children)
      +  children = children.dup
      +  empty_line = ->(child) { child.nil? || (child.type == :str && child.loc.expression.source.rstrip.empty?) }
      +
      +  children.shift while children.any? && empty_line[children.first]
      +  children.pop while children.any? && empty_line[children.last]
      +
      +  children
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/opal/nodes/x_string.rb', line 8
      +
      +def compile
      +  if compiler.backtick_javascript_or_warn?
      +    compile_javascript
      +  else
      +    compile_send
      +  end
      +end
      +
      +
      + +
      +

      + + #compile_javascriptObject + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +
      +
      # File 'opal/lib/opal/nodes/x_string.rb', line 21
      +
      +def compile_javascript
      +  @should_add_semicolon = false
      +  unpacked_children = unpack_return(children)
      +  stripped_children = XStringNode.strip_empty_children(unpacked_children)
      +
      +  if XStringNode.single_line?(stripped_children)
      +    # If it's a single line we'll try to:
      +    #
      +    # - strip empty lines
      +    # - remove a trailing `;`
      +    # - detect an embedded `return`
      +    # - prepend a `return` when needed
      +    # - append a `;` when needed
      +    # - warn the user not to use the semicolon in single-line x-strings
      +    compile_single_line(stripped_children)
      +  else
      +    # Here we leave to the user the responsibility to add
      +    # a return where it's due.
      +    unpacked_children.each { |c| compile_child(c) }
      +  end
      +
      +  wrap '(', ')' if recv?
      +  push ';' if @should_add_semicolon
      +end
      +
      +
      + +
      +

      + + #compile_sendObject + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/nodes/x_string.rb', line 16
      +
      +def compile_send
      +  sexp = s(:send, nil, :`, s(:dstr, *children))
      +  push process(sexp, @level)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/YieldNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/YieldNode.html new file mode 100644 index 00000000..1d9276f1 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/YieldNode.html @@ -0,0 +1,256 @@ + + + + + + + Class: Opal::Nodes::YieldNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::YieldNode + + + +

      +
      + +
      +
      Inherits:
      +
      + BaseYieldNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/yield.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from BaseYieldNode

      +

      #compile_call, #find_yielding_scope, #uses_splat?, #yields_single_arg?

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, #children, children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #initialize, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +

      This class inherits a constructor from Opal::Nodes::Base

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +54
      +55
      +56
      +
      +
      # File 'opal/lib/opal/nodes/yield.rb', line 54
      +
      +def compile
      +  compile_call
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Nodes/ZsuperNode.html b/docs/api/v1.8.2/lib/Opal/Nodes/ZsuperNode.html new file mode 100644 index 00000000..a7b72249 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Nodes/ZsuperNode.html @@ -0,0 +1,617 @@ + + + + + + + Class: Opal::Nodes::ZsuperNode + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Nodes::ZsuperNode + + + +

      +
      + +
      +
      Inherits:
      +
      + SuperNode + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/nodes/super.rb
      +
      + +
      + +

      Overview

      +
      +

      super with implicit args

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from CallNode

      +

      CallNode::OPERATORS, CallNode::SPECIALS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from CallNode

      +

      #arglist, #iter, #meth, #recvr

      + + + +

      Attributes inherited from Base

      +

      #compiler, #sexp, #type

      + + + +

      Attributes included from Closure::NodeSupport

      +

      #closure

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from BaseSuperNode

      +

      #compile_using_send

      + + + + + + + + + +

      Methods inherited from CallNode

      +

      add_special

      + + + + + + + + + +

      Methods inherited from Base

      +

      #add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_empty, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap

      + + + + + + + + + +

      Methods included from Closure::NodeSupport

      +

      #closure_is?, #compile_catcher, #generate_thrower, #generate_thrower_without_catcher, #in_closure, #pop_closure, #push_closure, #select_closure, #thrower

      + + + + + + + + + +

      Methods included from Helpers

      +

      #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeZsuperNode + + + + + +

      +
      +

      Returns a new instance of ZsuperNode.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 148
      +
      +def initialize(*)
      +  super
      +
      +  # preserve a block if we have one already but otherwise, assume a block is coming from higher
      +  # up the chain
      +  unless iter.type == :iter
      +    # Need to support passing block up even if it's not referenced in this method at all
      +    scope.uses_block!
      +    @iter = s(:js_tmp, scope.block_name || '$yield')
      +  end
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #block_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +211
      +212
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 203
      +
      +def block_name
      +  case def_scope
      +  when Opal::Nodes::IterNode
      +    def_scope.block_name
      +  when Opal::Nodes::DefNode
      +    def_scope.block_name
      +  else
      +    raise "Don't know what to do with super in the scope #{def_scope}"
      +  end
      +end
      +
      +
      + +
      +

      + + #compileObject + + + + + +

      + + + + +
      +
      +
      +
      +160
      +161
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +174
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 160
      +
      +def compile
      +  if def_scope
      +    implicit_args = implicit_arglist
      +    # If the method we're in has a block and we're using a default super call with no args, we need to grab the block
      +    # If an iter (block via braces) is provided, that takes precedence
      +    if block_name && !iter
      +      block_pass = s(:block_pass, s(:lvar, block_name))
      +      implicit_args << block_pass
      +    end
      +
      +    @arglist = s(:arglist, *implicit_args)
      +  end
      +
      +  compile_using_send
      +end
      +
      +
      + +
      +

      + + #implicit_arglistObject + + + + + +

      + + + + +
      +
      +
      +
      +176
      +177
      +178
      +179
      +180
      +181
      +182
      +183
      +184
      +185
      +186
      +187
      +188
      +189
      +190
      +191
      +192
      +193
      +194
      +195
      +196
      +197
      +198
      +199
      +200
      +201
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 176
      +
      +def implicit_arglist
      +  args = []
      +  kwargs = []
      +
      +  def_scope.original_args.children.each do |sexp|
      +    lvar_name = sexp.children[0]
      +
      +    case sexp.type
      +    when :arg, :optarg
      +      arg_node = s(:lvar, lvar_name)
      +      args << arg_node
      +    when :restarg
      +      arg_node = lvar_name ? s(:lvar, lvar_name) : s(:js_tmp, '$rest_arg')
      +      args << s(:splat, arg_node)
      +    when :kwarg, :kwoptarg
      +      key_name = sexp.meta[:arg_name]
      +      kwargs << s(:pair, s(:sym, key_name), s(:lvar, lvar_name))
      +    when :kwrestarg
      +      arg_node = lvar_name ? s(:lvar, lvar_name) : s(:js_tmp, '$kw_rest_arg')
      +      kwargs << s(:kwsplat, arg_node)
      +    end
      +  end
      +
      +  args << s(:hash, *kwargs) unless kwargs.empty?
      +  args
      +end
      +
      +
      + +
      +

      + + #implicit_arguments_paramObject + + + + + +

      + + + + +
      +
      +
      +
      +144
      +145
      +146
      +
      +
      # File 'opal/lib/opal/nodes/super.rb', line 144
      +
      +def implicit_arguments_param
      +  'true'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/OS.html b/docs/api/v1.8.2/lib/Opal/OS.html new file mode 100644 index 00000000..b23e3a9d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/OS.html @@ -0,0 +1,624 @@ + + + + + + + Module: Opal::OS + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::OS + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/os.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .bash_c(*commands) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/os.rb', line 39
      +
      +def bash_c(*commands)
      +  cmd = if windows?
      +          [
      +            'bundle',
      +            'exec',
      +            'cmd',
      +            '/c',
      +          ]
      +        else
      +          [
      +            'bundle',
      +            'exec',
      +            'bash',
      +            '-c',
      +          ]
      +        end
      +
      +  cmd << commands.join(cmd_sep)
      +end
      +
      +
      + +
      +

      + + .cmd_sepObject + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/os.rb', line 31
      +
      +def cmd_sep
      +  windows? ? ' & ' : ' ; '
      +end
      +
      +
      + +
      +

      + + .dev_nullObject + + + + + +

      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/os.rb', line 35
      +
      +def dev_null
      +  windows? ? 'NUL' : '/dev/null'
      +end
      +
      +
      + +
      +

      + + .env_sepObject + + + + + +

      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/os.rb', line 23
      +
      +def env_sep
      +  windows? ? ';' : ':'
      +end
      +
      +
      + +
      +

      + + .macos?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +
      +
      # File 'opal/lib/opal/os.rb', line 11
      +
      +def macos?
      +  /darwin|mac os/.match?(RbConfig::CONFIG['host_os'])
      +end
      +
      +
      + +
      +

      + + .path_sepObject + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/os.rb', line 27
      +
      +def path_sep
      +  windows? ? '\\' : '/'
      +end
      +
      +
      + +
      +

      + + .shellescape(str) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/os.rb', line 15
      +
      +def shellescape(str)
      +  if windows?
      +    '"' + str.gsub('"', '""') + '"'
      +  else
      +    str.shellescape
      +  end
      +end
      +
      +
      + +
      +

      + + .windows?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/os.rb', line 7
      +
      +def windows?
      +  /bccwin|cygwin|djgpp|mingw|mswin|wince/.match?(RbConfig::CONFIG['host_os'])
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/OpalBacktraceLocation.html b/docs/api/v1.8.2/lib/Opal/OpalBacktraceLocation.html new file mode 100644 index 00000000..b6b3bca6 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/OpalBacktraceLocation.html @@ -0,0 +1,625 @@ + + + + + + + Class: Opal::OpalBacktraceLocation + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::OpalBacktraceLocation + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/errors.rb
      +
      + +
      + +

      Overview

      +
      +

      Loosely compatible with Thread::Backtrace::Location

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

      Instance Attribute Summary collapse

      +
        + +
      • + + + #label ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute label.

        +
        + +
      • + + +
      • + + + #lineno ⇒ Object + + + + (also: #line) + + + + + + + + + + + + + + +

        Returns the value of attribute lineno.

        +
        + +
      • + + +
      • + + + #path ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute path.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(path = nil, lineno = nil, label = nil) ⇒ OpalBacktraceLocation + + + + + +

      +
      +

      Returns a new instance of OpalBacktraceLocation.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +52
      +53
      +54
      +
      +
      # File 'opal/lib/opal/errors.rb', line 52
      +
      +def initialize(path = nil, lineno = nil, label = nil)
      +  @path, @lineno, @label = path, lineno, label
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #labelObject + + + + + +

      +
      +

      Returns the value of attribute label.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/errors.rb', line 50
      +
      +def label
      +  @label
      +end
      +
      +
      + + + +
      +

      + + #linenoObject + + + + Also known as: + line + + + + +

      +
      +

      Returns the value of attribute lineno.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/errors.rb', line 50
      +
      +def lineno
      +  @lineno
      +end
      +
      +
      + + + +
      +

      + + #pathObject + + + + + +

      +
      +

      Returns the value of attribute path.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/errors.rb', line 50
      +
      +def path
      +  @path
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #diagnostic=(diagnostic) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +
      +
      # File 'opal/lib/opal/errors.rb', line 70
      +
      +def diagnostic=(diagnostic)
      +  return unless diagnostic
      +  self.location = diagnostic.location
      +end
      +
      +
      + +
      +

      + + #location=(location) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +
      +
      # File 'opal/lib/opal/errors.rb', line 75
      +
      +def location=(location)
      +  return unless location
      +  self.lineno = location.line
      +  if location.respond_to?(:source_line)
      +    self.label = location.source_line
      +  elsif location.respond_to?(:expression)
      +    self.label = location.expression.source_line
      +  end
      +end
      +
      +
      + +
      +

      + + #to_sObject + + + + + +

      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +
      +
      # File 'opal/lib/opal/errors.rb', line 56
      +
      +def to_s
      +  string = path
      +  string += ":#{lineno}" if lineno
      +  string += ':in '
      +  if label
      +    string += "`#{label}'"
      +  else
      +    string += 'unknown'
      +  end
      +  string
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Parser.html b/docs/api/v1.8.2/lib/Opal/Parser.html new file mode 100644 index 00000000..d9473e14 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Parser.html @@ -0,0 +1,268 @@ + + + + + + + Module: Opal::Parser + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Parser + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/source_buffer.rb,
      + opal/lib/opal/parser/default_config.rb
      +
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: DefaultConfig + + + + Classes: SourceBuffer, WithRubyLexer + + +

      + + + + +

      Class Attribute Summary collapse

      + + + + + + +

      + Class Method Summary + collapse +

      + + + + + +
      +

      Class Attribute Details

      + + + +
      +

      + + .default_parser_classObject + + + + + +

      +
      +

      Returns the value of attribute default_parser_class.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 44
      +
      +def default_parser_class
      +  @default_parser_class
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .default_parserObject + + + + + +

      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 46
      +
      +def default_parser
      +  default_parser_class.default_parser
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig.html b/docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig.html new file mode 100644 index 00000000..fde28828 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig.html @@ -0,0 +1,378 @@ + + + + + + + Module: Opal::Parser::DefaultConfig + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Parser::DefaultConfig + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      WithRubyLexer
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/default_config.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: ClassMethods + + + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .included(klass) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 18
      +
      +def self.included(klass)
      +  klass.extend(ClassMethods)
      +  klass.diagnostics_consumer = ->(diagnostic) do
      +    if RUBY_ENGINE != 'opal'
      +      $stderr.puts(diagnostic.render)
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #initializeObject + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 27
      +
      +def initialize(*)
      +  super(Opal::AST::Builder.new)
      +end
      +
      +
      + +
      +

      + + #parse(source_buffer) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 31
      +
      +def parse(source_buffer)
      +  parsed = super || ::Opal::AST::Node.new(:nil)
      +  wrapped = ::Opal::AST::Node.new(:top, [parsed])
      +  rewriten = rewrite(wrapped)
      +  rewriten
      +end
      +
      +
      + +
      +

      + + #rewrite(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 38
      +
      +def rewrite(node)
      +  Opal::Rewriter.new(node).process
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig/ClassMethods.html b/docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig/ClassMethods.html new file mode 100644 index 00000000..da31fa99 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Parser/DefaultConfig/ClassMethods.html @@ -0,0 +1,262 @@ + + + + + + + Module: Opal::Parser::DefaultConfig::ClassMethods + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Parser::DefaultConfig::ClassMethods + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/default_config.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #diagnostics_consumerObject + + + + + +

      +
      +

      Returns the value of attribute diagnostics_consumer.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 7
      +
      +def diagnostics_consumer
      +  @diagnostics_consumer
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #default_parserObject + + + + + +

      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/parser/default_config.rb', line 9
      +
      +def default_parser
      +  parser = super
      +  parser.diagnostics.all_errors_are_fatal = true
      +  parser.diagnostics.ignore_warnings      = false
      +  parser.diagnostics.consumer             = diagnostics_consumer
      +  parser
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Parser/SourceBuffer.html b/docs/api/v1.8.2/lib/Opal/Parser/SourceBuffer.html new file mode 100644 index 00000000..029681dc --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Parser/SourceBuffer.html @@ -0,0 +1,195 @@ + + + + + + + Class: Opal::Parser::SourceBuffer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Parser::SourceBuffer + + + +

      +
      + +
      +
      Inherits:
      +
      + Parser::Source::Buffer + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/source_buffer.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .recognize_encoding(string) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/parser/source_buffer.rb', line 6
      +
      +def self.recognize_encoding(string)
      +  super || Encoding::UTF_8
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Parser/WithRubyLexer.html b/docs/api/v1.8.2/lib/Opal/Parser/WithRubyLexer.html new file mode 100644 index 00000000..0bde7484 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Parser/WithRubyLexer.html @@ -0,0 +1,142 @@ + + + + + + + Class: Opal::Parser::WithRubyLexer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Parser::WithRubyLexer + + + +

      +
      + +
      +
      Inherits:
      +
      + Parser::Ruby32 + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      DefaultConfig
      +
      + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/with_ruby_lexer.rb
      +
      + +
      + + + + + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from DefaultConfig

      +

      included, #initialize, #parse, #rewrite

      + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/ParsingError.html b/docs/api/v1.8.2/lib/Opal/ParsingError.html new file mode 100644 index 00000000..d84b2336 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/ParsingError.html @@ -0,0 +1,151 @@ + + + + + + + Exception: Opal::ParsingError + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::ParsingError + + + +

      +
      + +
      +
      Inherits:
      +
      + CompilationError + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/errors.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      RewritingError

      +
      + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from CompilationError

      +

      #location

      + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/PathReader.html b/docs/api/v1.8.2/lib/Opal/PathReader.html new file mode 100644 index 00000000..d6ab08dc --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/PathReader.html @@ -0,0 +1,506 @@ + + + + + + + Class: Opal::PathReader + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::PathReader + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/path_reader.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      RELATIVE_PATH_REGEXP = + +
      +
      /#{Opal::REGEXP_START}\.?\.#{Regexp.quote File::SEPARATOR}/.freeze
      + +
      DEFAULT_EXTENSIONS = + +
      +
      ['.js', '.js.rb', '.rb', '.opalerb'].freeze
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(paths = Opal.paths, extensions = DEFAULT_EXTENSIONS) ⇒ PathReader + + + + + +

      +
      +

      Returns a new instance of PathReader.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/path_reader.rb', line 11
      +
      +def initialize(paths = Opal.paths, extensions = DEFAULT_EXTENSIONS)
      +  @file_finder = Hike::Trail.new
      +  @file_finder.append_paths(*paths)
      +  @file_finder.append_extensions(*extensions)
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #append_paths(*paths) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/path_reader.rb', line 39
      +
      +def append_paths(*paths)
      +  file_finder.append_paths(*paths)
      +end
      +
      +
      + +
      +

      + + #expand(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/path_reader.rb', line 23
      +
      +def expand(path)
      +  if Pathname.new(path).absolute? || path =~ RELATIVE_PATH_REGEXP
      +    path
      +  else
      +    find_path(path)
      +  end
      +end
      +
      +
      + +
      +

      + + #extensionsObject + + + + + +

      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/path_reader.rb', line 35
      +
      +def extensions
      +  file_finder.extensions
      +end
      +
      +
      + +
      +

      + + #pathsObject + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/path_reader.rb', line 31
      +
      +def paths
      +  file_finder.paths
      +end
      +
      +
      + +
      +

      + + #read(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/path_reader.rb', line 17
      +
      +def read(path)
      +  full_path = expand(path)
      +  return nil if full_path.nil?
      +  File.open(full_path, 'rb:UTF-8', &:read) if File.exist?(full_path)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/REPL.html b/docs/api/v1.8.2/lib/Opal/REPL.html new file mode 100644 index 00000000..f075679f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/REPL.html @@ -0,0 +1,751 @@ + + + + + + + Class: Opal::REPL + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::REPL + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/repl.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: Silencer + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      HISTORY_PATH = + +
      +
      File.expand_path('~/.opal-repl-history')
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #colorize ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute colorize.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initializeREPL + + + + + +

      +
      +

      Returns a new instance of REPL.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/repl.rb', line 15
      +
      +def initialize
      +  @argv = []
      +  @colorize = true
      +
      +  begin
      +    require 'readline'
      +  rescue LoadError
      +    abort 'opal-repl depends on readline, which is not currently available'
      +  end
      +
      +  begin
      +    FileUtils.touch(HISTORY_PATH)
      +  rescue
      +    nil
      +  end
      +  @history = File.exist?(HISTORY_PATH)
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #colorizeObject + + + + + +

      +
      +

      Returns the value of attribute colorize.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/repl.rb', line 13
      +
      +def colorize
      +  @colorize
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #eval_ruby(code) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/repl.rb', line 75
      +
      +def eval_ruby(code)
      +  builder = Opal::Builder.new
      +  silencer = Silencer.new
      +
      +  code = "#{@incomplete}#{code}"
      +  if code.start_with? 'ls '
      +    eval_code = code[3..-1]
      +    mode = :ls
      +  elsif code == 'ls'
      +    eval_code = 'self'
      +    mode = :ls
      +  elsif code.start_with? 'show '
      +    eval_code = code[5..-1]
      +    mode = :show
      +  else
      +    eval_code = code
      +    mode = :inspect
      +  end
      +
      +  begin
      +    silencer.silence do
      +      builder.build_str(eval_code, '(irb)', irb: true, const_missing: true)
      +    end
      +    @incomplete = nil
      +  rescue Opal::SyntaxError => e
      +    if LINEBREAKS.include?(e.message)
      +      @incomplete = "#{code}\n"
      +    else
      +      @incomplete = nil
      +      if silencer.warnings.empty?
      +        warn e.full_message
      +      else
      +        # Most likely a parser error
      +        warn silencer.warnings
      +      end
      +    end
      +    return
      +  end
      +  builder.processed[0...-1].each { |js_code| eval_js(:silent, js_code.to_s) }
      +  last_processed_file = builder.processed.last.to_s
      +
      +  if mode == :show
      +    puts last_processed_file
      +    return
      +  end
      +
      +  eval_js(mode, last_processed_file)
      +rescue Interrupt, SystemExit => e
      +  raise e
      +rescue Exception => e # rubocop:disable Lint/RescueException
      +  puts e.full_message(highlight: true)
      +end
      +
      +
      + +
      +

      + + #finishObject + + + + + +

      + + + + +
      +
      +
      +
      +69
      +70
      +71
      +72
      +73
      +
      +
      # File 'opal/lib/opal/repl.rb', line 69
      +
      +def finish
      +  @pipe.close
      +rescue
      +  nil
      +end
      +
      +
      + +
      +

      + + #load_opalObject + + + + + +

      + + + + +
      +
      +
      +
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +
      +
      # File 'opal/lib/opal/repl.rb', line 45
      +
      +def load_opal
      +  runner = @argv.reject { |i| i == '--repl' }
      +  runner += ['-e', 'require "opal/repl_js"']
      +  runner = [RbConfig.ruby, "#{__dir__}/../../exe/opal"] + runner
      +
      +  @pipe = IO.popen(runner, 'r+',
      +    # What I try to achieve here: let the runner ignore
      +    # interrupts. Those should be handled by a supervisor.
      +    pgroup: true,
      +    new_pgroup: true,
      +  )
      +end
      +
      +
      + +
      +

      + + #run(argv = []) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +
      +
      # File 'opal/lib/opal/repl.rb', line 33
      +
      +def run(argv = [])
      +  @argv = argv
      +
      +  savepoint = save_tty
      +  load_opal
      +  load_history
      +  run_input_loop
      +ensure
      +  dump_history
      +  restore_tty(savepoint)
      +end
      +
      +
      + +
      +

      + + #run_input_loopObject + + + + + +

      + + + + +
      +
      +
      +
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'opal/lib/opal/repl.rb', line 58
      +
      +def run_input_loop
      +  while (line = readline)
      +    eval_ruby(line)
      +  end
      +rescue Interrupt
      +  @incomplete = nil
      +  retry
      +ensure
      +  finish
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/REPL/Silencer.html b/docs/api/v1.8.2/lib/Opal/REPL/Silencer.html new file mode 100644 index 00000000..bd9d5d8f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/REPL/Silencer.html @@ -0,0 +1,321 @@ + + + + + + + Class: Opal::REPL::Silencer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::REPL::Silencer + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/repl.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initializeSilencer + + + + + +

      +
      +

      Returns a new instance of Silencer.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +136
      +137
      +138
      +
      +
      # File 'opal/lib/opal/repl.rb', line 136
      +
      +def initialize
      +  @stderr = $stderr
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #silenceObject + + + + + +

      + + + + +
      +
      +
      +
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +
      +
      # File 'opal/lib/opal/repl.rb', line 140
      +
      +def silence
      +  @collector = StringIO.new
      +  $stderr = @collector
      +  yield
      +ensure
      +  $stderr = @stderr
      +end
      +
      +
      + +
      +

      + + #warningsObject + + + + + +

      + + + + +
      +
      +
      +
      +148
      +149
      +150
      +
      +
      # File 'opal/lib/opal/repl.rb', line 148
      +
      +def warnings
      +  @collector.string
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriter.html b/docs/api/v1.8.2/lib/Opal/Rewriter.html new file mode 100644 index 00000000..ae27b24a --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriter.html @@ -0,0 +1,658 @@ + + + + + + + Class: Opal::Rewriter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriter + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriter.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(sexp) ⇒ Rewriter + + + + + +

      +
      +

      Returns a new instance of Rewriter.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 76
      +
      +def initialize(sexp)
      +  @sexp = sexp
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .delete(rewriter) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 35
      +
      +def delete(rewriter)
      +  list.delete(rewriter)
      +end
      +
      +
      + +
      +

      + + .disable(except: nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 39
      +
      +def disable(except: nil)
      +  old_disabled = @disabled
      +  @disabled = except || true
      +  yield
      +ensure
      +  @disabled = old_disabled
      +end
      +
      +
      + +
      +

      + + .disabled?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +47
      +48
      +49
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 47
      +
      +def disabled?
      +  @disabled == true
      +end
      +
      +
      + +
      +

      + + .listObject + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 27
      +
      +def list
      +  @list ||= []
      +end
      +
      +
      + +
      +

      + + .rewritter_disabled?(rewriter) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +51
      +52
      +53
      +54
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 51
      +
      +def rewritter_disabled?(rewriter)
      +  return false if @disabled == false
      +  @disabled != rewriter
      +end
      +
      +
      + +
      +

      + + .use(rewriter) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 31
      +
      +def use(rewriter)
      +  list << rewriter
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #processObject + + + + + +

      + + + + +
      +
      +
      +
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +
      +
      # File 'opal/lib/opal/rewriter.rb', line 80
      +
      +def process
      +  return @sexp if self.class.disabled?
      +
      +  self.class.list.each do |rewriter_class|
      +    next if self.class.rewritter_disabled?(rewriter_class)
      +    rewriter = rewriter_class.new
      +    @sexp = rewriter.process(@sexp)
      +  end
      +
      +  @sexp
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters.html b/docs/api/v1.8.2/lib/Opal/Rewriters.html new file mode 100644 index 00000000..73e238bc --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters.html @@ -0,0 +1,121 @@ + + + + + + + Module: Opal::Rewriters + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Rewriters + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/base.rb,
      + opal/lib/opal/rewriters/arguments.rb,
      opal/lib/opal/rewriters/dump_args.rb,
      opal/lib/opal/rewriters/mlhs_args.rb,
      opal/lib/opal/rewriters/numblocks.rb,
      opal/lib/opal/rewriters/inline_args.rb,
      opal/lib/opal/rewriters/for_rewriter.rb,
      opal/lib/opal/rewriters/forward_args.rb,
      opal/lib/opal/rewriters/block_to_iter.rb,
      opal/lib/opal/rewriters/dot_js_syntax.rb,
      opal/lib/opal/rewriters/thrower_finder.rb,
      opal/lib/opal/rewriters/pattern_matching.rb,
      opal/lib/opal/rewriters/returnable_logic.rb,
      opal/lib/opal/rewriters/targeted_patches.rb,
      opal/lib/opal/rewriters/js_reserved_words.rb,
      opal/lib/opal/rewriters/opal_engine_check.rb,
      opal/lib/opal/rewriters/deduplicate_arg_name.rb,
      opal/lib/opal/rewriters/binary_operator_assignment.rb,
      opal/lib/opal/rewriters/logical_operator_assignment.rb,
      opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb
      +
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: Hashes + + + + Classes: Arguments, Base, BinaryOperatorAssignment, BlockToIter, DeduplicateArgName, DotJsSyntax, DumpArgs, ForRewriter, ForwardArgs, InlineArgs, JsReservedWords, LogicalOperatorAssignment, MlhsArgs, Numblocks, OpalEngineCheck, PatternMatching, ReturnableLogic, TargetedPatches, ThrowerFinder + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/Arguments.html b/docs/api/v1.8.2/lib/Opal/Rewriters/Arguments.html new file mode 100644 index 00000000..394cd415 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/Arguments.html @@ -0,0 +1,1209 @@ + + + + + + + Class: Opal::Rewriters::Arguments + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::Arguments + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/arguments.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #args ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute args.

        +
        + +
      • + + +
      • + + + #blockarg ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute blockarg.

        +
        + +
      • + + +
      • + + + #kwargs ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute kwargs.

        +
        + +
      • + + +
      • + + + #kwnilarg ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute kwnilarg.

        +
        + +
      • + + +
      • + + + #kwoptargs ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute kwoptargs.

        +
        + +
      • + + +
      • + + + #kwrestarg ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute kwrestarg.

        +
        + +
      • + + +
      • + + + #optargs ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute optargs.

        +
        + +
      • + + +
      • + + + #postargs ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute postargs.

        +
        + +
      • + + +
      • + + + #restarg ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute restarg.

        +
        + +
      • + + +
      • + + + #shadowargs ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute shadowargs.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(args) ⇒ Arguments + + + + + +

      +
      +

      Returns a new instance of Arguments.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 10
      +
      +def initialize(args)
      +  @args = []
      +  @optargs = []
      +  @restarg = nil
      +  @postargs = []
      +  @kwargs = []
      +  @kwoptargs = []
      +  @kwrestarg = nil
      +  @kwnilarg = false
      +  @shadowargs = []
      +  @blockarg = nil
      +
      +  args.each do |arg|
      +    case arg.type
      +    when :arg, :mlhs
      +      (@restarg || @optargs.any? ? @postargs : @args) << arg
      +    when :optarg
      +      @optargs << arg
      +    when :restarg
      +      @restarg = arg
      +    when :kwarg
      +      @kwargs << arg
      +    when :kwoptarg
      +      @kwoptargs << arg
      +    when :kwnilarg
      +      @kwnilarg = true
      +    when :kwrestarg
      +      @kwrestarg = arg
      +    when :shadowarg
      +      @shadowargs << arg
      +    when :blockarg
      +      @blockarg = arg
      +    else
      +      raise "Unsupported arg type #{arg.type}"
      +    end
      +  end
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #argsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute args.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def args
      +  @args
      +end
      +
      +
      + + + +
      +

      + + #blockargObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute blockarg.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def blockarg
      +  @blockarg
      +end
      +
      +
      + + + +
      +

      + + #kwargsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute kwargs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def kwargs
      +  @kwargs
      +end
      +
      +
      + + + +
      +

      + + #kwnilargObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute kwnilarg.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def kwnilarg
      +  @kwnilarg
      +end
      +
      +
      + + + +
      +

      + + #kwoptargsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute kwoptargs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def kwoptargs
      +  @kwoptargs
      +end
      +
      +
      + + + +
      +

      + + #kwrestargObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute kwrestarg.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def kwrestarg
      +  @kwrestarg
      +end
      +
      +
      + + + +
      +

      + + #optargsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute optargs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def optargs
      +  @optargs
      +end
      +
      +
      + + + +
      +

      + + #postargsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute postargs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def postargs
      +  @postargs
      +end
      +
      +
      + + + +
      +

      + + #restargObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute restarg.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def restarg
      +  @restarg
      +end
      +
      +
      + + + +
      +

      + + #shadowargsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute shadowargs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 6
      +
      +def shadowargs
      +  @shadowargs
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #can_inline_kwargs?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 56
      +
      +def can_inline_kwargs?
      +  @optargs.empty? && @restarg.nil? && @postargs.empty?
      +end
      +
      +
      + +
      +

      + + #has_any_kwargs?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +52
      +53
      +54
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 52
      +
      +def has_any_kwargs?
      +  @kwargs.any? || @kwoptargs.any? || !@kwrestarg.nil?
      +end
      +
      +
      + +
      +

      + + #has_post_args?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +
      +
      # File 'opal/lib/opal/rewriters/arguments.rb', line 48
      +
      +def has_post_args?
      +  !@restarg.nil? || @postargs.any? || (has_any_kwargs? && !can_inline_kwargs?)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/Base.html b/docs/api/v1.8.2/lib/Opal/Rewriters/Base.html new file mode 100644 index 00000000..fa3ed3bc --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/Base.html @@ -0,0 +1,908 @@ + + + + + + + Class: Opal::Rewriters::Base + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::Base + + + +

      +
      + +
      +
      Inherits:
      +
      + Parser::AST::Processor + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/base.rb
      +
      + +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: DummyLocation + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      DUMMY_LOCATION = + +
      +
      DummyLocation.new
      + +
      + + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #current_nodeObject + + + + + +

      +
      +

      Store the current node for reporting.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +110
      +111
      +112
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 110
      +
      +def current_node
      +  @current_node
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .s(type, *children) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 49
      +
      +def self.s(type, *children)
      +  ::Opal::AST::Node.new(type, children, location: DUMMY_LOCATION)
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #append_to_body(body, node) ⇒ Object + + + + + +

      +
      +

      Appends given +node+ to +body+ node.

      + +

      Supports +body+ to be one of:

      + +
        +
      1. nil - empty body
      2. +
      3. s(:begin) / s(:kwbegin) - multiline body
      4. +
      5. s(:anything_else) - singleline body
      6. +
      + +

      Returns a new body with +node+ injected as a last statement.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +83
      +84
      +85
      +86
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 83
      +
      +def append_to_body(body, node)
      +  stmts = stmts_of(body) + stmts_of(node)
      +  begin_with_stmts(stmts)
      +end
      +
      +
      + +
      +

      + + #begin_with_stmts(stmts) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 98
      +
      +def begin_with_stmts(stmts)
      +  case stmts.length
      +  when 0
      +    nil
      +  when 1
      +    stmts[0]
      +  else
      +    s(:begin, *stmts)
      +  end
      +end
      +
      +
      + +
      +

      + + #dynamic!Object + + + + + +

      +
      +

      Called when a given transformation is deemed to be dynamic, so +that cache is conditionally disabled for a given file.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +135
      +136
      +137
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 135
      +
      +def dynamic!
      +  @dynamic_cache_result = true
      +end
      +
      +
      + +
      +

      + + #error(msg) ⇒ Object + + + + + +

      +
      +

      This is called when a rewriting error occurs.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +121
      +122
      +123
      +124
      +125
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 121
      +
      +def error(msg)
      +  error = ::Opal::RewritingError.new(msg)
      +  error.location = current_node.loc if current_node
      +  raise error
      +end
      +
      +
      + +
      +

      + + #on_top(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +127
      +128
      +129
      +130
      +131
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 127
      +
      +def on_top(node)
      +  node = process_regular_node(node)
      +  node.meta[:dynamic_cache_result] = true if @dynamic_cache_result
      +  node
      +end
      +
      +
      + +
      +

      + + #prepend_to_body(body, node) ⇒ Object + + + + + +

      +
      +

      Prepends given +node+ to +body+ node.

      + +

      Supports +body+ to be one of:

      + +
        +
      1. nil - empty body
      2. +
      3. s(:begin) / s(:kwbegin) - multiline body
      4. +
      5. s(:anything_else) - singleline body
      6. +
      + +

      Returns a new body with +node+ injected as a first statement.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +69
      +70
      +71
      +72
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 69
      +
      +def prepend_to_body(body, node)
      +  stmts = stmts_of(node) + stmts_of(body)
      +  begin_with_stmts(stmts)
      +end
      +
      +
      + +
      +

      + + #process(node) ⇒ Object + + + + + +

      +
      +

      Intercept the main call and assign current node.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +113
      +114
      +115
      +116
      +117
      +118
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 113
      +
      +def process(node)
      +  self.current_node = node
      +  super
      +ensure
      +  self.current_node = nil
      +end
      +
      +
      + +
      +

      + + #s(type, *children) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +47
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 44
      +
      +def s(type, *children)
      +  loc = current_node ? current_node.loc : DUMMY_LOCATION
      +  ::Opal::AST::Node.new(type, children, location: loc)
      +end
      +
      +
      + +
      +

      + + #stmts_of(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 88
      +
      +def stmts_of(node)
      +  if node.nil?
      +    []
      +  elsif %i[begin kwbegin].include?(node.type)
      +    node.children
      +  else
      +    [node]
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/Base/DummyLocation.html b/docs/api/v1.8.2/lib/Opal/Rewriters/Base/DummyLocation.html new file mode 100644 index 00000000..0f34403d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/Base/DummyLocation.html @@ -0,0 +1,556 @@ + + + + + + + Class: Opal::Rewriters::Base::DummyLocation + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::Base::DummyLocation + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/base.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #begin_posObject + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 18
      +
      +def begin_pos
      +  0
      +end
      +
      +
      + +
      +

      + + #columnObject + + + + + +

      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 34
      +
      +def column
      +  0
      +end
      +
      +
      + +
      +

      + + #end_posObject + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 22
      +
      +def end_pos
      +  0
      +end
      +
      +
      + +
      +

      + + #expressionObject + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 14
      +
      +def expression
      +  self
      +end
      +
      +
      + +
      +

      + + #last_lineObject + + + + + +

      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 38
      +
      +def last_line
      +  Float::INFINITY
      +end
      +
      +
      + +
      +

      + + #lineObject + + + + + +

      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 30
      +
      +def line
      +  0
      +end
      +
      +
      + +
      +

      + + #node=Object + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 10
      +
      +def node=(*)
      +  # stub
      +end
      +
      +
      + +
      +

      + + #sourceObject + + + + + +

      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/rewriters/base.rb', line 26
      +
      +def source
      +  ''
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment.html b/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment.html new file mode 100644 index 00000000..91a32ac8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment.html @@ -0,0 +1,590 @@ + + + + + + + Class: Opal::Rewriters::BinaryOperatorAssignment + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::BinaryOperatorAssignment + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/binary_operator_assignment.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      ConditionalSendHandler, SendHandler

      +
      +

      Defined Under Namespace

      +

      + + + + + Classes: ConditionalSendHandler, SendHandler + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      GET_SET = + +
      +
      ->(get_type, set_type) {
      +  ->(node, lhs, operation, rhs) {
      +    get_node = lhs.updated(get_type) # lhs
      +    set_node = node.updated(:send, [get_node, operation, rhs]) # lhs + rhs
      +
      +    lhs.updated(set_type, [*lhs, set_node]) # lhs = lhs + rhs
      +  }
      +}
      + +
      LocalVariableHandler = +
      +
      +

      Takes lhs += rhs +Produces lhs = lhs + rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      InstanceVariableHandler = +
      +
      +

      Takes @lhs += rhs +Produces @lhs = @lhs + rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      ConstantHandler = +
      +
      +

      Takes LHS += rhs +Produces LHS = LHS + rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      GlobalVariableHandler = +
      +
      +

      Takes $lhs += rhs +Produces $lhs = $lhs + rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      ClassVariableHandler = +
      +
      +

      Takes @@lhs += rhs +Produces @@lhs = @@lhs + rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      HANDLERS = + +
      +
      {
      +  lvasgn: LocalVariableHandler,
      +  ivasgn: InstanceVariableHandler,
      +  casgn:  ConstantHandler,
      +  gvasgn: GlobalVariableHandler,
      +  cvasgn: ClassVariableHandler,
      +  send:   SendHandler,
      +  csend:  ConditionalSendHandler
      +}.freeze
      + +
      ASSIGNMENT_STRING_NODE = + +
      +
      s(:str, 'assignment')
      + +
      + + + + + + +

      Constants inherited + from Base

      +

      Opal::Rewriters::Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .new_tempObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/rewriters/binary_operator_assignment.rb', line 12
      +
      +def self.new_temp
      +  @@counter ||= 0
      +  @@counter += 1
      +  :"$binary_op_recvr_tmp_#{@@counter}"
      +end
      +
      +
      + +
      +

      + + .reset_tmp_counter!Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/rewriters/binary_operator_assignment.rb', line 8
      +
      +def self.reset_tmp_counter!
      +  @@counter = 0
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #on_defined?(node) ⇒ Boolean + + + + + +

      +
      +

      Rewrites any or_asgn and and_asgn node like + defined?(a ||= 1) +and + defined?(a &&= 1) +to a static "assignment" string node

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +
      +
      # File 'opal/lib/opal/rewriters/binary_operator_assignment.rb', line 131
      +
      +def on_defined?(node)
      +  inner, _ = *node
      +  if inner.type == :op_asgn
      +    ASSIGNMENT_STRING_NODE
      +  else
      +    super(node)
      +  end
      +end
      +
      +
      + +
      +

      + + #on_op_asgn(node) ⇒ Object + + + + + +

      +
      +

      lhs += rhs

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +
      +
      # File 'opal/lib/opal/rewriters/binary_operator_assignment.rb', line 114
      +
      +def on_op_asgn(node)
      +  lhs, op, rhs = *node
      +
      +  result = HANDLERS
      +           .fetch(lhs.type) { error "cannot handle LHS type: #{lhs.type}" }
      +           .call(node, lhs, op, rhs)
      +
      +  process(result)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/ConditionalSendHandler.html b/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/ConditionalSendHandler.html new file mode 100644 index 00000000..e7f825e3 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/ConditionalSendHandler.html @@ -0,0 +1,285 @@ + + + + + + + Class: Opal::Rewriters::BinaryOperatorAssignment::ConditionalSendHandler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::BinaryOperatorAssignment::ConditionalSendHandler + + + +

      +
      + +
      +
      Inherits:
      +
      + Opal::Rewriters::BinaryOperatorAssignment + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/binary_operator_assignment.rb
      +
      + +
      + +

      Overview

      +
      +

      Takes recvr.meth += rhs +Produces recvr.nil? ? nil : recvr.meth += rhs + NOTE: Later output of this handler gets post-processed by this rewriter again + using SendHandler to recvr.nil? ? nil : (recvr.meth = recvr.meth + rhs)

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Opal::Rewriters::BinaryOperatorAssignment

      +

      ASSIGNMENT_STRING_NODE, ClassVariableHandler, ConstantHandler, GET_SET, GlobalVariableHandler, HANDLERS, InstanceVariableHandler, LocalVariableHandler

      + + + +

      Constants inherited + from Opal::Rewriters::Base

      +

      Opal::Rewriters::Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Opal::Rewriters::Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

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

      Methods inherited from Opal::Rewriters::BinaryOperatorAssignment

      +

      new_temp, #on_defined?, #on_op_asgn, reset_tmp_counter!

      + + + + + + + + + +

      Methods inherited from Opal::Rewriters::Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(node, lhs, operation, rhs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +
      +
      # File 'opal/lib/opal/rewriters/binary_operator_assignment.rb', line 81
      +
      +def self.call(node, lhs, operation, rhs)
      +  recvr, meth, *args = *lhs
      +
      +  recvr_tmp = new_temp
      +  cache_recvr = s(:lvasgn, recvr_tmp, recvr) # $tmp = recvr
      +  recvr = s(:js_tmp, recvr_tmp)
      +
      +  recvr_is_nil = s(:send, recvr, :nil?)                   # recvr.nil?
      +  plain_send = lhs.updated(:send, [recvr, meth, *args])   # recvr.meth
      +  plain_op_asgn = node.updated(:op_asgn, [plain_send, operation, rhs]) # recvr.meth += rhs
      +
      +  s(:begin,
      +    cache_recvr,
      +    s(:if, recvr_is_nil,                          # if recvr.nil?
      +      s(:nil),                                    #   nil
      +                                                  # else
      +      plain_op_asgn                               #   recvr.meth ||= rhs
      +    ),
      +  )                                               # end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/SendHandler.html b/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/SendHandler.html new file mode 100644 index 00000000..6cb0b7fc --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/BinaryOperatorAssignment/SendHandler.html @@ -0,0 +1,290 @@ + + + + + + + Class: Opal::Rewriters::BinaryOperatorAssignment::SendHandler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::BinaryOperatorAssignment::SendHandler + + + +

      +
      + +
      +
      Inherits:
      +
      + Opal::Rewriters::BinaryOperatorAssignment + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/binary_operator_assignment.rb
      +
      + +
      + +

      Overview

      +
      +

      Takes recvr.meth += rhs +Produces recvr.meth = recvr.meth + rhs +(lhs is a recvr.meth, op is :+)

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Opal::Rewriters::BinaryOperatorAssignment

      +

      ASSIGNMENT_STRING_NODE, ClassVariableHandler, ConstantHandler, GET_SET, GlobalVariableHandler, HANDLERS, InstanceVariableHandler, LocalVariableHandler

      + + + +

      Constants inherited + from Opal::Rewriters::Base

      +

      Opal::Rewriters::Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Opal::Rewriters::Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

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

      Methods inherited from Opal::Rewriters::BinaryOperatorAssignment

      +

      new_temp, #on_defined?, #on_op_asgn, reset_tmp_counter!

      + + + + + + + + + +

      Methods inherited from Opal::Rewriters::Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(node, lhs, operation, rhs) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +
      +
      # File 'opal/lib/opal/rewriters/binary_operator_assignment.rb', line 51
      +
      +def self.call(node, lhs, operation, rhs)
      +  recvr, reader_method, *args = *lhs
      +
      +  # If recvr is a complex expression it must be cached.
      +  # MRI calls recvr in `recvr.meth ||= rhs` only once.
      +  if recvr && recvr.type == :send
      +    recvr_tmp = new_temp
      +    cache_recvr = s(:lvasgn, recvr_tmp, recvr) # $tmp = recvr
      +    recvr = s(:js_tmp, recvr_tmp)
      +  end
      +
      +  writer_method = :"#{reader_method}="
      +
      +  call_reader = lhs.updated(:send, [recvr, reader_method, *args])          # $tmp.meth
      +  call_op = node.updated(:send, [call_reader, operation, rhs])             # $tmp.meth + rhs
      +  call_writer = lhs.updated(:send, [recvr, writer_method, *args, call_op]) # $tmp.meth = $tmp.meth + rhs
      +
      +  if cache_recvr
      +    node.updated(:begin, [cache_recvr, call_writer])
      +  else
      +    call_writer
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/BlockToIter.html b/docs/api/v1.8.2/lib/Opal/Rewriters/BlockToIter.html new file mode 100644 index 00000000..53a473c6 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/BlockToIter.html @@ -0,0 +1,229 @@ + + + + + + + Class: Opal::Rewriters::BlockToIter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::BlockToIter + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/block_to_iter.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Opal::Rewriters::Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_block(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/rewriters/block_to_iter.rb', line 8
      +
      +def on_block(node)
      +  recvr, args, body = *node
      +  iter_node = s(:iter, args, body)
      +  process recvr.updated(
      +    nil,
      +    (recvr.children + [iter_node]),
      +  )
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/DeduplicateArgName.html b/docs/api/v1.8.2/lib/Opal/Rewriters/DeduplicateArgName.html new file mode 100644 index 00000000..186da6e1 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/DeduplicateArgName.html @@ -0,0 +1,380 @@ + + + + + + + Class: Opal::Rewriters::DeduplicateArgName + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::DeduplicateArgName + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/deduplicate_arg_name.rb
      +
      + +
      + +

      Overview

      +
      +

      Ruby allows for args with the same name, if the arg starts with a '', like: + def funny_method_name(, ) + puts _ + end +but JavaScript in strict mode does not allow for args with the same name +Ruby assigns the value of the first arg given + funny_method_name(1, 2) => 1 +leave the first appearance as it is and rename the other ones +compiler result: + function $$funny_method_name(, __$2)

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_args(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/rewriters/deduplicate_arg_name.rb', line 16
      +
      +def on_args(node)
      +  @arg_name_count = Hash.new(0)
      +
      +  children = node.children.map do |arg|
      +    rename_arg(arg)
      +  end
      +
      +  super(node.updated(nil, children))
      +end
      +
      +
      + +
      +

      + + #rename_arg(arg) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/rewriters/deduplicate_arg_name.rb', line 26
      +
      +def rename_arg(arg)
      +  case arg.type
      +  when :arg, :restarg, :kwarg, :kwrestarg, :blockarg
      +    name = arg.children[0]
      +    name ? arg.updated(nil, [unique_name(name)]) : arg
      +  when :optarg, :kwoptarg
      +    name, value = arg.children
      +    arg.updated(nil, [unique_name(name), value])
      +  when :mlhs
      +    new_children = arg.children.map { |child| rename_arg(child) }
      +    arg.updated(nil, new_children)
      +  else
      +    arg
      +  end
      +end
      +
      +
      + +
      +

      + + #unique_name(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +
      +
      # File 'opal/lib/opal/rewriters/deduplicate_arg_name.rb', line 42
      +
      +def unique_name(name)
      +  count = (@arg_name_count[name] += 1)
      +  count > 1 ? :"#{name}_$#{count}" : name
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/DotJsSyntax.html b/docs/api/v1.8.2/lib/Opal/Rewriters/DotJsSyntax.html new file mode 100644 index 00000000..9df950d3 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/DotJsSyntax.html @@ -0,0 +1,590 @@ + + + + + + + Class: Opal::Rewriters::DotJsSyntax + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::DotJsSyntax + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/dot_js_syntax.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_send(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/rewriters/dot_js_syntax.rb', line 8
      +
      +def on_send(node)
      +  recv, meth, *args = *node
      +  if recv && recv.type == :send
      +    recv_of_recv, meth_of_recv, _ = *recv
      +    if meth_of_recv == :JS
      +      case meth
      +      when :[]
      +        if args.size != 1
      +          error '.JS[:property] syntax supports only one argument'
      +        end
      +        property = args.first
      +
      +        node = to_js_attr_call(recv_of_recv, property)
      +      when :[]=
      +        if args.size != 2
      +          error '.JS[:property]= syntax supports only two arguments'
      +        end
      +
      +        property, value = *args
      +        node = to_js_attr_assign_call(recv_of_recv, property, value)
      +      else
      +        node = to_native_js_call(recv_of_recv, meth, args)
      +      end
      +      super(node)
      +    else
      +      super
      +    end
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #to_js_attr_assign_call(recv, property, value) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + recv + + + (AST::Node) + + + + — +

        receiver of .JS[]= method

        +
        + +
      • + +
      • + + property + + + (AST::Node) + + + + — +

        property passed to brackets

        +
        + +
      • + +
      • + + value + + + (AST::Node) + + + + — +

        value of assignment

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'opal/lib/opal/rewriters/dot_js_syntax.rb', line 56
      +
      +def to_js_attr_assign_call(recv, property, value)
      +  s(:jsattrasgn, recv, property, value)
      +end
      +
      +
      + +
      +

      + + #to_js_attr_call(recv, property) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + recv + + + (AST::Node) + + + + — +

        receiver of .JS[] method

        +
        + +
      • + +
      • + + property + + + (AST::Node) + + + + — +

        argument passed to .JS[] method

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +
      +
      # File 'opal/lib/opal/rewriters/dot_js_syntax.rb', line 49
      +
      +def to_js_attr_call(recv, property)
      +  s(:jsattr, recv, property)
      +end
      +
      +
      + +
      +

      + + #to_native_js_call(recv, meth, args) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + recv + + + (AST::Node) + + + + — +

        receiver of .JS. method

        +
        + +
      • + +
      • + + meth + + + (Symbol) + + + + — +

        name of the JS method

        +
        + +
      • + +
      • + + args + + + (Array<AST::Node>) + + + + — +

        list of the arguments passed to JS method

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +43
      +44
      +45
      +
      +
      # File 'opal/lib/opal/rewriters/dot_js_syntax.rb', line 43
      +
      +def to_native_js_call(recv, meth, args)
      +  s(:jscall, recv, meth, *args)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/DumpArgs.html b/docs/api/v1.8.2/lib/Opal/Rewriters/DumpArgs.html new file mode 100644 index 00000000..5e8f1ce4 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/DumpArgs.html @@ -0,0 +1,337 @@ + + + + + + + Class: Opal::Rewriters::DumpArgs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::DumpArgs + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/dump_args.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_def(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/rewriters/dump_args.rb', line 8
      +
      +def on_def(node)
      +  node = super(node)
      +  _mid, args, _body = *node
      +  node.updated(nil, nil, meta: { original_args: args })
      +end
      +
      +
      + +
      +

      + + #on_defs(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/rewriters/dump_args.rb', line 14
      +
      +def on_defs(node)
      +  node = super(node)
      +  _recv, _mid, args, _body = *node
      +
      +  node.updated(nil, nil, meta: { original_args: args })
      +end
      +
      +
      + +
      +

      + + #on_iter(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/rewriters/dump_args.rb', line 21
      +
      +def on_iter(node)
      +  node = super(node)
      +  args, _body = *node
      +  node.updated(nil, nil, meta: { original_args: args })
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter.html b/docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter.html new file mode 100644 index 00000000..187dac94 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter.html @@ -0,0 +1,410 @@ + + + + + + + Class: Opal::Rewriters::ForRewriter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::ForRewriter + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/for_rewriter.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: LocalVariableAssigns + + +

      + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .next_tmpObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/rewriters/for_rewriter.rb', line 12
      +
      +def self.next_tmp
      +  @counter ||= 0
      +  @counter += 1
      +  :"$for_tmp#{@counter}"
      +end
      +
      +
      + +
      +

      + + .reset_tmp_counter!Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/rewriters/for_rewriter.rb', line 8
      +
      +def self.reset_tmp_counter!
      +  @counter = 0
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #on_for(node) ⇒ Object + + + + + +

      +
      +

      Handles + for i in 0..3; j = i + 1; end

      + +

      The problem here is that in Ruby for loop makes its +loop variable + all local variables available outside. +I.e. after this loop variable i is 3 and j is 4

      + +

      This class rewrites it to the following code: + j = nil + i = nil + (0..3).each { |__jstmp| i = __jstmp; j = i + 1 }

      + +

      Complex stuff with multiple loop variables: + for i, j in [[1, 2], [3, 4]]; end +Becomes multiple left-hand assignment: + i = nil + j = nil + [[1, 2], [3, 4]].each { |__jstmp| i, j = __jstmp }

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +
      +
      # File 'opal/lib/opal/rewriters/for_rewriter.rb', line 38
      +
      +def on_for(node)
      +  loop_variable, loop_range, loop_body = *node
      +
      +  # Declare local variables used in the loop and the loop body at the outer scope
      +  outer_assignments = generate_outer_assignments(loop_variable, loop_body)
      +
      +  # Generate temporary loop variable
      +  tmp_loop_variable = self.class.next_tmp
      +  get_tmp_loop_variable = s(:js_tmp, tmp_loop_variable)
      +
      +  # Assign the loop variables in the loop body
      +  loop_body = prepend_to_body(loop_body, assign_loop_variable(loop_variable, get_tmp_loop_variable))
      +
      +  # Transform the for-loop into each-loop with updated loop body
      +  node = transform_for_to_each_loop(node, loop_range, tmp_loop_variable, loop_body)
      +
      +  node.updated(:begin, [*outer_assignments, node])
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter/LocalVariableAssigns.html b/docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter/LocalVariableAssigns.html new file mode 100644 index 00000000..511c1f31 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/ForRewriter/LocalVariableAssigns.html @@ -0,0 +1,453 @@ + + + + + + + Class: Opal::Rewriters::ForRewriter::LocalVariableAssigns + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::ForRewriter::LocalVariableAssigns + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/for_rewriter.rb
      +
      + +
      + +

      Overview

      +
      +

      rubocop:enable Layout/MultilineMethodCallBraceLayout,Layout/MultilineArrayBraceLayout

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #result ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute result.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initializeLocalVariableAssigns + + + + + +

      +
      +

      Returns a new instance of LocalVariableAssigns.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +93
      +94
      +95
      +
      +
      # File 'opal/lib/opal/rewriters/for_rewriter.rb', line 93
      +
      +def initialize
      +  @result = Set.new
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #resultObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute result.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +85
      +86
      +87
      +
      +
      # File 'opal/lib/opal/rewriters/for_rewriter.rb', line 85
      +
      +def result
      +  @result
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .find(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +90
      +91
      +
      +
      # File 'opal/lib/opal/rewriters/for_rewriter.rb', line 87
      +
      +def self.find(node)
      +  processor = new
      +  processor.process(node)
      +  processor.result.to_a
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #on_lvasgn(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +97
      +98
      +99
      +100
      +101
      +
      +
      # File 'opal/lib/opal/rewriters/for_rewriter.rb', line 97
      +
      +def on_lvasgn(node)
      +  name, _ = *node
      +  result << name
      +  super
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/ForwardArgs.html b/docs/api/v1.8.2/lib/Opal/Rewriters/ForwardArgs.html new file mode 100644 index 00000000..44fe8f0f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/ForwardArgs.html @@ -0,0 +1,749 @@ + + + + + + + Class: Opal::Rewriters::ForwardArgs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::ForwardArgs + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/forward_args.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_args(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 38
      +
      +def on_args(node)
      +  if node.children.last && node.children.last.type == :forward_arg
      +    prev_children = node.children[0..-2]
      +
      +    super(node.updated(nil,
      +      [
      +        *prev_children,
      +        s(:restarg, '$fwd_rest'),
      +        s(:blockarg, '$fwd_block')
      +      ]
      +    ))
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #on_block_pass(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 26
      +
      +def on_block_pass(node)
      +  if !node.children.first
      +    process(
      +      node.updated(nil,
      +        [s(:lvar, '$fwd_block')]
      +      )
      +    )
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #on_blockarg(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 70
      +
      +def on_blockarg(node)
      +  if !node.children.first
      +    node.updated(nil, ['$fwd_block'])
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #on_forward_args(_node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 8
      +
      +def on_forward_args(_node)
      +  process(
      +    s(:args, s(:forward_arg, :"$"))
      +  )
      +end
      +
      +
      + +
      +

      + + #on_forwarded_kwrestarg(_node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 20
      +
      +def on_forwarded_kwrestarg(_node)
      +  process(
      +    s(:kwsplat, s(:lvar, '$fwd_kwrest'))
      +  )
      +end
      +
      +
      + +
      +

      + + #on_forwarded_restarg(_node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 14
      +
      +def on_forwarded_restarg(_node)
      +  process(
      +    s(:splat, s(:lvar, '$fwd_rest'))
      +  )
      +end
      +
      +
      + +
      +

      + + #on_kwrestarg(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 62
      +
      +def on_kwrestarg(node)
      +  if !node.children.first
      +    node.updated(nil, ['$fwd_kwrest'])
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #on_restarg(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 54
      +
      +def on_restarg(node)
      +  if !node.children.first
      +    node.updated(nil, ['$fwd_rest'])
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #on_send(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +
      +
      # File 'opal/lib/opal/rewriters/forward_args.rb', line 78
      +
      +def on_send(node)
      +  if node.children.last &&
      +     node.children.last.class != Symbol &&
      +     node.children.last.type == :forwarded_args
      +
      +    prev_children = node.children[0..-2]
      +
      +    super(node.updated(nil,
      +      [
      +        *prev_children,
      +        s(:splat,
      +          s(:lvar, '$fwd_rest')
      +        ),
      +        s(:block_pass,
      +          s(:lvar, '$fwd_block')
      +        )
      +      ]
      +    ))
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes.html b/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes.html new file mode 100644 index 00000000..b402c31b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes.html @@ -0,0 +1,117 @@ + + + + + + + Module: Opal::Rewriters::Hashes + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Rewriters::Hashes + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: KeyDuplicatesRewriter + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter.html b/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter.html new file mode 100644 index 00000000..2eecb095 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter.html @@ -0,0 +1,432 @@ + + + + + + + Class: Opal::Rewriters::Hashes::KeyDuplicatesRewriter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::Hashes::KeyDuplicatesRewriter + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: UniqKeysSet + + +

      + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initializeKeyDuplicatesRewriter + + + + + +

      +
      +

      Returns a new instance of KeyDuplicatesRewriter.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb', line 10
      +
      +def initialize
      +  @keys = UniqKeysSet.new
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_hash(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb', line 14
      +
      +def on_hash(node)
      +  previous_keys, @keys = @keys, UniqKeysSet.new
      +  super(node)
      +ensure
      +  @keys = previous_keys
      +end
      +
      +
      + +
      +

      + + #on_kwsplat(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb', line 31
      +
      +def on_kwsplat(node)
      +  hash, _ = *node
      +
      +  if hash.type == :hash
      +    hash = process_regular_node(hash)
      +  end
      +
      +  node.updated(nil, [hash])
      +end
      +
      +
      + +
      +

      + + #on_pair(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb', line 21
      +
      +def on_pair(node)
      +  key, _value = *node
      +
      +  if %i[str sym].include?(key.type)
      +    @keys << key
      +  end
      +
      +  super(node)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter/UniqKeysSet.html b/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter/UniqKeysSet.html new file mode 100644 index 00000000..aacf1bfe --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/Hashes/KeyDuplicatesRewriter/UniqKeysSet.html @@ -0,0 +1,273 @@ + + + + + + + Class: Opal::Rewriters::Hashes::KeyDuplicatesRewriter::UniqKeysSet + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::Hashes::KeyDuplicatesRewriter::UniqKeysSet + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initializeUniqKeysSet + + + + + +

      +
      +

      Returns a new instance of UniqKeysSet.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +
      +
      # File 'opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb', line 42
      +
      +def initialize
      +  @set = Set.new
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #<<(element) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +
      +
      # File 'opal/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb', line 46
      +
      +def <<(element)
      +  if @set.include?(element)
      +    key, _ = *element
      +    key = element.type == :str ? key.inspect : ":#{key}"
      +    Kernel.warn "warning: key #{key} is duplicated and overwritten"
      +  else
      +    @set << element
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs.html b/docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs.html new file mode 100644 index 00000000..d2bad9d7 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs.html @@ -0,0 +1,414 @@ + + + + + + + Class: Opal::Rewriters::InlineArgs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::InlineArgs + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/inline_args.rb
      +
      + +
      + +

      Overview

      +
      +

      Converts

      + +

      def m( a, b = 1, *c, d, e:, f: 1, **g, &blk ) + end

      + +

      To something like

      + +

      def m( a, , , , ) + blk = + $post_args = arguments[1..-1] + $kwargs = $post_args.pop + a = ? $post_args.shift : 1 + c = ? $post_args[0..-1] : [] + d = $post_args.last + e = $kwargs.delete(:e) + f = $kwargs.delete(:f) || 1 + g = $kwargs.except(:e, :f) + end

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Initializer + + +

      + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_def(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 28
      +
      +def on_def(node)
      +  node = super(node)
      +  mid, args, body = *node
      +
      +  body ||= s(:nil) # prevent returning initialization statement
      +
      +  initializer = Initializer.new(args, type: :def)
      +  inline_args = args.updated(nil, initializer.inline)
      +  body = prepend_to_body(body, initializer.initialization)
      +
      +  node.updated(nil, [mid, inline_args, body])
      +end
      +
      +
      + +
      +

      + + #on_defs(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 41
      +
      +def on_defs(node)
      +  node = super(node)
      +  recv, mid, args, body = *node
      +
      +  body ||= s(:nil) # prevent returning initialization statement
      +
      +  initializer = Initializer.new(args, type: :defs)
      +  inline_args = args.updated(nil, initializer.inline)
      +  body = prepend_to_body(body, initializer.initialization)
      +
      +  node.updated(nil, [recv, mid, inline_args, body])
      +end
      +
      +
      + +
      +

      + + #on_iter(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 54
      +
      +def on_iter(node)
      +  node = super(node)
      +  args, body = *node
      +
      +  body ||= s(:nil) # prevent returning initialization statement
      +
      +  initializer = Initializer.new(args, type: :iter)
      +  inline_args = args.updated(nil, initializer.inline)
      +  body = prepend_to_body(body, initializer.initialization)
      +
      +  node.updated(nil, [inline_args, body])
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs/Initializer.html b/docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs/Initializer.html new file mode 100644 index 00000000..b6b6184f --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/InlineArgs/Initializer.html @@ -0,0 +1,1175 @@ + + + + + + + Class: Opal::Rewriters::InlineArgs::Initializer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::InlineArgs::Initializer + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/inline_args.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      STEPS = + +
      +
      %i[
      +  extract_blockarg
      +  initialize_shadowargs
      +  extract_args
      +
      +  prepare_post_args
      +  prepare_kwargs
      +
      +  extract_optargs
      +  extract_restarg
      +  extract_post_args
      +
      +  extract_kwargs
      +  extract_kwoptargs
      +  extract_kwrestarg
      +].freeze
      + +
      + + + + + + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #initialization ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute initialization.

        +
        + +
      • + + +
      • + + + #inline ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute inline.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(args, type:) ⇒ Initializer + + + + + +

      +
      +

      Returns a new instance of Initializer.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 87
      +
      +def initialize(args, type:)
      +  @args = Arguments.new(args.children)
      +
      +  @inline = []
      +  @initialization = []
      +
      +  @type = type
      +
      +  STEPS.each do |step|
      +    send(step)
      +  end
      +
      +  if @initialization.any?
      +    @initialization = s(:begin, *@initialization)
      +  else
      +    @initialization = nil
      +  end
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #initializationObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute initialization.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 68
      +
      +def initialization
      +  @initialization
      +end
      +
      +
      + + + +
      +

      + + #inlineObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute inline.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 68
      +
      +def inline
      +  @inline
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #args_to_keepObject + + + + + +

      + + + + +
      +
      +
      +
      +202
      +203
      +204
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 202
      +
      +def args_to_keep
      +  @args.postargs.length
      +end
      +
      +
      + +
      +

      + + #extract_argsObject + + + + + +

      + + + + +
      +
      +
      +
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 118
      +
      +def extract_args
      +  @args.args.each do |arg|
      +    if @type == :iter
      +      # block args are not required,
      +      # so we need to tell compiler that required args
      +      # must be initialized with nil-s
      +      @initialization << arg.updated(:initialize_iter_arg)
      +    else
      +      # required inline def argument like 'def m(req)'
      +      # no initialization is required
      +    end
      +    @inline << arg
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_blockargObject + + + + + +

      + + + + +
      +
      +
      +
      +106
      +107
      +108
      +109
      +110
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 106
      +
      +def extract_blockarg
      +  if (arg = @args.blockarg)
      +    @initialization << arg.updated(:extract_blockarg)
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_kwargsObject + + + + + +

      + + + + +
      +
      +
      +
      +152
      +153
      +154
      +155
      +156
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 152
      +
      +def extract_kwargs
      +  @args.kwargs.each do |arg|
      +    @initialization << arg.updated(:extract_kwarg)
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_kwoptargsObject + + + + + +

      + + + + +
      +
      +
      +
      +158
      +159
      +160
      +161
      +162
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 158
      +
      +def extract_kwoptargs
      +  @args.kwoptargs.each do |arg|
      +    @initialization << arg.updated(:extract_kwoptarg)
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_kwrestargObject + + + + + +

      + + + + +
      +
      +
      +
      +164
      +165
      +166
      +167
      +168
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 164
      +
      +def extract_kwrestarg
      +  if (arg = @args.kwrestarg)
      +    @initialization << arg.updated(:extract_kwrestarg)
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_optargsObject + + + + + +

      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +181
      +182
      +183
      +184
      +185
      +186
      +187
      +188
      +189
      +190
      +191
      +192
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 178
      +
      +def extract_optargs
      +  has_post_args = @args.has_post_args?
      +  @args.optargs.each do |arg|
      +    if has_post_args
      +      # optional post argument like 'def m(opt = 1, a)'
      +      arg_name, default_value = *arg
      +      @initialization << arg.updated(:extract_post_optarg, [arg_name, default_value, args_to_keep])
      +      @inline << s(:fake_arg)
      +    else
      +      # optional inline argument like 'def m(a, opt = 1)'
      +      @inline << arg.updated(:arg)
      +      @initialization << arg.updated(:extract_optarg)
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_post_argsObject + + + + + +

      + + + + +
      +
      +
      +
      +170
      +171
      +172
      +173
      +174
      +175
      +176
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 170
      +
      +def extract_post_args
      +  # post arguments must be extracted with an offset
      +  @args.postargs.each do |arg|
      +    @initialization << arg.updated(:extract_post_arg)
      +    @inline << s(:fake_arg)
      +  end
      +end
      +
      +
      + +
      +

      + + #extract_restargObject + + + + + +

      + + + + +
      +
      +
      +
      +194
      +195
      +196
      +197
      +198
      +199
      +200
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 194
      +
      +def extract_restarg
      +  if (arg = @args.restarg)
      +    arg_name = arg.children[0]
      +    @initialization << arg.updated(:extract_restarg, [arg_name, args_to_keep])
      +    @inline << s(:fake_arg)
      +  end
      +end
      +
      +
      + +
      +

      + + #initialize_shadowargsObject + + + + + +

      + + + + +
      +
      +
      +
      +112
      +113
      +114
      +115
      +116
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 112
      +
      +def initialize_shadowargs
      +  @args.shadowargs.each do |arg|
      +    @initialization << arg.updated(:initialize_shadowarg)
      +  end
      +end
      +
      +
      + +
      +

      + + #prepare_kwargsObject + + + + + +

      + + + + +
      +
      +
      +
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 139
      +
      +def prepare_kwargs
      +  return unless @args.has_any_kwargs?
      +
      +  if @args.can_inline_kwargs?
      +    @inline << s(:arg, :'$kwargs')
      +  else
      +    @initialization << s(:extract_kwargs)
      +    @inline << s(:fake_arg)
      +  end
      +
      +  @initialization << s(:ensure_kwargs_are_kwargs)
      +end
      +
      +
      + +
      +

      + + #prepare_post_argsObject + + + + + +

      + + + + +
      +
      +
      +
      +133
      +134
      +135
      +136
      +137
      +
      +
      # File 'opal/lib/opal/rewriters/inline_args.rb', line 133
      +
      +def prepare_post_args
      +  if @args.has_post_args?
      +    @initialization << s(:prepare_post_args, @args.args.length)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/JsReservedWords.html b/docs/api/v1.8.2/lib/Opal/Rewriters/JsReservedWords.html new file mode 100644 index 00000000..55b88b78 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/JsReservedWords.html @@ -0,0 +1,956 @@ + + + + + + + Class: Opal::Rewriters::JsReservedWords + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::JsReservedWords + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/js_reserved_words.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      ES51_RESERVED_WORD = +
      +
      +

      Reserved javascript keywords - we cannot create variables with the +same name (ref: http://stackoverflow.com/a/9337272/601782)

      + + +
      +
      +
      + + +
      +
      +
      /#{REGEXP_START}(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)#{REGEXP_END}/.freeze
      + +
      ES3_RESERVED_WORD_EXCLUSIVE = +
      +
      +

      ES3 reserved words that aren’t ES5.1 reserved words

      + + +
      +
      +
      + + +
      +
      +
      /#{REGEXP_START}(?:int|byte|char|goto|long|final|float|short|double|native|throws|boolean|abstract|volatile|transient|synchronized)#{REGEXP_END}/.freeze
      + +
      PROTO_SPECIAL_PROPS = +
      +
      +

      Prototype special properties.

      + + +
      +
      +
      + + +
      +
      +
      /#{REGEXP_START}(?:constructor|displayName|__proto__|__parent__|__noSuchMethod__|__count__)#{REGEXP_END}/.freeze
      + +
      PROTO_SPECIAL_METHODS = +
      +
      +

      Prototype special methods.

      + + +
      +
      +
      + + +
      +
      +
      /#{REGEXP_START}(?:hasOwnProperty|valueOf)#{REGEXP_END}/.freeze
      + +
      IMMUTABLE_PROPS = +
      +
      +

      Immutable properties of the global object

      + + +
      +
      +
      + + +
      +
      +
      /#{REGEXP_START}(?:NaN|Infinity|undefined)#{REGEXP_END}/.freeze
      + +
      BASIC_IDENTIFIER_RULES = +
      +
      +

      Doesn't take in account utf8

      + + +
      +
      +
      + + +
      +
      +
      /#{REGEXP_START}[$_a-z][$_a-z\d]*#{REGEXP_END}/i.freeze
      + +
      RESERVED_FUNCTION_NAMES = +
      +
      +

      Defining a local function like Array may break everything

      + + +
      +
      +
      + + +
      +
      +
      /#{REGEXP_START}(?:Array)#{REGEXP_END}/.freeze
      + +
      + + + + + + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .valid_ivar_name?(name) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 39
      +
      +def self.valid_ivar_name?(name)
      +  !(PROTO_SPECIAL_PROPS =~ name || PROTO_SPECIAL_METHODS =~ name)
      +end
      +
      +
      + +
      +

      + + .valid_name?(name) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 31
      +
      +def self.valid_name?(name)
      +  BASIC_IDENTIFIER_RULES =~ name && !(
      +    ES51_RESERVED_WORD =~ name ||
      +    ES3_RESERVED_WORD_EXCLUSIVE =~ name ||
      +    IMMUTABLE_PROPS =~ name
      +  )
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #fix_ivar_name(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +47
      +48
      +49
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 47
      +
      +def fix_ivar_name(name)
      +  self.class.valid_ivar_name?(name.to_s[1..-1]) ? name : "#{name}$".to_sym
      +end
      +
      +
      + +
      +

      + + #fix_var_name(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +43
      +44
      +45
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 43
      +
      +def fix_var_name(name)
      +  self.class.valid_name?(name) ? name : "#{name}$".to_sym
      +end
      +
      +
      + +
      +

      + + #on_argument(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 104
      +
      +def on_argument(node)
      +  node = super(node)
      +  name, value = *node
      +  fixed_name = fix_var_name(name)
      +  new_children = value ? [fixed_name, value] : [fixed_name]
      +
      +  node.updated(nil, new_children, meta: { arg_name: name })
      +end
      +
      +
      + +
      +

      + + #on_ivar(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +74
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 70
      +
      +def on_ivar(node)
      +  name, _ = *node
      +  node = node.updated(nil, [fix_ivar_name(name)])
      +  super(node)
      +end
      +
      +
      + +
      +

      + + #on_ivasgn(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 76
      +
      +def on_ivasgn(node)
      +  name, value = *node
      +
      +  node =
      +    if value
      +      node.updated(nil, [fix_ivar_name(name), value])
      +    else
      +      node.updated(nil, [fix_ivar_name(name)])
      +    end
      +
      +  super(node)
      +end
      +
      +
      + +
      +

      + + #on_lvar(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +51
      +52
      +53
      +54
      +55
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 51
      +
      +def on_lvar(node)
      +  name, _ = *node
      +  node = node.updated(nil, [fix_var_name(name)])
      +  super(node)
      +end
      +
      +
      + +
      +

      + + #on_lvasgn(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 57
      +
      +def on_lvasgn(node)
      +  name, value = *node
      +
      +  node =
      +    if value
      +      node.updated(nil, [fix_var_name(name), value])
      +    else
      +      node.updated(nil, [fix_var_name(name)])
      +    end
      +
      +  super(node)
      +end
      +
      +
      + +
      +

      + + #on_restarg(node) ⇒ Object + + + + Also known as: + on_kwrestarg + + + + +

      +
      +

      Restarg and kwrestarg are special cases +because they may have no name +def m(, *); end

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +
      +
      # File 'opal/lib/opal/rewriters/js_reserved_words.rb', line 92
      +
      +def on_restarg(node)
      +  name, _ = *node
      +
      +  if name
      +    node = node.updated(nil, [fix_var_name(name)], meta: { arg_name: name })
      +  end
      +
      +  node
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment.html b/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment.html new file mode 100644 index 00000000..e6fdb6ff --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment.html @@ -0,0 +1,678 @@ + + + + + + + Class: Opal::Rewriters::LogicalOperatorAssignment + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::LogicalOperatorAssignment + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/logical_operator_assignment.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      ConditionalSendHandler, SendHandler

      +
      +

      Defined Under Namespace

      +

      + + + + + Classes: ConditionalSendHandler, SendHandler + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      GET_SET = + +
      +
      ->(get_type, set_type) {
      +  ->(lhs, rhs, root_type) {
      +    get_node = lhs.updated(get_type)              # lhs
      +    condition_node = s(root_type, get_node, rhs)  # lhs || rhs
      +
      +    if %i[const cvar].include?(get_type) && root_type == :or
      +      # defined?(lhs)
      +      defined_node = s(:defined?, get_node)
      +      # LHS = defined?(LHS) ? (LHS || rhs) : rhs
      +      condition_node = s(:if, defined_node, s(:begin, condition_node), rhs)
      +    end
      +
      +    lhs.updated(set_type, [*lhs, condition_node]) # lhs = lhs || rhs
      +  }
      +}
      + +
      LocalVariableHandler = +
      +
      +

      Takes lhs ||= rhs +Produces lhs = lhs || rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      InstanceVariableHandler = +
      +
      +

      Takes @lhs ||= rhs +Produces @lhs = @lhs || rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      ConstantHandler = +
      +
      +

      Takes LHS ||= rhs +Produces LHS = defined?(LHS) ? (LHS || rhs) : rhs

      + +

      Takes LHS &&= rhs +Produces LHS = LHS && rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      GlobalVariableHandler = +
      +
      +

      Takes $lhs ||= rhs +Produces $lhs = $lhs || rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      ClassVariableHandler = +
      +
      +

      Takes @@lhs ||= rhs +Produces @@lhs = defined?(@@lhs) ? (@@lhs || rhs) : rhs

      + +

      Takes @@lhs &&= rhs +Produces @@lhs = @@lhs && rhs

      + + +
      +
      +
      + + +
      +
      +
      + +
      HANDLERS = + +
      +
      {
      +  lvasgn: LocalVariableHandler,
      +  ivasgn: InstanceVariableHandler,
      +  casgn:  ConstantHandler,
      +  gvasgn: GlobalVariableHandler,
      +  cvasgn: ClassVariableHandler,
      +  send:   SendHandler,
      +  csend:  ConditionalSendHandler
      +}.freeze
      + +
      ASSIGNMENT_STRING_NODE = + +
      +
      s(:str, 'assignment')
      + +
      + + + + + + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .new_tempObject + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/rewriters/logical_operator_assignment.rb', line 12
      +
      +def self.new_temp
      +  @@counter ||= 0
      +  @@counter += 1
      +  :"$logical_op_recvr_tmp_#{@@counter}"
      +end
      +
      +
      + +
      +

      + + .reset_tmp_counter!Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/rewriters/logical_operator_assignment.rb', line 8
      +
      +def self.reset_tmp_counter!
      +  @@counter = 0
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #on_and_asgn(node) ⇒ Object + + + + + +

      +
      +

      lhs &&= rhs

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +
      +
      # File 'opal/lib/opal/rewriters/logical_operator_assignment.rb', line 140
      +
      +def on_and_asgn(node)
      +  lhs, rhs = *node
      +
      +  result = HANDLERS
      +           .fetch(lhs.type) { error "cannot handle LHS type: #{lhs.type}" }
      +           .call(lhs, rhs, :and)
      +
      +  process(result)
      +end
      +
      +
      + +
      +

      + + #on_defined?(node) ⇒ Boolean + + + + + +

      +
      +

      Rewrites any or_asgn and and_asgn node like + defined?(a ||= 1) +and + defined?(a &&= 1) +to a static "assignment" string node

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +157
      +158
      +159
      +160
      +161
      +162
      +163
      +164
      +
      +
      # File 'opal/lib/opal/rewriters/logical_operator_assignment.rb', line 157
      +
      +def on_defined?(node)
      +  inner, _ = *node
      +  if %i[or_asgn and_asgn].include?(inner.type)
      +    ASSIGNMENT_STRING_NODE
      +  else
      +    super(node)
      +  end
      +end
      +
      +
      + +
      +

      + + #on_or_asgn(node) ⇒ Object + + + + + +

      +
      +

      lhs ||= rhs

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +
      +
      # File 'opal/lib/opal/rewriters/logical_operator_assignment.rb', line 129
      +
      +def on_or_asgn(node)
      +  lhs, rhs = *node
      +
      +  result = HANDLERS
      +           .fetch(lhs.type) { error "cannot handle LHS type: #{lhs.type}" }
      +           .call(lhs, rhs, :or)
      +
      +  process(result)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/ConditionalSendHandler.html b/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/ConditionalSendHandler.html new file mode 100644 index 00000000..ef27b4b5 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/ConditionalSendHandler.html @@ -0,0 +1,289 @@ + + + + + + + Class: Opal::Rewriters::LogicalOperatorAssignment::ConditionalSendHandler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::LogicalOperatorAssignment::ConditionalSendHandler + + + +

      +
      + +
      +
      Inherits:
      +
      + Opal::Rewriters::LogicalOperatorAssignment + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/logical_operator_assignment.rb
      +
      + +
      + +

      Overview

      +
      +

      Takes recvr&.meth ||= rhs +Produces recvr.nil? ? nil : recvr.meth ||= rhs + NOTE: Later output of this handler gets post-processed by this rewriter again + using SendHandler to recvr.nil? ? nil : (recvr.meth || recvr.meth = rhs)

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Opal::Rewriters::LogicalOperatorAssignment

      +

      ASSIGNMENT_STRING_NODE, ClassVariableHandler, ConstantHandler, GET_SET, GlobalVariableHandler, HANDLERS, InstanceVariableHandler, LocalVariableHandler

      + + + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

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

      Methods inherited from Opal::Rewriters::LogicalOperatorAssignment

      +

      new_temp, #on_and_asgn, #on_defined?, #on_or_asgn, reset_tmp_counter!

      + + + + + + + + + +

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(lhs, rhs, root_type) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +
      +
      # File 'opal/lib/opal/rewriters/logical_operator_assignment.rb', line 94
      +
      +def self.call(lhs, rhs, root_type)
      +  root_type = :"#{root_type}_asgn"
      +
      +  recvr, meth, *args = *lhs
      +
      +  recvr_tmp = new_temp
      +  cache_recvr = s(:lvasgn, recvr_tmp, recvr) # $tmp = recvr
      +  recvr = s(:js_tmp, recvr_tmp)
      +
      +  recvr_is_nil = s(:send, recvr, :nil?)                 # recvr.nil?
      +  plain_send = lhs.updated(:send, [recvr, meth, *args]) # recvr.meth
      +  plain_or_asgn = s(root_type, plain_send, rhs)         # recvr.meth ||= rhs
      +
      +  s(:begin,
      +    cache_recvr,
      +    s(:if, recvr_is_nil,                          # if recvr.nil?
      +      s(:nil),                                    #   nil
      +                                                  # else
      +      plain_or_asgn                               #   recvr.meth ||= rhs
      +    ),
      +  )                                               # end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/SendHandler.html b/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/SendHandler.html new file mode 100644 index 00000000..20e4027d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/LogicalOperatorAssignment/SendHandler.html @@ -0,0 +1,290 @@ + + + + + + + Class: Opal::Rewriters::LogicalOperatorAssignment::SendHandler + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::LogicalOperatorAssignment::SendHandler + + + +

      +
      + +
      +
      Inherits:
      +
      + Opal::Rewriters::LogicalOperatorAssignment + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/logical_operator_assignment.rb
      +
      + +
      + +

      Overview

      +
      +

      Takes recvr.meth ||= rhs +Produces recvr.meth || recvr.meth = rhs +(lhs is a recvr.meth)

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Opal::Rewriters::LogicalOperatorAssignment

      +

      ASSIGNMENT_STRING_NODE, ClassVariableHandler, ConstantHandler, GET_SET, GlobalVariableHandler, HANDLERS, InstanceVariableHandler, LocalVariableHandler

      + + + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

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

      Methods inherited from Opal::Rewriters::LogicalOperatorAssignment

      +

      new_temp, #on_and_asgn, #on_defined?, #on_or_asgn, reset_tmp_counter!

      + + + + + + + + + +

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Class Method Details

      + + +
      +

      + + .call(lhs, rhs, root_type) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +
      +
      # File 'opal/lib/opal/rewriters/logical_operator_assignment.rb', line 64
      +
      +def self.call(lhs, rhs, root_type)
      +  recvr, reader_method, *args = *lhs
      +
      +  # If recvr is a complex expression it must be cached.
      +  # MRI calls recvr in `recvr.meth ||= rhs` only once.
      +  if recvr && recvr.type == :send
      +    recvr_tmp = new_temp
      +    cache_recvr = s(:lvasgn, recvr_tmp, recvr)                         # $tmp = recvr
      +    recvr = s(:js_tmp, recvr_tmp)
      +  end
      +
      +  writer_method = :"#{reader_method}="
      +
      +  call_reader = lhs.updated(:send, [recvr, reader_method, *args])      # $tmp.meth
      +  call_writer = lhs.updated(:send, [recvr, writer_method, *args, rhs]) # $tmp.meth = rhs
      +  get_or_set = s(root_type, call_reader, call_writer)
      +
      +  if cache_recvr
      +    s(:begin, cache_recvr, get_or_set)
      +  else
      +    get_or_set
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs.html b/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs.html new file mode 100644 index 00000000..687dda4c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs.html @@ -0,0 +1,421 @@ + + + + + + + Class: Opal::Rewriters::MlhsArgs + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::MlhsArgs + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/mlhs_args.rb
      +
      + +
      + +

      Overview

      +
      +

      Rewrites

      + +

      def m( (a, b), (c, d) ) + body +end

      + +

      To

      + +

      def m($mlhs_tmp1, $mlhs_tmp2) + (a, b) = $mlhs_tmp1 + (c, d) = $mlhs_tmp2 + body +end

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Arguments, MlhsRewriter + + +

      + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_def(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 22
      +
      +def on_def(node)
      +  node = super(node)
      +  mid, args, body = *node
      +
      +  arguments = Arguments.new(args)
      +
      +  args = args.updated(nil, arguments.rewritten)
      +  if arguments.initialization
      +    body ||= s(:nil) # prevent returning mlhs assignment
      +    body = prepend_to_body(body, arguments.initialization)
      +  end
      +
      +  node.updated(nil, [mid, args, body])
      +end
      +
      +
      + +
      +

      + + #on_defs(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 37
      +
      +def on_defs(node)
      +  node = super(node)
      +  recv, mid, args, body = *node
      +
      +  arguments = Arguments.new(args)
      +
      +  args = args.updated(nil, arguments.rewritten)
      +  if arguments.initialization
      +    body ||= s(:nil) # prevent returning mlhs assignment
      +    body = prepend_to_body(body, arguments.initialization)
      +  end
      +
      +  node.updated(nil, [recv, mid, args, body])
      +end
      +
      +
      + +
      +

      + + #on_iter(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 52
      +
      +def on_iter(node)
      +  node = super(node)
      +  args, body = *node
      +
      +  arguments = Arguments.new(args)
      +
      +  args = args.updated(nil, arguments.rewritten)
      +  if arguments.initialization
      +    body ||= s(:nil) # prevent returning mlhs assignment
      +    body = prepend_to_body(body, arguments.initialization)
      +  end
      +
      +  node.updated(nil, [args, body])
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/Arguments.html b/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/Arguments.html new file mode 100644 index 00000000..4918c2de --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/Arguments.html @@ -0,0 +1,592 @@ + + + + + + + Class: Opal::Rewriters::MlhsArgs::Arguments + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::MlhsArgs::Arguments + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/mlhs_args.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #initialization ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute initialization.

        +
        + +
      • + + +
      • + + + #rewritten ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute rewritten.

        +
        + +
      • + + +
      + + + + + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(args) ⇒ Arguments + + + + + +

      +
      +

      Returns a new instance of Arguments.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 70
      +
      +def initialize(args)
      +  @args = args
      +  @rewritten = []
      +  @initialization = []
      +  @rewriter = MlhsRewriter.new
      +
      +  split!
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #initializationObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute initialization.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 68
      +
      +def initialization
      +  @initialization
      +end
      +
      +
      + + + +
      +

      + + #rewrittenObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute rewritten.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 68
      +
      +def rewritten
      +  @rewritten
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #new_mlhs_tmpObject + + + + + +

      + + + + +
      +
      +
      +
      +83
      +84
      +85
      +86
      +87
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 83
      +
      +def new_mlhs_tmp
      +  @counter ||= 0
      +  @counter += 1
      +  :"$mlhs_tmp#{@counter}"
      +end
      +
      +
      + +
      +

      + + #reset_tmp_counter!Object + + + + + +

      + + + + +
      +
      +
      +
      +79
      +80
      +81
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 79
      +
      +def reset_tmp_counter!
      +  @counter = 0
      +end
      +
      +
      + +
      +

      + + #split!Object + + + + + +

      + + + + +
      +
      +
      +
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 89
      +
      +def split!
      +  @args.children.each do |arg|
      +    if arg.type == :mlhs
      +      var_name = new_mlhs_tmp
      +      rhs = s(:lvar, var_name)
      +      mlhs = @rewriter.process(arg)
      +      @initialization << s(:masgn, mlhs, rhs)
      +      @rewritten << s(:arg, var_name).updated(nil, nil, meta: { arg_name: var_name })
      +    else
      +      @rewritten << arg
      +    end
      +  end
      +
      +  if @initialization.length == 1
      +    @initialization = @initialization[0]
      +  elsif @initialization.empty?
      +    @initialization = nil
      +  else
      +    @initialization = s(:begin, *@initialization)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/MlhsRewriter.html b/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/MlhsRewriter.html new file mode 100644 index 00000000..d8f11d5c --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/MlhsArgs/MlhsRewriter.html @@ -0,0 +1,281 @@ + + + + + + + Class: Opal::Rewriters::MlhsArgs::MlhsRewriter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::MlhsArgs::MlhsRewriter + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/mlhs_args.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_arg(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +113
      +114
      +115
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 113
      +
      +def on_arg(node)
      +  node.updated(:lvasgn)
      +end
      +
      +
      + +
      +

      + + #on_restarg(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +
      +
      # File 'opal/lib/opal/rewriters/mlhs_args.rb', line 117
      +
      +def on_restarg(node)
      +  name = node.children[0]
      +  if name
      +    s(:splat, node.updated(:lvasgn))
      +  else
      +    s(:splat)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/Numblocks.html b/docs/api/v1.8.2/lib/Opal/Rewriters/Numblocks.html new file mode 100644 index 00000000..cc4af4e9 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/Numblocks.html @@ -0,0 +1,303 @@ + + + + + + + Class: Opal::Rewriters::Numblocks + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::Numblocks + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/numblocks.rb
      +
      + +
      + +

      Overview

      +
      +

      This rewriter transforms the Ruby 2.7 numblocks to regular blocks:

      + +

      proc { _1 } + v +proc { |_1| _1 }

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #gen_args(arg_count) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/rewriters/numblocks.rb', line 24
      +
      +def gen_args(arg_count)
      +  (1..arg_count).map do |i|
      +    s(:arg, :"_#{i}")
      +  end
      +end
      +
      +
      + +
      +

      + + #on_numblock(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/rewriters/numblocks.rb', line 13
      +
      +def on_numblock(node)
      +  left, arg_count, right = node.children
      +
      +  s(
      +    :block,
      +    left,
      +    s(:args, *gen_args(arg_count)),
      +    right
      +  )
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/OpalEngineCheck.html b/docs/api/v1.8.2/lib/Opal/Rewriters/OpalEngineCheck.html new file mode 100644 index 00000000..decc67ef --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/OpalEngineCheck.html @@ -0,0 +1,422 @@ + + + + + + + Class: Opal::Rewriters::OpalEngineCheck + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::OpalEngineCheck + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/opal_engine_check.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      RUBY_ENGINE_CHECK = + +
      +
      s(:send, s(:const, nil, :RUBY_ENGINE),
      +  :==, s(:str, 'opal')
      +)
      + +
      RUBY_ENGINE_CHECK_NOT = + +
      +
      s(:send, s(:const, nil, :RUBY_ENGINE),
      +  :!=, s(:str, 'opal')
      +)
      + +
      RUBY_PLATFORM_CHECK = + +
      +
      s(:send, s(:const, nil, :RUBY_PLATFORM),
      +  :==, s(:str, 'opal')
      +)
      + +
      RUBY_PLATFORM_CHECK_NOT = + +
      +
      s(:send, s(:const, nil, :RUBY_PLATFORM),
      +  :!=, s(:str, 'opal')
      +)
      + +
      + + + + + + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_if(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +
      +
      # File 'opal/lib/opal/rewriters/opal_engine_check.rb', line 8
      +
      +def on_if(node)
      +  test, true_body, false_body = *node.children
      +
      +  if skip_check_present?(test)
      +    process(true_body || s(:nil))
      +  elsif skip_check_present_not?(test)
      +    process(false_body || s(:nil))
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #skip_check_present?(test) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/rewriters/opal_engine_check.rb', line 20
      +
      +def skip_check_present?(test)
      +  test == RUBY_ENGINE_CHECK || test == RUBY_PLATFORM_CHECK
      +end
      +
      +
      + +
      +

      + + #skip_check_present_not?(test) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +
      +
      # File 'opal/lib/opal/rewriters/opal_engine_check.rb', line 24
      +
      +def skip_check_present_not?(test)
      +  test == RUBY_ENGINE_CHECK_NOT || test == RUBY_PLATFORM_CHECK_NOT
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching.html b/docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching.html new file mode 100644 index 00000000..e8547f5d --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching.html @@ -0,0 +1,497 @@ + + + + + + + Class: Opal::Rewriters::PatternMatching + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::PatternMatching + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/pattern_matching.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: PatternConverter + + +

      + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initializePatternMatching + + + + + +

      +
      +

      Returns a new instance of PatternMatching.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 8
      +
      +def initialize
      +  @depth = 0
      +  super
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_case_match(node) ⇒ Object + + + + + +

      +
      +

      case a; in b; end

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 39
      +
      +def on_case_match(node)
      +  @depth += 1
      +
      +  cmvar = :"$cmvar#{@depth}"
      +
      +  from, *cases, els = *node
      +
      +  if els
      +    process els
      +  else
      +    els = raise_no_matching_pattern_error(cmvar)
      +  end
      +
      +  s(:begin,
      +    s(:lvasgn, cmvar, from),
      +    single_case_match(cmvar, *cases, els)
      +  )
      +end
      +
      +
      + +
      +

      + + #on_match_pattern(node) ⇒ Object + + + + + +

      +
      +

      a => b

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 14
      +
      +def on_match_pattern(node)
      +  from, pat = *node
      +
      +  s(:begin,
      +    s(:lvasgn, :"$pmvar", from),
      +    s(:if,
      +      convert_full_pattern(from, pat),
      +      nil,
      +      raise_no_matching_pattern_error(:"$pmvar")
      +    )
      +  )
      +end
      +
      +
      + +
      +

      + + #on_match_pattern_p(node) ⇒ Object + + + + + +

      +
      +

      a in b

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 28
      +
      +def on_match_pattern_p(node)
      +  from, pat = *node
      +
      +  s(:if,
      +    convert_full_pattern(from, pat),
      +    s(:true),
      +    s(:false)
      +  )
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching/PatternConverter.html b/docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching/PatternConverter.html new file mode 100644 index 00000000..5bb77fc8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/PatternMatching/PatternConverter.html @@ -0,0 +1,1200 @@ + + + + + + + Class: Opal::Rewriters::PatternMatching::PatternConverter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::PatternMatching::PatternConverter + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/pattern_matching.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(pat) ⇒ PatternConverter + + + + + +

      +
      +

      Returns a new instance of PatternConverter.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +118
      +119
      +120
      +121
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 118
      +
      +def initialize(pat)
      +  @pat = pat
      +  @variables = []
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_array_pattern(node, tail = false) ⇒ Object + + + + + +

      +
      +

      [0, 1, 2] or [*, 0, 1] or [0, 1, *]

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +197
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +211
      +212
      +213
      +214
      +215
      +216
      +217
      +218
      +219
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 197
      +
      +def on_array_pattern(node, tail = false)
      +  children = *node
      +  children << s(:match_rest) if tail
      +
      +  fixed_size = true
      +  array_size = 0
      +
      +  children = children.each do |i|
      +    case i.type
      +    when :match_rest
      +      fixed_size = false
      +    else
      +      array_size += 1
      +    end
      +  end
      +
      +  array(
      +    s(:sym, :array),
      +    to_ast(fixed_size),
      +    to_ast(array_size),
      +    to_ast(children.map(&method(:process)))
      +  )
      +end
      +
      +
      + +
      +

      + + #on_array_pattern_with_tail(node) ⇒ Object + + + + + +

      +
      +

      [0, 1, 2,]

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +222
      +223
      +224
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 222
      +
      +def on_array_pattern_with_tail(node)
      +  on_array_pattern(node, true)
      +end
      +
      +
      + +
      +

      + + #on_const_pattern(node) ⇒ Object + + + + + +

      +
      +

      MyStructName

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +192
      +193
      +194
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 192
      +
      +def on_const_pattern(node)
      +  array(s(:sym, :all), *node.children.map(&method(:process)))
      +end
      +
      +
      + +
      +

      + + #on_find_pattern(node) ⇒ Object + + + + + +

      +
      +

      [*, a, b, *]

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +256
      +257
      +258
      +259
      +260
      +261
      +262
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 256
      +
      +def on_find_pattern(node)
      +  children = *node
      +
      +  children = children.map(&method(:process))
      +
      +  array(s(:sym, :find), array(*children))
      +end
      +
      +
      + +
      +

      + + #on_hash_pattern(node) ⇒ Object + + + + + +

      +
      +

      b:

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 227
      +
      +def on_hash_pattern(node)
      +  children = *node
      +
      +  any_size = children.empty? ? to_ast(false) : to_ast(true)
      +
      +  children = children.map do |i|
      +    case i.type
      +    when :pair
      +      array(i.children[0], process(i.children[1]))
      +    when :match_var
      +      array(s(:sym, i.children[0]), process(i))
      +    when :match_nil_pattern
      +      any_size = to_ast(false)
      +      nil
      +    when :match_rest
      +      # Capturing rest?
      +      if i.children.first
      +        any_size = process(i.children.first)
      +      else
      +        any_size = to_ast(true)
      +      end
      +      nil
      +    end
      +  end.compact
      +
      +  array(s(:sym, :hash), any_size, array(*children))
      +end
      +
      +
      + +
      +

      + + #on_literal(node) ⇒ Object + + + + Also known as: + on_int, on_float, on_complex, on_rational, on_array, on_str, on_dstr, on_xstr, on_sym, on_irange, on_erange, on_const, on_regexp, on_lambda, on_begin + + + + +

      + + + + +
      +
      +
      +
      +152
      +153
      +154
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 152
      +
      +def on_literal(node)
      +  array(s(:sym, :lit), node)
      +end
      +
      +
      + +
      +

      + + #on_match_alt(node) ⇒ Object + + + + + +

      +
      +

      {} | []

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +187
      +188
      +189
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 187
      +
      +def on_match_alt(node)
      +  array(s(:sym, :any), *node.children.map(&method(:process)))
      +end
      +
      +
      + +
      +

      + + #on_match_as(node) ⇒ Object + + + + + +

      +
      +

      [...] => a

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +145
      +146
      +147
      +148
      +149
      +150
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 145
      +
      +def on_match_as(node)
      +  pat, save = *node
      +
      +  process(save)
      +  array(s(:sym, :save), process(pat))
      +end
      +
      +
      + +
      +

      + + #on_match_rest(node) ⇒ Object + + + + + +

      +
      +

      *

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +178
      +179
      +180
      +181
      +182
      +183
      +184
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 178
      +
      +def on_match_rest(node)
      +  if node.children.empty?
      +    array(s(:sym, :rest))
      +  else
      +    array(s(:sym, :rest), process(node.children.first))
      +  end
      +end
      +
      +
      + +
      +

      + + #on_match_var(node) ⇒ Object + + + + + +

      +
      +

      a

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 136
      +
      +def on_match_var(node)
      +  var, = *node
      +
      +  @variables << var
      +
      +  s(:sym, :var)
      +end
      +
      +
      + +
      +

      + + #on_pin(node) ⇒ Object + + + + + +

      +
      +

      ^a

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +173
      +174
      +175
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 173
      +
      +def on_pin(node)
      +  on_literal(node.children.first)
      +end
      +
      +
      + +
      +

      + + #patternObject + + + + + +

      + + + + +
      +
      +
      +
      +127
      +128
      +129
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 127
      +
      +def pattern
      +  @outpat
      +end
      +
      +
      + +
      +

      + + #run!Object + + + + + +

      + + + + +
      +
      +
      +
      +123
      +124
      +125
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 123
      +
      +def run!
      +  @outpat = process(@pat)
      +end
      +
      +
      + +
      +

      + + #variablesObject + + + + + +

      + + + + +
      +
      +
      +
      +131
      +132
      +133
      +
      +
      # File 'opal/lib/opal/rewriters/pattern_matching.rb', line 131
      +
      +def variables
      +  @variables.map { |i| s(:lvasgn, i) }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/ReturnableLogic.html b/docs/api/v1.8.2/lib/Opal/Rewriters/ReturnableLogic.html new file mode 100644 index 00000000..1a5a9289 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/ReturnableLogic.html @@ -0,0 +1,707 @@ + + + + + + + Class: Opal::Rewriters::ReturnableLogic + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::ReturnableLogic + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/returnable_logic.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #free_tmpObject + + + + + +

      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 14
      +
      +def free_tmp
      +  @counter -= 1
      +end
      +
      +
      + +
      +

      + + #next_tmpObject + + + + + +

      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +11
      +12
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 8
      +
      +def next_tmp
      +  @counter ||= 0
      +  @counter += 1
      +  "$ret_or_#{@counter}"
      +end
      +
      +
      + +
      +

      + + #on_and(node) ⇒ Object + + + + + +

      +
      +

      a && b / a and b

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 63
      +
      +def on_and(node)
      +  lhs, rhs = *node.children
      +
      +  check_control_flow!(lhs)
      +
      +  if node.meta[:if_test]
      +    lhs.meta[:if_test] = rhs.meta[:if_test] = true
      +    out = process(node.updated(:if, [lhs, rhs, s(:false)]))
      +  else
      +    lhs_tmp = next_tmp
      +    out = process(node.updated(:if, [s(:lvasgn, lhs_tmp, lhs), rhs, s(:js_tmp, lhs_tmp)]))
      +    free_tmp
      +  end
      +  out
      +end
      +
      +
      + +
      +

      + + #on_begin(node) ⇒ Object + + + + + +

      +
      +

      Parser sometimes generates parentheses as a begin node. If it's a single node begin value, then +let's forward the if_test metadata.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 81
      +
      +def on_begin(node)
      +  if node.meta[:if_test] && node.children.count == 1
      +    node.children.first.meta[:if_test] = true
      +  end
      +  node.meta.delete(:if_test)
      +  super
      +end
      +
      +
      + +
      +

      + + #on_case(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 33
      +
      +def on_case(node)
      +  lhs, *whens, els = *node.children
      +  els ||= s(:nil)
      +  lhs_tmp = next_tmp if lhs
      +
      +  out = build_if_from_when(node, lhs, lhs_tmp, whens, els)
      +  free_tmp if lhs
      +  out
      +end
      +
      +
      + +
      +

      + + #on_if(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 22
      +
      +def on_if(node)
      +  test, = *node.children
      +
      +  check_control_flow!(test)
      +
      +  # The if_test metadata signifies that we don't care about the return value except if it's
      +  # truthy or falsy. And those tests will be carried out by the respective $truthy helper calls.
      +  test.meta[:if_test] = true if test
      +  super
      +end
      +
      +
      + +
      +

      + + #on_or(node) ⇒ Object + + + + + +

      +
      +

      a || b / a or b

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 44
      +
      +def on_or(node)
      +  lhs, rhs = *node.children
      +
      +  check_control_flow!(lhs)
      +
      +  if node.meta[:if_test]
      +    # Let's forward the if_test to the lhs and rhs - since we don't care about the exact return
      +    # value of our or, we neither do care about a return value of our lhs or rhs.
      +    lhs.meta[:if_test] = rhs.meta[:if_test] = true
      +    out = process(node.updated(:if, [lhs, s(:true), rhs]))
      +  else
      +    lhs_tmp = next_tmp
      +    out = process(node.updated(:if, [s(:lvasgn, lhs_tmp, lhs), s(:js_tmp, lhs_tmp), rhs]))
      +    free_tmp
      +  end
      +  out
      +end
      +
      +
      + +
      +

      + + #reset_tmp_counter!Object + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +
      +
      # File 'opal/lib/opal/rewriters/returnable_logic.rb', line 18
      +
      +def reset_tmp_counter!
      +  @counter = nil
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/TargetedPatches.html b/docs/api/v1.8.2/lib/Opal/Rewriters/TargetedPatches.html new file mode 100644 index 00000000..20d8d688 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/TargetedPatches.html @@ -0,0 +1,429 @@ + + + + + + + Class: Opal::Rewriters::TargetedPatches + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::TargetedPatches + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/targeted_patches.rb
      +
      + +
      + +

      Overview

      +
      +

      This module attempts to run some optimizations or compatibility +improvements against some libraries used with Opal.

      + +

      This should be a last resort and must not break functionality in +existing applications.

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_array(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +
      +
      # File 'opal/lib/opal/rewriters/targeted_patches.rb', line 49
      +
      +def on_array(node)
      +  children = node.children
      +
      +  # Optimize large arrays produced by lexer, but mainly we are interested
      +  # in improving compile times, by reducing the tree for the further
      +  # compilation efforts (also reducing the bundle size a bit)
      +  #
      +  # This particular patch reduces compile time of the following command
      +  # by 12.5%:
      +  #
      +  #     OPAL_CACHE_DISABLE=true OPAL_PREFORK_DISABLE=true bin/opal \
      +  #         --no-source-map -ropal-parser -ropal/platform -ce \
      +  #         'puts ::Opal.compile($stdin.read)' > _Cnow.js
      +  #
      +  # So, in short, an array of a kind:
      +  #
      +  #     [1, 2, 3, nil, nil, :something, :abc, nil, ...]
      +  #
      +  # Becomes compiled to:
      +  #
      +  #     Opal.large_array_unpack("1,2,3,,something,abc,,...")
      +
      +  if children.length > 32
      +    ssin_array = children.all? do |child|
      +      # Break for wrong types
      +      next false unless %i[str sym int nil].include?(child.type)
      +      # Break for strings that may conflict with our numbers, nils and separator
      +      next false if %i[str sym].include?(child.type) && child.children.first.to_s =~ /\A[0-9-]|\A\z|,/
      +      # Break for too numbers out of range, as there may be decoding issues
      +      next false if child.type == :int && !(-1_000_000..1_000_000).cover?(child.children.first)
      +      true
      +    end
      +
      +    if ssin_array
      +      str = children.map { |i| i.children.first.to_s }.join(',')
      +      node.updated(:jscall, [s(:js_tmp, :Opal), :large_array_unpack, s(:sym, str)])
      +    else
      +      super
      +    end
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #on_def(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/rewriters/targeted_patches.rb', line 13
      +
      +def on_def(node)
      +  name, args, body = *node
      +
      +  if body && body.type == :begin && body.children.length >= 2
      +    # parser/rubyxx.rb - racc generated code often looks like:
      +    #
      +    #     def _reduce_219(val, _values, result)
      +    #       result = @builder.op_assign(val[0], val[1], val[2])
      +    #       result
      +    #     end
      +    #
      +    # This converter transform this into just
      +    #
      +    #     def _reduce_219(val, _values, result)
      +    #       @builder.op_assign(val[0], val[1], val[2])
      +    #     end
      +
      +    calls = body.children
      +    assignment, ret = calls.last(2)
      +    if assignment.type == :lvasgn && ret.type == :lvar &&
      +       assignment.children.first == ret.children.first
      +
      +      if calls.length == 2
      +        node.updated(nil, [name, args, assignment.children[1]])
      +      else
      +        calls = calls[0..-3] << assignment.children[1]
      +        node.updated(nil, [name, args, body.updated(nil, calls)])
      +      end
      +    else
      +      super
      +    end
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rewriters/ThrowerFinder.html b/docs/api/v1.8.2/lib/Opal/Rewriters/ThrowerFinder.html new file mode 100644 index 00000000..564ad456 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rewriters/ThrowerFinder.html @@ -0,0 +1,961 @@ + + + + + + + Class: Opal::Rewriters::ThrowerFinder + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rewriters::ThrowerFinder + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/thrower_finder.rb
      +
      + +
      + +

      Overview

      +
      +

      ThrowerFinder attempts to track the presence of throwers, like +break, redo, so we can make an informed guess in the early +compilation phase before traversing other nodes whether we +want to track a closure. Tracking a closure is often a deoptimizing +step, so we want to get that knowledge earlier.

      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Base

      +

      Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Base

      +

      #current_node

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initializeThrowerFinder + + + + + +

      +
      +

      Returns a new instance of ThrowerFinder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 12
      +
      +def initialize
      +  @break_stack = []
      +  @redo_stack = []
      +  @retry_stack = []
      +  @rescue_else_stack = []
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #on_break(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 19
      +
      +def on_break(node)
      +  tracking(:break, @break_stack)
      +  super
      +end
      +
      +
      + +
      +

      + + #on_defined(node) ⇒ Object + + + + + +

      +
      +

      ignore throwers inside defined

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 49
      +
      +def on_defined(node)
      +  pushing(
      +    [@redo_stack, nil],
      +    [@break_stack, nil],
      +    [@retry_stack, nil]
      +  ) { super }
      +end
      +
      +
      + +
      +

      + + #on_ensure(node) ⇒ Object + + + + + +

      +
      +

      In Opal we handle rescue-else either in ensure or in +rescue. If ensure is present, we handle it in ensure. +Otherwise we handle it in rescue. ensure is always +above a rescue. This logic is about tracking if a given +ensure node should expect a rescue-else inside a +rescue node.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +63
      +64
      +65
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 63
      +
      +def on_ensure(node)
      +  pushing([@rescue_else_stack, node]) { super }
      +end
      +
      +
      + +
      +

      + + #on_for(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +42
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 42
      +
      +def on_for(node);        on_loop(node) { super }; end
      +
      +
      + +
      +

      + + #on_iter(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 34
      +
      +def on_iter(node)
      +  pushing([@break_stack, node]) { super }
      +end
      +
      +
      + +
      +

      + + #on_loop(node, &block) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 38
      +
      +def on_loop(node, &block)
      +  pushing([@redo_stack, node], [@break_stack, nil], &block)
      +end
      +
      +
      + +
      +

      + + #on_redo(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 24
      +
      +def on_redo(node)
      +  tracking(:redo, @redo_stack)
      +  super
      +end
      +
      +
      + +
      +

      + + #on_rescue(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 67
      +
      +def on_rescue(node)
      +  if node.children[1..-1].detect { |sexp| sexp && sexp.type != :resbody }
      +    tracking(:rescue_else, @rescue_else_stack)
      +  end
      +
      +  pushing([@rescue_else_stack, nil], [@retry_stack, node]) { super }
      +end
      +
      +
      + +
      +

      + + #on_retry(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 29
      +
      +def on_retry(node)
      +  tracking(:retry, @retry_stack)
      +  super
      +end
      +
      +
      + +
      +

      + + #on_until(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +45
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 45
      +
      +def on_until(node);      on_loop(node) { super }; end
      +
      +
      + +
      +

      + + #on_until_post(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +46
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 46
      +
      +def on_until_post(node); on_loop(node) { super }; end
      +
      +
      + +
      +

      + + #on_while(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +43
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 43
      +
      +def on_while(node);      on_loop(node) { super }; end
      +
      +
      + +
      +

      + + #on_while_post(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +44
      +
      +
      # File 'opal/lib/opal/rewriters/thrower_finder.rb', line 44
      +
      +def on_while_post(node); on_loop(node) { super }; end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/RewritingError.html b/docs/api/v1.8.2/lib/Opal/RewritingError.html new file mode 100644 index 00000000..4aaa6df8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/RewritingError.html @@ -0,0 +1,155 @@ + + + + + + + Exception: Opal::RewritingError + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::RewritingError + + + +

      +
      + +
      +
      Inherits:
      +
      + ParsingError + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/errors.rb
      +
      + +
      + + + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from CompilationError

      +

      #location

      + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rubyspec.html b/docs/api/v1.8.2/lib/Opal/Rubyspec.html new file mode 100644 index 00000000..54cea5fe --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rubyspec.html @@ -0,0 +1,117 @@ + + + + + + + Module: Opal::Rubyspec + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Rubyspec + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: FiltersRewriter + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Rubyspec/FiltersRewriter.html b/docs/api/v1.8.2/lib/Opal/Rubyspec/FiltersRewriter.html new file mode 100644 index 00000000..af1c14c8 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Rubyspec/FiltersRewriter.html @@ -0,0 +1,874 @@ + + + + + + + Class: Opal::Rubyspec::FiltersRewriter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::Rubyspec::FiltersRewriter + + + +

      +
      + +
      +
      Inherits:
      +
      + Opal::Rewriters::Base + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      RUBYSPEC_DSL = + +
      +
      %i[describe it context].freeze
      + +
      + + + + + + +

      Constants inherited + from Opal::Rewriters::Base

      +

      Opal::Rewriters::Base::DUMMY_LOCATION

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Opal::Rewriters::Base

      +

      #current_node

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

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

      Methods inherited from Opal::Rewriters::Base

      +

      #append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

      + +
      +

      Constructor Details

      + +
      +

      + + #initializeFiltersRewriter + + + + + +

      +
      +

      Returns a new instance of FiltersRewriter.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 29
      +
      +def initialize
      +  @specs_stack = []
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .clear_filters!Object + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 24
      +
      +def clear_filters!
      +  @filters = []
      +end
      +
      +
      + +
      +

      + + .filter(spec_name) ⇒ Object + + + + Also known as: + fails, fails_badly + + + + +

      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 13
      +
      +def filter(spec_name)
      +  filters << spec_name
      +end
      +
      +
      + +
      +

      + + .filtered?(spec_name) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 20
      +
      +def filtered?(spec_name)
      +  filters.include?(spec_name)
      +end
      +
      +
      + +
      +

      + + .filtersObject + + + + + +

      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 9
      +
      +def filters
      +  @filters ||= []
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #current_spec_nameObject + + + + + +

      + + + + +
      +
      +
      +
      +72
      +73
      +74
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 72
      +
      +def current_spec_name
      +  @specs_stack.join(' ')
      +end
      +
      +
      + +
      +

      + + #fixture(file, *args) ⇒ Object + + + + + +

      +
      +

      Adapted from: spec/mspec/lib/mspec/helpers/fixture.rb

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +77
      +78
      +79
      +80
      +81
      +82
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 77
      +
      +def fixture(file, *args)
      +  path = File.dirname(file)
      +  path = path[0..-7] if path[-7..-1] == '/shared'
      +  fixtures = path[-9..-1] == '/fixtures' ? '' : 'fixtures'
      +  File.join(path, fixtures, args)
      +end
      +
      +
      + +
      +

      + + #on_send(node) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +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
      +62
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 35
      +
      +def on_send(node)
      +  _recvr, method_name, *args = *node
      +
      +  if rubyspec_dsl?(method_name)
      +    dynamic!
      +    spec_name, _ = *args.first
      +    begin
      +      @specs_stack.push(spec_name)
      +      if skip?
      +        s(:nil)
      +      else
      +        super
      +      end
      +    ensure
      +      @specs_stack.pop
      +    end
      +  elsif method_name == :fixture
      +    # We want to expand the fixture paths before autoload happens.
      +    if args.all? { |i| i.type == :str }
      +      as = args.map { |i| i.children.first }
      +      s(:str, fixture(*as))
      +    else
      +      super
      +    end
      +  else
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #rubyspec_dsl?(method_name) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 68
      +
      +def rubyspec_dsl?(method_name)
      +  RUBYSPEC_DSL.include?(method_name)
      +end
      +
      +
      + +
      +

      + + #skip?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +64
      +65
      +66
      +
      +
      # File 'opal/lib/opal/rewriters/rubyspec/filters_rewriter.rb', line 64
      +
      +def skip?
      +  self.class.filtered?(current_spec_name)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/SimpleServer.html b/docs/api/v1.8.2/lib/Opal/SimpleServer.html new file mode 100644 index 00000000..b47cfd40 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/SimpleServer.html @@ -0,0 +1,948 @@ + + + + + + + Class: Opal::SimpleServer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::SimpleServer + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/simple_server.rb
      +
      + +
      + +

      Overview

      +
      +

      Opal::SimpleServer is a very basic Rack server for Opal assets, it relies on +Opal::Builder and Ruby corelib/stdlib. It's meant to be used just for local +development.

      + +

      For a more complete implementation see opal-sprockets (Rubygems) or +opal-webpack (NPM).

      + + +
      +
      +
      + +
      +

      Examples:

      + + +

      (CLI)

      +

      + +
      rackup -ropal -ropal/simple_server -b 'Opal.append_path("app"); run Opal::SimpleServer.new'
      +... or use the Server runner ...
      +opal -Rserver app.rb
      + +
      + + +
      +

      Direct Known Subclasses

      +

      CliRunners::Server::App

      +
      + + +

      + Constant Summary + collapse +

      + +
      + +
      NotFound = + +
      +
      Class.new(StandardError)
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #index_path ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute index_path.

        +
        + +
      • + + +
      • + + + #main ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute main.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(options = {}) {|_self| ... } ⇒ SimpleServer + + + + + +

      +
      +

      Returns a new instance of SimpleServer.

      + + +
      +
      +
      + +

      Yields:

      +
        + +
      • + + + (_self) + + + +
      • + +
      +

      Yield Parameters:

      +
        + +
      • + + _self + + + (Opal::SimpleServer) + + + + — +

        the object that the method was called on

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 22
      +
      +def initialize(options = {})
      +  @prefix = options.fetch(:prefix, 'assets')
      +  @main = options.fetch(:main, 'application')
      +  @index_path = nil
      +  yield self if block_given?
      +  freeze
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #index_pathObject + + + + + +

      +
      +

      Returns the value of attribute index_path.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 30
      +
      +def index_path
      +  @index_path
      +end
      +
      +
      + + + +
      +

      + + #mainObject + + + + + +

      +
      +

      Returns the value of attribute main.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 30
      +
      +def main
      +  @main
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #append_path(path) ⇒ Object + + + + + +

      +
      +
      Deprecated.
      +

      It's here for compatibility with Opal::Sprockets::Server

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +37
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 34
      +
      +def append_path(path)
      +  Opal.deprecation "`#{self.class}#append_path` is deprecated, please use `Opal.append_path(path)` instead (called from: #{caller(1, 1).first})"
      +  Opal.append_path path
      +end
      +
      +
      + +
      +

      + + #builder(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +59
      +60
      +61
      +62
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 59
      +
      +def builder(path)
      +  builder = Opal::Builder.new
      +  builder.build(path.gsub(/(\.(?:rb|js|opal))*\z/, ''))
      +end
      +
      +
      + +
      +

      + + #cache_invalidatorObject + + + + + +

      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 81
      +
      +def cache_invalidator
      +  "?#{Time.now.to_i}"
      +end
      +
      +
      + +
      +

      + + #call(env) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 39
      +
      +def call(env)
      +  case env['PATH_INFO']
      +  when %r{\A/#{@prefix}/(.*)\.m?js\z}
      +    path, _cache_invalidator = Regexp.last_match(1).split('?', 2)
      +    call_js(path)
      +  else call_index
      +  end
      +rescue NotFound => error
      +  [404, {}, [error.to_s]]
      +end
      +
      +
      + +
      +

      + + #call_indexObject + + + + + +

      + + + + +
      +
      +
      +
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 85
      +
      +def call_index
      +  if @index_path
      +    contents = File.read(@index_path)
      +    html = ERB.new(contents).result binding
      +  else
      +    html = <<-HTML
      +    <!doctype html>
      +    <html>
      +      <head>
      +        <meta charset="utf-8">
      +      </head>
      +      <body>
      +        #{javascript_include_tag(main)}
      +      </body>
      +    </html>
      +    HTML
      +  end
      +  [200, { 'content-type' => 'text/html' }, [html]]
      +end
      +
      +
      + +
      +

      + + #call_js(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 50
      +
      +def call_js(path)
      +  asset = fetch_asset(path)
      +  [
      +    200,
      +    { 'content-type' => 'application/javascript' },
      +    [asset[:data], "\n", asset[:map].to_data_uri_comment],
      +  ]
      +end
      +
      +
      + +
      +

      + + #fetch_asset(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 64
      +
      +def fetch_asset(path)
      +  builder = self.builder(path)
      +  {
      +    data: builder.to_s,
      +    map: builder.source_map
      +  }
      +end
      +
      +
      + +
      +

      + + #javascript_include_tag(path) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +
      +
      # File 'opal/lib/opal/simple_server.rb', line 72
      +
      +def javascript_include_tag(path)
      +  case Opal::Config.esm
      +  when true
      +    %{<script src="/#{@prefix}/#{path}.mjs#{cache_invalidator}" type="module"></script>}
      +  when false
      +    %{<script src="/#{@prefix}/#{path}.js#{cache_invalidator}"></script>}
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/SourceMap.html b/docs/api/v1.8.2/lib/Opal/SourceMap.html new file mode 100644 index 00000000..4cac4c71 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/SourceMap.html @@ -0,0 +1,130 @@ + + + + + + + Module: Opal::SourceMap + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::SourceMap + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/source_map.rb
      +
      + +
      + +

      Overview

      +
      +

      To generate the source map for a single file use Opal::SourceMap::File. +To combine multiple files the Opal::SourceMap::Index should be used.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + Modules: Map, VLQ + + + + Classes: File, Index + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/SourceMap/File.html b/docs/api/v1.8.2/lib/Opal/SourceMap/File.html new file mode 100644 index 00000000..76d1d6b3 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/SourceMap/File.html @@ -0,0 +1,1008 @@ + + + + + + + Class: Opal::SourceMap::File + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::SourceMap::File + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Map
      +
      + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/source_map/file.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #file ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute file.

        +
        + +
      • + + +
      • + + + #fragments ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute fragments.

        +
        + +
      • + + +
      • + + + #source ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute source.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

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

      Methods included from Map

      +

      #as_json, #cache, #marshal_dump, #marshal_load, #to_data_uri_comment, #to_h, #to_json, #to_s

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(fragments, file, source, generated_code = nil) ⇒ File + + + + + +

      +
      +

      Returns a new instance of File.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 10
      +
      +def initialize(fragments, file, source, generated_code = nil)
      +  @fragments = fragments
      +  @file = file
      +  @source = source
      +  @names_map = Hash.new { |hash, name| hash[name] = hash.size }
      +  @generated_code = generated_code
      +  @absolute_mappings = nil
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #fileObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute file.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 7
      +
      +def file
      +  @file
      +end
      +
      +
      + + + +
      +

      + + #fragmentsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute fragments.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 6
      +
      +def fragments
      +  @fragments
      +end
      +
      +
      + + + +
      +

      + + #sourceObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute source.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 8
      +
      +def source
      +  @source
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #absolute_mappingsObject + + + + + +

      +
      +

      The “mappings” data is broken down as follows:

      + +

      each group representing a line in the generated file is separated by a ”;” +each segment is separated by a “,” +each segment is made up of 1,4 or 5 variable length fields.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +160
      +161
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +174
      +175
      +176
      +177
      +178
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 160
      +
      +def absolute_mappings
      +  @absolute_mappings ||= begin
      +    mappings = []
      +
      +    .each do |raw_segments|
      +      generated_column = 0
      +      segments = []
      +      raw_segments.each do |(generated_code, fragment)|
      +        unless fragment.is_a?(Opal::Fragment) && fragment.skip_source_map?
      +          segments << segment_from_fragment(fragment, generated_column)
      +        end
      +        generated_column += generated_code.size
      +      end
      +      mappings << segments
      +    end
      +
      +    mappings
      +  end
      +end
      +
      +
      + +
      +

      + + #generated_codeObject + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 19
      +
      +def generated_code
      +  @generated_code ||= @fragments.map(&:code).join
      +end
      +
      +
      + +
      +

      + + #map(source_root: '') ⇒ Object + + + + + +

      +
      +

      Proposed Format +1: { +2: "version" : 3, +3: "file": "out.js", +4: "sourceRoot": "", +5: "sources": ["foo.js", "bar.js"], +6: "sourcesContent": [null, null], +7: "names": ["src", "maps", "are", "fun"], +8: "mappings": "A,AAAB;;ABCDE;" +9: }

      + +

      Line 1: The entire file is a single JSON object +Line 2: File version (always the first entry in the object) and must be a + positive integer. +Line 3: An optional name of the generated code that this source map is + associated with. +Line 4: An optional source root, useful for relocating source files on a server + or removing repeated values in the “sources” entry. This value is prepended to + the individual entries in the “source” field. +Line 5: A list of original sources used by the “mappings” entry. +Line 6: An optional list of source content, useful when the “source” can’t be + hosted. The contents are listed in the same order as the sources in line 5. + “null” may be used if some original sources should be retrieved by name. +Line 7: A list of symbol names used by the “mappings” entry. +Line 8: A string with the encoded mapping data.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 48
      +
      +def map(source_root: '')
      +  {
      +    version: 3,
      +    # file: "out.js", # This is optional
      +    sourceRoot: source_root,
      +    sources: [file],
      +    sourcesContent: [source.encoding == Encoding::UTF_8 ? source : source.encode('UTF-8', undef: :replace)],
      +    names: names,
      +    mappings: Opal::SourceMap::VLQ.encode_mappings(relative_mappings),
      +    # x_com_opalrb_original_lines: source.count("\n"),
      +    # x_com_opalrb_generated_lines: generated_code.count("\n"),
      +  }
      +end
      +
      +
      + +
      +

      + + #namesObject + + + + + +

      + + + + +
      +
      +
      +
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 62
      +
      +def names
      +  @names ||= begin
      +    absolute_mappings # let the processing happen
      +    @names_map.to_a.sort_by { |_, index| index }.map { |name, _| name }
      +  end
      +end
      +
      +
      + +
      +

      + + #relative_mappingsObject + + + + + +

      + + + + +
      +
      +
      +
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 126
      +
      +def relative_mappings
      +  @relative_mappings ||= begin
      +    reference_segment = [0, 0, 0, 0, 0]
      +    reference_name_index = 0
      +    absolute_mappings.map do |absolute_mapping|
      +      # [generated_column, source_index, original_line, original_column, map_name_index]
      +      reference_segment[0] = 0 # reset the generated_column at each new line
      +
      +      absolute_mapping.map do |absolute_segment|
      +        segment = []
      +
      +        segment[0] = absolute_segment[0] - reference_segment[0]
      +        segment[1] = absolute_segment[1] - (reference_segment[1] || 0)
      +        segment[2] = absolute_segment[2] - (reference_segment[2] || 0)
      +        segment[3] = absolute_segment[3] - (reference_segment[3] || 0)
      +
      +        # Since [4] can be nil we need to keep track of it in the reference_segment even if it's nil in absolute_segment
      +        if absolute_segment[4]
      +          segment[4] = absolute_segment[4].to_int - (reference_segment[4] || reference_name_index).to_int
      +          reference_name_index = absolute_segment[4]
      +        end
      +
      +        reference_segment = absolute_segment
      +        segment
      +      end
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #segment_from_fragment(fragment, generated_column) ⇒ Object + + + + + +

      +
      +

      The fields in each segment are:

      + +
        +
      1. The zero-based starting column of the line in the generated code that +the segment represents. If this is the first field of the first segment, or +the first segment following a new generated line (“;”), then this field +holds the whole base 64 VLQ. Otherwise, this field contains a base 64 VLQ +that is relative to the previous occurrence of this field. Note that this +is different than the fields below because the previous value is reset +after every generated line.

      2. +
      3. If present, an zero-based index into the “sources” list. This field is +a base 64 VLQ relative to the previous occurrence of this field, unless +this is the first occurrence of this field, in which case the whole value +is represented.

      4. +
      5. If present, the zero-based starting line in the original source +represented. This field is a base 64 VLQ relative to the previous +occurrence of this field, unless this is the first occurrence of this +field, in which case the whole value is represented. Always present if +there is a source field.

      6. +
      7. If present, the zero-based starting column of the line in the source +represented. This field is a base 64 VLQ relative to the previous +occurrence of this field, unless this is the first occurrence of this +field, in which case the whole value is represented. Always present if +there is a source field.

      8. +
      9. If present, the zero-based index into the “names” list associated with +this segment. This field is a base 64 VLQ relative to the previous +occurrence of this field, unless this is the first occurrence of this +field, in which case the whole value is represented.

      10. +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/source_map/file.rb', line 100
      +
      +def segment_from_fragment(fragment, generated_column)
      +  source_index     = 0                          # always 0, we're dealing with a single file
      +  original_line    = (fragment.line || 0) - 1   # fragments have 1-based lines
      +  original_line    = 0 if original_line < 0     # line 0 (-1) for fragments in source maps will crash
      +                                                # browsers devtools and the webpack build process
      +  original_column  = fragment.column || 0       # fragments have 0-based columns
      +
      +  if fragment.source_map_name
      +    map_name_index = (@names_map[fragment.source_map_name.to_s] ||= @names_map.size)
      +    [
      +      generated_column,
      +      source_index,
      +      original_line,
      +      original_column,
      +      map_name_index,
      +    ]
      +  else
      +    [
      +      generated_column,
      +      source_index,
      +      original_line,
      +      original_column,
      +    ]
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/SourceMap/Index.html b/docs/api/v1.8.2/lib/Opal/SourceMap/Index.html new file mode 100644 index 00000000..0661a312 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/SourceMap/Index.html @@ -0,0 +1,489 @@ + + + + + + + Class: Opal::SourceMap::Index + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::SourceMap::Index + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Map
      +
      + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/source_map/index.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #source_maps ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

        Returns the value of attribute source_maps.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #initialize(source_maps, join: nil) ⇒ Index + + + + + + + constructor + + + + + + + + +

        A new instance of Index.

        +
        + +
      • + + +
      • + + + #map ⇒ Object + + + + + + + + + + + + + +

        To support concatenating generated code and other common post processing, an alternate representation of a map is supported:.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Methods included from Map

      +

      #as_json, #cache, #marshal_dump, #marshal_load, #to_data_uri_comment, #to_h, #to_json, #to_s

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(source_maps, join: nil) ⇒ Index + + + + + +

      +
      +

      Returns a new instance of Index.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + source_maps + + + (Opal::SourceMap::File) + + + +
      • + +
      • + + join: + + + + + + (defaults to: nil) + + + — +

        the string used to join the sources, empty by default, Opal::Builder uses "\n"

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +
      +
      # File 'opal/lib/opal/source_map/index.rb', line 10
      +
      +def initialize(source_maps, join: nil)
      +  @source_maps = source_maps
      +  @join = join
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #source_mapsObject (readonly) + + + + + +

      +
      +

      Returns the value of attribute source_maps.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'opal/lib/opal/source_map/index.rb', line 6
      +
      +def source_maps
      +  @source_maps
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #mapObject + + + + + +

      +
      +

      To support concatenating generated code and other common post processing, an +alternate representation of a map is supported:

      + +

      1: { + 2: version : 3, + 3: file: “app.js”, + 4: sections: [ + 5: { offset: column:0, url: “url_for_part1.map” } + 6: { offset: column:10, map: + 7: { + 8: version : 3, + 9: file: “section.js”, +10: sources: ["foo.js", "bar.js"], +11: names: ["src", "maps", "are", "fun"], +12: mappings: "AAAA,E;;ABCDE;" +13: } +14: } +15: ], +16: }

      + +

      The index map follow the form of the standard map

      + +

      Line 1: The entire file is an JSON object. +Line 2: The version field. See the description of the standard map. +Line 3: The name field. See the description of the standard map. +Line 4: The sections field.

      + +

      The “sections” field is an array of JSON objects that itself has two fields +“offset” and a source map reference. “offset” is an object with two fields, +“line” and “column”, that represent the offset into generated code that the +referenced source map represents.

      + +

      The other field must be either “url” or “map”. A “url” entry must be a URL +where a source map can be found for this section and the url is resolved in the +same way as the “sources” fields in the standard map. A “map” entry must be an +embedded complete source map object. An embedded map does not inherit any +values from the containing index map.

      + +

      The sections must be sorted by starting position and the represented sections +may not overlap.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/source_map/index.rb', line 56
      +
      +def map
      +  offset_line = 0
      +  offset_column = 0
      +  {
      +    version: 3,
      +    # file: "app.js",
      +    sections: @source_maps.map do |source_map|
      +      map = {
      +        offset: {
      +          line: offset_line,
      +          column: offset_column,
      +        },
      +        map: source_map.to_h,
      +      }
      +
      +      generated_code  = source_map.generated_code
      +      generated_code += @join if @join
      +      new_lines_count = generated_code.count("\n")
      +      last_line       = generated_code[generated_code.rindex("\n") + 1..-1]
      +
      +      offset_line    += new_lines_count
      +      offset_column  += last_line.size
      +
      +      map
      +    end
      +  }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/SourceMap/Map.html b/docs/api/v1.8.2/lib/Opal/SourceMap/Map.html new file mode 100644 index 00000000..fb05ea5b --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/SourceMap/Map.html @@ -0,0 +1,574 @@ + + + + + + + Module: Opal::SourceMap::Map + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::SourceMap::Map + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      File, Index
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/source_map/map.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #as_jsonObject + + + + + +

      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 23
      +
      +def as_json(*)
      +  to_h
      +end
      +
      +
      + +
      +

      + + #cacheObject + + + + + +

      +
      +

      Marshaling for cache shortpath

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +36
      +37
      +38
      +39
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 36
      +
      +def cache
      +  @to_h ||= map
      +  self
      +end
      +
      +
      + +
      +

      + + #marshal_dumpObject + + + + + +

      + + + + +
      +
      +
      +
      +41
      +42
      +43
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 41
      +
      +def marshal_dump
      +  [to_h, generated_code]
      +end
      +
      +
      + +
      +

      + + #marshal_load(value) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +45
      +46
      +47
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 45
      +
      +def marshal_load(value)
      +  @to_h, @generated_code = value
      +end
      +
      +
      + +
      +

      + + #to_data_uri_commentObject + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 31
      +
      +def to_data_uri_comment
      +  "//# sourceMappingURL=data:application/json;base64,#{Base64.encode64(to_json).delete("\n")}"
      +end
      +
      +
      + +
      +

      + + #to_hObject + + + + + +

      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 7
      +
      +def to_h
      +  @to_h || map
      +end
      +
      +
      + +
      +

      + + #to_jsonObject + + + + + +

      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 11
      +
      +def to_json
      +  map = to_h
      +  map.to_json
      +rescue Encoding::UndefinedConversionError
      +  map[:sections].each do |i|
      +    i.to_json
      +  rescue Encoding::UndefinedConversionError
      +    map[:sections].delete(i)
      +  end
      +  map.to_json
      +end
      +
      +
      + +
      +

      + + #to_sObject + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'opal/lib/opal/source_map/map.rb', line 27
      +
      +def to_s
      +  to_h.to_s
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/SourceMap/VLQ.html b/docs/api/v1.8.2/lib/Opal/SourceMap/VLQ.html new file mode 100644 index 00000000..58feb470 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/SourceMap/VLQ.html @@ -0,0 +1,536 @@ + + + + + + + Module: Opal::SourceMap::VLQ + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::SourceMap::VLQ + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/source_map/vlq.rb
      +
      + +
      + +

      Overview

      +
      + + +
      + +

      + Constant Summary + collapse +

      + +
      + +
      VLQ_BASE_SHIFT = + +
      +
      5
      + +
      VLQ_BASE = + +
      +
      1 << VLQ_BASE_SHIFT
      + +
      VLQ_BASE_MASK = + +
      +
      VLQ_BASE - 1
      + +
      VLQ_CONTINUATION_BIT = + +
      +
      VLQ_BASE
      + +
      BASE64_DIGITS = + +
      +
      'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('')
      + +
      BASE64_VALUES = + +
      +
      (0...64).inject({}) { |h, i| h[BASE64_DIGITS[i]] = i; h }
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .decode(str) ⇒ Object + + + + + +

      +
      +

      Public: Decode a VLQ string.

      + +

      str - VLQ encoded String

      + +

      Returns an Array of Integers.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +
      +
      # File 'opal/lib/opal/source_map/vlq.rb', line 47
      +
      +def self.decode(str)
      +  result = []
      +  chars = str.split('')
      +  while chars.any?
      +    vlq = 0
      +    shift = 0
      +    continuation = true
      +    while continuation
      +      char = chars.shift
      +      raise ArgumentError unless char
      +      digit = BASE64_VALUES[char]
      +      continuation = false if (digit & VLQ_CONTINUATION_BIT) == 0
      +      digit &= VLQ_BASE_MASK
      +      vlq   += digit << shift
      +      shift += VLQ_BASE_SHIFT
      +    end
      +    result << (vlq & 1 == 1 ? -(vlq >> 1) : vlq >> 1)
      +  end
      +  result
      +end
      +
      +
      + +
      +

      + + .decode_mappings(str) ⇒ Object + + + + + +

      +
      +

      Public: Decode a VLQ string into mapping numbers.

      + +

      str - VLQ encoded String

      + +

      Returns an two dimensional Array of Integers.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +
      +
      # File 'opal/lib/opal/source_map/vlq.rb', line 86
      +
      +def self.decode_mappings(str)
      +  mappings = []
      +
      +  str.split(';').each_with_index do |group, index|
      +    mappings[index] = []
      +    group.split(',').each do |segment|
      +      mappings[index] << decode(segment)
      +    end
      +  end
      +
      +  mappings
      +end
      +
      +
      + +
      +

      + + .encode(ary) ⇒ Object + + + + + +

      +
      +

      Public: Encode a list of numbers into a compact VLQ string.

      + +

      ary - An Array of Integers

      + +

      Returns a VLQ String.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +
      +
      # File 'opal/lib/opal/source_map/vlq.rb', line 26
      +
      +def self.encode(ary)
      +  result = []
      +  ary.each do |n|
      +    vlq = n < 0 ? ((-n) << 1) + 1 : n << 1
      +    loop do
      +      digit  = vlq & VLQ_BASE_MASK
      +      vlq  >>= VLQ_BASE_SHIFT
      +      digit |= VLQ_CONTINUATION_BIT if vlq > 0
      +      result << BASE64_DIGITS[digit]
      +
      +      break unless vlq > 0
      +    end
      +  end
      +  result.join
      +end
      +
      +
      + +
      +

      + + .encode_mappings(ary) ⇒ Object + + + + + +

      +
      +

      Public: Encode a mapping array into a compact VLQ string.

      + +

      ary - Two dimensional Array of Integers.

      + +

      Returns a VLQ encoded String seperated by , and ;.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +
      +
      # File 'opal/lib/opal/source_map/vlq.rb', line 73
      +
      +def self.encode_mappings(ary)
      +  ary.map { |group|
      +    group.map { |segment|
      +      encode(segment)
      +    }.join(',')
      +  }.join(';')
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/SyntaxError.html b/docs/api/v1.8.2/lib/Opal/SyntaxError.html new file mode 100644 index 00000000..ad2439b5 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/SyntaxError.html @@ -0,0 +1,204 @@ + + + + + + + Exception: Opal::SyntaxError + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: Opal::SyntaxError + + + +

      +
      + +
      +
      Inherits:
      +
      + SyntaxError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/errors.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #location ⇒ Object + + + + + + + + + + + + + + + + +

        Returns the value of attribute location.

        +
        + +
      • + + +
      + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #locationObject + + + + + +

      +
      +

      Returns the value of attribute location.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +
      +
      # File 'opal/lib/opal/errors.rb', line 31
      +
      +def location
      +  @location
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/TiltTemplate.html b/docs/api/v1.8.2/lib/Opal/TiltTemplate.html new file mode 100644 index 00000000..c02ac3d0 --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/TiltTemplate.html @@ -0,0 +1,612 @@ + + + + + + + Class: Opal::TiltTemplate + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Opal::TiltTemplate + + + +

      +
      + +
      +
      Inherits:
      +
      + Tilt::Template + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/tilt/opal.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .compiler_optionsObject + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 24
      +
      +def self.compiler_options
      +  Opal::Config.compiler_options.merge(requirable: true)
      +end
      +
      +
      + +
      +

      + + .engine_initialized?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 16
      +
      +def self.engine_initialized?
      +  true
      +end
      +
      +
      + +
      +

      + + .inherited(subclass) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 12
      +
      +def self.inherited(subclass)
      +  subclass.default_mime_type = 'application/javascript'
      +end
      +
      +
      + +
      +

      + + .versionObject + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 20
      +
      +def self.version
      +  ::Opal::VERSION
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #compiler_optionsObject + + + + + +

      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 48
      +
      +def compiler_options
      +  self.class.compiler_options
      +end
      +
      +
      + +
      +

      + + #evaluate(_scope, _locals) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 36
      +
      +def evaluate(_scope, _locals)
      +  if builder = @options[:builder]
      +    builder.dup.build(file).to_s
      +  elsif @options[:build]
      +    Opal::Builder.build(file).to_s
      +  else
      +    compiler_options = (compiler_options || {}).merge!(file: file)
      +    compiler = Compiler.new(data, compiler_options)
      +    compiler.compile.to_s
      +  end
      +end
      +
      +
      + +
      +

      + + #initialize_engineObject + + + + + +

      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 28
      +
      +def initialize_engine
      +  require_template_library 'opal'
      +end
      +
      +
      + +
      +

      + + #prepareObject + + + + + +

      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +
      +
      # File 'opal/lib/tilt/opal.rb', line 32
      +
      +def prepare
      +  # stub
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/UseGem.html b/docs/api/v1.8.2/lib/Opal/UseGem.html new file mode 100644 index 00000000..e1f7fe4e --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/UseGem.html @@ -0,0 +1,248 @@ + + + + + + + Module: Opal::UseGem + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::UseGem + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      Opal, Builder
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/paths.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #use_gem(gem_name, include_dependencies = true) ⇒ Object + + + + + +

      +
      +

      Adds the "require_paths" (usually lib/) of gem with the given name to +Opal paths. By default will include the "require_paths" from all the +dependent gems.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + gem_name + + + (String) + + + + — +

        the name of the gem

        +
        + +
      • + +
      • + + include_dependencies + + + (Boolean) + + + (defaults to: true) + + + — +

        whether or not to add recursively +the gem's dependencies

        +
        + +
      • + +
      + +

      Raises:

      +
        + +
      • + + + (Opal::GemNotFound) + + + + — +

        if gem or any of its runtime dependencies not found

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +
      +
      # File 'opal/lib/opal/paths.rb', line 57
      +
      +def use_gem(gem_name, include_dependencies = true)
      +  append_paths(*require_paths_for_gem(gem_name, include_dependencies))
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Opal/Util.html b/docs/api/v1.8.2/lib/Opal/Util.html new file mode 100644 index 00000000..aa054bea --- /dev/null +++ b/docs/api/v1.8.2/lib/Opal/Util.html @@ -0,0 +1,311 @@ + + + + + + + Module: Opal::Util + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: Opal::Util + + + +

      +
      + + + + +
      +
      Extended by:
      +
      Util
      +
      + + + + + + +
      +
      Included in:
      +
      Util
      +
      + + + +
      +
      Defined in:
      +
      opal/lib/opal/util.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      ExitStatusError = + +
      +
      Class.new(StandardError)
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #gzip(source) ⇒ Object + + + + + +

      +
      +

      Gzip code to check file size.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'opal/lib/opal/util.rb', line 22
      +
      +def gzip(source)
      +  sh 'gzip -f', data: source
      +end
      +
      +
      + +
      +

      + + #uglify(source, mangle: false) ⇒ String + + + + + +

      +
      +

      Used for uglifying source to minify.

      + +
      Opal::Util.uglify("javascript contents")
      +
      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + str + + + (String) + + + + — +

        string to minify

        +
        + +
      • + +
      + +

      Returns:

      +
        + +
      • + + + (String) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'opal/lib/opal/util.rb', line 17
      +
      +def uglify(source, mangle: false)
      +  sh "#{'ruby ' if Gem.win_platform?}bin/yarn -s run terser -c #{'-m' if mangle}", data: source
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Parser/Builders/Default.html b/docs/api/v1.8.2/lib/Parser/Builders/Default.html new file mode 100644 index 00000000..35fd6103 --- /dev/null +++ b/docs/api/v1.8.2/lib/Parser/Builders/Default.html @@ -0,0 +1,366 @@ + + + + + + + Class: Parser::Builders::Default + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Parser::Builders::Default + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/patch.rb,
      + opal/lib/opal/parser/patch.rb
      +
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      Opal::AST::Builder

      +
      + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #check_lvar_name(name, loc) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 50
      +
      +def check_lvar_name(name, loc)
      +  # https://javascript.info/regexp-unicode
      +  if name =~ `new RegExp('^[\\p{Ll}|_][\\p{L}\\p{Nl}\\p{Nd}_]*$', 'u')`
      +    # OK
      +  else
      +    diagnostic :error, :lvar_name, { name: name }, loc
      +  end
      +end
      +
      +
      + +
      +

      + + #dedent_string(node, dedent_level) ⇒ Object + + + + + +

      +
      + + +
      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 61
      +
      +def dedent_string(node, dedent_level)
      +  unless dedent_level.nil?
      +    dedenter = ::Parser::Lexer::Dedenter.new(dedent_level)
      +
      +    case node.type
      +    when :str
      +      node = node.updated(nil, [dedenter.dedent(node.children.first)])
      +    when :dstr, :xstr
      +      children = node.children.map do |str_node|
      +        if str_node.type == :str
      +          str_node = str_node.updated(nil, [dedenter.dedent(str_node.children.first)])
      +          next nil if str_node.children.first.empty?
      +        else
      +          dedenter.interrupt
      +        end
      +        str_node
      +      end
      +
      +      node = node.updated(nil, children.compact)
      +    end
      +  end
      +
      +  node
      +end
      +
      +
      + +
      +

      + + #string_value(token) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +165
      +166
      +167
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 165
      +
      +def string_value(token)
      +  value(token)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Parser/Lexer.html b/docs/api/v1.8.2/lib/Parser/Lexer.html new file mode 100644 index 00000000..8584f6fb --- /dev/null +++ b/docs/api/v1.8.2/lib/Parser/Lexer.html @@ -0,0 +1,222 @@ + + + + + + + Class: Parser::Lexer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Parser::Lexer + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/patch.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #source_buffer=(source_buffer) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 6
      +
      +def source_buffer=(source_buffer)
      +  @source_buffer = source_buffer
      +
      +  if @source_buffer
      +    source = @source_buffer.source
      +    # Force UTF8 unpacking even if JS works with UTF-16/UCS-2
      +    # See: https://mathiasbynens.be/notes/javascript-encoding
      +    @source_pts = source.unpack('U*')
      +  else
      +    @source_pts = nil
      +  end
      +
      +  # Since parser v3.2.1 Parser::Lexer has @strings
      +  if @strings
      +    @strings.source_buffer = @source_buffer
      +    @strings.source_pts = @source_pts
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Parser/Lexer/Dedenter.html b/docs/api/v1.8.2/lib/Parser/Lexer/Dedenter.html new file mode 100644 index 00000000..6250f164 --- /dev/null +++ b/docs/api/v1.8.2/lib/Parser/Lexer/Dedenter.html @@ -0,0 +1,284 @@ + + + + + + + Class: Parser::Lexer::Dedenter + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Parser::Lexer::Dedenter + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/patch.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #dedent(string) ⇒ Object + + + + + +

      +
      + + +
      + + + + +
      +
      +
      +
      +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
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 90
      +
      +def dedent(string)
      +  original_encoding = string.encoding
      +  # Prevent the following error when processing binary encoded source.
      +  # "\xC0".split # => ArgumentError (invalid byte sequence in UTF-8)
      +  lines = string.force_encoding(Encoding::BINARY).split("\\\n")
      +  if lines.length == 1
      +    # If the line continuation sequence was found but there is no second
      +    # line, it was not really a line continuation and must be ignored.
      +    lines = [string.force_encoding(original_encoding)]
      +  else
      +    lines.map! { |s| s.force_encoding(original_encoding) }
      +  end
      +
      +  lines.each_with_index do |line, index|
      +    next if (index == 0) && !@at_line_begin
      +    left_to_remove = @dedent_level
      +    remove = 0
      +
      +    line.each_char do |char|
      +      break if left_to_remove <= 0
      +      case char
      +      when "\s"
      +        remove += 1
      +        left_to_remove -= 1
      +      when "\t"
      +        break if TAB_WIDTH * (remove / TAB_WIDTH + 1) > @dedent_level
      +        remove += 1
      +        left_to_remove -= TAB_WIDTH
      +      else
      +        # no more spaces or tabs
      +        break
      +      end
      +    end
      +
      +    lines[index] = line[remove..-1]
      +  end
      +
      +  string = lines.join
      +
      +  @at_line_begin = string.end_with?("\n")
      +
      +  string
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Parser/Lexer/Literal.html b/docs/api/v1.8.2/lib/Parser/Lexer/Literal.html new file mode 100644 index 00000000..9a18fe89 --- /dev/null +++ b/docs/api/v1.8.2/lib/Parser/Lexer/Literal.html @@ -0,0 +1,202 @@ + + + + + + + Class: Parser::Lexer::Literal + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Parser::Lexer::Literal + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/patch.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #extend_string(string, ts, te) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 29
      +
      +def extend_string(string, ts, te)
      +  @buffer_s ||= ts
      +  @buffer_e = te
      +
      +  # Patch for opal-parser, original:
      +  # @buffer << string
      +  @buffer += string
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/Parser/Source/Buffer.html b/docs/api/v1.8.2/lib/Parser/Source/Buffer.html new file mode 100644 index 00000000..ff3aae62 --- /dev/null +++ b/docs/api/v1.8.2/lib/Parser/Source/Buffer.html @@ -0,0 +1,204 @@ + + + + + + + Class: Parser::Source::Buffer + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: Parser::Source::Buffer + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      opal/lib/opal/parser/patch.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      Opal::Parser::SourceBuffer

      +
      + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #source_linesObject + + + + + +

      + + + + +
      +
      +
      +
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +
      +
      # File 'opal/lib/opal/parser/patch.rb', line 40
      +
      +def source_lines
      +  @lines ||= begin
      +    lines = @source.lines.to_a
      +    lines << '' if @source.end_with?("\n")
      +    lines.map { |line| line.chomp("\n") }
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/_index.html b/docs/api/v1.8.2/lib/_index.html new file mode 100644 index 00000000..7e2147b9 --- /dev/null +++ b/docs/api/v1.8.2/lib/_index.html @@ -0,0 +1,1988 @@ + + + + + + + lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
      + + +

      lib (Opal v1.8.2)

      +
      +

      Alphabetic Index

      + +

      File Listing

      + + +
      +

      Namespace Listing A-Z

      + + + + + + + + +
      + + +
        +
      • A
      • +
          + +
        • + AST + + (Opal) + +
        • + +
        • + AliasNode + + (Opal::Nodes) + +
        • + +
        • + App + + (Opal::CliRunners::Server) + +
        • + +
        • + Applescript + + (Opal::CliRunners) + +
        • + +
        • + ArgNode + + (Opal::Nodes::Args) + +
        • + +
        • + ArglistNode + + (Opal::Nodes) + +
        • + +
        • + Args + + (Opal::Nodes) + +
        • + +
        • + ArgsNode + + (Opal::Nodes) + +
        • + +
        • + Arguments + + (Opal::Rewriters::MlhsArgs) + +
        • + +
        • + Arguments + + (Opal::Rewriters) + +
        • + +
        • + ArityCheckNode + + (Opal::Nodes) + +
        • + +
        • + ArrayNode + + (Opal::Nodes) + +
        • + +
        +
      + + + + + + + + + + + + + + +
        +
      • F
      • +
          + +
        • + FakeArgNode + + (Opal::Nodes::Args) + +
        • + +
        • + File + + (Opal::SourceMap) + +
        • + +
        • + FileCache + + (Opal::Cache) + +
        • + +
        • + FiltersRewriter + + (Opal::Rubyspec) + +
        • + +
        • + Firefox + + (Opal::CliRunners) + +
        • + +
        • + ForRewriter + + (Opal::Rewriters) + +
        • + +
        • + Fork + + (Opal::BuilderScheduler::Prefork) + +
        • + +
        • + ForkSet + + (Opal::BuilderScheduler::Prefork) + +
        • + +
        • + ForwardArgs + + (Opal::Rewriters) + +
        • + +
        • + Fragment + + (Opal) + +
        • + +
        +
      + + + + + +
      + + +
        +
      • H
      • +
          + +
        • + HashNode + + (Opal::Nodes) + +
        • + +
        • + Hashes + + (Opal::Rewriters) + +
        • + +
        • + Helpers + + (Opal::Nodes) + +
        • + +
        • + Hike + + (Opal) + +
        • + +
        +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
        +
      • Q
      • +
          + +
        • + Quickjs + + (Opal::CliRunners) + +
        • + +
        +
      + + + + + + + + + + + +
        +
      • U
      • + +
      + + +
        +
      • V
      • +
          + +
        • + VLQ + + (Opal::SourceMap) + +
        • + +
        • + ValueNode + + (Opal::Nodes) + +
        • + +
        +
      + + + + + +
      + + + + + +
        +
      • Y
      • + +
      + + +
        +
      • Z
      • + +
      + +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/class_list.html b/docs/api/v1.8.2/lib/class_list.html new file mode 100644 index 00000000..20e667e3 --- /dev/null +++ b/docs/api/v1.8.2/lib/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
      +
      +

      Class List

      + + + +
      + + +
      + + diff --git a/docs/api/v1.8.2/lib/css/common.css b/docs/api/v1.8.2/lib/css/common.css new file mode 100644 index 00000000..cf25c452 --- /dev/null +++ b/docs/api/v1.8.2/lib/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/css/full_list.css b/docs/api/v1.8.2/lib/css/full_list.css new file mode 100644 index 00000000..fa359824 --- /dev/null +++ b/docs/api/v1.8.2/lib/css/full_list.css @@ -0,0 +1,58 @@ +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/v1.8.2/lib/css/style.css b/docs/api/v1.8.2/lib/css/style.css new file mode 100644 index 00000000..eb0dbc86 --- /dev/null +++ b/docs/api/v1.8.2/lib/css/style.css @@ -0,0 +1,497 @@ +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; + box-sizing: border-box; +} + +@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 > li > ol { font-size: 0.9em; } +#toc ol ol > li > 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/v1.8.2/lib/file.History.html b/docs/api/v1.8.2/lib/file.History.html new file mode 100644 index 00000000..f51a0652 --- /dev/null +++ b/docs/api/v1.8.2/lib/file.History.html @@ -0,0 +1,416 @@ + + + + + + + File: History + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        2.11.0 / 2017-07-03

        + +
          +
        • Fix help section order and padding (#652)
        • +
        • feature: support for signals to subcommands (#632)
        • +
        • Fixed #37, --help should not display first (#447)
        • +
        • Fix translation errors. (#570)
        • +
        • Add package-lock.json
        • +
        • Remove engines
        • +
        • Upgrade package version
        • +
        • Prefix events to prevent conflicts between commands and options (#494)
        • +
        • Removing dependency on graceful-readlink
        • +
        • Support setting name in #name function and make it chainable
        • +
        • Add .vscode directory to .gitignore (Visual Studio Code metadata)
        • +
        • Updated link to ruby commander in readme files
        • +
        + +

        2.10.0 / 2017-06-19

        + +
          +
        • Update .travis.yml. drop support for older node.js versions.
        • +
        • Fix require arguments in README.md
        • +
        • On SemVer you do not start from 0.0.1
        • +
        • Add missing semi colon in readme
        • +
        • Add save param to npm install
        • +
        • node v6 travis test
        • +
        • Update Readme_zh-CN.md
        • +
        • Allow literal '--' to be passed-through as an argument
        • +
        • Test subcommand alias help
        • +
        • link build badge to master branch
        • +
        • Support the alias of Git style sub-command
        • +
        • added keyword commander for better search result on npm
        • +
        • Fix Sub-Subcommands
        • +
        • test node.js stable
        • +
        • Fixes TypeError when a command has an option called --description
        • +
        • Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets.
        • +
        • Add chinese Readme file
        • +
        + +

        2.9.0 / 2015-10-13

        + +
          +
        • Add option isDefault to set default subcommand #415 @Qix-
        • +
        • Add callback to allow filtering or post-processing of help text #434 @djulien
        • +
        • Fix undefined text in help information close #414 #416 @zhiyelee
        • +
        + +

        2.8.1 / 2015-04-22

        + +
          +
        • Back out support multiline description Close #396 #397
        • +
        + +

        2.8.0 / 2015-04-07

        + +
          +
        • Add process.execArg support, execution args like --harmony will be passed to sub-commands #387 @DigitalIO @zhiyelee
        • +
        • Fix bug in Git-style sub-commands #372 @zhiyelee
        • +
        • Allow commands to be hidden from help #383 @tonylukasavage
        • +
        • When git-style sub-commands are in use, yet none are called, display help #382 @claylo
        • +
        • Add ability to specify arguments syntax for top-level command #258 @rrthomas
        • +
        • Support multiline descriptions #208 @zxqfox
        • +
        + +

        2.7.1 / 2015-03-11

        + +
          +
        • Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
        • +
        + +

        2.7.0 / 2015-03-09

        + +
          +
        • Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
        • +
        • Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage
        • +
        • Add support for camelCase on opts(). Close #353 @nkzawa
        • +
        • Add node.js 0.12 and io.js to travis.yml
        • +
        • Allow RegEx options. #337 @palanik
        • +
        • Fixes exit code when sub-command failing. Close #260 #332 @pirelenito
        • +
        • git-style bin files in $PATH make sense. Close #196 #327 @zhiyelee
        • +
        + +

        2.6.0 / 2014-12-30

        + +
          +
        • added Command#allowUnknownOption method. Close #138 #318 @doozr @zhiyelee
        • +
        • Add application description to the help msg. Close #112 @dalssoft
        • +
        + +

        2.5.1 / 2014-12-15

        + +
          +
        • fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee
        • +
        + +

        2.5.0 / 2014-10-24

        + +
          +
        • add support for variadic arguments. Closes #277 @whitlockjc
        • +
        + +

        2.4.0 / 2014-10-17

        + +
          +
        • fixed a bug on executing the coercion function of subcommands option. Closes #270
        • +
        • added Command.prototype.name to retrieve command name. Closes #264 #266 @tonylukasavage
        • +
        • added Command.prototype.opts to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage
        • +
        • fixed a bug on subcommand name. Closes #248 @jonathandelgado
        • +
        • fixed function normalize doesn’t honor option terminator. Closes #216 @abbr
        • +
        + +

        2.3.0 / 2014-07-16

        + +
          +
        • add command alias'. Closes PR #210
        • +
        • fix: Typos. Closes #99
        • +
        • fix: Unused fs module. Closes #217
        • +
        + +

        2.2.0 / 2014-03-29

        + +
          +
        • add passing of previous option value
        • +
        • fix: support subcommands on windows. Closes #142
        • +
        • Now the defaultValue passed as the second argument of the coercion function.
        • +
        + +

        2.1.0 / 2013-11-21

        + +
          +
        • add: allow cflag style option params, unit test, fixes #174
        • +
        + +

        2.0.0 / 2013-07-18

        + +
          +
        • remove input methods (.prompt, .confirm, etc)
        • +
        + +

        1.3.2 / 2013-07-18

        + +
          +
        • add support for sub-commands to co-exist with the original command
        • +
        + +

        1.3.1 / 2013-07-18

        + +
          +
        • add quick .runningCommand hack so you can opt-out of other logic when running a sub command
        • +
        + +

        1.3.0 / 2013-07-09

        + +
          +
        • add EACCES error handling
        • +
        • fix sub-command --help
        • +
        + +

        1.2.0 / 2013-06-13

        + +
          +
        • allow "-" hyphen as an option argument
        • +
        • support for RegExp coercion
        • +
        + +

        1.1.1 / 2012-11-20

        + +
          +
        • add more sub-command padding
        • +
        • fix .usage() when args are present. Closes #106
        • +
        + +

        1.1.0 / 2012-11-16

        + +
          +
        • add git-style executable subcommand support. Closes #94
        • +
        + +

        1.0.5 / 2012-10-09

        + +
          +
        • fix --name clobbering. Closes #92
        • +
        • fix examples/help. Closes #89
        • +
        + +

        1.0.4 / 2012-09-03

        + +
          +
        • add outputHelp() method.
        • +
        + +

        1.0.3 / 2012-08-30

        + +
          +
        • remove invalid .version() defaulting
        • +
        + +

        1.0.2 / 2012-08-24

        + +
          +
        • add --foo=bar support [arv]
        • +
        • fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
        • +
        + +

        1.0.1 / 2012-08-03

        + +
          +
        • fix issue #56
        • +
        • fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
        • +
        + +

        1.0.0 / 2012-07-05

        + +
          +
        • add support for optional option descriptions
        • +
        • add defaulting of .version() to package.json's version
        • +
        + +

        0.6.1 / 2012-06-01

        + +
          +
        • Added: append (yes or no) on confirmation
        • +
        • Added: allow node.js v0.7.x
        • +
        + +

        0.6.0 / 2012-04-10

        + +
          +
        • Added .prompt(obj, callback) support. Closes #49
        • +
        • Added default support to .choose(). Closes #41
        • +
        • Fixed the choice example
        • +
        + +

        0.5.1 / 2011-12-20

        + +
          +
        • Fixed password() for recent nodes. Closes #36
        • +
        + +

        0.5.0 / 2011-12-04

        + +
          +
        • Added sub-command option support [itay]
        • +
        + +

        0.4.3 / 2011-12-04

        + +
          +
        • Fixed custom help ordering. Closes #32
        • +
        + +

        0.4.2 / 2011-11-24

        + +
          +
        • Added travis support
        • +
        • Fixed: line-buffered input automatically trimmed. Closes #31
        • +
        + +

        0.4.1 / 2011-11-18

        + +
          +
        • Removed listening for "close" on --help
        • +
        + +

        0.4.0 / 2011-11-15

        + +
          +
        • Added support for --. Closes #24
        • +
        + +

        0.3.3 / 2011-11-14

        + +
          +
        • Fixed: wait for close event when writing help info [Jerry Hamlet]
        • +
        + +

        0.3.2 / 2011-11-01

        + +
          +
        • Fixed long flag definitions with values [felixge]
        • +
        + +

        0.3.1 / 2011-10-31

        + +
          +
        • Changed --version short flag to -V from -v
        • +
        • Changed .version() so it's configurable [felixge]
        • +
        + +

        0.3.0 / 2011-10-31

        + +
          +
        • Added support for long flags only. Closes #18
        • +
        + +

        0.2.1 / 2011-10-24

        + +
          +
        • "node": ">= 0.4.x < 0.7.0". Closes #20
        • +
        + +

        0.2.0 / 2011-09-26

        + +
          +
        • Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
        • +
        + +

        0.1.0 / 2011-08-24

        + +
          +
        • Added support for custom --help output
        • +
        + +

        0.0.5 / 2011-08-18

        + +
          +
        • Changed: when the user enters nothing prompt for password again
        • +
        • Fixed issue with passwords beginning with numbers [NuckChorris]
        • +
        + +

        0.0.4 / 2011-08-15

        + +
          +
        • Fixed Commander#args
        • +
        + +

        0.0.3 / 2011-08-15

        + +
          +
        • Added default option value support
        • +
        + +

        0.0.2 / 2011-08-15

        + +
          +
        • Added mask support to Command#password(str[, mask], fn)
        • +
        • Added Command#password(str, fn)
        • +
        + +

        0.0.1 / 2010-01-03

        + +
          +
        • Initial release
        • +
        +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/file.README.html b/docs/api/v1.8.2/lib/file.README.html new file mode 100644 index 00000000..396bdb34 --- /dev/null +++ b/docs/api/v1.8.2/lib/file.README.html @@ -0,0 +1,552 @@ + + + + + + + File: README + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        ws: a Node.js WebSocket library

        + +

        Version npm +CI +Coverage Status

        + +

        ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and +server implementation.

        + +

        Passes the quite extensive Autobahn test suite: server, +client.

        + +

        Note: This module does not work in the browser. The client in the docs is a +reference to a back end with the role of a client in the WebSocket +communication. Browser clients must use the native +WebSocket +object. To make the same code work seamlessly on Node.js and the browser, you +can use one of the many wrappers available on npm, like +isomorphic-ws.

        + +

        Table of Contents

        + + + +

        Protocol support

        + +
          +
        • HyBi drafts 07-12 (Use the option protocolVersion: 8)
        • +
        • HyBi drafts 13-17 (Current default, alternatively option +protocolVersion: 13)
        • +
        + +

        Installing

        + +
        npm install ws
        +
        + +

        Opt-in for performance

        + +

        There are 2 optional modules that can be installed along side with the ws +module. These modules are binary addons which improve certain operations. +Prebuilt binaries are available for the most popular platforms so you don't +necessarily need to have a C++ compiler installed on your machine.

        + +
          +
        • npm install --save-optional bufferutil: Allows to efficiently perform +operations such as masking and unmasking the data payload of the WebSocket +frames.
        • +
        • npm install --save-optional utf-8-validate: Allows to efficiently check if a +message contains valid UTF-8.
        • +
        + +

        API docs

        + +

        See /doc/ws.md for Node.js-like documentation of ws classes and +utility functions.

        + +

        WebSocket compression

        + +

        ws supports the permessage-deflate extension which enables +the client and server to negotiate a compression algorithm and its parameters, +and then selectively apply it to the data payloads of each WebSocket message.

        + +

        The extension is disabled by default on the server and enabled by default on the +client. It adds a significant overhead in terms of performance and memory +consumption so we suggest to enable it only if it is really needed.

        + +

        Note that Node.js has a variety of issues with high-performance compression, +where increased concurrency, especially on Linux, can lead to catastrophic +memory fragmentation and slow performance. If you intend to use +permessage-deflate in production, it is worthwhile to set up a test +representative of your workload and ensure Node.js/zlib will handle it with +acceptable performance and memory usage.

        + +

        Tuning of permessage-deflate can be done via the options defined below. You can +also use zlibDeflateOptions and zlibInflateOptions, which is passed directly +into the creation of raw deflate/inflate streams.

        + +

        See the docs for more options.

        + +
        const WebSocket = require('ws');
        +
        +const wss = new WebSocket.Server({
        +  port: 8080,
        +  perMessageDeflate: {
        +    zlibDeflateOptions: {
        +      // See zlib defaults.
        +      chunkSize: 1024,
        +      memLevel: 7,
        +      level: 3
        +    },
        +    zlibInflateOptions: {
        +      chunkSize: 10 * 1024
        +    },
        +    // Other options settable:
        +    clientNoContextTakeover: true, // Defaults to negotiated value.
        +    serverNoContextTakeover: true, // Defaults to negotiated value.
        +    serverMaxWindowBits: 10, // Defaults to negotiated value.
        +    // Below options specified as default values.
        +    concurrencyLimit: 10, // Limits zlib concurrency for perf.
        +    threshold: 1024 // Size (in bytes) below which messages
        +    // should not be compressed.
        +  }
        +});
        +
        + +

        The client will only use the extension if it is supported and enabled on the +server. To always disable the extension on the client set the +perMessageDeflate option to false.

        + +
        const WebSocket = require('ws');
        +
        +const ws = new WebSocket('ws://www.host.com/path', {
        +  perMessageDeflate: false
        +});
        +
        + +

        Usage examples

        + +

        Sending and receiving text data

        + +
        const WebSocket = require('ws');
        +
        +const ws = new WebSocket('ws://www.host.com/path');
        +
        +ws.on('open', function open() {
        +  ws.send('something');
        +});
        +
        +ws.on('message', function incoming(data) {
        +  console.log(data);
        +});
        +
        + +

        Sending binary data

        + +
        const WebSocket = require('ws');
        +
        +const ws = new WebSocket('ws://www.host.com/path');
        +
        +ws.on('open', function open() {
        +  const array = new Float32Array(5);
        +
        +  for (var i = 0; i < array.length; ++i) {
        +    array[i] = i / 2;
        +  }
        +
        +  ws.send(array);
        +});
        +
        + +

        Simple server

        + +
        const WebSocket = require('ws');
        +
        +const wss = new WebSocket.Server({ port: 8080 });
        +
        +wss.on('connection', function connection(ws) {
        +  ws.on('message', function incoming(message) {
        +    console.log('received: %s', message);
        +  });
        +
        +  ws.send('something');
        +});
        +
        + +

        External HTTP/S server

        + +
        const fs = require('fs');
        +const https = require('https');
        +const WebSocket = require('ws');
        +
        +const server = https.createServer({
        +  cert: fs.readFileSync('/path/to/cert.pem'),
        +  key: fs.readFileSync('/path/to/key.pem')
        +});
        +const wss = new WebSocket.Server({ server });
        +
        +wss.on('connection', function connection(ws) {
        +  ws.on('message', function incoming(message) {
        +    console.log('received: %s', message);
        +  });
        +
        +  ws.send('something');
        +});
        +
        +server.listen(8080);
        +
        + +

        Multiple servers sharing a single HTTP/S server

        + +
        const http = require('http');
        +const WebSocket = require('ws');
        +const url = require('url');
        +
        +const server = http.createServer();
        +const wss1 = new WebSocket.Server({ noServer: true });
        +const wss2 = new WebSocket.Server({ noServer: true });
        +
        +wss1.on('connection', function connection(ws) {
        +  // ...
        +});
        +
        +wss2.on('connection', function connection(ws) {
        +  // ...
        +});
        +
        +server.on('upgrade', function upgrade(request, socket, head) {
        +  const pathname = url.parse(request.url).pathname;
        +
        +  if (pathname === '/foo') {
        +    wss1.handleUpgrade(request, socket, head, function done(ws) {
        +      wss1.emit('connection', ws, request);
        +    });
        +  } else if (pathname === '/bar') {
        +    wss2.handleUpgrade(request, socket, head, function done(ws) {
        +      wss2.emit('connection', ws, request);
        +    });
        +  } else {
        +    socket.destroy();
        +  }
        +});
        +
        +server.listen(8080);
        +
        + +

        Client authentication

        + +
        const http = require('http');
        +const WebSocket = require('ws');
        +
        +const server = http.createServer();
        +const wss = new WebSocket.Server({ noServer: true });
        +
        +wss.on('connection', function connection(ws, request, client) {
        +  ws.on('message', function message(msg) {
        +    console.log(`Received message ${msg} from user ${client}`);
        +  });
        +});
        +
        +server.on('upgrade', function upgrade(request, socket, head) {
        +  // This function is not defined on purpose. Implement it with your own logic.
        +  authenticate(request, (err, client) => {
        +    if (err || !client) {
        +      socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
        +      socket.destroy();
        +      return;
        +    }
        +
        +    wss.handleUpgrade(request, socket, head, function done(ws) {
        +      wss.emit('connection', ws, request, client);
        +    });
        +  });
        +});
        +
        +server.listen(8080);
        +
        + +

        Also see the provided example using express-session.

        + +

        Server broadcast

        + +

        A client WebSocket broadcasting to all connected WebSocket clients, including +itself.

        + +
        const WebSocket = require('ws');
        +
        +const wss = new WebSocket.Server({ port: 8080 });
        +
        +wss.on('connection', function connection(ws) {
        +  ws.on('message', function incoming(data) {
        +    wss.clients.forEach(function each(client) {
        +      if (client.readyState === WebSocket.OPEN) {
        +        client.send(data);
        +      }
        +    });
        +  });
        +});
        +
        + +

        A client WebSocket broadcasting to every other connected WebSocket clients, +excluding itself.

        + +
        const WebSocket = require('ws');
        +
        +const wss = new WebSocket.Server({ port: 8080 });
        +
        +wss.on('connection', function connection(ws) {
        +  ws.on('message', function incoming(data) {
        +    wss.clients.forEach(function each(client) {
        +      if (client !== ws && client.readyState === WebSocket.OPEN) {
        +        client.send(data);
        +      }
        +    });
        +  });
        +});
        +
        + +

        echo.websocket.org demo

        + +
        const WebSocket = require('ws');
        +
        +const ws = new WebSocket('wss://echo.websocket.org/', {
        +  origin: 'https://websocket.org'
        +});
        +
        +ws.on('open', function open() {
        +  console.log('connected');
        +  ws.send(Date.now());
        +});
        +
        +ws.on('close', function close() {
        +  console.log('disconnected');
        +});
        +
        +ws.on('message', function incoming(data) {
        +  console.log(`Roundtrip time: ${Date.now() - data} ms`);
        +
        +  setTimeout(function timeout() {
        +    ws.send(Date.now());
        +  }, 500);
        +});
        +
        + +

        Use the Node.js streams API

        + +
        const WebSocket = require('ws');
        +
        +const ws = new WebSocket('wss://echo.websocket.org/', {
        +  origin: 'https://websocket.org'
        +});
        +
        +const duplex = WebSocket.createWebSocketStream(ws, { encoding: 'utf8' });
        +
        +duplex.pipe(process.stdout);
        +process.stdin.pipe(duplex);
        +
        + +

        Other examples

        + +

        For a full example with a browser client communicating with a ws server, see the +examples folder.

        + +

        Otherwise, see the test cases.

        + +

        FAQ

        + +

        How to get the IP address of the client?

        + +

        The remote IP address can be obtained from the raw socket.

        + +
        const WebSocket = require('ws');
        +
        +const wss = new WebSocket.Server({ port: 8080 });
        +
        +wss.on('connection', function connection(ws, req) {
        +  const ip = req.socket.remoteAddress;
        +});
        +
        + +

        When the server runs behind a proxy like NGINX, the de-facto standard is to use +the X-Forwarded-For header.

        + +
        wss.on('connection', function connection(ws, req) {
        +  const ip = req.headers['x-forwarded-for'].split(',')[0].trim();
        +});
        +
        + +

        How to detect and close broken connections?

        + +

        Sometimes the link between the server and the client can be interrupted in a way +that keeps both the server and the client unaware of the broken state of the +connection (e.g. when pulling the cord).

        + +

        In these cases ping messages can be used as a means to verify that the remote +endpoint is still responsive.

        + +
        const WebSocket = require('ws');
        +
        +function noop() {}
        +
        +function heartbeat() {
        +  this.isAlive = true;
        +}
        +
        +const wss = new WebSocket.Server({ port: 8080 });
        +
        +wss.on('connection', function connection(ws) {
        +  ws.isAlive = true;
        +  ws.on('pong', heartbeat);
        +});
        +
        +const interval = setInterval(function ping() {
        +  wss.clients.forEach(function each(ws) {
        +    if (ws.isAlive === false) return ws.terminate();
        +
        +    ws.isAlive = false;
        +    ws.ping(noop);
        +  });
        +}, 30000);
        +
        +wss.on('close', function close() {
        +  clearInterval(interval);
        +});
        +
        + +

        Pong messages are automatically sent in response to ping messages as required by +the spec.

        + +

        Just like the server example above your clients might as well lose connection +without knowing it. You might want to add a ping listener on your clients to +prevent that. A simple implementation would be:

        + +
        const WebSocket = require('ws');
        +
        +function heartbeat() {
        +  clearTimeout(this.pingTimeout);
        +
        +  // Use `WebSocket#terminate()`, which immediately destroys the connection,
        +  // instead of `WebSocket#close()`, which waits for the close timer.
        +  // Delay should be equal to the interval at which your server
        +  // sends out pings plus a conservative assumption of the latency.
        +  this.pingTimeout = setTimeout(() => {
        +    this.terminate();
        +  }, 30000 + 1000);
        +}
        +
        +const client = new WebSocket('wss://echo.websocket.org/');
        +
        +client.on('open', heartbeat);
        +client.on('ping', heartbeat);
        +client.on('close', function clear() {
        +  clearTimeout(this.pingTimeout);
        +});
        +
        + +

        How to connect via a proxy?

        + +

        Use a custom http.Agent implementation like https-proxy-agent or +socks-proxy-agent.

        + +

        Changelog

        + +

        We're using the GitHub releases for changelog entries.

        + +

        License

        + +

        MIT

        +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/file_list.html b/docs/api/v1.8.2/lib/file_list.html new file mode 100644 index 00000000..a0e13ea6 --- /dev/null +++ b/docs/api/v1.8.2/lib/file_list.html @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + File List + + + +
        +
        +

        File List

        + + + +
        + + +
        + + diff --git a/docs/api/v1.8.2/lib/frames.html b/docs/api/v1.8.2/lib/frames.html new file mode 100644 index 00000000..d2a5073a --- /dev/null +++ b/docs/api/v1.8.2/lib/frames.html @@ -0,0 +1,17 @@ + + + + + lib (Opal v1.8.2) + + + + diff --git a/docs/api/v1.8.2/lib/index.html b/docs/api/v1.8.2/lib/index.html new file mode 100644 index 00000000..e64ca9ba --- /dev/null +++ b/docs/api/v1.8.2/lib/index.html @@ -0,0 +1,100 @@ + + + + + + + File: README + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Opal Documentation Central

        + +

        This repo will hold the keys for generating Opal API documentation and guides on the master branch, while the gh-pages branch will keep track of the generated docs. The source for the docs will be the Opal repo itself.

        + +

        documentation: Opal API

        + +

        Generating docs for a single version

        + +

        The passed version needs to be a valid git ref (e.g. a tag)

        + +
        bin/build v0.5.5
        +bin/build master
        +
        + +

        Rebuilding all the docs

        + +
        bin/build-all
        +
        + +

        Previewing locally

        + +
        bin/server # will use port 5000
        +
        + +

        Publishing (only with commit access)

        + +
        bin/deploy
        +
        +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/lib/js/app.js b/docs/api/v1.8.2/lib/js/app.js new file mode 100644 index 00000000..8d067fe3 --- /dev/null +++ b/docs/api/v1.8.2/lib/js/app.js @@ -0,0 +1,314 @@ +(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; + var curli; + 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++) { + if ( typeof(curli) == "undefined" ) { + curli = $('
          1. '); + toc.append(curli); + } + toc = $('
              '); + curli.append(toc); + curli = undefined; + } + } + if (thisTag < lastTag) { + for (i = 0; i < lastTag - thisTag; i++) { + toc = toc.parent(); + toc = toc.parent(); + } + } + var title = $(this).attr('toc-title'); + if (typeof(title) == "undefined") title = $(this).text(); + curli =$('
            1. ' + title + '
            2. '); + toc.append(curli); + 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/v1.8.2/lib/js/full_list.js b/docs/api/v1.8.2/lib/js/full_list.js new file mode 100644 index 00000000..59069c5e --- /dev/null +++ b/docs/api/v1.8.2/lib/js/full_list.js @@ -0,0 +1,216 @@ +(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/v1.8.2/lib/js/jquery.js b/docs/api/v1.8.2/lib/js/jquery.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/docs/api/v1.8.2/lib/js/jquery.js @@ -0,0 +1,4 @@ +/*! 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/v1.8.2/lib/method_list.html b/docs/api/v1.8.2/lib/method_list.html new file mode 100644 index 00000000..cf5bd037 --- /dev/null +++ b/docs/api/v1.8.2/lib/method_list.html @@ -0,0 +1,8379 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
        +
        +

        Method List

        + + + +
        + + +
        + + diff --git a/docs/api/v1.8.2/lib/top-level-namespace.html b/docs/api/v1.8.2/lib/top-level-namespace.html new file mode 100644 index 00000000..c559203e --- /dev/null +++ b/docs/api/v1.8.2/lib/top-level-namespace.html @@ -0,0 +1,177 @@ + + + + + + + Top Level Namespace + + — lib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Top Level Namespace + + + +

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

        Defined Under Namespace

        +

        + + + Modules: Opal + + + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        SystemRunner = +
        +
        +

        Generic runner that will resort to calling an external program.

        + + +
        +
        +
        + + +
        +
        +
        ->(data, &block) {
        +  options  = data[:options] || {}
        +  builder  = data.fetch(:builder).call
        +  output   = data.fetch(:output)
        +
        +  env      = options.fetch(:env, {})
        +  debug    = options.fetch(:debug, false) || RUBY_ENGINE == 'opal'
        +
        +  code = builder.to_s
        +  # Temporary issue with UTF-8, Base64 and source maps
        +  code += "\n" + builder.source_map.to_data_uri_comment unless RUBY_ENGINE == 'opal'
        +
        +  ext = builder.output_extension
        +
        +  tempfile =
        +    if debug
        +      File.new("opal-nodejs-runner.#{ext}", 'wb')
        +    else
        +      Tempfile.new(['opal-system-runner', ".#{ext}"], mode: File::BINARY)
        +    end
        +
        +  tempfile.write code
        +  cmd = block.call tempfile
        +  tempfile.close
        +
        +  if RUBY_PLATFORM == 'opal'
        +    # Opal doesn't support neither `out:` nor `IO.try_convert` nor `open3`
        +    system(env, *cmd)
        +    $?.exitstatus
        +  elsif IO.try_convert(output) && RUBY_PLATFORM != 'java'
        +    system(env, *cmd, out: output)
        +    $?.exitstatus
        +  else
        +    # JRuby (v9.2) doesn't support using `out:` to redirect output.
        +    require 'open3'
        +    captured_output, status = Open3.capture2(env, *cmd)
        +    output.write captured_output
        +    status.exitstatus
        +  end
        +}
        + +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Array.html b/docs/api/v1.8.2/stdlib/Array.html new file mode 100644 index 00000000..3e1753a1 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Array.html @@ -0,0 +1,632 @@ + + + + + + + Class: Array + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Array + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb,
        + opal/stdlib/json.rb,
        opal/stdlib/await.rb,
        opal/stdlib/native.rb,
        opal/stdlib/shellwords.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +
        +
        # File 'opal/stdlib/await.rb', line 22
        +
        +def each_await(&block)
        +  i = 0
        +  while i < `self.length`
        +    yield(self[i]).await
        +    i += 1
        +  end
        +  self
        +end
        +
        + + +
        +

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

        + + + + +
        +
        +
        +
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +
        +
        # File 'opal/stdlib/await.rb', line 12
        +
        +def map_await(&block)
        +  i = 0
        +  results = []
        +  while i < `self.length`
        +    results << yield(self[i]).await
        +    i += 1
        +  end
        +  results
        +end
        +
        +
        + +
        +

        + + #pretty_print(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +352
        +353
        +354
        +355
        +356
        +357
        +358
        +
        +
        # File 'opal/stdlib/pp.rb', line 352
        +
        +def pretty_print(q) # :nodoc:
        +  q.group(1, '[', ']') {
        +    q.seplist(self) {|v|
        +      q.pp v
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #pretty_print_cycle(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +360
        +361
        +362
        +
        +
        # File 'opal/stdlib/pp.rb', line 360
        +
        +def pretty_print_cycle(q) # :nodoc:
        +  q.text(empty? ? '[]' : '[...]')
        +end
        +
        +
        + +
        +

        + + #shelljoinObject + + + + + +

        +
        +

        call-seq: + array.shelljoin => string

        + +

        Builds a command line string from an argument list +array+ joining +all elements escaped for the Bourne shell and separated by a space.

        + +

        See Shellwords.shelljoin for details.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +237
        +238
        +239
        +
        +
        # File 'opal/stdlib/shellwords.rb', line 237
        +
        +def shelljoin
        +  Shellwords.join(self)
        +end
        +
        +
        + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +136
        +137
        +138
        +139
        +140
        +141
        +142
        +143
        +144
        +145
        +146
        +
        +
        # File 'opal/stdlib/json.rb', line 136
        +
        +def to_json
        +  %x{
        +    var result = [];
        +
        +    for (var i = 0, length = #{self}.length; i < length; i++) {
        +      result.push(#{`self[i]`.to_json});
        +    }
        +
        +    return '[' + result.join(',') + ']';
        +  }
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Retuns a copy of itself trying to call #to_n on each member.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +498
        +499
        +500
        +501
        +502
        +503
        +504
        +505
        +506
        +507
        +508
        +509
        +510
        +
        +
        # File 'opal/stdlib/native.rb', line 498
        +
        +def to_n
        +  %x{
        +    var result = [];
        +
        +    for (var i = 0, length = self.length; i < length; i++) {
        +      var obj = self[i];
        +
        +      result.push(#{Native.try_convert(`obj`, `obj`)});
        +    }
        +
        +    return result;
        +  }
        +end
        +
        +
        + + + + + + + + + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Base64.html b/docs/api/v1.8.2/stdlib/Base64.html new file mode 100644 index 00000000..14966ab2 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Base64.html @@ -0,0 +1,450 @@ + + + + + + + Module: Base64 + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Base64 + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/base64.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

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

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .decode64(string) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +61
        +62
        +63
        +
        +
        # File 'opal/stdlib/base64.rb', line 61
        +
        +def self.decode64(string)
        +  `decode(string.replace(/\r?\n/g, ''))`
        +end
        +
        +
        + +
        +

        + + .encode64(string) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +65
        +66
        +67
        +
        +
        # File 'opal/stdlib/base64.rb', line 65
        +
        +def self.encode64(string)
        +  `encode(string).replace(/(.{60})/g, "$1\n").replace(/([^\n])$/g, "$1\n")`
        +end
        +
        +
        + +
        +

        + + .strict_decode64(string) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +69
        +70
        +71
        +
        +
        # File 'opal/stdlib/base64.rb', line 69
        +
        +def self.strict_decode64(string)
        +  `decode(string)`
        +end
        +
        +
        + +
        +

        + + .strict_encode64(string) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +73
        +74
        +75
        +
        +
        # File 'opal/stdlib/base64.rb', line 73
        +
        +def self.strict_encode64(string)
        +  `encode(string)`
        +end
        +
        +
        + +
        +

        + + .urlsafe_decode64(string) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +77
        +78
        +79
        +
        +
        # File 'opal/stdlib/base64.rb', line 77
        +
        +def self.urlsafe_decode64(string)
        +  `decode(string.replace(/\-/g, '+').replace(/_/g, '/'))`
        +end
        +
        +
        + +
        +

        + + .urlsafe_encode64(string, padding: true) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +81
        +82
        +83
        +84
        +85
        +
        +
        # File 'opal/stdlib/base64.rb', line 81
        +
        +def self.urlsafe_encode64(string, padding: true)
        +  str = `encode(string).replace(/\+/g, '-').replace(/\//g, '_')`
        +  str = str.delete('=') unless padding
        +  str
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/BasicObject.html b/docs/api/v1.8.2/stdlib/BasicObject.html new file mode 100644 index 00000000..e7855d7b --- /dev/null +++ b/docs/api/v1.8.2/stdlib/BasicObject.html @@ -0,0 +1,238 @@ + + + + + + + Class: BasicObject + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: BasicObject + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/await.rb
        +
        + +
        + +
        +

        Direct Known Subclasses

        +

        Delegator, Native::Object, Object

        +
        + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #instance_exec_await(*args, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +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 'opal/stdlib/await.rb', line 82
        +
        +def instance_exec_await(*args, &block)
        +  ::Kernel.raise ::ArgumentError, 'no block given' unless block
        +
        +  # The awaits are defined inside an x-string. Opal can't find them
        +  # reliably and async-ify a method. Therefore, let's make Opal know
        +  # this is an async method.
        +  nil.__await__
        +
        +  %x{
        +    var block_self = block.$$s,
        +        result;
        +
        +    block.$$s = null;
        +
        +    if (self.$$is_a_module) {
        +      self.$$eval = true;
        +      try {
        +        result = await block.apply(self, args);
        +      }
        +      finally {
        +        self.$$eval = false;
        +      }
        +    }
        +    else {
        +      result = await block.apply(self, args);
        +    }
        +
        +    block.$$s = block_self;
        +
        +    return result;
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Benchmark.html b/docs/api/v1.8.2/stdlib/Benchmark.html new file mode 100644 index 00000000..7a96b2bc --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Benchmark.html @@ -0,0 +1,823 @@ + + + + + + + Module: Benchmark + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Benchmark + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/benchmark.rb
        +
        + +
        + +

        Overview

        +
        +

        The Benchmark module provides methods to measure and report the time +used to execute Ruby code.

        + +
          +
        • Measure the time to construct the string given by the expression +"a"*1_000_000_000:

          + +

          require 'benchmark'

          + +

          puts Benchmark.measure { "a"*1_000_000_000 }

        • +
        + +

        On my machine (OSX 10.8.3 on i5 1.7 Ghz) this generates:

        + +
          0.350000   0.400000   0.750000 (  0.835234)
        +
        + +

        This report shows the user CPU time, system CPU time, the sum of + the user and system CPU times, and the elapsed real time. The unit + of time is seconds.

        + +
          +
        • Do some experiments sequentially using the #bm method:

          + +

          require 'benchmark'

          + +

          n = 5000000 + Benchmark.bm do |x| + x.report { for i in 1..n; a = "1"; end } + x.report { n.times do ; a = "1"; end } + x.report { 1.upto(n) do ; a = "1"; end } + end

        • +
        + +

        The result:

        + +
                 user     system      total        real
        +     1.010000   0.000000   1.010000 (  1.014479)
        +     1.000000   0.000000   1.000000 (  0.998261)
        +     0.980000   0.000000   0.980000 (  0.981335)
        +
        + +
          +
        • Continuing the previous example, put a label in each report:

          + +

          require 'benchmark'

          + +

          n = 5000000 + Benchmark.bm(7) do |x| + x.report("for:") { for i in 1..n; a = "1"; end } + x.report("times:") { n.times do ; a = "1"; end } + x.report("upto:") { 1.upto(n) do ; a = "1"; end } + end

        • +
        + +

        The result:

        + +
                        user     system      total        real
        +  for:      1.010000   0.000000   1.010000 (  1.015688)
        +  times:    1.000000   0.000000   1.000000 (  1.003611)
        +  upto:     1.030000   0.000000   1.030000 (  1.028098)
        +
        + +
          +
        • The times for some benchmarks depend on the order in which items +are run. These differences are due to the cost of memory +allocation and garbage collection. To avoid these discrepancies, +the #bmbm method is provided. For example, to compare ways to +sort an array of floats:

          + +

          require 'benchmark'

          + +

          array = (1..1000000).map { rand }

          + +

          Benchmark.bmbm do |x| + x.report("sort!") { array.dup.sort! } + x.report("sort") { array.dup.sort } + end

        • +
        + +

        The result:

        + +
           Rehearsal -----------------------------------------
        +   sort!   1.490000   0.010000   1.500000 (  1.490520)
        +   sort    1.460000   0.000000   1.460000 (  1.463025)
        +   -------------------------------- total: 2.960000sec
        +
        +               user     system      total        real
        +   sort!   1.460000   0.000000   1.460000 (  1.460465)
        +   sort    1.450000   0.010000   1.460000 (  1.448327)
        +
        + +
          +
        • Report statistics of sequential experiments with unique labels, +using the #benchmark method:

          + +

          require 'benchmark' + include Benchmark # we need the CAPTION and FORMAT constants

          + +

          n = 5000000 + Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| + tf = x.report("for:") { for i in 1..n; a = "1"; end } + tt = x.report("times:") { n.times do ; a = "1"; end } + tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } + [tf+tt+tu, (tf+tt+tu)/3] + end

        • +
        + +

        The result:

        + +
                        user     system      total        real
        +   for:      0.950000   0.000000   0.950000 (  0.952039)
        +   times:    0.980000   0.000000   0.980000 (  0.984938)
        +   upto:     0.950000   0.000000   0.950000 (  0.946787)
        +   >total:   2.880000   0.000000   2.880000 (  2.883764)
        +   >avg:     0.960000   0.000000   0.960000 (  0.961255)
        +
        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + + + Classes: Job, Report, Tms + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        BENCHMARK_VERSION = +
        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        +
        +
        "2002-04-25"
        + +
        CAPTION = +
        +
        +

        The default caption string (heading above the output times).

        + + +
        +
        +
        + + +
        +
        +
        Benchmark::Tms::CAPTION
        + +
        FORMAT = +
        +
        +

        The default format string used to display times. See also Benchmark::Tms#format.

        + + +
        +
        +
        + + +
        +
        +
        Benchmark::Tms::FORMAT
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .benchmark(caption = "", label_width = nil, format = nil, *labels) ⇒ Object + + + + + +

        +
        +

        Invokes the block with a Benchmark::Report object, which +may be used to collect and report on the results of individual +benchmark tests. Reserves +label_width+ leading spaces for +labels on each line. Prints +caption+ at the top of the +report, and uses +format+ to format each line. +Returns an array of Benchmark::Tms objects.

        + +

        If the block returns an array of +Benchmark::Tms objects, these will be used to format +additional lines of output. If +label+ parameters are +given, these are used to label these extra lines.

        + +

        Note: Other methods provide a simpler interface to this one, and are +suitable for nearly all benchmarking requirements. See the examples in +Benchmark, and the #bm and #bmbm methods.

        + +

        Example:

        + +
        require 'benchmark'
        +include Benchmark          # we need the CAPTION and FORMAT constants
        +
        +n = 5000000
        +Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x|
        +  tf = x.report("for:")   { for i in 1..n; a = "1"; end }
        +  tt = x.report("times:") { n.times do   ; a = "1"; end }
        +  tu = x.report("upto:")  { 1.upto(n) do ; a = "1"; end }
        +  [tf+tt+tu, (tf+tt+tu)/3]
        +end
        +
        + +

        Generates:

        + +
                        user     system      total        real
        +  for:      0.970000   0.000000   0.970000 (  0.970493)
        +  times:    0.990000   0.000000   0.990000 (  0.989542)
        +  upto:     0.970000   0.000000   0.970000 (  0.972854)
        +  >total:   2.930000   0.000000   2.930000 (  2.932889)
        +  >avg:     0.976667   0.000000   0.976667 (  0.977630)
        +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +164
        +165
        +166
        +167
        +168
        +169
        +170
        +171
        +172
        +173
        +174
        +175
        +176
        +177
        +178
        +179
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 164
        +
        +def benchmark(caption = "", label_width = nil, format = nil, *labels) # :yield: report
        +  sync = STDOUT.sync
        +  STDOUT.sync = true
        +  label_width ||= 0
        +  label_width += 1
        +  format ||= FORMAT
        +  print ' '*label_width + caption unless caption.empty?
        +  report = Report.new(label_width, format)
        +  results = yield(report)
        +  Array === results and results.grep(Tms).each {|t|
        +    print((labels.shift || t.label || "").ljust(label_width), t.format(format))
        +  }
        +  report.list
        +ensure
        +  STDOUT.sync = sync unless sync.nil?
        +end
        +
        +
        + +
        +

        + + .bm(label_width = 0, *labels, &blk) ⇒ Object + + + + + +

        +
        +

        A simple interface to the #benchmark method, #bm generates sequential +reports with labels. The parameters have the same meaning as for

        + +

        benchmark.

        + +
        require 'benchmark'
        +
        +n = 5000000
        +Benchmark.bm(7) do |x|
        +  x.report("for:")   { for i in 1..n; a = "1"; end }
        +  x.report("times:") { n.times do   ; a = "1"; end }
        +  x.report("upto:")  { 1.upto(n) do ; a = "1"; end }
        +end
        +
        + +

        Generates:

        + +
                        user     system      total        real
        +  for:      0.960000   0.000000   0.960000 (  0.957966)
        +  times:    0.960000   0.000000   0.960000 (  0.960423)
        +  upto:     0.950000   0.000000   0.950000 (  0.954864)
        +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +203
        +204
        +205
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 203
        +
        +def bm(label_width = 0, *labels, &blk) # :yield: report
        +  benchmark(CAPTION, label_width, FORMAT, *labels, &blk)
        +end
        +
        +
        + +
        +

        + + .bmbm(width = 0) ⇒ Object + + + + + +

        +
        +

        Sometimes benchmark results are skewed because code executed +earlier encounters different garbage collection overheads than +that run later. #bmbm attempts to minimize this effect by running +the tests twice, the first time as a rehearsal in order to get the +runtime environment stable, the second time for +real. GC.start is executed before the start of each of +the real timings; the cost of this is not included in the +timings. In reality, though, there's only so much that #bmbm can +do, and the results are not guaranteed to be isolated from garbage +collection and other effects.

        + +

        Because #bmbm takes two passes through the tests, it can +calculate the required label width.

        + +
          require 'benchmark'
        +
        +  array = (1..1000000).map { rand }
        +
        +  Benchmark.bmbm do |x|
        +    x.report("sort!") { array.dup.sort! }
        +    x.report("sort")  { array.dup.sort  }
        +  end
        +
        + +

        Generates:

        + +
           Rehearsal -----------------------------------------
        +   sort!   1.440000   0.010000   1.450000 (  1.446833)
        +   sort    1.440000   0.000000   1.440000 (  1.448257)
        +   -------------------------------- total: 2.890000sec
        +
        +               user     system      total        real
        +   sort!   1.460000   0.000000   1.460000 (  1.458065)
        +   sort    1.450000   0.000000   1.450000 (  1.455963)
        +
        + +

        bmbm yields a Benchmark::Job object and returns an array of

        + +

        Benchmark::Tms objects.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 245
        +
        +def bmbm(width = 0) # :yield: job
        +  job = Job.new(width)
        +  yield(job)
        +  width = job.width + 1
        +  sync = STDOUT.sync
        +  STDOUT.sync = true
        +
        +  # rehearsal
        +  puts 'Rehearsal '.ljust(width+CAPTION.length,'-')
        +  ets = job.list.inject(Tms.new) { |sum,(label,item)|
        +    print label.ljust(width)
        +    res = Benchmark.measure(&item)
        +    print res.format
        +    sum + res
        +  }.format("total: %tsec")
        +  print " #{ets}\n\n".rjust(width+CAPTION.length+2,'-')
        +
        +  # take
        +  print ' '*width + CAPTION
        +  job.list.map { |label,item|
        +    GC.start
        +    print label.ljust(width)
        +    Benchmark.measure(label, &item).tap { |res| print res }
        +  }
        +ensure
        +  STDOUT.sync = sync unless sync.nil?
        +end
        +
        +
        + +
        +

        + + .measure(label = "") ⇒ Object + + + + + +

        +
        +

        Returns the time used to execute the given block as a +Benchmark::Tms object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +286
        +287
        +288
        +289
        +290
        +291
        +292
        +293
        +294
        +295
        +296
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 286
        +
        +def measure(label = "") # :yield:
        +  t0, r0 = Process.times, Process.clock_gettime(BENCHMARK_CLOCK)
        +  yield
        +  t1, r1 = Process.times, Process.clock_gettime(BENCHMARK_CLOCK)
        +  Benchmark::Tms.new(t1.utime  - t0.utime,
        +                     t1.stime  - t0.stime,
        +                     t1.cutime - t0.cutime,
        +                     t1.cstime - t0.cstime,
        +                     r1 - r0,
        +                     label)
        +end
        +
        +
        + +
        +

        + + .realtimeObject + + + + + +

        +
        +

        Returns the elapsed real time used to execute the given block.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +301
        +302
        +303
        +304
        +305
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 301
        +
        +def realtime # :yield:
        +  r0 = Process.clock_gettime(BENCHMARK_CLOCK)
        +  yield
        +  Process.clock_gettime(BENCHMARK_CLOCK) - r0
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Benchmark/Job.html b/docs/api/v1.8.2/stdlib/Benchmark/Job.html new file mode 100644 index 00000000..d4af51dd --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Benchmark/Job.html @@ -0,0 +1,468 @@ + + + + + + + Class: Benchmark::Job + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Benchmark::Job + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/benchmark.rb
        +
        + +
        + +

        Overview

        +
        +

        A Job is a sequence of labelled blocks to be processed by the +Benchmark.bmbm method. It is of little direct interest to the user.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #list ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          An array of 2-element arrays, consisting of label and block pairs.

          +
          + +
        • + + +
        • + + + #width ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Length of the widest label in the #list.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(width) ⇒ Job + + + + + +

        +
        +

        Returns an initialized Job instance. +Usually, one doesn't call this method directly, as new +Job objects are created by the #bmbm method. ++width+ is a initial value for the label offset used in formatting; +the #bmbm method passes its +width+ argument to this constructor.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +321
        +322
        +323
        +324
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 321
        +
        +def initialize(width)
        +  @width = width
        +  @list = []
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #listObject (readonly) + + + + + +

        +
        +

        An array of 2-element arrays, consisting of label and block pairs.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +341
        +342
        +343
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 341
        +
        +def list
        +  @list
        +end
        +
        +
        + + + +
        +

        + + #widthObject (readonly) + + + + + +

        +
        +

        Length of the widest label in the #list.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +344
        +345
        +346
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 344
        +
        +def width
        +  @width
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #item(label = "", &blk) ⇒ Object + + + + Also known as: + report + + + + +

        +
        +

        Registers the given label and block pair in the job list.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +329
        +330
        +331
        +332
        +333
        +334
        +335
        +336
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 329
        +
        +def item(label = "", &blk) # :yield:
        +  raise ArgumentError, "no block" unless block_given?
        +  label = label.to_s
        +  w = label.length
        +  @width = w if @width < w
        +  @list << [label, blk]
        +  self
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Benchmark/Report.html b/docs/api/v1.8.2/stdlib/Benchmark/Report.html new file mode 100644 index 00000000..fa6ef8f8 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Benchmark/Report.html @@ -0,0 +1,381 @@ + + + + + + + Class: Benchmark::Report + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Benchmark::Report + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/benchmark.rb
        +
        + +
        + +

        Overview

        +
        +

        This class is used by the Benchmark.benchmark and Benchmark.bm methods. +It is of little direct interest to the user.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #list ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          An array of Benchmark::Tms objects representing each item.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(width = 0, format = nil) ⇒ Report + + + + + +

        +
        +

        Returns an initialized Report instance. +Usually, one doesn't call this method directly, as new +Report objects are created by the #benchmark and #bm methods. ++width+ and +format+ are the label offset and +format string used by Tms#format.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +359
        +360
        +361
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 359
        +
        +def initialize(width = 0, format = nil)
        +  @width, @format, @list = width, format, []
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #listObject (readonly) + + + + + +

        +
        +

        An array of Benchmark::Tms objects representing each item.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +378
        +379
        +380
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 378
        +
        +def list
        +  @list
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #item(label = "", *format, &blk) ⇒ Object + + + + Also known as: + report + + + + +

        +
        +

        Prints the +label+ and measured time for the block, +formatted by +format+. See Tms#format for the +formatting rules.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +368
        +369
        +370
        +371
        +372
        +373
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 368
        +
        +def item(label = "", *format, &blk) # :yield:
        +  print label.to_s.ljust(@width)
        +  @list << res = Benchmark.measure(label, &blk)
        +  print res.format(@format, *format)
        +  res
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Benchmark/Tms.html b/docs/api/v1.8.2/stdlib/Benchmark/Tms.html new file mode 100644 index 00000000..20822704 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Benchmark/Tms.html @@ -0,0 +1,1448 @@ + + + + + + + Class: Benchmark::Tms + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Benchmark::Tms + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/benchmark.rb
        +
        + +
        + +

        Overview

        +
        +

        A data object, representing the times associated with a benchmark +measurement.

        + + +
        +
        +
        + + +
        + +

        + Constant Summary + collapse +

        + +
        + +
        CAPTION = +
        +
        +

        Default caption, see also Benchmark::CAPTION

        + + +
        +
        +
        + + +
        +
        +
        "      user     system      total        real\n"
        + +
        FORMAT = +
        +
        +

        Default format string, see also Benchmark::FORMAT

        + + +
        +
        +
        + + +
        +
        +
        "%10.6u %10.6y %10.6t %10.6r\n"
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #cstime ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          System CPU time of children.

          +
          + +
        • + + +
        • + + + #cutime ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          User CPU time of children.

          +
          + +
        • + + +
        • + + + #label ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Label.

          +
          + +
        • + + +
        • + + + #real ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Elapsed real time.

          +
          + +
        • + + +
        • + + + #stime ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          System CPU time.

          +
          + +
        • + + +
        • + + + #total ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+.

          +
          + +
        • + + +
        • + + + #utime ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          User CPU time.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #*(x) ⇒ Object + + + + + + + + + + + + + +

          Returns a new Tms object obtained by memberwise multiplication of the individual times for this Tms object by x.

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

          Returns a new Tms object obtained by memberwise summation of the individual times for this Tms object with those of the other Tms object.

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

          Returns a new Tms object obtained by memberwise subtraction of the individual times for the other Tms object from those of this Tms object.

          +
          + +
        • + + +
        • + + + #/(x) ⇒ Object + + + + + + + + + + + + + +

          Returns a new Tms object obtained by memberwise division of the individual times for this Tms object by x.

          +
          + +
        • + + +
        • + + + #add(&blk) ⇒ Object + + + + + + + + + + + + + +

          Returns a new Tms object whose times are the sum of the times for this Tms object, plus the time required to execute the code block (+blk+).

          +
          + +
        • + + +
        • + + + #add!(&blk) ⇒ Object + + + + + + + + + + + + + +

          An in-place version of #add.

          +
          + +
        • + + +
        • + + + #format(format = nil, *args) ⇒ Object + + + + + + + + + + + + + +

          Returns the contents of this Tms object as a formatted string, according to a format string like that passed to Kernel.format.

          +
          + +
        • + + +
        • + + + #initialize(utime = 0.0, stime = 0.0, cutime = 0.0, cstime = 0.0, real = 0.0, label = nil) ⇒ Tms + + + + + + + constructor + + + + + + + + +

          Returns an initialized Tms object which has +utime+ as the user CPU time, +stime+ as the system CPU time, +cutime+ as the children's user CPU time, +cstime+ as the children's system CPU time, +real+ as the elapsed real time and +label+ as the label.

          +
          + +
        • + + +
        • + + + #to_a ⇒ Object + + + + + + + + + + + + + +

          Returns a new 6-element array, consisting of the label, user CPU time, system CPU time, children's user CPU time, children's system CPU time and elapsed real time.

          +
          + +
        • + + +
        • + + + #to_h ⇒ Object + + + + + + + + + + + + + +

          Returns a hash containing the same data as to_a.

          +
          + +
        • + + +
        • + + + #to_s ⇒ Object + + + + + + + + + + + + + +

          Same as #format.

          +
          + +
        • + + +
        + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(utime = 0.0, stime = 0.0, cutime = 0.0, cstime = 0.0, real = 0.0, label = nil) ⇒ Tms + + + + + +

        +
        +

        Returns an initialized Tms object which has ++utime+ as the user CPU time, +stime+ as the system CPU time, ++cutime+ as the children's user CPU time, +cstime+ as the children's +system CPU time, +real+ as the elapsed real time and +label+ as the label.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +422
        +423
        +424
        +425
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 422
        +
        +def initialize(utime = 0.0, stime = 0.0, cutime = 0.0, cstime = 0.0, real = 0.0, label = nil)
        +  @utime, @stime, @cutime, @cstime, @real, @label = utime, stime, cutime, cstime, real, label.to_s
        +  @total = @utime + @stime + @cutime + @cstime
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #cstimeObject (readonly) + + + + + +

        +
        +

        System CPU time of children

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +405
        +406
        +407
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 405
        +
        +def cstime
        +  @cstime
        +end
        +
        +
        + + + +
        +

        + + #cutimeObject (readonly) + + + + + +

        +
        +

        User CPU time of children

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +402
        +403
        +404
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 402
        +
        +def cutime
        +  @cutime
        +end
        +
        +
        + + + +
        +

        + + #labelObject (readonly) + + + + + +

        +
        +

        Label

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +414
        +415
        +416
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 414
        +
        +def label
        +  @label
        +end
        +
        +
        + + + +
        +

        + + #realObject (readonly) + + + + + +

        +
        +

        Elapsed real time

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +408
        +409
        +410
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 408
        +
        +def real
        +  @real
        +end
        +
        +
        + + + +
        +

        + + #stimeObject (readonly) + + + + + +

        +
        +

        System CPU time

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +399
        +400
        +401
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 399
        +
        +def stime
        +  @stime
        +end
        +
        +
        + + + +
        +

        + + #totalObject (readonly) + + + + + +

        +
        +

        Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +411
        +412
        +413
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 411
        +
        +def total
        +  @total
        +end
        +
        +
        + + + +
        +

        + + #utimeObject (readonly) + + + + + +

        +
        +

        User CPU time

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +396
        +397
        +398
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 396
        +
        +def utime
        +  @utime
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #*(x) ⇒ Object + + + + + +

        +
        +

        Returns a new Tms object obtained by memberwise multiplication +of the individual times for this Tms object by x.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +467
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 467
        +
        +def *(x); memberwise(:*, x) end
        +
        +
        + +
        +

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

        +
        +

        Returns a new Tms object obtained by memberwise summation +of the individual times for this Tms object with those of the other +Tms object. +This method and #/() are useful for taking statistics.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +454
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 454
        +
        +def +(other); memberwise(:+, other) end
        +
        +
        + +
        +

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

        +
        +

        Returns a new Tms object obtained by memberwise subtraction +of the individual times for the other Tms object from those of this +Tms object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +461
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 461
        +
        +def -(other); memberwise(:-, other) end
        +
        +
        + +
        +

        + + #/(x) ⇒ Object + + + + + +

        +
        +

        Returns a new Tms object obtained by memberwise division +of the individual times for this Tms object by x. +This method and #+() are useful for taking statistics.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +474
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 474
        +
        +def /(x); memberwise(:/, x) end
        +
        +
        + +
        +

        + + #add(&blk) ⇒ Object + + + + + +

        +
        +

        Returns a new Tms object whose times are the sum of the times for this +Tms object, plus the time required to execute the code block (+blk+).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +431
        +432
        +433
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 431
        +
        +def add(&blk) # :yield:
        +  self + Benchmark.measure(&blk)
        +end
        +
        +
        + +
        +

        + + #add!(&blk) ⇒ Object + + + + + +

        +
        +

        An in-place version of #add.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +438
        +439
        +440
        +441
        +442
        +443
        +444
        +445
        +446
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 438
        +
        +def add!(&blk)
        +  t = Benchmark.measure(&blk)
        +  @utime  = utime + t.utime
        +  @stime  = stime + t.stime
        +  @cutime = cutime + t.cutime
        +  @cstime = cstime + t.cstime
        +  @real   = real + t.real
        +  self
        +end
        +
        +
        + +
        +

        + + #format(format = nil, *args) ⇒ Object + + + + + +

        +
        +

        Returns the contents of this Tms object as +a formatted string, according to a format string +like that passed to Kernel.format. In addition, #format +accepts the following extensions:

        + +

        %u:: Replaced by the user CPU time, as reported by Tms#utime. +%y:: Replaced by the system CPU time, as reported by #stime (Mnemonic: y of "s*y*stem") +%U:: Replaced by the children's user CPU time, as reported by Tms#cutime +%Y:: Replaced by the children's system CPU time, as reported by Tms#cstime +%t:: Replaced by the total CPU time, as reported by Tms#total +%r:: Replaced by the elapsed real time, as reported by Tms#real +%n:: Replaced by the label string, as reported by Tms#label (Mnemonic: n of "*n*ame")

        + +

        If format is not given, FORMAT is used as default value, detailing the +user, system and real elapsed time.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +493
        +494
        +495
        +496
        +497
        +498
        +499
        +500
        +501
        +502
        +503
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 493
        +
        +def format(format = nil, *args)
        +  str = (format || FORMAT).dup
        +  .gsub(/(%[-+.\d]*)n/) { "#{$1}s" % label }
        +  .gsub(/(%[-+.\d]*)u/) { "#{$1}f" % utime }
        +  .gsub(/(%[-+.\d]*)y/) { "#{$1}f" % stime }
        +  .gsub(/(%[-+.\d]*)U/) { "#{$1}f" % cutime }
        +  .gsub(/(%[-+.\d]*)Y/) { "#{$1}f" % cstime }
        +  .gsub(/(%[-+.\d]*)t/) { "#{$1}f" % total }
        +  .gsub(/(%[-+.\d]*)r/) { "(#{$1}f)" % real }
        +  format ? str % args : str
        +end
        +
        +
        + +
        +

        + + #to_aObject + + + + + +

        +
        +

        Returns a new 6-element array, consisting of the +label, user CPU time, system CPU time, children's +user CPU time, children's system CPU time and elapsed +real time.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +518
        +519
        +520
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 518
        +
        +def to_a
        +  [@label, @utime, @stime, @cutime, @cstime, @real]
        +end
        +
        +
        + +
        +

        + + #to_hObject + + + + + +

        +
        +

        Returns a hash containing the same data as to_a.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +525
        +526
        +527
        +528
        +529
        +530
        +531
        +532
        +533
        +534
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 525
        +
        +def to_h
        +  {
        +    label:  @label,
        +    utime:  @utime,
        +    stime:  @stime,
        +    cutime: @cutime,
        +    cstime: @cstime,
        +    real:   @real
        +  }
        +end
        +
        +
        + +
        +

        + + #to_sObject + + + + + +

        +
        +

        Same as #format.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +508
        +509
        +510
        +
        +
        # File 'opal/stdlib/benchmark.rb', line 508
        +
        +def to_s
        +  format
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/BigDecimal.html b/docs/api/v1.8.2/stdlib/BigDecimal.html new file mode 100644 index 00000000..2cbc6a16 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/BigDecimal.html @@ -0,0 +1,2194 @@ + + + + + + + Class: BigDecimal + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: BigDecimal + + + +

        +
        + +
        +
        Inherits:
        +
        + Numeric + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/bigdecimal.rb,
        + opal/stdlib/bigdecimal.rb,
        opal/stdlib/bigdecimal/util.rb,
        opal/stdlib/bigdecimal/bignumber.js.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +
        + +

        + Constant Summary + collapse +

        + +
        + +
        VERSION = + +
        +
        '0'
        + +
        ROUND_MODE = + +
        +
        256
        + +
        ROUND_UP = +
        +
        +

        NOTE: the numeric values of the ROUND_* constants +follow BigNumber.js, they are NOT the same as MRI

        + + +
        +
        +
        + + +
        +
        +
        0
        + +
        ROUND_DOWN = + +
        +
        1
        + +
        ROUND_CEILING = + +
        +
        2
        + +
        ROUND_FLOOR = + +
        +
        3
        + +
        ROUND_HALF_UP = + +
        +
        4
        + +
        ROUND_HALF_DOWN = + +
        +
        5
        + +
        ROUND_HALF_EVEN = + +
        +
        6
        + +
        SIGN_NaN = + +
        +
        0
        + +
        SIGN_POSITIVE_ZERO = + +
        +
        1
        + +
        SIGN_NEGATIVE_ZERO = + +
        +
        -1
        + +
        SIGN_POSITIVE_FINITE = + +
        +
        2
        + +
        SIGN_NEGATIVE_FINITE = + +
        +
        -2
        + +
        SIGN_POSITIVE_INFINITE = + +
        +
        3
        + +
        SIGN_NEGATIVE_INFINITE = + +
        +
        -3
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #bignumber ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute bignumber.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Numeric

        +

        #to_json, #to_n

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(initial, digits = 0) ⇒ BigDecimal + + + + + +

        +
        +

        Returns a new instance of BigDecimal.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +59
        +60
        +61
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 59
        +
        +def initialize(initial, digits = 0)
        +  @bignumber = JS.new(BigNumber, initial)
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #bignumberObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute bignumber.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +57
        +58
        +59
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 57
        +
        +def bignumber
        +  @bignumber
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .limit(digits = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +44
        +45
        +46
        +47
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 44
        +
        +def self.limit(digits = nil)
        +  @digits = digits if digits
        +  @digits
        +end
        +
        +
        + +
        +

        + + .mode(mode, value = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 49
        +
        +def self.mode(mode, value = nil)
        +  case mode
        +  when ROUND_MODE
        +    @round_mode = value if value
        +    @round_mode || ROUND_HALF_UP
        +  end
        +end
        +
        +
        + +
        +

        + + .new(*args, **kwargs) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +16
        +17
        +18
        +19
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 16
        +
        +def BigDecimal.new(*args, **kwargs)
        +  warn 'BigDecimal.new is deprecated; use BigDecimal() method instead.', uplevel: 1
        +  BigDecimal(*args, **kwargs)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +84
        +85
        +86
        +87
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 84
        +
        +def <(other)
        +  return false if nan? || other && other.nan?
        +  super
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +89
        +90
        +91
        +92
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 89
        +
        +def <=(other)
        +  return false if nan? || other && other.nan?
        +  super
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +74
        +75
        +76
        +77
        +78
        +79
        +80
        +81
        +82
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 74
        +
        +def <=>(other)
        +  result = case other
        +           when self.class
        +             bignumber.JS.comparedTo(other.bignumber)
        +           when Number
        +             bignumber.JS.comparedTo(other)
        +           end
        +  `#{result} === null ? nil : #{result}`
        +end
        +
        +
        + +
        +

        + + #==(other) ⇒ Object + + + + Also known as: + === + + + + +

        + + + + +
        +
        +
        +
        +63
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +72
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 63
        +
        +def ==(other)
        +  case other
        +  when self.class
        +    bignumber.JS.equals(other.bignumber)
        +  when Number
        +    bignumber.JS.equals(other)
        +  else
        +    false
        +  end
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +94
        +95
        +96
        +97
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 94
        +
        +def >(other)
        +  return false if nan? || other && other.nan?
        +  super
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +99
        +100
        +101
        +102
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 99
        +
        +def >=(other)
        +  return false if nan? || other && other.nan?
        +  super
        +end
        +
        +
        + +
        +

        + + #absObject + + + + + +

        + + + + +
        +
        +
        +
        +104
        +105
        +106
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 104
        +
        +def abs
        +  self.class.new(bignumber.JS.abs)
        +end
        +
        +
        + +
        +

        + + #add(other, digits = 0) ⇒ Object + + + + Also known as: + + + + + + +

        + + + + +
        +
        +
        +
        +108
        +109
        +110
        +111
        +112
        +113
        +114
        +115
        +116
        +117
        +118
        +119
        +120
        +121
        +122
        +123
        +124
        +125
        +126
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 108
        +
        +def add(other, digits = 0)
        +  if digits.nil?
        +    raise TypeError, 'wrong argument type nil (expected Fixnum)'
        +  end
        +
        +  if digits < 0
        +    raise ArgumentError, 'argument must be positive'
        +  end
        +
        +  other, _ = coerce(other)
        +
        +  result = bignumber.JS.plus(other.bignumber)
        +
        +  if digits > 0
        +    result = result.JS.toDigits(digits, self.class.mode(ROUND_MODE))
        +  end
        +
        +  self.class.new(result)
        +end
        +
        +
        + +
        +

        + + #ceil(n = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +128
        +129
        +130
        +131
        +132
        +133
        +134
        +135
        +136
        +137
        +138
        +139
        +140
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 128
        +
        +def ceil(n = nil)
        +  unless bignumber.JS.isFinite
        +    raise FloatDomainError, "Computation results to 'Infinity'"
        +  end
        +
        +  if n.nil?
        +    bignumber.JS.round(0, ROUND_CEILING).JS.toNumber
        +  elsif n >= 0
        +    self.class.new(bignumber.JS.round(n, ROUND_CEILING))
        +  else
        +    self.class.new(bignumber.JS.round(0, ROUND_CEILING))
        +  end
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +142
        +143
        +144
        +145
        +146
        +147
        +148
        +149
        +150
        +151
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 142
        +
        +def coerce(other)
        +  case other
        +  when self.class
        +    [other, self]
        +  when Number
        +    [self.class.new(other), self]
        +  else
        +    raise TypeError, "#{other.class} can't be coerced into #{self.class}"
        +  end
        +end
        +
        +
        + +
        +

        + + #div(other, digits = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +153
        +154
        +155
        +156
        +157
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +169
        +170
        +171
        +172
        +173
        +174
        +175
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 153
        +
        +def div(other, digits = nil)
        +  return self / other if digits == 0
        +
        +  other, _ = coerce(other)
        +
        +  if nan? || other.nan?
        +    raise FloatDomainError, "Computation results to 'NaN'(Not a Number)"
        +  end
        +
        +  if digits.nil?
        +    if other.zero?
        +      raise ZeroDivisionError, 'divided by 0'
        +    end
        +
        +    if infinite?
        +      raise FloatDomainError, "Computation results to 'Infinity'"
        +    end
        +
        +    return self.class.new(bignumber.JS.dividedToIntegerBy(other.bignumber))
        +  end
        +
        +  self.class.new(bignumber.JS.dividedBy(other.bignumber).JS.round(digits, self.class.mode(ROUND_MODE)))
        +end
        +
        +
        + +
        +

        + + #finite?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +177
        +178
        +179
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 177
        +
        +def finite?
        +  bignumber.JS.isFinite
        +end
        +
        +
        + +
        +

        + + #infinite?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +181
        +182
        +183
        +184
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 181
        +
        +def infinite?
        +  return nil if finite? || nan?
        +  bignumber.JS.isNegative ? -1 : 1
        +end
        +
        +
        + +
        +

        + + #minus(other) ⇒ Object + + + + Also known as: + - + + + + +

        + + + + +
        +
        +
        +
        +186
        +187
        +188
        +189
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 186
        +
        +def minus(other)
        +  other, _ = coerce(other)
        +  self.class.new(bignumber.JS.minus(other.bignumber))
        +end
        +
        +
        + +
        +

        + + #mult(other, digits = nil) ⇒ Object + + + + Also known as: + * + + + + +

        + + + + +
        +
        +
        +
        +191
        +192
        +193
        +194
        +195
        +196
        +197
        +198
        +199
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 191
        +
        +def mult(other, digits = nil)
        +  other, _ = coerce(other)
        +
        +  if digits.nil?
        +    return self.class.new(bignumber.JS.times(other.bignumber))
        +  end
        +
        +  self.class.new(bignumber.JS.times(other.bignumber).JS.round(digits, self.class.mode(ROUND_MODE)))
        +end
        +
        +
        + +
        +

        + + #nan?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +201
        +202
        +203
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 201
        +
        +def nan?
        +  bignumber.JS.isNaN
        +end
        +
        +
        + +
        +

        + + #quo(other) ⇒ Object + + + + Also known as: + / + + + + +

        + + + + +
        +
        +
        +
        +205
        +206
        +207
        +208
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 205
        +
        +def quo(other)
        +  other, _ = coerce(other)
        +  self.class.new(bignumber.JS.dividedBy(other.bignumber))
        +end
        +
        +
        + +
        +

        + + #signObject + + + + + +

        + + + + +
        +
        +
        +
        +210
        +211
        +212
        +213
        +214
        +215
        +216
        +217
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 210
        +
        +def sign
        +  if bignumber.JS.isNaN
        +    return SIGN_NaN
        +  end
        +  if bignumber.JS.isZero
        +    return bignumber.JS.isNegative ? SIGN_NEGATIVE_ZERO : SIGN_POSITIVE_ZERO
        +  end
        +end
        +
        +
        + +
        +

        + + #sub(other, precision) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +219
        +220
        +221
        +222
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 219
        +
        +def sub(other, precision)
        +  other, _ = coerce(other)
        +  self.class.new(bignumber.JS.minus(other.bignumber))
        +end
        +
        +
        + +
        +

        + + #to_dObject + + + + + +

        +
        +

        call-seq: + a.to_d -> bigdecimal

        + +

        Returns self.

        + +
        require 'bigdecimal/util'
        +
        +d = BigDecimal("3.14")
        +d.to_d                       # => 0.314e1
        +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +107
        +108
        +109
        +
        +
        # File 'opal/stdlib/bigdecimal/util.rb', line 107
        +
        +def to_d
        +  self
        +end
        +
        +
        + +
        +

        + + #to_digitsObject + + + + + +

        +
        +

        call-seq: + a.to_digits -> string

        + +

        Converts a BigDecimal to a String of the form "nnnnnn.mmm". +This method is deprecated; use BigDecimal#to_s("F") instead.

        + +
        require 'bigdecimal/util'
        +
        +d = BigDecimal("3.14")
        +d.to_digits                  # => "3.14"
        +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +87
        +88
        +89
        +90
        +91
        +92
        +93
        +94
        +95
        +
        +
        # File 'opal/stdlib/bigdecimal/util.rb', line 87
        +
        +def to_digits
        +  if nan? || infinite? || zero?
        +    to_s
        +  else
        +    i          = to_i.to_s
        +    _, f, _, z = frac.split
        +    i + '.' + ('0' * -z) + f
        +  end
        +end
        +
        +
        + +
        +

        + + #to_fObject + + + + + +

        + + + + +
        +
        +
        +
        +224
        +225
        +226
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 224
        +
        +def to_f
        +  bignumber.JS.toNumber
        +end
        +
        +
        + +
        +

        + + #to_s(s = '') ⇒ Object + + + + Also known as: + inspect + + + + +

        + + + + +
        +
        +
        +
        +228
        +229
        +230
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 228
        +
        +def to_s(s = '')
        +  bignumber.JS.toString
        +end
        +
        +
        + +
        +

        + + #zero?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +232
        +233
        +234
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 232
        +
        +def zero?
        +  bignumber.JS.isZero
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Boolean.html b/docs/api/v1.8.2/stdlib/Boolean.html new file mode 100644 index 00000000..9491da91 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Boolean.html @@ -0,0 +1,274 @@ + + + + + + + Class: Boolean + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Boolean + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/json.rb,
        + opal/stdlib/native.rb
        +
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +150
        +151
        +152
        +
        +
        # File 'opal/stdlib/json.rb', line 150
        +
        +def to_json
        +  `(self == true) ? 'true' : 'false'`
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Returns the internal JavaScript value (with valueOf).

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          the internal JavaScript value (with valueOf).

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +515
        +516
        +517
        +
        +
        # File 'opal/stdlib/native.rb', line 515
        +
        +def to_n
        +  `self.valueOf()`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Buffer.html b/docs/api/v1.8.2/stdlib/Buffer.html new file mode 100644 index 00000000..c6304ce1 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Buffer.html @@ -0,0 +1,620 @@ + + + + + + + Class: Buffer + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Buffer + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Native::Wrapper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/buffer/view.rb,
        + opal/stdlib/buffer.rb,
        opal/stdlib/buffer/array.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + + + Classes: Array, View + + +

        + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods included from Native::Wrapper

        +

        included, #to_n

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(size, bits = 8) ⇒ Buffer + + + + + +

        +
        +

        Returns a new instance of Buffer.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +
        +
        # File 'opal/stdlib/buffer.rb', line 23
        +
        +def initialize(size, bits = 8)
        +  if native?(size)
        +    super(size)
        +  else
        +    super(`new ArrayBuffer(size * (bits / 8))`)
        +  end
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .name_for(bits, type) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +
        +
        # File 'opal/stdlib/buffer.rb', line 14
        +
        +def self.name_for(bits, type)
        +  part = case type
        +         when :unsigned then 'Uint'
        +         when :signed   then 'Int'
        +         when :float    then 'Float'
        +         end
        +  "#{part}#{bits}"
        +end
        +
        +
        + +
        +

        + + .supported?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +10
        +11
        +12
        +
        +
        # File 'opal/stdlib/buffer.rb', line 10
        +
        +def self.supported?
        +  !$$[:ArrayBuffer].nil?
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #lengthObject + + + + Also known as: + size + + + + +

        + + + + +
        +
        +
        +
        +31
        +32
        +33
        +
        +
        # File 'opal/stdlib/buffer.rb', line 31
        +
        +def length
        +  `#{@native}.byteLength`
        +end
        +
        +
        + +
        +

        + + #to_a(bits = 8, type = :unsigned) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +35
        +36
        +37
        +
        +
        # File 'opal/stdlib/buffer.rb', line 35
        +
        +def to_a(bits = 8, type = :unsigned)
        +  Array.new(self, bits, type)
        +end
        +
        +
        + +
        +

        + + #to_sObject + + + + + +

        + + + + +
        +
        +
        +
        +43
        +44
        +45
        +
        +
        # File 'opal/stdlib/buffer.rb', line 43
        +
        +def to_s
        +  to_a.to_a.pack('c*')
        +end
        +
        +
        + +
        +

        + + #view(offset = nil, length = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +39
        +40
        +41
        +
        +
        # File 'opal/stdlib/buffer.rb', line 39
        +
        +def view(offset = nil, length = nil)
        +  View.new(self, offset, length)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Buffer/Array.html b/docs/api/v1.8.2/stdlib/Buffer/Array.html new file mode 100644 index 00000000..a38e56cb --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Buffer/Array.html @@ -0,0 +1,861 @@ + + + + + + + Class: Buffer::Array + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Buffer::Array + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Enumerable, Native::Wrapper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/buffer/array.rb
        +
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #buffer ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute buffer.

          +
          + +
        • + + +
        • + + + #type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute type.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods included from Enumerable

        +

        #each_async, #to_json

        + + + + + + + + + +

        Methods included from Native::Wrapper

        +

        included, #to_n

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(buffer, bits = nil, type = nil) ⇒ Array + + + + + +

        +
        +

        Returns a new instance of Array.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 15
        +
        +def initialize(buffer, bits = nil, type = nil)
        +  if Native == buffer
        +    super(buffer)
        +  else
        +    %x{
        +      var klass = #{Array.for(bits, type)};
        +
        +      #{super(`new klass(#{buffer.to_n})`)}
        +    }
        +  end
        +
        +  @buffer = buffer
        +  @type   = type
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #bufferObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute buffer.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +13
        +14
        +15
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 13
        +
        +def buffer
        +  @buffer
        +end
        +
        +
        + + + +
        +

        + + #typeObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute type.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +13
        +14
        +15
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 13
        +
        +def type
        +  @type
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .for(bits, type) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +7
        +8
        +9
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 7
        +
        +def self.for(bits, type)
        +  $$["#{Buffer.name_for bits, type}Array"]
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #[](index, offset = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +34
        +35
        +36
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 34
        +
        +def [](index, offset = nil)
        +  offset ? `#{@native}.subarray(index, offset)` : `#{@native}[index]`
        +end
        +
        +
        + +
        +

        + + #[]=(index, value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +38
        +39
        +40
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 38
        +
        +def []=(index, value)
        +  `#{@native}[index] = value`
        +end
        +
        +
        + +
        +

        + + #bitsObject + + + + + +

        + + + + +
        +
        +
        +
        +30
        +31
        +32
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 30
        +
        +def bits
        +  `#{@native}.BYTES_PER_ELEMENT * 8`
        +end
        +
        +
        + +
        +

        + + #bytesizeObject + + + + + +

        + + + + +
        +
        +
        +
        +42
        +43
        +44
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 42
        +
        +def bytesize
        +  `#{@native}.byteLength`
        +end
        +
        +
        + +
        +

        + + #eachObject + + + + + +

        + + + + +
        +
        +
        +
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 46
        +
        +def each
        +  return enum_for :each unless block_given?
        +
        +  %x{
        +    for (var i = 0, length = #{@native}.length; i < length; i++) {
        +      #{yield `#{@native}[i]`}
        +    }
        +  }
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #lengthObject + + + + Also known as: + size + + + + +

        + + + + +
        +
        +
        +
        +58
        +59
        +60
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 58
        +
        +def length
        +  `#{@native}.length`
        +end
        +
        +
        + +
        +

        + + #merge!(other, offset = undefined) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +62
        +63
        +64
        +
        +
        # File 'opal/stdlib/buffer/array.rb', line 62
        +
        +def merge!(other, offset = undefined)
        +  `#{@native}.set(#{other.to_n}, offset)`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Buffer/View.html b/docs/api/v1.8.2/stdlib/Buffer/View.html new file mode 100644 index 00000000..85a46783 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Buffer/View.html @@ -0,0 +1,1492 @@ + + + + + + + Class: Buffer::View + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Buffer::View + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Native::Wrapper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/buffer/view.rb
        +
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #buffer ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute buffer.

          +
          + +
        • + + +
        • + + + #offset ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute offset.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods included from Native::Wrapper

        +

        included, #to_n

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(buffer, offset = nil, length = nil) ⇒ View + + + + + +

        +
        +

        Returns a new instance of View.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 13
        +
        +def initialize(buffer, offset = nil, length = nil)
        +  if native?(buffer)
        +    super(buffer)
        +  elsif offset && length
        +    super(`new DataView(#{buffer.to_n}, #{offset.to_n}, #{length.to_n})`)
        +  elsif offset
        +    super(`new DataView(#{buffer.to_n}, #{offset.to_n})`)
        +  else
        +    super(`new DataView(#{buffer.to_n})`)
        +  end
        +
        +  @buffer = buffer
        +  @offset = offset
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #bufferObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute buffer.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +11
        +12
        +13
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 11
        +
        +def buffer
        +  @buffer
        +end
        +
        +
        + + + +
        +

        + + #offsetObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute offset.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +11
        +12
        +13
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 11
        +
        +def offset
        +  @offset
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .supported?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +7
        +8
        +9
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 7
        +
        +def self.supported?
        +  !$$[:DataView].nil?
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #get(offset, bits = 8, type = :unsigned, little = false) ⇒ Object + + + + Also known as: + [] + + + + +

        + + + + +
        +
        +
        +
        +32
        +33
        +34
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 32
        +
        +def get(offset, bits = 8, type = :unsigned, little = false)
        +  `#{@native}["get" + #{Buffer.name_for bits, type}](offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_float32(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +92
        +93
        +94
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 92
        +
        +def get_float32(offset, little = false)
        +  `#{@native}.getFloat32(offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_float64(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +100
        +101
        +102
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 100
        +
        +def get_float64(offset, little = false)
        +  `#{@native}.getFloat64(offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_int16(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +60
        +61
        +62
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 60
        +
        +def get_int16(offset, little = false)
        +  `#{@native}.getInt16(offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_int32(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +76
        +77
        +78
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 76
        +
        +def get_int32(offset, little = false)
        +  `#{@native}.getInt32(offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_int8(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +44
        +45
        +46
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 44
        +
        +def get_int8(offset, little = false)
        +  `#{@native}.getInt8(offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_uint16(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +68
        +69
        +70
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 68
        +
        +def get_uint16(offset, little = false)
        +  `#{@native}.getUint16(offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_uint32(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +84
        +85
        +86
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 84
        +
        +def get_uint32(offset, little = false)
        +  `#{@native}.getUint32(offset, little)`
        +end
        +
        +
        + +
        +

        + + #get_uint8(offset, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +52
        +53
        +54
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 52
        +
        +def get_uint8(offset, little = false)
        +  `#{@native}.getUint8(offset, little)`
        +end
        +
        +
        + +
        +

        + + #lengthObject + + + + Also known as: + size + + + + +

        + + + + +
        +
        +
        +
        +28
        +29
        +30
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 28
        +
        +def length
        +  `#{@native}.byteLength`
        +end
        +
        +
        + +
        +

        + + #set(offset, value, bits = 8, type = :unsigned, little = false) ⇒ Object + + + + Also known as: + []= + + + + +

        + + + + +
        +
        +
        +
        +38
        +39
        +40
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 38
        +
        +def set(offset, value, bits = 8, type = :unsigned, little = false)
        +  `#{@native}["set" + #{Buffer.name_for bits, type}](offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_float32(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +96
        +97
        +98
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 96
        +
        +def set_float32(offset, value, little = false)
        +  `#{@native}.setFloat32(offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_float64(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +104
        +105
        +106
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 104
        +
        +def set_float64(offset, value, little = false)
        +  `#{@native}.setFloat64(offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_int16(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +64
        +65
        +66
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 64
        +
        +def set_int16(offset, value, little = false)
        +  `#{@native}.setInt16(offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_int32(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +80
        +81
        +82
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 80
        +
        +def set_int32(offset, value, little = false)
        +  `#{@native}.setInt32(offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_int8(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +48
        +49
        +50
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 48
        +
        +def set_int8(offset, value, little = false)
        +  `#{@native}.setInt8(offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_uint16(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +72
        +73
        +74
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 72
        +
        +def set_uint16(offset, value, little = false)
        +  `#{@native}.setUint16(offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_uint32(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +88
        +89
        +90
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 88
        +
        +def set_uint32(offset, value, little = false)
        +  `#{@native}.setUint32(offset, value, little)`
        +end
        +
        +
        + +
        +

        + + #set_uint8(offset, value, little = false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +56
        +57
        +58
        +
        +
        # File 'opal/stdlib/buffer/view.rb', line 56
        +
        +def set_uint8(offset, value, little = false)
        +  `#{@native}.setUint8(offset, value, little)`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/CGI.html b/docs/api/v1.8.2/stdlib/CGI.html new file mode 100644 index 00000000..bbfa80ef --- /dev/null +++ b/docs/api/v1.8.2/stdlib/CGI.html @@ -0,0 +1,171 @@ + + + + + + + Class: CGI + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: CGI + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + +
        +
        Extended by:
        +
        Util
        +
        + + + +
        +
        Includes:
        +
        Util
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/cgi/util.rb
        +
        + +
        + +

        Overview

        +
        +

        This file contains parts of https://github.com/ruby/ruby/blob/master/lib/cgi/util.rb +licensed under a Ruby license.

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + Modules: Util + + + + +

        + + + +

        Constant Summary

        + +

        Constants included + from Util

        +

        Util::TABLE_FOR_ESCAPE_HTML__

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

        Method Summary

        + +

        Methods included from Util

        +

        escape, escapeHTML, escapeURIComponent, unescape, unescapeHTML, unescapeURIComponent

        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/CGI/Util.html b/docs/api/v1.8.2/stdlib/CGI/Util.html new file mode 100644 index 00000000..224bbdac --- /dev/null +++ b/docs/api/v1.8.2/stdlib/CGI/Util.html @@ -0,0 +1,599 @@ + + + + + + + Module: CGI::Util + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: CGI::Util + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        CGI, CGI
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/cgi/util.rb
        +
        + +
        + + + +

        + Constant Summary + collapse +

        + +
        + +
        TABLE_FOR_ESCAPE_HTML__ = +
        +
        +

        The set of special characters and their escaped values

        + + +
        +
        +
        + + +
        +
        +
        {
        +  "'" => '&#39;',
        +  '&' => '&amp;',
        +  '"' => '&quot;',
        +  '<' => '&lt;',
        +  '>' => '&gt;',
        +}
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #escape(c) ⇒ Object + + + + + + + + + + + + + +

          URL-encode a string into application/x-www-form-urlencoded.

          +
          + +
        • + + +
        • + + + #escapeHTML(string) ⇒ Object + + + + (also: #escape_html, #h) + + + + + + + + + + + +

          Escape special characters in HTML, namely '&\"<> CGI.escapeHTML('Usage: foo "bar" ') # => "Usage: foo "bar" <baz>".

          +
          + +
        • + + +
        • + + + #escapeURIComponent(c) ⇒ Object + + + + + + + + + + + + + +

          URL-encode a string following RFC 3986 Space characters (+" "+) are encoded with (+"%20"+) url_encoded_string = CGI.escapeURIComponent("'Stop!' said Fred") # => "%27Stop%21%27%20said%20Fred".

          +
          + +
        • + + +
        • + + + #unescape(c) ⇒ Object + + + + + + + + + + + + + +

          URL-decode an application/x-www-form-urlencoded string with encoding(optional).

          +
          + +
        • + + +
        • + + + #unescapeHTML(string) ⇒ Object + + + + (also: #unescape_html) + + + + + + + + + + + +

          Unescape a string that has been HTML-escaped CGI.unescapeHTML("Usage: foo "bar" <baz>") # => "Usage: foo \"bar\" ".

          +
          + +
        • + + +
        • + + + #unescapeURIComponent(c) ⇒ Object + + + + + + + + + + + + + +

          URL-decode a string following RFC 3986 with encoding(optional).

          +
          + +
        • + + +
        + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #escape(c) ⇒ Object + + + + + +

        +
        +

        URL-encode a string into application/x-www-form-urlencoded. +Space characters (+" "+) are encoded with plus signs (+"+"+) + url_encoded_string = CGI.escape("'Stop!' said Fred") + # => "%27Stop%21%27+said+Fred"

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +12
        +13
        +14
        +
        +
        # File 'opal/stdlib/cgi/util.rb', line 12
        +
        +def escape(c)
        +  `encodeURI(c)`
        +end
        +
        +
        + +
        +

        + + #escapeHTML(string) ⇒ Object + + + + Also known as: + escape_html, h + + + + +

        +
        +

        Escape special characters in HTML, namely '&\"<> + CGI.escapeHTML('Usage: foo "bar" ') + # => "Usage: foo "bar" <baz>"

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +50
        +51
        +52
        +
        +
        # File 'opal/stdlib/cgi/util.rb', line 50
        +
        +def escapeHTML(string)
        +  string.gsub(/['&"<>]/, TABLE_FOR_ESCAPE_HTML__)
        +end
        +
        +
        + +
        +

        + + #escapeURIComponent(c) ⇒ Object + + + + + +

        +
        +

        URL-encode a string following RFC 3986 +Space characters (+" "+) are encoded with (+"%20"+) + url_encoded_string = CGI.escapeURIComponent("'Stop!' said Fred") + # => "%27Stop%21%27%20said%20Fred"

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +27
        +28
        +29
        +
        +
        # File 'opal/stdlib/cgi/util.rb', line 27
        +
        +def escapeURIComponent(c)
        +  `encodeURIComponent(c)`
        +end
        +
        +
        + +
        +

        + + #unescape(c) ⇒ Object + + + + + +

        +
        +

        URL-decode an application/x-www-form-urlencoded string with encoding(optional). + string = CGI.unescape("%27Stop%21%27+said+Fred") + # => "'Stop!' said Fred"

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +19
        +20
        +21
        +
        +
        # File 'opal/stdlib/cgi/util.rb', line 19
        +
        +def unescape(c)
        +  `decodeURI(c)`
        +end
        +
        +
        + +
        +

        + + #unescapeHTML(string) ⇒ Object + + + + Also known as: + unescape_html + + + + +

        +
        +

        Unescape a string that has been HTML-escaped + CGI.unescapeHTML("Usage: foo "bar" <baz>") + # => "Usage: foo \"bar\" "

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +57
        +58
        +59
        +60
        +61
        +62
        +63
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +72
        +73
        +74
        +75
        +76
        +
        +
        # File 'opal/stdlib/cgi/util.rb', line 57
        +
        +def unescapeHTML(string)
        +  string.gsub(/&(apos|amp|quot|gt|lt|\#[0-9]+|\#[xX][0-9A-Fa-f]+);/) do
        +    match = ::Regexp.last_match(1)
        +    case match
        +    when 'apos'                then "'"
        +    when 'amp'                 then '&'
        +    when 'quot'                then '"'
        +    when 'gt'                  then '>'
        +    when 'lt'                  then '<'
        +    when /\A#0*(\d+)\z/
        +      n = ::Regexp.last_match(1).to_i
        +      n.chr('utf-8')
        +    when /\A#x([0-9a-f]+)\z/i
        +      n = ::Regexp.last_match(1).hex
        +      n.chr('utf-8')
        +    else
        +      "&#{match};"
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #unescapeURIComponent(c) ⇒ Object + + + + + +

        +
        +

        URL-decode a string following RFC 3986 with encoding(optional). + string = CGI.unescapeURIComponent("%27Stop%21%27+said%20Fred") + # => "'Stop!'+said Fred"

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +34
        +35
        +36
        +
        +
        # File 'opal/stdlib/cgi/util.rb', line 34
        +
        +def unescapeURIComponent(c)
        +  `decodeURIComponent(c)`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Class.html b/docs/api/v1.8.2/stdlib/Class.html new file mode 100644 index 00000000..64df1ba8 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Class.html @@ -0,0 +1,258 @@ + + + + + + + Class: Class + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Class + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/native.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #native_alias(new_jsid, existing_mid) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +616
        +617
        +618
        +619
        +620
        +621
        +622
        +623
        +624
        +
        +
        # File 'opal/stdlib/native.rb', line 616
        +
        +def native_alias(new_jsid, existing_mid)
        +  %x{
        +    var aliased = #{self}.prototype[Opal.jsid(#{existing_mid})];
        +    if (!aliased) {
        +      #{raise NameError.new("undefined method `#{existing_mid}' for class `#{inspect}'", existing_mid)};
        +    }
        +    #{self}.prototype[#{new_jsid}] = aliased;
        +  }
        +end
        +
        +
        + +
        +

        + + #native_classObject + + + + + +

        + + + + +
        +
        +
        +
        +626
        +627
        +628
        +629
        +
        +
        # File 'opal/stdlib/native.rb', line 626
        +
        +def native_class
        +  native_module
        +  `self["new"] = self.$new`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Console.html b/docs/api/v1.8.2/stdlib/Console.html new file mode 100644 index 00000000..f3429cf3 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Console.html @@ -0,0 +1,839 @@ + + + + + + + Class: Console + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Console + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Native::Wrapper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/console.rb
        +
        + +
        + +

        Overview

        +
        +

        Manipulate the browser console.

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

        + Instance Method Summary + collapse +

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

        Methods included from Native::Wrapper

        +

        included, #initialize, #to_n

        + + +
        +

        Instance Method Details

        + + +
        +

        + + #clearObject + + + + + +

        +
        +

        Clear the console.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +12
        +13
        +14
        +
        +
        # File 'opal/stdlib/console.rb', line 12
        +
        +def clear
        +  `#{@native}.clear()`
        +end
        +
        +
        + +
        +

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

        +
        +

        Log the passed objects based on an optional initial format as error.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +38
        +39
        +40
        +
        +
        # File 'opal/stdlib/console.rb', line 38
        +
        +def error(*args)
        +  `#{@native}.error.apply(#{@native}, args)`
        +end
        +
        +
        + +
        +

        + + #group(*args, &block) ⇒ Object + + + + + +

        +
        +

        Group the given block.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +60
        +61
        +62
        +63
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +72
        +73
        +74
        +
        +
        # File 'opal/stdlib/console.rb', line 60
        +
        +def group(*args, &block)
        +  raise ArgumentError, 'no block given' unless block
        +
        +  `#{@native}.group.apply(#{@native}, args)`
        +
        +  begin
        +    if block.arity == 0
        +      instance_exec(&block)
        +    else
        +      yield(self)
        +    end
        +  ensure
        +    `#{@native}.groupEnd()`
        +  end
        +end
        +
        +
        + +
        +

        + + #group!(*args, &block) ⇒ Object + + + + + +

        +
        +

        Group the given block but collapse it.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +77
        +78
        +79
        +80
        +81
        +82
        +83
        +84
        +85
        +86
        +87
        +88
        +89
        +90
        +91
        +
        +
        # File 'opal/stdlib/console.rb', line 77
        +
        +def group!(*args, &block)
        +  return unless block_given?
        +
        +  `#{@native}.groupCollapsed.apply(#{@native}, args)`
        +
        +  begin
        +    if block.arity == 0
        +      instance_exec(&block)
        +    else
        +      yield(self)
        +    end
        +  ensure
        +    `#{@native}.groupEnd()`
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        Log the passed objects based on an optional initial format as informational +log.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +28
        +29
        +30
        +
        +
        # File 'opal/stdlib/console.rb', line 28
        +
        +def info(*args)
        +  `#{@native}.info.apply(#{@native}, args)`
        +end
        +
        +
        + +
        +

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

        +
        +

        Log the passed objects based on an optional initial format.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +
        +
        # File 'opal/stdlib/console.rb', line 22
        +
        +def log(*args)
        +  `#{@native}.log.apply(#{@native}, args)`
        +end
        +
        +
        + +
        +

        + + #time(label, &block) ⇒ Object + + + + + +

        +
        +

        Time the given block with the given label.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +43
        +44
        +45
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +57
        +
        +
        # File 'opal/stdlib/console.rb', line 43
        +
        +def time(label, &block)
        +  raise ArgumentError, 'no block given' unless block
        +
        +  `#{@native}.time(label)`
        +
        +  begin
        +    if block.arity == 0
        +      instance_exec(&block)
        +    else
        +      yield(self)
        +    end
        +  ensure
        +    `#{@native}.timeEnd()`
        +  end
        +end
        +
        +
        + +
        +

        + + #traceObject + + + + + +

        +
        +

        Print a stacktrace from the call site.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +17
        +18
        +19
        +
        +
        # File 'opal/stdlib/console.rb', line 17
        +
        +def trace
        +  `#{@native}.trace()`
        +end
        +
        +
        + +
        +

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

        +
        +

        Log the passed objects based on an optional initial format as warning.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +33
        +34
        +35
        +
        +
        # File 'opal/stdlib/console.rb', line 33
        +
        +def warn(*args)
        +  `#{@native}.warn.apply(#{@native}, args)`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Date.html b/docs/api/v1.8.2/stdlib/Date.html new file mode 100644 index 00000000..266e51cd --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Date.html @@ -0,0 +1,2999 @@ + + + + + + + Class: Date + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Date + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + +
        +
        Extended by:
        +
        Forwardable
        +
        + + + +
        +
        Includes:
        +
        Comparable
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/date.rb,
        + opal/stdlib/json.rb,
        opal/stdlib/date/infinity.rb,
        opal/stdlib/date/formatters.rb
        +
        +
        + +
        + +
        +

        Direct Known Subclasses

        +

        DateTime

        +
        +

        Defined Under Namespace

        +

        + + + + + Classes: Infinity + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        JULIAN = + +
        +
        Infinity.new
        + +
        GREGORIAN = + +
        +
        -Infinity.new
        + +
        ITALY = +
        +
        +

        1582-10-15

        + + +
        +
        +
        + + +
        +
        +
        2_299_161
        + +
        ENGLAND = +
        +
        +

        1752-09-14

        + + +
        +
        +
        + + +
        +
        +
        2_361_222
        + +
        MONTHNAMES = + +
        +
        [nil] + %w[January February March April May June July August September October November December]
        + +
        ABBR_MONTHNAMES = + +
        +
        %w[jan feb mar apr may jun jul aug sep oct nov dec]
        + +
        DAYNAMES = + +
        +
        %w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday]
        + +
        ABBR_DAYNAMES = + +
        +
        %w[Sun Mon Tue Wed Thu Fri Sat]
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #start ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute start.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods included from Forwardable

        +

        def_instance_delegator, def_instance_delegators, instance_delegate

        + +
        +

        Constructor Details

        + +
        +

        + + #initialize(year = -4712,, month = 1, day = 1, start = ITALY) ⇒ Date + + + + + +

        +
        +

        Returns a new instance of Date.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +285
        +286
        +287
        +288
        +289
        +290
        +291
        +292
        +293
        +294
        +295
        +296
        +
        +
        # File 'opal/stdlib/date.rb', line 285
        +
        +def initialize(year = -4712, month = 1, day = 1, start = ITALY)
        +  %x{
        +    // Because of Gregorian reform calendar goes from 1582-10-04 to 1582-10-15.
        +    // All days in between end up as 4 october.
        +    if (year === 1582 && month === 10 && day > 4 && day < 15) {
        +      day = 4;
        +    }
        +  }
        +
        +  @date = `new Date(year, month - 1, day)`
        +  @start = start
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #startObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute start.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +298
        +299
        +300
        +
        +
        # File 'opal/stdlib/date.rb', line 298
        +
        +def start
        +  @start
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + ._days_in_month(year, month) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +535
        +536
        +537
        +538
        +539
        +540
        +
        +
        # File 'opal/stdlib/date.rb', line 535
        +
        +def self._days_in_month(year, month)
        +  %x{
        +    var leap = ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);
        +    return [31, (leap ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
        +  }
        +end
        +
        +
        + +
        +

        + + .def_formatter(*args, **kwargs) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +2
        +3
        +4
        +
        +
        # File 'opal/stdlib/date/formatters.rb', line 2
        +
        +def self.def_formatter(*args, **kwargs)
        +  Time.def_formatter(*args, **kwargs, on: self)
        +end
        +
        +
        + +
        +

        + + .gregorian_leap?(year) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +278
        +279
        +280
        +
        +
        # File 'opal/stdlib/date.rb', line 278
        +
        +def gregorian_leap?(year)
        +  `(new Date(#{year}, 1, 29).getMonth()-1) === 0`
        +end
        +
        +
        + +
        +

        + + .parse(string, comp = true) ⇒ Object + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +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
        +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
        +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
        +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
        +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
        +
        +
        # File 'opal/stdlib/date.rb', line 28
        +
        +def parse(string, comp = true)
        +  %x{
        +    var current_date = new Date();
        +
        +    var current_day = current_date.getDate(),
        +        current_month = current_date.getMonth(),
        +        current_year = current_date.getFullYear(),
        +        current_wday = current_date.getDay(),
        +        full_month_name_regexp = #{MONTHNAMES.compact.join('|')};
        +
        +    function match1(match) { return match[1]; }
        +    function match2(match) { return match[2]; }
        +    function match3(match) { return match[3]; }
        +    function match4(match) { return match[4]; }
        +
        +    // Converts passed short year (0..99)
        +    // to a 4-digits year in the range (1969..2068)
        +    function fromShortYear(fn) {
        +      return function(match) {
        +        var short_year = fn(match);
        +
        +        if (short_year >= 69) {
        +          short_year += 1900;
        +        } else {
        +          short_year += 2000;
        +        }
        +        return short_year;
        +      }
        +    }
        +
        +    // Converts month abbr (nov) to a month number
        +    function fromMonthAbbr(fn) {
        +      return function(match) {
        +        var abbr = fn(match).toLowerCase();
        +        return #{ABBR_MONTHNAMES}.indexOf(abbr) + 1;
        +      }
        +    }
        +
        +    function toInt(fn) {
        +      return function(match) {
        +        var value = fn(match);
        +        return parseInt(value, 10);
        +      }
        +    }
        +
        +    // Depending on the 'comp' value appends 20xx to a passed year
        +    function to2000(fn) {
        +      return function(match) {
        +        var value = fn(match);
        +        if (comp) {
        +          return value + 2000;
        +        } else {
        +          return value;
        +        }
        +      }
        +    }
        +
        +    // Converts passed week day name to a day number
        +    function fromDayName(fn) {
        +      return function(match) {
        +        var dayname = fn(match),
        +            wday = #{DAYNAMES.map(&:downcase)}.indexOf(#{`dayname`.downcase});
        +
        +        return current_day - current_wday + wday;
        +      }
        +    }
        +
        +    // Converts passed month name to a month number
        +    function fromFullMonthName(fn) {
        +      return function(match) {
        +        var month_name = fn(match);
        +        return #{MONTHNAMES.compact.map(&:downcase)}.indexOf(#{`month_name`.downcase}) + 1;
        +      }
        +    }
        +
        +    var rules = [
        +      {
        +        // DD as month day number
        +        regexp: /^(\d{2})$/,
        +        year: current_year,
        +        month: current_month,
        +        day: toInt(match1)
        +      },
        +      {
        +        // DDD as year day number
        +        regexp: /^(\d{3})$/,
        +        year: current_year,
        +        month: 0,
        +        day: toInt(match1)
        +      },
        +      {
        +        // MMDD as month and day
        +        regexp: /^(\d{2})(\d{2})$/,
        +        year: current_year,
        +        month: toInt(match1),
        +        day: toInt(match2)
        +      },
        +      {
        +        // YYDDD as year and day number in 1969--2068
        +        regexp: /^(\d{2})(\d{3})$/,
        +        year: fromShortYear(toInt(match1)),
        +        month: 0,
        +        day: toInt(match2)
        +      },
        +      {
        +        // YYMMDD as year, month and day in 1969--2068
        +        regexp: /^(\d{2})(\d{2})(\d{2})$/,
        +        year: fromShortYear(toInt(match1)),
        +        month: toInt(match2),
        +        day: toInt(match3)
        +      },
        +      {
        +        // YYYYDDD as year and day number
        +        regexp: /^(\d{4})(\d{3})$/,
        +        year: toInt(match1),
        +        month: 0,
        +        day: toInt(match2)
        +      },
        +      {
        +        // YYYYMMDD as year, month and day number
        +        regexp: /^(\d{4})(\d{2})(\d{2})$/,
        +        year: toInt(match1),
        +        month: toInt(match2),
        +        day: toInt(match3)
        +      },
        +      {
        +        // mmm YYYY
        +        regexp: /^([a-z]{3})[\s\.\/\-](\d{3,4})$/,
        +        year: toInt(match2),
        +        month: fromMonthAbbr(match1),
        +        day: 1
        +      },
        +      {
        +        // DD mmm YYYY
        +        regexp: /^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i,
        +        year: toInt(match3),
        +        month: fromMonthAbbr(match2),
        +        day: toInt(match1)
        +      },
        +      {
        +        // mmm DD YYYY
        +        regexp: /^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i,
        +        year: toInt(match3),
        +        month: fromMonthAbbr(match1),
        +        day: toInt(match2)
        +      },
        +      {
        +        // YYYY mmm DD
        +        regexp: /^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i,
        +        year: toInt(match1),
        +        month: fromMonthAbbr(match2),
        +        day: toInt(match3)
        +      },
        +      {
        +        // YYYY-MM-DD YYYY/MM/DD YYYY.MM.DD
        +        regexp: /^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,
        +        year: toInt(match1),
        +        month: toInt(match2),
        +        day: toInt(match3)
        +      },
        +      {
        +        // YY-MM-DD
        +        regexp: /^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/,
        +        year: to2000(toInt(match1)),
        +        month: toInt(match2),
        +        day: toInt(match3)
        +      },
        +      {
        +        // DD-MM-YYYY
        +        regexp: /^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/,
        +        year: toInt(match3),
        +        month: toInt(match2),
        +        day: toInt(match1)
        +      },
        +      {
        +        // ddd
        +        regexp: new RegExp("^(" + #{DAYNAMES.join('|')} + ")$", 'i'),
        +        year: current_year,
        +        month: current_month,
        +        day: fromDayName(match1)
        +      },
        +      {
        +        // monthname daynumber YYYY
        +        regexp: new RegExp("^(" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$", "i"),
        +        year: toInt(match4),
        +        month: fromFullMonthName(match1),
        +        day: toInt(match2)
        +      },
        +      {
        +        // monthname daynumber
        +        regexp: new RegExp("^(" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)", "i"),
        +        year: current_year,
        +        month: fromFullMonthName(match1),
        +        day: toInt(match2)
        +      },
        +      {
        +        // daynumber monthname YYYY
        +        regexp: new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\-?\\d{3,4})$", "i"),
        +        year: toInt(match4),
        +        month: fromFullMonthName(match3),
        +        day: toInt(match1)
        +      },
        +      {
        +        // YYYY monthname daynumber
        +        regexp: new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-](" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$", "i"),
        +        year: toInt(match1),
        +        month: fromFullMonthName(match2),
        +        day: toInt(match3)
        +      }
        +    ]
        +
        +    var rule, i, match;
        +
        +    for (i = 0; i < rules.length; i++) {
        +      rule = rules[i];
        +      match = rule.regexp.exec(string);
        +      if (match) {
        +        var year = rule.year;
        +        if (typeof(year) === 'function') {
        +          year = year(match);
        +        }
        +
        +        var month = rule.month;
        +        if (typeof(month) === 'function') {
        +          month = month(match) - 1
        +        }
        +
        +        var day = rule.day;
        +        if (typeof(day) === 'function') {
        +          day = day(match);
        +        }
        +
        +        var result = new Date(year, month, day);
        +
        +        // an edge case, JS can't handle 'new Date(1)', minimal year is 1970
        +        if (year >= 0 && year <= 1970) {
        +          result.setFullYear(year);
        +        }
        +
        +        return #{wrap `result`};
        +      }
        +    }
        +  }
        +  raise ArgumentError, 'invalid date'
        +end
        +
        +
        + +
        +

        + + .todayObject + + + + + +

        + + + + +
        +
        +
        +
        +274
        +275
        +276
        +
        +
        # File 'opal/stdlib/date.rb', line 274
        +
        +def today
        +  wrap `new Date()`
        +end
        +
        +
        + +
        +

        + + .wrap(native) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +21
        +22
        +23
        +24
        +25
        +26
        +
        +
        # File 'opal/stdlib/date.rb', line 21
        +
        +def wrap(native)
        +  instance = allocate
        +  `#{instance}.start = #{ITALY}`
        +  `#{instance}.date = #{native}`
        +  instance
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #+(date) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +409
        +410
        +411
        +
        +
        # File 'opal/stdlib/date.rb', line 409
        +
        +def +(date)
        +  next_day(date)
        +end
        +
        +
        + +
        +

        + + #-(date) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +400
        +401
        +402
        +403
        +404
        +405
        +406
        +407
        +
        +
        # File 'opal/stdlib/date.rb', line 400
        +
        +def -(date)
        +  %x{
        +    if (date.date) {
        +      return Math.round((#{@date} - #{date}.date) / (1000 * 60 * 60 * 24));
        +    }
        +  }
        +  prev_day(date)
        +end
        +
        +
        + +
        +

        + + #<<(n) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +332
        +333
        +334
        +335
        +336
        +
        +
        # File 'opal/stdlib/date.rb', line 332
        +
        +def <<(n)
        +  `if (!n.$$is_number) #{raise ::TypeError}`
        +
        +  prev_month(n)
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +300
        +301
        +302
        +303
        +304
        +305
        +306
        +307
        +308
        +309
        +310
        +311
        +312
        +313
        +314
        +315
        +316
        +317
        +318
        +319
        +320
        +321
        +322
        +323
        +324
        +
        +
        # File 'opal/stdlib/date.rb', line 300
        +
        +def <=>(other)
        +  %x{
        +    if (other.$$is_number) {
        +      return #{jd <=> other}
        +    }
        +
        +    if (#{::Date === other}) {
        +      var a = #{@date}, b = #{other}.date;
        +      if (!Opal.is_a(#{self}, #{::DateTime})) a.setHours(0, 0, 0, 0);
        +      if (!Opal.is_a(#{other}, #{::DateTime})) b.setHours(0, 0, 0, 0);
        +
        +      if (a < b) {
        +        return -1;
        +      }
        +      else if (a > b) {
        +        return 1;
        +      }
        +      else {
        +        return 0;
        +      }
        +    } else {
        +      return nil;
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #>>(n) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +326
        +327
        +328
        +329
        +330
        +
        +
        # File 'opal/stdlib/date.rb', line 326
        +
        +def >>(n)
        +  `if (!n.$$is_number) #{raise ::TypeError}`
        +
        +  self << -n
        +end
        +
        +
        + +
        +

        + + #as_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +199
        +200
        +201
        +
        +
        # File 'opal/stdlib/json.rb', line 199
        +
        +def as_json
        +  to_s
        +end
        +
        +
        + +
        +

        + + #cloneObject + + + + + +

        + + + + +
        +
        +
        +
        +338
        +339
        +340
        +341
        +342
        +
        +
        # File 'opal/stdlib/date.rb', line 338
        +
        +def clone
        +  date = Date.wrap(@date.dup)
        +  `date.start = #{@start}`
        +  date
        +end
        +
        +
        + +
        +

        + + #cwdayObject + + + + + +

        + + + + +
        +
        +
        +
        +522
        +523
        +524
        +
        +
        # File 'opal/stdlib/date.rb', line 522
        +
        +def cwday
        +  `#{@date}.getDay() || 7`
        +end
        +
        +
        + +
        +

        + + #cweekObject + + + + + +

        + + + + +
        +
        +
        +
        +526
        +527
        +528
        +529
        +530
        +531
        +532
        +533
        +
        +
        # File 'opal/stdlib/date.rb', line 526
        +
        +def cweek
        +  %x{
        +    var d = new Date(#{@date});
        +    d.setHours(0,0,0);
        +    d.setDate(d.getDate()+4-(d.getDay()||7));
        +    return Math.ceil((((d-new Date(d.getFullYear(),0,1))/8.64e7)+1)/7);
        +  }
        +end
        +
        +
        + +
        +

        + + #downto(min, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +518
        +519
        +520
        +
        +
        # File 'opal/stdlib/date.rb', line 518
        +
        +def downto(min, &block)
        +  step(min, -1, &block)
        +end
        +
        +
        + +
        +

        + + #jdObject + + + + + +

        + + + + +
        +
        +
        +
        +350
        +351
        +352
        +353
        +354
        +355
        +356
        +357
        +358
        +359
        +360
        +361
        +362
        +363
        +364
        +365
        +366
        +367
        +368
        +369
        +370
        +371
        +372
        +373
        +374
        +375
        +376
        +377
        +378
        +379
        +380
        +381
        +382
        +383
        +384
        +
        +
        # File 'opal/stdlib/date.rb', line 350
        +
        +def jd
        +  %x{
        +  //Adapted from http://www.physics.sfasu.edu/astro/javascript/julianday.html
        +
        +  var mm = #{@date}.getMonth() + 1,
        +      dd = #{@date}.getDate(),
        +      yy = #{@date}.getFullYear(),
        +      hr = 12, mn = 0, sc = 0,
        +      ggg, s, a, j1, jd;
        +
        +  hr = hr + (mn / 60) + (sc/3600);
        +
        +  ggg = 1;
        +  if (yy <= 1585) {
        +    ggg = 0;
        +  }
        +
        +  jd = -1 * Math.floor(7 * (Math.floor((mm + 9) / 12) + yy) / 4);
        +
        +  s = 1;
        +  if ((mm - 9) < 0) {
        +    s =- 1;
        +  }
        +
        +  a = Math.abs(mm - 9);
        +  j1 = Math.floor(yy + s * Math.floor(a / 7));
        +  j1 = -1 * Math.floor((Math.floor(j1 / 100) + 1) * 3 / 4);
        +
        +  jd = jd + Math.floor(275 * mm / 9) + dd + (ggg * j1);
        +  jd = jd + 1721027 + 2 * ggg + 367 * yy - 0.5;
        +  jd = jd + (hr / 24);
        +
        +  return jd;
        +  }
        +end
        +
        +
        + +
        +

        + + #julian?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +386
        +387
        +388
        +
        +
        # File 'opal/stdlib/date.rb', line 386
        +
        +def julian?
        +  `#{@date} < new Date(1582, 10 - 1, 15, 12)`
        +end
        +
        +
        + +
        +

        + + #new_start(start) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +390
        +391
        +392
        +393
        +394
        +
        +
        # File 'opal/stdlib/date.rb', line 390
        +
        +def new_start(start)
        +  new_date = clone
        +  `new_date.start = start`
        +  new_date
        +end
        +
        +
        + +
        +

        + + #nextObject + + + + Also known as: + succ + + + + +

        + + + + +
        +
        +
        +
        +396
        +397
        +398
        +
        +
        # File 'opal/stdlib/date.rb', line 396
        +
        +def next
        +  self + 1
        +end
        +
        +
        + +
        +

        + + #next_day(n = 1) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +426
        +427
        +428
        +429
        +
        +
        # File 'opal/stdlib/date.rb', line 426
        +
        +def next_day(n = 1)
        +  `if (!n.$$is_number) #{raise ::TypeError}`
        +  prev_day(-n)
        +end
        +
        +
        + +
        +

        + + #next_month(n = 1) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +442
        +443
        +444
        +445
        +
        +
        # File 'opal/stdlib/date.rb', line 442
        +
        +def next_month(n = 1)
        +  `if (!n.$$is_number) #{raise ::TypeError}`
        +  prev_month(-n)
        +end
        +
        +
        + +
        +

        + + #next_year(years = 1) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +452
        +453
        +454
        +455
        +
        +
        # File 'opal/stdlib/date.rb', line 452
        +
        +def next_year(years = 1)
        +  `if (!years.$$is_number) #{raise ::TypeError}`
        +  prev_year(-years)
        +end
        +
        +
        + +
        +

        + + #prev_day(n = 1) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +413
        +414
        +415
        +416
        +417
        +418
        +419
        +420
        +421
        +422
        +423
        +424
        +
        +
        # File 'opal/stdlib/date.rb', line 413
        +
        +def prev_day(n = 1)
        +  %x{
        +    if (n.$$is_number) {
        +      var result = #{clone};
        +      result.date.setDate(#{@date}.getDate() - n);
        +      return result;
        +    }
        +    else {
        +      #{raise ::TypeError};
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #prev_month(n = 1) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +431
        +432
        +433
        +434
        +435
        +436
        +437
        +438
        +439
        +440
        +
        +
        # File 'opal/stdlib/date.rb', line 431
        +
        +def prev_month(n = 1)
        +  %x{
        +    if (!n.$$is_number) #{raise ::TypeError}
        +    var result = #{clone}, date = result.date, cur = date.getDate();
        +    date.setDate(1);
        +    date.setMonth(date.getMonth() - n);
        +    date.setDate(Math.min(cur, #{Date._days_in_month(`date.getFullYear()`, `date.getMonth()`)}));
        +    return result;
        +  }
        +end
        +
        +
        + +
        +

        + + #prev_year(years = 1) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +447
        +448
        +449
        +450
        +
        +
        # File 'opal/stdlib/date.rb', line 447
        +
        +def prev_year(years = 1)
        +  `if (!years.$$is_number) #{raise ::TypeError}`
        +  self.class.new(year - years, month, day)
        +end
        +
        +
        + +
        +

        + + #step(limit, step = 1, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +492
        +493
        +494
        +495
        +496
        +497
        +498
        +499
        +500
        +501
        +502
        +503
        +504
        +505
        +506
        +507
        +508
        +509
        +510
        +511
        +512
        +
        +
        # File 'opal/stdlib/date.rb', line 492
        +
        +def step(limit, step = 1, &block)
        +  steps_count = (limit - self).to_i
        +
        +  steps = if steps_count * step < 0
        +            []
        +          elsif steps_count < 0
        +            (0..-steps_count).step(step.abs).map(&:-@).reverse
        +          else
        +            (0..steps_count).step(step.abs)
        +          end
        +
        +  result = steps.map { |i| self + i }
        +
        +
        +  if block_given?
        +    result.each { |i| yield(i) }
        +    self
        +  else
        +    result
        +  end
        +end
        +
        +
        + +
        +

        + + #strftime(format = '') ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +457
        +458
        +459
        +460
        +461
        +462
        +463
        +464
        +465
        +
        +
        # File 'opal/stdlib/date.rb', line 457
        +
        +def strftime(format = '')
        +  %x{
        +    if (format == '') {
        +      return #{to_s};
        +    }
        +
        +    return #{@date.strftime(format)}
        +  }
        +end
        +
        +
        + +
        +

        + + #to_dateObject + + + + + +

        + + + + +
        +
        +
        +
        +480
        +481
        +482
        +
        +
        # File 'opal/stdlib/date.rb', line 480
        +
        +def to_date
        +  self
        +end
        +
        +
        + +
        +

        + + #to_datetimeObject + + + + + +

        + + + + +
        +
        +
        +
        +484
        +485
        +486
        +
        +
        # File 'opal/stdlib/date.rb', line 484
        +
        +def to_datetime
        +  DateTime.new(year, month, day)
        +end
        +
        +
        + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +195
        +196
        +197
        +
        +
        # File 'opal/stdlib/json.rb', line 195
        +
        +def to_json
        +  to_s.to_json
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        + + + + +
        +
        +
        +
        +488
        +489
        +490
        +
        +
        # File 'opal/stdlib/date.rb', line 488
        +
        +def to_n
        +  @date
        +end
        +
        +
        + +
        +

        + + #to_timeObject + + + + + +

        + + + + +
        +
        +
        +
        +476
        +477
        +478
        +
        +
        # File 'opal/stdlib/date.rb', line 476
        +
        +def to_time
        +  Time.new(year, month, day)
        +end
        +
        +
        + +
        +

        + + #upto(max, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/date.rb', line 514
        +
        +def upto(max, &block)
        +  step(max, 1, &block)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Date/Infinity.html b/docs/api/v1.8.2/stdlib/Date/Infinity.html new file mode 100644 index 00000000..718ae56a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Date/Infinity.html @@ -0,0 +1,960 @@ + + + + + + + Class: Date::Infinity + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Date::Infinity + + + +

        +
        + +
        +
        Inherits:
        +
        + Numeric + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Comparable
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/date/infinity.rb
        +
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #d ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute d.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Numeric

        +

        #to_json, #to_n

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(d = 1) ⇒ Infinity + + + + + +

        +
        +

        Returns a new instance of Infinity.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +5
        +6
        +7
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 5
        +
        +def initialize(d = 1)
        +  @d = d <=> 0
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #dObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute d.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +9
        +10
        +11
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 9
        +
        +def d
        +  @d
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #+@Object + + + + + +

        + + + + +
        +
        +
        +
        +35
        +36
        +37
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 35
        +
        +def +@
        +  self.class.new(+d)
        +end
        +
        +
        + +
        +

        + + #-@Object + + + + + +

        + + + + +
        +
        +
        +
        +31
        +32
        +33
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 31
        +
        +def -@
        +  self.class.new(-d)
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +39
        +40
        +41
        +42
        +43
        +44
        +45
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 39
        +
        +def <=>(other)
        +  case other
        +  when Infinity
        +    d <=> other.d
        +  when Numeric
        +    d
        +  else
        +    begin
        +      l, r = other.coerce(self)
        +      l <=> r
        +    rescue NoMethodError
        +      nil
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #absObject + + + + + +

        + + + + +
        +
        +
        +
        +27
        +28
        +29
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 27
        +
        +def abs
        +  self.class.new
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +55
        +56
        +57
        +58
        +59
        +60
        +61
        +62
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 55
        +
        +def coerce(other)
        +  case other
        +  when Numeric
        +    [-d, d]
        +  else
        +    super
        +  end
        +end
        +
        +
        + +
        +

        + + #finite?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +15
        +16
        +17
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 15
        +
        +def finite?
        +  false
        +end
        +
        +
        + +
        +

        + + #infinite?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +19
        +20
        +21
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 19
        +
        +def infinite?
        +  d.nonzero?
        +end
        +
        +
        + +
        +

        + + #nan?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +23
        +24
        +25
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 23
        +
        +def nan?
        +  d.zero?
        +end
        +
        +
        + +
        +

        + + #to_fObject + + + + + +

        + + + + +
        +
        +
        +
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 64
        +
        +def to_f
        +  return 0 if @d == 0
        +  if @d > 0
        +    Float::INFINITY
        +  else
        +    -Float::INFINITY
        +  end
        +end
        +
        +
        + +
        +

        + + #zero?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +11
        +12
        +13
        +
        +
        # File 'opal/stdlib/date/infinity.rb', line 11
        +
        +def zero?
        +  false
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/DateTime.html b/docs/api/v1.8.2/stdlib/DateTime.html new file mode 100644 index 00000000..0d860a2c --- /dev/null +++ b/docs/api/v1.8.2/stdlib/DateTime.html @@ -0,0 +1,834 @@ + + + + + + + Class: DateTime + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: DateTime + + + +

        +
        + +
        +
        Inherits:
        +
        + Date + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/date/date_time.rb,
        + opal/stdlib/date/formatters.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants inherited + from Date

        +

        Date::ABBR_DAYNAMES, Date::ABBR_MONTHNAMES, Date::DAYNAMES, Date::ENGLAND, Date::GREGORIAN, Date::ITALY, Date::JULIAN, Date::MONTHNAMES

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from Date

        +

        #start

        + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Date

        +

        #<<, #<=>, #>>, _days_in_month, #as_json, #clone, #cwday, #cweek, def_formatter, #downto, gregorian_leap?, #jd, #julian?, #new_start, #next, #next_day, #next_month, #next_year, #prev_day, #prev_month, #prev_year, #step, #strftime, #to_json, #to_n, today, #upto, wrap

        + + + + + + + + + +

        Methods included from Forwardable

        +

        #def_instance_delegator, #def_instance_delegators, #instance_delegate

        + +
        +

        Constructor Details

        + +
        +

        + + #initialize(year = -4712,, month = 1, day = 1, hours = 0, minutes = 0, seconds = 0, offset = 0, start = ITALY) ⇒ DateTime + + + + + +

        +
        +

        Returns a new instance of DateTime.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +24
        +25
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 14
        +
        +def initialize(year = -4712, month = 1, day = 1, hours = 0, minutes = 0, seconds = 0, offset = 0, start = ITALY)
        +  %x{
        +    // Because of Gregorian reform calendar goes from 1582-10-04 to 1582-10-15.
        +    // All days in between end up as 4 october.
        +    if (year === 1582 && month === 10 && day > 4 && day < 15) {
        +      day = 4;
        +    }
        +  }
        +
        +  @date = Time.new(year, month, day, hours, minutes, seconds, offset)
        +  @start = start
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .nowObject + + + + + +

        + + + + +
        +
        +
        +
        +5
        +6
        +7
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 5
        +
        +def now
        +  wrap Time.now
        +end
        +
        +
        + +
        +

        + + .parse(str) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +9
        +10
        +11
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 9
        +
        +def parse(str)
        +  wrap Time.parse(str)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +41
        +42
        +43
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 41
        +
        +def +(other)
        +  ::DateTime.wrap @date + other
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +45
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 45
        +
        +def -(other)
        +  `if (Opal.is_a(other, #{::Date})) other = other.date`
        +  result = @date - other
        +  if result.is_a? ::Time
        +    ::DateTime.wrap result
        +  else
        +    result
        +  end
        +end
        +
        +
        + +
        +

        + + #new_offset(offset) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +55
        +56
        +57
        +58
        +59
        +60
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 55
        +
        +def new_offset(offset)
        +  new_date = clone
        +  offset = Time._parse_offset(offset)
        +  `new_date.date.timezone = offset`
        +  new_date
        +end
        +
        +
        + +
        +

        + + #offsetObject + + + + + +

        + + + + +
        +
        +
        +
        +37
        +38
        +39
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 37
        +
        +def offset
        +  @date.gmt_offset / (24 * 3600r)
        +end
        +
        +
        + +
        +

        + + #sec_fractionObject + + + + Also known as: + second_fraction + + + + +

        + + + + +
        +
        +
        +
        +31
        +32
        +33
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 31
        +
        +def sec_fraction
        +  @date.usec / 1_000_000r
        +end
        +
        +
        + +
        +

        + + #to_dateObject + + + + + +

        + + + + +
        +
        +
        +
        +70
        +71
        +72
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 70
        +
        +def to_date
        +  Date.new(year, month, day)
        +end
        +
        +
        + +
        +

        + + #to_datetimeObject + + + + + +

        + + + + +
        +
        +
        +
        +62
        +63
        +64
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 62
        +
        +def to_datetime
        +  self
        +end
        +
        +
        + +
        +

        + + #to_timeObject + + + + + +

        + + + + +
        +
        +
        +
        +66
        +67
        +68
        +
        +
        # File 'opal/stdlib/date/date_time.rb', line 66
        +
        +def to_time
        +  @date.dup
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Delegator.html b/docs/api/v1.8.2/stdlib/Delegator.html new file mode 100644 index 00000000..56b4c422 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Delegator.html @@ -0,0 +1,1404 @@ + + + + + + + Class: Delegator + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Delegator + + + +

        +
        + +
        +
        Inherits:
        +
        + BasicObject + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/delegate.rb
        +
        + +
        + +
        +

        Direct Known Subclasses

        +

        SimpleDelegator

        +
        + + +

        + Constant Summary + collapse +

        + +
        + +
        VERSION = + +
        +
        '0.2.0'
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #! ⇒ Object + + + + + + + + + + + + + +

          Delegates ! to the __getobj__.

          +
          + +
        • + + +
        • + + + #!=(obj) ⇒ Object + + + + + + + + + + + + + +

          Returns true if two objects are not considered of equal value.

          +
          + +
        • + + +
        • + + + #==(obj) ⇒ Object + + + + + + + + + + + + + +

          Returns true if two objects are considered of equal value.

          +
          + +
        • + + +
        • + + + #__getobj__ ⇒ Object + + + + + + + + + + + + + +

          This method must be overridden by subclasses and should return the object method calls are being delegated to.

          +
          + +
        • + + +
        • + + + #__setobj__(obj) ⇒ Object + + + + + + + + + + + + + +

          This method must be overridden by subclasses and change the object delegate to obj.

          +
          + +
        • + + +
        • + + + #eql?(obj) ⇒ Boolean + + + + + + + + + + + + + +

          Returns true if two objects are considered of equal value.

          +
          + +
        • + + +
        • + + + #freeze ⇒ Object + + + + + + + + + + + + + +

          :method: freeze Freeze both the object returned by __getobj__ and self.

          +
          + +
        • + + +
        • + + + #frozen? ⇒ Boolean + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #initialize(obj) ⇒ Delegator + + + + + + + constructor + + + + + + + + +

          Pass in the obj to delegate method calls to.

          +
          + +
        • + + +
        • + + + #marshal_dump ⇒ Object + + + + + + + + + + + + + +

          Serialization support for the object returned by __getobj__.

          +
          + +
        • + + +
        • + + + #marshal_load(data) ⇒ Object + + + + + + + + + + + + + +

          Reinitializes delegation from a serialized object.

          +
          + +
        • + + +
        • + + + #methods(all = true) ⇒ Object + + + + + + + + + + + + + +

          Returns the methods available to this delegate object as the union of this object's and __getobj__ methods.

          +
          + +
        • + + +
        • + + + #protected_methods(all = true) ⇒ Object + + + + + + + + + + + + + +

          Returns the methods available to this delegate object as the union of this object's and __getobj__ protected methods.

          +
          + +
        • + + +
        • + + + #public_methods(all = true) ⇒ Object + + + + + + + + + + + + + +

          Returns the methods available to this delegate object as the union of this object's and __getobj__ public methods.

          +
          + +
        • + + +
        • + + + #respond_to_missing?(m, include_private) ⇒ Boolean + + + + + + + + + + + + + +

          Checks for a method provided by this the delegate object by forwarding the call through __getobj__.

          +
          + +
        • + + +
        + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(obj) ⇒ Delegator + + + + + +

        +
        +

        Pass in the obj to delegate method calls to. All methods supported by +obj will be delegated to.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +83
        +84
        +85
        +
        +
        # File 'opal/stdlib/delegate.rb', line 83
        +
        +def initialize(obj)
        +  __setobj__(obj)
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .const_missing(n) ⇒ Object + + + + + +

        +
        +

        :stopdoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +68
        +69
        +70
        +
        +
        # File 'opal/stdlib/delegate.rb', line 68
        +
        +def self.const_missing(n)
        +  ::Object.const_get(n)
        +end
        +
        +
        + +
        +

        + + .delegating_block(mid) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +360
        +361
        +362
        +363
        +364
        +365
        +
        +
        # File 'opal/stdlib/delegate.rb', line 360
        +
        +def Delegator.delegating_block(mid) # :nodoc:
        +  ->(*args, &block) do
        +    target = __getobj__
        +    target.__send__(mid, *args, &block)
        +  end.ruby2_keywords
        +end
        +
        +
        + +
        +

        + + .public_apiObject + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +257
        +258
        +259
        +
        +
        # File 'opal/stdlib/delegate.rb', line 257
        +
        +def self.public_api # :nodoc:
        +  @delegator_api
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #!Object + + + + + +

        +
        +

        Delegates ! to the __getobj__

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +188
        +189
        +190
        +
        +
        # File 'opal/stdlib/delegate.rb', line 188
        +
        +def !
        +  !__getobj__
        +end
        +
        +
        + +
        +

        + + #!=(obj) ⇒ Object + + + + + +

        +
        +

        Returns true if two objects are not considered of equal value.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +172
        +173
        +174
        +175
        +
        +
        # File 'opal/stdlib/delegate.rb', line 172
        +
        +def !=(obj)
        +  return false if obj.equal?(self)
        +  __getobj__ != obj
        +end
        +
        +
        + +
        +

        + + #==(obj) ⇒ Object + + + + + +

        +
        +

        Returns true if two objects are considered of equal value.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +164
        +165
        +166
        +167
        +
        +
        # File 'opal/stdlib/delegate.rb', line 164
        +
        +def ==(obj)
        +  return true if obj.equal?(self)
        +  __getobj__ == obj
        +end
        +
        +
        + +
        +

        + + #__getobj__Object + + + + + +

        +
        +

        This method must be overridden by subclasses and should return the object +method calls are being delegated to.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +196
        +197
        +198
        +
        +
        # File 'opal/stdlib/delegate.rb', line 196
        +
        +def __getobj__
        +  __raise__ ::NotImplementedError, "need to define `__getobj__'"
        +end
        +
        +
        + +
        +

        + + #__setobj__(obj) ⇒ Object + + + + + +

        +
        +

        This method must be overridden by subclasses and change the object delegate +to obj.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +204
        +205
        +206
        +
        +
        # File 'opal/stdlib/delegate.rb', line 204
        +
        +def __setobj__(obj)
        +  __raise__ ::NotImplementedError, "need to define `__setobj__'"
        +end
        +
        +
        + +
        +

        + + #eql?(obj) ⇒ Boolean + + + + + +

        +
        +

        Returns true if two objects are considered of equal value.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +180
        +181
        +182
        +183
        +
        +
        # File 'opal/stdlib/delegate.rb', line 180
        +
        +def eql?(obj)
        +  return true if obj.equal?(self)
        +  obj.eql?(__getobj__)
        +end
        +
        +
        + +
        +

        + + #freezeObject + + + + + +

        +
        +

        :method: freeze +Freeze both the object returned by __getobj__ and self.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +246
        +247
        +248
        +249
        +250
        +
        +
        # File 'opal/stdlib/delegate.rb', line 246
        +
        +def freeze
        +  __getobj__.freeze
        +  `$freeze_props(self)`
        +  `$freeze(self)`
        +end
        +
        +
        + +
        +

        + + #frozen?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +252
        +253
        +254
        +
        +
        # File 'opal/stdlib/delegate.rb', line 252
        +
        +def frozen?
        +  `(self.$$frozen || false)`
        +end
        +
        +
        + +
        +

        + + #marshal_dumpObject + + + + + +

        +
        +

        Serialization support for the object returned by __getobj__.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +211
        +212
        +213
        +214
        +215
        +216
        +217
        +218
        +
        +
        # File 'opal/stdlib/delegate.rb', line 211
        +
        +def marshal_dump
        +  ivars = instance_variables.reject { |var| /\A@delegate_/ =~ var }
        +  [
        +    :__v2__,
        +    ivars, ivars.map { |var| instance_variable_get(var) },
        +    __getobj__
        +  ]
        +end
        +
        +
        + +
        +

        + + #marshal_load(data) ⇒ Object + + + + + +

        +
        +

        Reinitializes delegation from a serialized object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +223
        +224
        +225
        +226
        +227
        +228
        +229
        +230
        +231
        +
        +
        # File 'opal/stdlib/delegate.rb', line 223
        +
        +def marshal_load(data)
        +  version, vars, values, obj = data
        +  if version == :__v2__
        +    vars.each_with_index { |var, i| instance_variable_set(var, values[i]) }
        +    __setobj__(obj)
        +  else
        +    __setobj__(data)
        +  end
        +end
        +
        +
        + +
        +

        + + #methods(all = true) ⇒ Object + + + + + +

        +
        +

        Returns the methods available to this delegate object as the union +of this object's and __getobj__ methods.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +139
        +140
        +141
        +
        +
        # File 'opal/stdlib/delegate.rb', line 139
        +
        +def methods(all = true)
        +  __getobj__.methods(all) | super
        +end
        +
        +
        + +
        +

        + + #protected_methods(all = true) ⇒ Object + + + + + +

        +
        +

        Returns the methods available to this delegate object as the union +of this object's and __getobj__ protected methods.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +155
        +156
        +157
        +
        +
        # File 'opal/stdlib/delegate.rb', line 155
        +
        +def protected_methods(all = true)
        +  __getobj__.protected_methods(all) | super
        +end
        +
        +
        + +
        +

        + + #public_methods(all = true) ⇒ Object + + + + + +

        +
        +

        Returns the methods available to this delegate object as the union +of this object's and __getobj__ public methods.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +147
        +148
        +149
        +
        +
        # File 'opal/stdlib/delegate.rb', line 147
        +
        +def public_methods(all = true)
        +  __getobj__.public_methods(all) | super
        +end
        +
        +
        + +
        +

        + + #respond_to_missing?(m, include_private) ⇒ Boolean + + + + + +

        +
        +

        Checks for a method provided by this the delegate object by forwarding the +call through __getobj__.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +107
        +108
        +109
        +110
        +111
        +112
        +113
        +114
        +115
        +116
        +
        +
        # File 'opal/stdlib/delegate.rb', line 107
        +
        +def respond_to_missing?(m, include_private)
        +  r = true
        +  target = __getobj__ { r = false }
        +  r &&= target_respond_to?(target, m, include_private)
        +  if r && include_private && !target_respond_to?(target, m, false)
        +    warn "delegator does not forward private method \##{m}", uplevel: 3
        +    return false
        +  end
        +  r
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Deno.html b/docs/api/v1.8.2/stdlib/Deno.html new file mode 100644 index 00000000..c1f90218 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Deno.html @@ -0,0 +1,133 @@ + + + + + + + Module: Deno + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Deno + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/deno/base.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +
        + +

        + Constant Summary + collapse +

        + +
        + +
        VERSION = + +
        +
        `Deno.version.deno`
        + +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Dir.html b/docs/api/v1.8.2/stdlib/Dir.html new file mode 100644 index 00000000..5d634bd1 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Dir.html @@ -0,0 +1,544 @@ + + + + + + + Class: Dir + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Dir + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/nodejs/dir.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

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

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .[](glob) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +
        +
        # File 'opal/stdlib/nodejs/dir.rb', line 14
        +
        +def [](glob)
        +  `__glob__.sync(#{glob})`
        +end
        +
        +
        + +
        +

        + + .chdir(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +26
        +27
        +28
        +
        +
        # File 'opal/stdlib/nodejs/dir.rb', line 26
        +
        +def chdir(path)
        +  `process.chdir(#{path})`
        +end
        +
        +
        + +
        +

        + + .entries(dirname) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +34
        +35
        +36
        +37
        +38
        +39
        +40
        +41
        +42
        +43
        +
        +
        # File 'opal/stdlib/nodejs/dir.rb', line 34
        +
        +def entries(dirname)
        +  %x{
        +    var result = [];
        +    var entries = __fs__.readdirSync(#{dirname});
        +    for (var i = 0, ii = entries.length; i < ii; i++) {
        +      result.push(entries[i]);
        +    }
        +    return result;
        +  }
        +end
        +
        +
        + +
        +

        + + .glob(pattern) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +45
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +
        +
        # File 'opal/stdlib/nodejs/dir.rb', line 45
        +
        +def glob(pattern)
        +  pattern = [pattern] unless pattern.respond_to? :each
        +  pattern.flat_map do |subpattern|
        +    subpattern = subpattern.to_path if subpattern.respond_to? :to_path
        +    subpattern = ::Opal.coerce_to!(subpattern, String, :to_str)
        +    `__glob__.sync(subpattern)`
        +  end
        +end
        +
        +
        + +
        +

        + + .homeObject + + + + + +

        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +
        +
        # File 'opal/stdlib/nodejs/dir.rb', line 22
        +
        +def home
        +  `__os__.homedir()`
        +end
        +
        +
        + +
        +

        + + .mkdir(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +30
        +31
        +32
        +
        +
        # File 'opal/stdlib/nodejs/dir.rb', line 30
        +
        +def mkdir(path)
        +  `__fs__.mkdirSync(#{path})`
        +end
        +
        +
        + +
        +

        + + .pwdObject + + + + Also known as: + getwd + + + + +

        + + + + +
        +
        +
        +
        +18
        +19
        +20
        +
        +
        # File 'opal/stdlib/nodejs/dir.rb', line 18
        +
        +def pwd
        +  `process.cwd().split(__path__.sep).join(__path__.posix.sep)`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/ENV.html b/docs/api/v1.8.2/stdlib/ENV.html new file mode 100644 index 00000000..e057ccfb --- /dev/null +++ b/docs/api/v1.8.2/stdlib/ENV.html @@ -0,0 +1,839 @@ + + + + + + + Class: ENV + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: ENV + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .[](name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +6
        +7
        +8
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 6
        +
        +def [](name)
        +  `process.env[#{name}] || nil`
        +end
        +
        +
        + +
        +

        + + .[]=(name, value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +10
        +11
        +12
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 10
        +
        +def []=(name, value)
        +  `process.env[#{name.to_s}] = #{value.to_s}`
        +end
        +
        +
        + +
        +

        + + .delete(name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +26
        +27
        +28
        +29
        +30
        +31
        +32
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 26
        +
        +def delete(name)
        +  %x{
        +    var value = process.env[#{name}] || nil;
        +    delete process.env[#{name}];
        +    return value;
        +  }
        +end
        +
        +
        + +
        +

        + + .empty?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +18
        +19
        +20
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 18
        +
        +def empty?
        +  `Object.keys(process.env).length === 0`
        +end
        +
        +
        + +
        +

        + + .fetch(key, default_value = undefined, &block) ⇒ Object + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (KeyError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +34
        +35
        +36
        +37
        +38
        +39
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 34
        +
        +def fetch(key, default_value = undefined, &block)
        +  return self[key] if key?(key)
        +  return yield key if block_given?
        +  return default_value unless `typeof(#{default_value}) === 'undefined'`
        +  raise KeyError, 'key not found'
        +end
        +
        +
        + +
        +

        + + .key?(name) ⇒ Boolean + + + + Also known as: + has_key?, include?, member? + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 14
        +
        +def key?(name)
        +  `process.env.hasOwnProperty(#{name})`
        +end
        +
        +
        + +
        +

        + + .keysObject + + + + + +

        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 22
        +
        +def keys
        +  `Object.keys(process.env)`
        +end
        +
        +
        + +
        +

        + + .merge(keys) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +49
        +50
        +51
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 49
        +
        +def merge(keys)
        +  to_h.merge(keys)
        +end
        +
        +
        + +
        +

        + + .pretty_print(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +376
        +377
        +378
        +379
        +380
        +381
        +382
        +
        +
        # File 'opal/stdlib/pp.rb', line 376
        +
        +def pretty_print(q) # :nodoc:
        +  h = {}
        +  ENV.keys.sort.each {|k|
        +    h[k] = ENV[k]
        +  }
        +  q.pp_hash h
        +end
        +
        +
        + +
        +

        + + .to_hObject + + + + Also known as: + to_hash + + + + +

        + + + + +
        +
        +
        +
        +45
        +46
        +47
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 45
        +
        +def to_h
        +  keys.to_h { |k| [k, self[k]] }
        +end
        +
        +
        + +
        +

        + + .to_sObject + + + + Also known as: + inspect + + + + +

        + + + + +
        +
        +
        +
        +41
        +42
        +43
        +
        +
        # File 'opal/stdlib/nodejs/env.rb', line 41
        +
        +def to_s
        +  'ENV'
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/ERB.html b/docs/api/v1.8.2/stdlib/ERB.html new file mode 100644 index 00000000..94023fe2 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/ERB.html @@ -0,0 +1,133 @@ + + + + + + + Class: ERB + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: ERB + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/erb.rb
        +
        + +
        + +

        Defined Under Namespace

        +

        + + + Modules: Util + + + + +

        + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/ERB/Util.html b/docs/api/v1.8.2/stdlib/ERB/Util.html new file mode 100644 index 00000000..7a6dbbc1 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/ERB/Util.html @@ -0,0 +1,228 @@ + + + + + + + Module: ERB::Util + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: ERB::Util + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/erb.rb
        +
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .hObject + + + + + +

        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +
        +
        # File 'opal/stdlib/erb.rb', line 14
        +
        +def html_escape(str)
        +  `("" + str).replace(escape_regexp, function (m) { return escapes[m] })`
        +end
        +
        +
        + +
        +

        + + .html_escape(str) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +10
        +11
        +12
        +
        +
        # File 'opal/stdlib/erb.rb', line 10
        +
        +def html_escape(str)
        +  `("" + str).replace(escape_regexp, function (m) { return escapes[m] })`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Enumerable.html b/docs/api/v1.8.2/stdlib/Enumerable.html new file mode 100644 index 00000000..935fc5ad --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Enumerable.html @@ -0,0 +1,246 @@ + + + + + + + Module: Enumerable + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Enumerable + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        Buffer::Array, Matrix, Native::Array, Vector
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/json.rb,
        + opal/stdlib/await.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        BUG: Enumerable must come before Array, otherwise it overrides #to_json + this is due to how modules are implemented.

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +33
        +34
        +35
        +
        +
        # File 'opal/stdlib/await.rb', line 33
        +
        +def each_async(&block)
        +  PromiseV2.when(*map(&block)).await
        +end
        +
        +
        + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +130
        +131
        +132
        +
        +
        # File 'opal/stdlib/json.rb', line 130
        +
        +def to_json
        +  to_a.to_json
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Exception2MessageMapper.html b/docs/api/v1.8.2/stdlib/Exception2MessageMapper.html new file mode 100644 index 00000000..9b8cc7d5 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Exception2MessageMapper.html @@ -0,0 +1,988 @@ + + + + + + + Module: Exception2MessageMapper + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Exception2MessageMapper + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        ExceptionForMatrix
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/e2mmap.rb
        +
        + +
        + +

        Overview

        +
        +

        -- + e2mmap.rb - for Ruby 1.1 + $Release Version: 2.0$ + $Revision: 1.10 $ + by Keiju ISHITSUKA

        + +

        ++

        + +

        Helper module for easily defining exceptions with predefined messages.

        + +

        == Usage

        + +

        1. + class Foo + extend Exception2MessageMapper + def_e2message ExistingExceptionClass, "message..." + def_exception :NewExceptionClass, "message..."[, superclass] + ... + end

        + +

        2. + module Error + extend Exception2MessageMapper + def_e2message ExistingExceptionClass, "message..." + def_exception :NewExceptionClass, "message..."[, superclass] + ... + end + class Foo + include Error + ... + end

        + +

        foo = Foo.new + foo.Fail ....

        + +

        3. + module Error + extend Exception2MessageMapper + def_e2message ExistingExceptionClass, "message..." + def_exception :NewExceptionClass, "message..."[, superclass] + ... + end + class Foo + extend Exception2MessageMapper + include Error + ... + end

        + +

        Foo.Fail NewExceptionClass, arg... + Foo.Fail ExistingExceptionClass, arg...

        + + +
        +
        +
        + + +
        + +

        + Constant Summary + collapse +

        + +
        + +
        E2MM = +
        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        +
        +
        Exception2MessageMapper
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .def_e2message(k, c, m) ⇒ Object + + + + + +

        +
        +

        E2MM.def_e2message(k, e, m) + k: class to define exception under. + e: exception + m: message_form + define exception c with message m.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +121
        +122
        +123
        +124
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 121
        +
        +def E2MM.def_e2message(k, c, m)
        +  E2MM.instance_eval{@MessageMap[[k, c]] = m}
        +  c
        +end
        +
        +
        + +
        +

        + + .def_exception(k, n, m, s = StandardError) ⇒ Object + + + + + +

        +
        +

        E2MM.def_exception(k, n, m, s) + k: class to define exception under. + n: exception_name + m: message_form + s: superclass(default: StandardError) + define exception named ``c'' with message m.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +133
        +134
        +135
        +136
        +137
        +138
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 133
        +
        +def E2MM.def_exception(k, n, m, s = StandardError)
        +  e = Class.new(s)
        +  E2MM.instance_eval{@MessageMap[[k, e]] = m}
        +  k.module_eval {remove_const(n)} if k.const_defined?(n, false)
        +  k.const_set(n, e)
        +end
        +
        +
        + +
        +

        + + .e2mm_message(klass, exp) ⇒ Object + + + + Also known as: + message + + + + +

        + + + + +
        +
        +
        +
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 158
        +
        +def E2MM.e2mm_message(klass, exp)
        +  klass.ancestors.each do |c|
        +    if mes = @MessageMap[[c,exp]]
        +      # PATCH: who needs this hack?
        +      # m = klass.instance_eval('"' + mes + '"')
        +      # return m
        +      return mes
        +    end
        +  end
        +  nil
        +end
        +
        +
        + +
        +

        + + .extend_object(cl) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +59
        +60
        +61
        +62
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 59
        +
        +def E2MM.extend_object(cl)
        +  super
        +  cl.bind(self) unless cl < E2MM
        +end
        +
        +
        + +
        +

        + + .Raise(klass = E2MM, err = nil, *rest) ⇒ Object + + + + Also known as: + Fail + + + + +

        +
        +

        Fail(klass, err, *rest) + klass: class to define exception under. + err: exception + rest: message arguments

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +145
        +146
        +147
        +148
        +149
        +150
        +151
        +152
        +153
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 145
        +
        +def E2MM.Raise(klass = E2MM, err = nil, *rest)
        +  if form = e2mm_message(klass, err)
        +    b = $@.nil? ? caller(1) : $@
        +    b.shift if b[0] =~ /^#{Regexp.quote(__FILE__)}:/
        +    raise err, sprintf(form, *rest), b
        +  else
        +    E2MM.Fail E2MM, ErrNotRegisteredException, err.inspect
        +  end
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #bind(cl) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +72
        +73
        +74
        +75
        +76
        +77
        +78
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 64
        +
        +def bind(cl)
        +  self.module_eval do
        +    def Raise(err = nil, *rest)
        +      Exception2MessageMapper.Raise(self.class, err, *rest)
        +    end
        +    alias Fail Raise
        +
        +    class << self
        +      undef included
        +    end
        +    def self.included(mod)
        +      mod.extend Exception2MessageMapper
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #def_e2message(c, m) ⇒ Object + + + + + +

        +
        +

        def_e2message(c, m) + c: exception + m: message_form + define exception c with message m.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +95
        +96
        +97
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 95
        +
        +def def_e2message(c, m)
        +  E2MM.def_e2message(self, c, m)
        +end
        +
        +
        + +
        +

        + + #def_exception(n, m, s = StandardError) ⇒ Object + + + + + +

        +
        +

        def_exception(n, m, s) + n: exception_name + m: message_form + s: superclass(default: StandardError) + define exception named ``c'' with message m.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +105
        +106
        +107
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 105
        +
        +def def_exception(n, m, s = StandardError)
        +  E2MM.def_exception(self, n, m, s)
        +end
        +
        +
        + +
        +

        + + #failObject + + + + + +

        +
        +

        Fail(err, *rest) + err: exception + rest: message arguments

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +88
        +89
        +90
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 88
        +
        +def Raise(err = nil, *rest)
        +  E2MM.Raise(self, err, *rest)
        +end
        +
        +
        + +
        +

        + + #FailObject + + + + + +

        +
        +

        Fail(err, *rest) + err: exception + rest: message arguments

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +87
        +88
        +89
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 87
        +
        +def Raise(err = nil, *rest)
        +  E2MM.Raise(self, err, *rest)
        +end
        +
        +
        + +
        +

        + + #Raise(err = nil, *rest) ⇒ Object + + + + + +

        +
        +

        Fail(err, *rest) + err: exception + rest: message arguments

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +84
        +85
        +86
        +
        +
        # File 'opal/stdlib/e2mmap.rb', line 84
        +
        +def Raise(err = nil, *rest)
        +  E2MM.Raise(self, err, *rest)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/ExceptionForMatrix.html b/docs/api/v1.8.2/stdlib/ExceptionForMatrix.html new file mode 100644 index 00000000..1474abf7 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/ExceptionForMatrix.html @@ -0,0 +1,144 @@ + + + + + + + Module: ExceptionForMatrix + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: ExceptionForMatrix + + + +

        +
        + + + + +
        +
        Extended by:
        +
        Exception2MessageMapper
        +
        + + + + + + +
        +
        Included in:
        +
        Matrix, Matrix::Scalar, Vector
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix.rb
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants included + from Exception2MessageMapper

        +

        Exception2MessageMapper::E2MM

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

        Method Summary

        + +

        Methods included from Exception2MessageMapper

        +

        Fail, Raise, Raise, bind, def_e2message, def_e2message, def_exception, def_exception, e2mm_message, extend_object, fail

        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/File.html b/docs/api/v1.8.2/stdlib/File.html new file mode 100644 index 00000000..7d2a01b5 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/File.html @@ -0,0 +1,1754 @@ + + + + + + + Class: File + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: File + + + +

        +
        + +
        +
        Inherits:
        +
        + IO + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/headless_browser/file.rb,
        + opal/stdlib/deno/file.rb,
        opal/stdlib/nodejs/file.rb,
        opal/stdlib/nashorn/file.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + + + Classes: Stat + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        ALT_SEPARATOR = + +
        +
        `__path__.sep`
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #path ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute path.

          +
          + +
        • + + +
        + + + + + +

        Attributes inherited from IO

        +

        #lineno

        + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from IO

        +

        binread, #initialize_before_node_io

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(path, flags = 'r') ⇒ File + + + + + +

        +
        +

        Instance Methods

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +242
        +243
        +244
        +245
        +246
        +247
        +248
        +249
        +250
        +251
        +252
        +253
        +254
        +255
        +256
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 242
        +
        +def initialize(path, flags = 'r')
        +  @binary_flag = flags.include?('b')
        +  # Node does not recognize this flag
        +  flags = flags.delete('b')
        +  # encoding flag is unsupported
        +  encoding_option_rx = /:(.*)/
        +  if encoding_option_rx.match?(flags)
        +    `handle_unsupported_feature("Encoding option (:encoding) is unsupported by Node.js openSync method and will be removed.")`
        +    flags = flags.sub(encoding_option_rx, '')
        +  end
        +  @path = path
        +
        +  fd = `executeIOAction(function(){return Deno.openSync(path, flags)})`
        +  super(fd, flags)
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #pathObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute path.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +258
        +259
        +260
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 258
        +
        +def path
        +  @path
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .absolute_path(path, basedir = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +236
        +237
        +238
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 236
        +
        +def self.absolute_path(path, basedir = nil)
        +  raise 'File::absolute_path is currently unsupported in Deno!'
        +end
        +
        +
        + +
        +

        + + .delete(path) ⇒ Object + + + + Also known as: + unlink + + + + +

        + + + + +
        +
        +
        +
        +127
        +128
        +129
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 127
        +
        +def self.delete(path)
        +  `executeIOAction(function(){return Deno.removeSync(#{path})})`
        +end
        +
        +
        + +
        +

        + + .directory?(path) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +170
        +171
        +172
        +173
        +174
        +175
        +176
        +177
        +178
        +179
        +180
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 170
        +
        +def self.directory?(path)
        +  return false unless exist? path
        +  result = `executeIOAction(function(){return !!Deno.lstatSync(path).isDirectory})`
        +  unless result
        +    realpath = realpath(path)
        +    if realpath != path
        +      result = `executeIOAction(function(){return !!Deno.lstatSync(realpath).isDirectory})`
        +    end
        +  end
        +  result
        +end
        +
        +
        + +
        +

        + + .exist?(path) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +135
        +136
        +137
        +138
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 135
        +
        +def self.exist?(path)
        +  path = path.path if path.respond_to? :path
        +  `return executeIOAction(function(){return Deno.statSync(#{path})})`
        +end
        +
        +
        + +
        +

        + + .file?(path) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +182
        +183
        +184
        +185
        +186
        +187
        +188
        +189
        +190
        +191
        +192
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 182
        +
        +def self.file?(path)
        +  return false unless exist? path
        +  result = `executeIOAction(function(){return !!Deno.lstatSync(path).isFile})`
        +  unless result
        +    realpath = realpath(path)
        +    if realpath != path
        +      result = `executeIOAction(function(){return !!Deno.lstatSync(realpath).isFile})`
        +    end
        +  end
        +  result
        +end
        +
        +
        + +
        +

        + + .join(*paths) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +154
        +155
        +156
        +157
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 154
        +
        +def self.join(*paths)
        +  # by itself, `path.posix.join` normalizes leading // to /.
        +  # restore the leading / on UNC paths (i.e., paths starting with //).
        +  paths = paths.map(&:to_s)
        +  prefix = paths.first&.start_with?('//') ? '/' : ''
        +  path = prefix
        +  paths.each do |pth|
        +    path << if pth.end_with?('/') || pth.start_with?('/')
        +              pth
        +            else
        +              '/' + pth
        +            end
        +  end
        +  path
        +end
        +
        +
        + +
        +

        + + .mtime(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +228
        +229
        +230
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 228
        +
        +def self.mtime(path)
        +  `return executeIOAction(function(){return Deno.statSync(#{path}).mtime})`
        +end
        +
        +
        + +
        +

        + + .open(path, mode = 'r') ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +210
        +211
        +212
        +213
        +214
        +215
        +216
        +217
        +218
        +219
        +220
        +221
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 210
        +
        +def self.open(path, mode = 'r')
        +  file = new(path, mode)
        +  if block_given?
        +    begin
        +      yield(file)
        +    ensure
        +      file.close
        +    end
        +  else
        +    file
        +  end
        +end
        +
        +
        + +
        +

        + + .read(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +118
        +119
        +120
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 118
        +
        +def self.read(path)
        +  `return executeIOAction(function(){return Deno.readFileSync(#{path}).toString()})`
        +end
        +
        +
        + +
        +

        + + .readable?(path) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +194
        +195
        +196
        +197
        +198
        +199
        +200
        +201
        +202
        +203
        +204
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 194
        +
        +def self.readable?(path)
        +  return false unless exist? path
        +  %{
        +    try {
        +      Deno.openSync(path, {read: true}).close();
        +      return true;
        +    } catch (error) {
        +      return false;
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + .realpath(pathname, dir_string = nil, cache = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +140
        +141
        +142
        +143
        +144
        +145
        +146
        +147
        +148
        +149
        +150
        +151
        +152
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 140
        +
        +def self.realpath(pathname, dir_string = nil, cache = nil, &block)
        +  pathname = join(dir_string, pathname) if dir_string
        +  if block_given?
        +    `
        +      Deno.realpath(#{pathname}, #{cache}, function(error, realpath){
        +        if (error) Opal.IOError.$new(error.message)
        +        else #{block.call(`realpath`)}
        +      })
        +      `
        +  else
        +    `return executeIOAction(function(){return Deno.realpathSync(#{pathname}, #{cache})})`
        +  end
        +end
        +
        +
        + +
        +

        + + .size(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +206
        +207
        +208
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 206
        +
        +def self.size(path)
        +  `return executeIOAction(function(){return Deno.lstatSync(path).size})`
        +end
        +
        +
        + +
        +

        + + .stat(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +223
        +224
        +225
        +226
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 223
        +
        +def self.stat(path)
        +  path = path.path if path.respond_to? :path
        +  File::Stat.new(path)
        +end
        +
        +
        + +
        + + + + + +
        +
        +
        +
        +140
        +141
        +142
        +143
        +
        +
        # File 'opal/stdlib/nodejs/file.rb', line 140
        +
        +def self.symlink(path, new_path)
        +  `executeIOAction(function(){return __fs__.symlinkSync(#{path}, #{new_path})})`
        +  0
        +end
        +
        +
        + +
        +

        + + .symlink?(path) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +232
        +233
        +234
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 232
        +
        +def self.symlink?(path)
        +  `return executeIOAction(function(){return Deno.lstatSync(#{path}).isSymLink})`
        +end
        +
        +
        + +
        +

        + + .write(path, data) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +122
        +123
        +124
        +125
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 122
        +
        +def self.write(path, data)
        +  `executeIOAction(function(){return Deno.writeFileSync(#{path}, __textEncoder__.encode(#{data}));})`
        +  data.size
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #closeObject + + + + + +

        + + + + +
        +
        +
        +
        +293
        +294
        +295
        +296
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 293
        +
        +def close
        +  `executeIOAction(function(){return #{@fd}.close()})`
        +  super
        +end
        +
        +
        + +
        +

        + + #flushObject + + + + + +

        + + + + +
        +
        +
        +
        +289
        +290
        +291
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 289
        +
        +def flush
        +  # not supported by deno
        +end
        +
        +
        + +
        +

        + + #mtimeObject + + + + + +

        + + + + +
        +
        +
        +
        +298
        +299
        +300
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 298
        +
        +def mtime
        +  `return executeIOAction(function(){return Deno.statSync(#{@path}).mtime})`
        +end
        +
        +
        + +
        +

        + + #sysread(bytes) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +260
        +261
        +262
        +263
        +264
        +265
        +266
        +267
        +268
        +269
        +270
        +271
        +272
        +273
        +274
        +275
        +276
        +277
        +278
        +279
        +280
        +281
        +282
        +283
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 260
        +
        +def sysread(bytes)
        +  if @eof
        +    raise EOFError, 'end of file reached'
        +  else
        +    if @binary_flag
        +      %x{
        +        var buf = executeIOAction(function(){return Deno.readFileSync(#{@path})})
        +        var content
        +        if (is_utf8(buf)) {
        +          content = buf.toString('utf8')
        +        } else {
        +          // coerce to utf8
        +          content = __utf8TextDecoder__.decode(__textEncoder__.encode(buf.toString('binary')))
        +        }
        +      }
        +      res = `content`
        +    else
        +      res = `executeIOAction(function(){return Deno.readFileSync(#{@path}).toString('utf8')})`
        +    end
        +    @eof = true
        +    @lineno = res.size
        +    res
        +  end
        +end
        +
        +
        + +
        +

        + + #write(string) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +285
        +286
        +287
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 285
        +
        +def write(string)
        +  `executeIOAction(function(){return #{@fd}.writeSync(__textEncoder__.encode(#{string}))})`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/File/Stat.html b/docs/api/v1.8.2/stdlib/File/Stat.html new file mode 100644 index 00000000..2e6f757a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/File/Stat.html @@ -0,0 +1,655 @@ + + + + + + + Class: File::Stat + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: File::Stat + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/deno/file.rb,
        + opal/stdlib/nodejs/file.rb
        +
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(path) ⇒ Stat + + + + + +

        +
        +

        Returns a new instance of Stat.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +304
        +305
        +306
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 304
        +
        +def initialize(path)
        +  @path = path
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #directory?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +312
        +313
        +314
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 312
        +
        +def directory?
        +  `return executeIOAction(function(){return Deno.statSync(#{@path}).isDirectory})`
        +end
        +
        +
        + +
        +

        + + #executable?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +338
        +339
        +340
        +341
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 338
        +
        +def executable?
        +  # accessible only over unstable API
        +  false
        +end
        +
        +
        + +
        +

        + + #file?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +308
        +309
        +310
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 308
        +
        +def file?
        +  `return executeIOAction(function(){return Deno.statSync(#{@path}).isFile})`
        +end
        +
        +
        + +
        +

        + + #mtimeObject + + + + + +

        + + + + +
        +
        +
        +
        +316
        +317
        +318
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 316
        +
        +def mtime
        +  `return executeIOAction(function(){return Deno.statSync(#{@path}).mtime})`
        +end
        +
        +
        + +
        +

        + + #readable?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +320
        +321
        +322
        +323
        +324
        +325
        +326
        +327
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 320
        +
        +def readable?
        +  %x{
        +    return executeIOAction(function(){
        +      Deno.openSync(path, {read: true}).close();
        +      return true;
        +    })
        +  }
        +end
        +
        +
        + +
        +

        + + #writable?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +329
        +330
        +331
        +332
        +333
        +334
        +335
        +336
        +
        +
        # File 'opal/stdlib/deno/file.rb', line 329
        +
        +def writable?
        +  %x{
        +    return executeIOAction(function(){
        +      Deno.openSync(path, {write: true}).close();
        +      return true;
        +    })
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/FileUtils.html b/docs/api/v1.8.2/stdlib/FileUtils.html new file mode 100644 index 00000000..f753305f --- /dev/null +++ b/docs/api/v1.8.2/stdlib/FileUtils.html @@ -0,0 +1,444 @@ + + + + + + + Module: FileUtils + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: FileUtils + + + +

        +
        + + + + +
        +
        Extended by:
        +
        FileUtils
        +
        + + + + + + +
        +
        Included in:
        +
        FileUtils
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/nodejs/fileutils.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #chmod(mode, file_list) ⇒ Object + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (NotImplementedError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +7
        +8
        +9
        +10
        +11
        +12
        +
        +
        # File 'opal/stdlib/nodejs/fileutils.rb', line 7
        +
        +def chmod(mode, file_list)
        +  raise NotImplementedError, 'symbolic mode is not supported, use numeric mode' if String === mode
        +  Array(file_list).each do |file|
        +    `__fs__.chmodSync(mode, file)`
        +  end
        +end
        +
        +
        + +
        +

        + + #cp(source, target) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +17
        +
        +
        # File 'opal/stdlib/nodejs/fileutils.rb', line 14
        +
        +def cp(source, target)
        +  target = File.join(target, File.basename(source)) if File.directory? target
        +  `__fs__.writeFileSync(target, __fs__.readFileSync(source))`
        +end
        +
        +
        + +
        +

        + + #mkdir_p(path) ⇒ Object + + + + Also known as: + mkpath, makedirs + + + + +

        + + + + +
        +
        +
        +
        +23
        +24
        +25
        +26
        +
        +
        # File 'opal/stdlib/nodejs/fileutils.rb', line 23
        +
        +def mkdir_p(path)
        +  return true if File.directory? path
        +  `__fs__.mkdirSync(#{path})`
        +end
        +
        +
        + +
        +

        + + #mv(source, target) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +28
        +29
        +30
        +31
        +
        +
        # File 'opal/stdlib/nodejs/fileutils.rb', line 28
        +
        +def mv(source, target)
        +  target = File.join(target, File.basename(source)) if File.directory? target
        +  `__fs__.renameSync(source, target)`
        +end
        +
        +
        + +
        +

        + + #rm(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +19
        +20
        +21
        +
        +
        # File 'opal/stdlib/nodejs/fileutils.rb', line 19
        +
        +def rm(path)
        +  `__fs__.unlinkSync(path)`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Float.html b/docs/api/v1.8.2/stdlib/Float.html new file mode 100644 index 00000000..e761b91b --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Float.html @@ -0,0 +1,231 @@ + + + + + + + Class: Float + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Float + + + +

        +
        + +
        +
        Inherits:
        +
        + Numeric + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/bigdecimal/util.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Numeric

        +

        #to_json, #to_n

        + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_d(precision = Float::DIG) ⇒ Object + + + + + +

        +
        +

        call-seq: + float.to_d -> bigdecimal + float.to_d(precision) -> bigdecimal

        + +

        Returns the value of +float+ as a BigDecimal. +The +precision+ parameter is used to determine the number of +significant digits for the result (the default is Float::DIG).

        + +
        require 'bigdecimal'
        +require 'bigdecimal/util'
        +
        +0.5.to_d         # => 0.5e0
        +1.234.to_d(2)    # => 0.12e1
        +
        + +

        See also BigDecimal::new.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +47
        +48
        +49
        +
        +
        # File 'opal/stdlib/bigdecimal/util.rb', line 47
        +
        +def to_d(precision = Float::DIG)
        +  BigDecimal(self, precision)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Forwardable.html b/docs/api/v1.8.2/stdlib/Forwardable.html new file mode 100644 index 00000000..0377e425 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Forwardable.html @@ -0,0 +1,339 @@ + + + + + + + Module: Forwardable + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Forwardable + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        Date
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/forwardable.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #def_instance_delegator(accessor, method, ali = method) ⇒ Object + + + + Also known as: + def_delegator + + + + +

        + + + + +
        +
        +
        +
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +
        +
        # File 'opal/stdlib/forwardable.rb', line 20
        +
        +def def_instance_delegator(accessor, method, ali = method)
        +  if accessor.to_s.start_with? '@'
        +    define_method ali do |*args, &block|
        +      instance_variable_get(accessor).__send__(method, *args, &block)
        +    end
        +  else
        +    define_method ali do |*args, &block|
        +      __send__(accessor).__send__(method, *args, &block)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #def_instance_delegators(accessor, *methods) ⇒ Object + + + + Also known as: + def_delegators + + + + +

        + + + + +
        +
        +
        +
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +
        +
        # File 'opal/stdlib/forwardable.rb', line 12
        +
        +def def_instance_delegators(accessor, *methods)
        +  methods.each do |method|
        +    next if %w[__send__ __id__].include?(method)
        +
        +    def_instance_delegator(accessor, method)
        +  end
        +end
        +
        +
        + +
        +

        + + #instance_delegate(hash) ⇒ Object + + + + Also known as: + delegate + + + + +

        + + + + +
        +
        +
        +
        +2
        +3
        +4
        +5
        +6
        +7
        +8
        +9
        +10
        +
        +
        # File 'opal/stdlib/forwardable.rb', line 2
        +
        +def instance_delegate(hash)
        +  hash.each do |methods, accessor|
        +    methods = [methods] unless methods.respond_to? :each
        +
        +    methods.each do |method|
        +      def_instance_delegator(accessor, method)
        +    end
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Hash.html b/docs/api/v1.8.2/stdlib/Hash.html new file mode 100644 index 00000000..cafcbff5 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Hash.html @@ -0,0 +1,754 @@ + + + + + + + Class: Hash + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Hash + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb,
        + opal/stdlib/json.rb,
        opal/stdlib/native.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(defaults = undefined, &block) ⇒ Hash + + + + + +

        +
        +

        Returns a new instance of Hash.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +565
        +566
        +567
        +568
        +569
        +570
        +571
        +572
        +573
        +574
        +575
        +576
        +577
        +578
        +579
        +580
        +581
        +582
        +583
        +584
        +585
        +586
        +587
        +588
        +
        +
        # File 'opal/stdlib/native.rb', line 565
        +
        +def initialize(defaults = undefined, &block)
        +  %x{
        +    if (defaults != null) {
        +      if (defaults.constructor === undefined ||
        +          defaults.constructor === Object) {
        +        var key, value;
        +
        +        for (key in defaults) {
        +          value = defaults[key];
        +          $hash_convert_and_put_value(self, key, value);
        +        }
        +
        +        return self;
        +      } else if (defaults instanceof Map) {
        +        Opal.hash_each(defaults, false, function(key, value) {
        +          $hash_convert_and_put_value(self, key, value);
        +          return [false, false];
        +        });
        +      }
        +    }
        +
        +    return #{_initialize(defaults, &block)};
        +  }
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #_initializeObject + + + + + +

        + + + + +
        +
        +
        +
        +539
        +
        +
        # File 'opal/stdlib/native.rb', line 539
        +
        +alias _initialize initialize
        +
        +
        + +
        +

        + + #pretty_print(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +366
        +367
        +368
        +
        +
        # File 'opal/stdlib/pp.rb', line 366
        +
        +def pretty_print(q) # :nodoc:
        +  q.pp_hash self
        +end
        +
        +
        + +
        +

        + + #pretty_print_cycle(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +370
        +371
        +372
        +
        +
        # File 'opal/stdlib/pp.rb', line 370
        +
        +def pretty_print_cycle(q) # :nodoc:
        +  q.text(empty? ? '{}' : '{...}')
        +end
        +
        +
        + +
        +

        + + #ruby2_keywords_hash(hash) ⇒ Object + + + + + +

        +
        +

        call-seq: + Hash.ruby2_keywords_hash(hash) -> new_hash

        + +

        Duplicates a given hash and returns the new hash.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +56
        +57
        +58
        +
        +
        # File 'opal/stdlib/ruby2_keywords.rb', line 56
        +
        +def ruby2_keywords_hash(hash)
        +  hash.dup
        +end
        +
        +
        + +
        +

        + + #ruby2_keywords_hash?(hash) ⇒ Boolean + + + + + +

        +
        +

        call-seq: + Hash.ruby2_keywords_hash?(hash) -> false

        + +

        Returns false.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +46
        +47
        +48
        +
        +
        # File 'opal/stdlib/ruby2_keywords.rb', line 46
        +
        +def ruby2_keywords_hash?(hash)
        +  false
        +end
        +
        +
        + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +156
        +157
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +
        +
        # File 'opal/stdlib/json.rb', line 156
        +
        +def to_json
        +  %x{
        +    var result = [];
        +
        +    Opal.hash_each(self, false, function(key, value) {
        +      result.push(#{`key`.to_s.to_json} + ':' + #{`value`.to_json});
        +      return [false, false];
        +    });
        +
        +    return '{' + result.join(',') + '}';
        +  }
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        all keys and values.

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          a JavaScript object, in turn also calling #to_n on

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +592
        +593
        +594
        +595
        +596
        +597
        +598
        +599
        +600
        +601
        +602
        +603
        +
        +
        # File 'opal/stdlib/native.rb', line 592
        +
        +def to_n
        +  %x{
        +    var result = {};
        +
        +    Opal.hash_each(self, false, function(key, value) {
        +      result[#{Native.try_convert(`key`, `key`)}] = #{Native.try_convert(`value`, `value`)};
        +      return [false, false];
        +    });
        +
        +    return result;
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/IO.html b/docs/api/v1.8.2/stdlib/IO.html new file mode 100644 index 00000000..b45c57a6 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/IO.html @@ -0,0 +1,514 @@ + + + + + + + Class: IO + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: IO + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/nodejs/io.rb
        +
        + +
        + +
        +

        Direct Known Subclasses

        +

        File, StringIO

        +
        + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #lineno ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute lineno.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(fd, flags = 'r') ⇒ IO + + + + + +

        +
        +

        Returns a new instance of IO.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +31
        +32
        +33
        +34
        +
        +
        # File 'opal/stdlib/nodejs/io.rb', line 31
        +
        +def initialize(fd, flags = 'r')
        +  @lineno = 0
        +  initialize_before_node_io(fd, flags)
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #linenoObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute lineno.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +27
        +28
        +29
        +
        +
        # File 'opal/stdlib/nodejs/io.rb', line 27
        +
        +def lineno
        +  @lineno
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .binread(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +44
        +45
        +46
        +
        +
        # File 'opal/stdlib/nodejs/io.rb', line 44
        +
        +def self.binread(path)
        +  `return executeIOAction(function(){return __fs__.readFileSync(#{path}).toString('binary')})`
        +end
        +
        +
        + +
        +

        + + .read(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +40
        +41
        +42
        +
        +
        # File 'opal/stdlib/nodejs/io.rb', line 40
        +
        +def self.read(path)
        +  File.read(path)
        +end
        +
        +
        + +
        +

        + + .write(path, data) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +36
        +37
        +38
        +
        +
        # File 'opal/stdlib/nodejs/io.rb', line 36
        +
        +def self.write(path, data)
        +  File.write(path, data)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #initialize_before_node_ioObject + + + + + +

        + + + + +
        +
        +
        +
        +29
        +
        +
        # File 'opal/stdlib/nodejs/io.rb', line 29
        +
        +alias initialize_before_node_io initialize
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Integer.html b/docs/api/v1.8.2/stdlib/Integer.html new file mode 100644 index 00000000..a247da4d --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Integer.html @@ -0,0 +1,227 @@ + + + + + + + Class: Integer + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Integer + + + +

        +
        + +
        +
        Inherits:
        +
        + Numeric + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/bigdecimal/util.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #to_d ⇒ Object + + + + + + + + + + + + + +

          call-seq: int.to_d -> bigdecimal.

          +
          + +
        • + + +
        + + + + + + + + + + + +

        Methods inherited from Numeric

        +

        #to_json, #to_n

        + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_dObject + + + + + +

        +
        +

        call-seq: + int.to_d -> bigdecimal

        + +

        Returns the value of +int+ as a BigDecimal.

        + +
        require 'bigdecimal'
        +require 'bigdecimal/util'
        +
        +42.to_d   # => 0.42e2
        +
        + +

        See also BigDecimal::new.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +24
        +25
        +26
        +
        +
        # File 'opal/stdlib/bigdecimal/util.rb', line 24
        +
        +def to_d
        +  BigDecimal(self)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/JS.html b/docs/api/v1.8.2/stdlib/JS.html new file mode 100644 index 00000000..d6f6787e --- /dev/null +++ b/docs/api/v1.8.2/stdlib/JS.html @@ -0,0 +1,762 @@ + + + + + + + Module: JS + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: JS + + + +

        +
        + + + + +
        +
        Extended by:
        +
        JS
        +
        + + + + + + +
        +
        Included in:
        +
        JS
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/js.rb
        +
        + +
        + +

        Overview

        +
        +

        The JS module provides syntax sugar for calling native javascript +operators (e.g. typeof, instanceof, new, delete) and global functions +(e.g. parseFloat, parseInt).

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

        + Instance Method Summary + collapse +

        + + + + +
        +

        Dynamic Method Handling

        +

        + This class handles dynamic methods through the method_missing method + +

        + +
        +

        + + #method_missingObject + + + + + +

        +
        +

        Call the global javascript function with the given arguments.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +68
        +69
        +70
        +71
        +72
        +
        +
        # File 'opal/stdlib/js.rb', line 68
        +
        +def call(func, *args, &block)
        +  g = global
        +  args << block if block
        +  g.JS[func].JS.apply(g, args)
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #[](name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +64
        +65
        +66
        +
        +
        # File 'opal/stdlib/js.rb', line 64
        +
        +def [](name)
        +  `Opal.global[#{name}]`
        +end
        +
        +
        + +
        +

        + + #call(func, *args, &block) ⇒ Object + + + + Also known as: + method_missing + + + + +

        +
        +

        Call the global javascript function with the given arguments.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +58
        +59
        +60
        +61
        +62
        +
        +
        # File 'opal/stdlib/js.rb', line 58
        +
        +def call(func, *args, &block)
        +  g = global
        +  args << block if block
        +  g.JS[func].JS.apply(g, args)
        +end
        +
        +
        + +
        +

        + + #delete(object, property) ⇒ Object + + + + + +

        +
        +

        Use delete to remove a property from an object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +8
        +9
        +10
        +
        +
        # File 'opal/stdlib/js.rb', line 8
        +
        +def delete(object, property)
        +  `delete #{object}[#{property}]`
        +end
        +
        +
        + +
        +

        + + #globalObject + + + + + +

        +
        +

        The global object

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +13
        +14
        +15
        +
        +
        # File 'opal/stdlib/js.rb', line 13
        +
        +def global
        +  `Opal.global`
        +end
        +
        +
        + +
        +

        + + #in(property, object) ⇒ Object + + + + + +

        +
        +

        Use in to check for a property in an object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +18
        +19
        +20
        +
        +
        # File 'opal/stdlib/js.rb', line 18
        +
        +def in(property, object)
        +  `#{property} in #{object}`
        +end
        +
        +
        + +
        +

        + + #instanceof(value, func) ⇒ Object + + + + + +

        +
        +

        Use instanceof to return whether value is an instance of the function.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +23
        +24
        +25
        +
        +
        # File 'opal/stdlib/js.rb', line 23
        +
        +def instanceof(value, func)
        +  `#{value} instanceof #{func}`
        +end
        +
        +
        + +
        +

        + + #new(func, *args, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +29
        +30
        +31
        +32
        +33
        +
        +
        # File 'opal/stdlib/js.rb', line 29
        +
        +def new(func, *args, &block)
        +  args.insert(0, `this`)
        +  args << block if block
        +  `new (#{func}.bind.apply(#{func}, #{args}))()`
        +end
        +
        +
        + +
        +

        + + #typeof(value) ⇒ Object + + + + + +

        +
        +

        Use typeof to return the underlying javascript type of value. +Note that for undefined values, this will not work exactly like +the javascript typeof operator, as the argument is evaluated before +the function call.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +47
        +48
        +49
        +
        +
        # File 'opal/stdlib/js.rb', line 47
        +
        +def typeof(value)
        +  `typeof #{value}`
        +end
        +
        +
        + +
        +

        + + #void(expr) ⇒ Object + + + + + +

        +
        +

        Use void to return undefined.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +52
        +53
        +54
        +55
        +
        +
        # File 'opal/stdlib/js.rb', line 52
        +
        +def void(expr)
        +  # Could use `undefined` here, but this is closer to the intent of the method
        +  `void #{expr}`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/JSON.html b/docs/api/v1.8.2/stdlib/JSON.html new file mode 100644 index 00000000..96c98582 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/JSON.html @@ -0,0 +1,629 @@ + + + + + + + Module: JSON + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: JSON + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/json.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + + + Classes: JSONError, ParserError + + +

        + + + + +

        Class Attribute Summary collapse

        +
          + +
        • + + + .create_id ⇒ Object + + + + + + + + + + + + + + + + +

          Returns the value of attribute create_id.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + + + +
        +

        Class Attribute Details

        + + + +
        +

        + + .create_idObject + + + + + +

        +
        +

        Returns the value of attribute create_id.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +70
        +71
        +72
        +
        +
        # File 'opal/stdlib/json.rb', line 70
        +
        +def create_id
        +  @create_id
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .[](value, options = {}) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +75
        +76
        +77
        +78
        +79
        +80
        +81
        +
        +
        # File 'opal/stdlib/json.rb', line 75
        +
        +def self.[](value, options = {})
        +  if String === value
        +    parse(value, options)
        +  else
        +    generate(value, options)
        +  end
        +end
        +
        +
        + +
        +

        + + .dump(obj, io = nil, limit = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +107
        +108
        +109
        +110
        +111
        +112
        +113
        +114
        +115
        +116
        +117
        +118
        +
        +
        # File 'opal/stdlib/json.rb', line 107
        +
        +def self.dump(obj, io = nil, limit = nil)
        +  string = generate(obj)
        +
        +  if io
        +    io = io.to_io if io.responds_to? :to_io
        +    io.write string
        +
        +    io
        +  else
        +    string
        +  end
        +end
        +
        +
        + +
        +

        + + .from_object(js_object, options = {}) ⇒ Object + + + + + +

        +
        +

        Raw js object => opal object

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +96
        +97
        +98
        +99
        +100
        +101
        +
        +
        # File 'opal/stdlib/json.rb', line 96
        +
        +def self.from_object(js_object, options = {})
        +  options[:object_class] ||= Hash
        +  options[:array_class]  ||= Array
        +
        +  `to_opal(js_object, options)`
        +end
        +
        +
        + +
        +

        + + .generate(obj, options = {}) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +103
        +104
        +105
        +
        +
        # File 'opal/stdlib/json.rb', line 103
        +
        +def self.generate(obj, options = {})
        +  obj.to_json(options)
        +end
        +
        +
        + +
        +

        + + .load(source, options = {}) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +91
        +92
        +93
        +
        +
        # File 'opal/stdlib/json.rb', line 91
        +
        +def self.load(source, options = {})
        +  from_object(`$parse(source)`, options)
        +end
        +
        +
        + +
        +

        + + .parse(source, options = {}) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +83
        +84
        +85
        +
        +
        # File 'opal/stdlib/json.rb', line 83
        +
        +def self.parse(source, options = {})
        +  from_object(`$parse(source)`, options.merge(parse: true))
        +end
        +
        +
        + +
        +

        + + .parse!(source, options = {}) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +87
        +88
        +89
        +
        +
        # File 'opal/stdlib/json.rb', line 87
        +
        +def self.parse!(source, options = {})
        +  parse(source, options)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/JSON/JSONError.html b/docs/api/v1.8.2/stdlib/JSON/JSONError.html new file mode 100644 index 00000000..d54ef998 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/JSON/JSONError.html @@ -0,0 +1,130 @@ + + + + + + + Exception: JSON::JSONError + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: JSON::JSONError + + + +

        +
        + +
        +
        Inherits:
        +
        + StandardError + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/json.rb
        +
        + +
        + +
        +

        Direct Known Subclasses

        +

        ParserError

        +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/JSON/ParserError.html b/docs/api/v1.8.2/stdlib/JSON/ParserError.html new file mode 100644 index 00000000..cf632dba --- /dev/null +++ b/docs/api/v1.8.2/stdlib/JSON/ParserError.html @@ -0,0 +1,134 @@ + + + + + + + Exception: JSON::ParserError + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: JSON::ParserError + + + +

        +
        + +
        +
        Inherits:
        +
        + JSONError + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/json.rb
        +
        + +
        + + + + + + + + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Kernel.html b/docs/api/v1.8.2/stdlib/Kernel.html new file mode 100644 index 00000000..911c6567 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Kernel.html @@ -0,0 +1,1480 @@ + + + + + + + Module: Kernel + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Kernel + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb,
        + opal/stdlib/await.rb,
        opal/stdlib/native.rb,
        opal/stdlib/open-uri.rb,
        opal/stdlib/pathname.rb,
        opal/stdlib/bigdecimal.rb,
        opal/stdlib/opal-parser.rb,
        opal/stdlib/nodejs/kernel.rb,
        opal/stdlib/nodejs/require.rb
        +
        +
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .open(name, *rest, &block) ⇒ Object + + + + + +

        +
        +

        Allows the opening of various resources including URIs.

        + +

        If the first argument responds to the 'open' method, 'open' is called on +it with the rest of the arguments.

        + +

        If the first argument is a string that begins with xxx://, it is parsed by +URI.parse. If the parsed object responds to the 'open' method, +'open' is called on it with the rest of the arguments.

        + +

        Otherwise, the original Kernel#open is called.

        + +

        OpenURI::OpenRead#open provides URI::HTTP#open, URI::HTTPS#open and +URI::FTP#open, Kernel#open.

        + +

        We can accept URIs and strings that begin with http://, https:// and +ftp://. In these cases, the opened file object is extended by OpenURI::Meta.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +32
        +33
        +34
        +35
        +36
        +37
        +38
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 32
        +
        +def open(name, *rest, &block) # :doc:
        +  if name.respond_to?(:to_str) && %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name
        +    OpenURI.open_uri(name, *rest, &block)
        +  else
        +    open_uri_original_open(name, *rest, &block)
        +  end
        +end
        +
        +
        + +
        +

        + + .open_uri_original_openObject + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +13
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 13
        +
        +alias open_uri_original_open open
        +
        +
        + +
        +

        + + .pp(*objs) ⇒ Object + + + + + +

        +
        +

        prints arguments in pretty form.

        + +

        pp returns argument(s).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +610
        +611
        +612
        +613
        +614
        +615
        +
        +
        # File 'opal/stdlib/pp.rb', line 610
        +
        +def pp(*objs)
        +  objs.each {|obj|
        +    PP.pp(obj)
        +  }
        +  objs.size <= 1 ? objs.first : objs
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #__prepare_require__(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +6
        +7
        +8
        +9
        +10
        +11
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +
        +
        # File 'opal/stdlib/nodejs/require.rb', line 6
        +
        +def __prepare_require__(path)
        +  name = `Opal.normalize(#{path})`
        +  full_path = name.end_with?('.rb') ? name : name + '.rb'
        +
        +  if `!Opal.modules[#{name}]`
        +    ruby = File.read(full_path)
        +    compiler = Opal::Compiler.new(ruby, requirable: true, file: name)
        +    js = compiler.compile
        +    compiler.requires.each do |sub_path|
        +      __prepare_require__(sub_path)
        +    end
        +    `eval(#{js})`
        +  end
        +
        +  name
        +rescue => e
        +  raise [path, name, full_path].inspect + e.message
        +end
        +
        +
        + +
        +

        + + #_ArrayObject + + + + + +

        + + + + +
        +
        +
        +
        +245
        +
        +
        # File 'opal/stdlib/native.rb', line 245
        +
        +alias _Array Array
        +
        +
        + +
        +

        + + #`(cmdline) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +33
        +34
        +35
        +
        +
        # File 'opal/stdlib/nodejs/kernel.rb', line 33
        +
        +def `(cmdline)
        +  Buffer.new(`__child_process__.execSync(#{cmdline})`).to_s.encode('UTF-8')
        +end
        +
        +
        + +
        +

        + + #Array(object, *args, &block) ⇒ Object + + + + + +

        +
        +

        Wraps array-like JavaScript objects in Native::Array

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +248
        +249
        +250
        +251
        +252
        +253
        +
        +
        # File 'opal/stdlib/native.rb', line 248
        +
        +def Array(object, *args, &block)
        +  if native?(object)
        +    return Native::Array.new(object, *args, &block).to_a
        +  end
        +  _Array(object)
        +end
        +
        +
        + +
        +

        + + #BigDecimal(initial, digits = 0) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +9
        +10
        +11
        +12
        +13
        +
        +
        # File 'opal/stdlib/bigdecimal.rb', line 9
        +
        +def BigDecimal(initial, digits = 0)
        +  bigdecimal = BigDecimal.allocate
        +  bigdecimal.initialize(initial, digits)
        +  bigdecimal
        +end
        +
        +
        + +
        +

        + + #eval(str, binding = nil, file = nil, line = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +
        +
        # File 'opal/stdlib/opal-parser.rb', line 12
        +
        +def eval(str, binding = nil, file = nil, line = nil)
        +  str = ::Opal.coerce_to!(str, String, :to_str)
        +  default_eval_options = { file: file || '(eval)', eval: true }
        +  compiling_options = __OPAL_COMPILER_CONFIG__.merge(default_eval_options)
        +  compiler = Opal::Compiler.new(str, compiling_options)
        +  code = compiler.compile
        +  code += compiler.source_map.to_data_uri_comment unless compiling_options[:no_source_map]
        +  if binding
        +    binding.js_eval(code)
        +  else
        +    %x{
        +      return (function(self) {
        +        return eval(#{code});
        +      })(self)
        +    }
        +  end
        +end
        +
        +
        + +
        +

        + + #exit(status = true) ⇒ Object + + + + + +

        +
        +

        Overwrite Kernel.exit to be async-capable.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +40
        +41
        +42
        +43
        +44
        +45
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +57
        +58
        +
        +
        # File 'opal/stdlib/await.rb', line 40
        +
        +def exit(status = true)
        +  $__at_exit__ ||= []
        +
        +  until $__at_exit__.empty?
        +    block = $__at_exit__.pop
        +    block.call.await
        +  end
        +
        +  %x{
        +    if (status.$$is_boolean) {
        +      status = status ? 0 : 1;
        +    } else {
        +      status = $coerce_to(status, #{Integer}, 'to_int')
        +    }
        +
        +    Opal.exit(status);
        +  }
        +  nil
        +end
        +
        +
        + +
        +

        + + #load(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +29
        +30
        +31
        +
        +
        # File 'opal/stdlib/nodejs/require.rb', line 29
        +
        +def load(path)
        +  `Opal.load(#{__prepare_require__(path)})`
        +end
        +
        +
        + +
        +

        + + #Native(obj) ⇒ Native::Object, ... + + + + + +

        +
        +

        Wraps a native JavaScript with Native::Object.new

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + (Native::Object) + + + + — +

          The wrapped object if it is native

          +
          + +
        • + +
        • + + + (nil) + + + + — +

          for null and undefined

          +
          + +
        • + +
        • + + + (obj) + + + + — +

          The object itself if it's not native

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +227
        +228
        +229
        +230
        +231
        +232
        +233
        +234
        +235
        +236
        +237
        +238
        +239
        +240
        +241
        +242
        +243
        +
        +
        # File 'opal/stdlib/native.rb', line 227
        +
        +def Native(obj)
        +  if `#{obj} == null`
        +    nil
        +  elsif native?(obj)
        +    Native::Object.new(obj)
        +  elsif obj.is_a?(Array)
        +    obj.map do |o|
        +      Native(o)
        +    end
        +  elsif obj.is_a?(Proc)
        +    proc do |*args, &block|
        +      Native(obj.call(*args, &block))
        +    end
        +  else
        +    obj
        +  end
        +end
        +
        +
        + +
        +

        + + #native?(value) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +218
        +219
        +220
        +
        +
        # File 'opal/stdlib/native.rb', line 218
        +
        +def native?(value)
        +  `value == null || !value.$$class`
        +end
        +
        +
        + +
        +

        + + #Pathname(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +224
        +225
        +226
        +
        +
        # File 'opal/stdlib/pathname.rb', line 224
        +
        +def Pathname(path)
        +  Pathname.new(path)
        +end
        +
        +
        + +
        +

        + + #pretty_inspectObject + + + + + +

        +
        +

        Returns a pretty printed object as a string.

        + +

        In order to use this method you must first require the PP module:

        + +

        require 'pp'

        + +

        See the PP module for more information.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +603
        +604
        +605
        +
        +
        # File 'opal/stdlib/pp.rb', line 603
        +
        +def pretty_inspect
        +  PP.pp(self, StringIO.new).string
        +end
        +
        +
        + +
        +

        + + #require(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +25
        +26
        +27
        +
        +
        # File 'opal/stdlib/nodejs/require.rb', line 25
        +
        +def require(path)
        +  `Opal.require(#{__prepare_require__(path)})`
        +end
        +
        +
        + +
        +

        + + #require_remote(url) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +30
        +31
        +32
        +33
        +34
        +35
        +36
        +37
        +
        +
        # File 'opal/stdlib/opal-parser.rb', line 30
        +
        +def require_remote(url)
        +  %x{
        +    var r = new XMLHttpRequest();
        +    r.open("GET", url, false);
        +    r.send('');
        +  }
        +  eval `r.responseText`
        +end
        +
        +
        + +
        +

        + + #sleep(seconds) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +60
        +61
        +62
        +63
        +64
        +
        +
        # File 'opal/stdlib/await.rb', line 60
        +
        +def sleep(seconds)
        +  prom = PromiseV2.new
        +  `setTimeout(#{proc { prom.resolve }}, #{seconds * 1000})`
        +  prom
        +end
        +
        +
        + +
        +

        + + #system(*argv, exception: false) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +10
        +11
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +
        +
        # File 'opal/stdlib/nodejs/kernel.rb', line 10
        +
        +def system(*argv, exception: false)
        +  env = {}
        +  env = argv.shift if argv.first.is_a? Hash
        +  env = ENV.merge(env).to_n
        +  cmdname = argv.shift
        +
        +  out = if argv.empty?
        +          `__child_process__.spawnSync(#{cmdname}, { shell: true, stdio: 'inherit', env: #{env} })`
        +        elsif Array === cmdname
        +          `__child_process__.spawnSync(#{cmdname[0]}, #{argv}, { argv0: #{cmdname[1]}, stdio: 'inherit', env: #{env} })`
        +        else
        +          `__child_process__.spawnSync(#{cmdname}, #{argv}, { stdio: 'inherit', env: #{env} })`
        +        end
        +
        +  status = out.JS[:status]
        +  status = 127 if `status === null`
        +  pid = out.JS[:pid]
        +
        +  $? = Process::Status.new(status, pid)
        +  raise "Command failed with exit #{status}: #{cmdname}" if exception && status != 0
        +  status == 0
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Logger.html b/docs/api/v1.8.2/stdlib/Logger.html new file mode 100644 index 00000000..0b811400 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Logger.html @@ -0,0 +1,1238 @@ + + + + + + + Class: Logger + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Logger + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Severity
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/logger.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + Modules: Severity + + + + Classes: Formatter + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        SEVERITY_LABELS = + +
        +
        Severity.constants.map { |s| [(Severity.const_get s), s.to_s] }.to_h
        + +
        + + + + + + +

        Constants included + from Severity

        +

        Severity::DEBUG, Severity::ERROR, Severity::FATAL, Severity::INFO, Severity::UNKNOWN, Severity::WARN

        + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #formatter ⇒ Object + + + + + + + + + + + + + + + + +

          Returns the value of attribute formatter.

          +
          + +
        • + + +
        • + + + #level ⇒ Object + + + + + + + + + + + + + + + + +

          Returns the value of attribute level.

          +
          + +
        • + + +
        • + + + #progname ⇒ Object + + + + + + + + + + + + + + + + +

          Returns the value of attribute progname.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

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

        Constructor Details

        + +
        +

        + + #initialize(pipe) ⇒ Logger + + + + + +

        +
        +

        Returns a new instance of Logger.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +40
        +41
        +42
        +43
        +44
        +
        +
        # File 'opal/stdlib/logger.rb', line 40
        +
        +def initialize(pipe)
        +  @pipe = pipe
        +  @level = DEBUG
        +  @formatter = Formatter.new
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #formatterObject + + + + + +

        +
        +

        Returns the value of attribute formatter.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +38
        +39
        +40
        +
        +
        # File 'opal/stdlib/logger.rb', line 38
        +
        +def formatter
        +  @formatter
        +end
        +
        +
        + + + +
        +

        + + #levelObject + + + + + +

        +
        +

        Returns the value of attribute level.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +36
        +37
        +38
        +
        +
        # File 'opal/stdlib/logger.rb', line 36
        +
        +def level
        +  @level
        +end
        +
        +
        + + + +
        +

        + + #prognameObject + + + + + +

        +
        +

        Returns the value of attribute progname.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +37
        +38
        +39
        +
        +
        # File 'opal/stdlib/logger.rb', line 37
        +
        +def progname
        +  @progname
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #add(severity, message = nil, progname = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +100
        +101
        +102
        +103
        +104
        +105
        +106
        +107
        +108
        +109
        +110
        +111
        +112
        +113
        +
        +
        # File 'opal/stdlib/logger.rb', line 100
        +
        +def add(severity, message = nil, progname = nil, &block)
        +  return true if (severity ||= UNKNOWN) < @level
        +  progname ||= @progname
        +  unless message
        +    if block_given?
        +      message = yield
        +    else
        +      message = progname
        +      progname = @progname
        +    end
        +  end
        +  @pipe.write(@formatter.call(SEVERITY_LABELS[severity] || 'ANY', ::Time.now, progname, message))
        +  true
        +end
        +
        +
        + +
        +

        + + #debug(progname = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +60
        +61
        +62
        +
        +
        # File 'opal/stdlib/logger.rb', line 60
        +
        +def debug(progname = nil, &block)
        +  add DEBUG, nil, progname, &block
        +end
        +
        +
        + +
        +

        + + #debug?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +84
        +85
        +86
        +
        +
        # File 'opal/stdlib/logger.rb', line 84
        +
        +def debug?
        +  @level <= DEBUG
        +end
        +
        +
        + +
        +

        + + #error(progname = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +68
        +69
        +70
        +
        +
        # File 'opal/stdlib/logger.rb', line 68
        +
        +def error(progname = nil, &block)
        +  add ERROR, nil, progname, &block
        +end
        +
        +
        + +
        +

        + + #error?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +92
        +93
        +94
        +
        +
        # File 'opal/stdlib/logger.rb', line 92
        +
        +def error?
        +  @level <= ERROR
        +end
        +
        +
        + +
        +

        + + #fatal(progname = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +72
        +73
        +74
        +
        +
        # File 'opal/stdlib/logger.rb', line 72
        +
        +def fatal(progname = nil, &block)
        +  add FATAL, nil, progname, &block
        +end
        +
        +
        + +
        +

        + + #fatal?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +96
        +97
        +98
        +
        +
        # File 'opal/stdlib/logger.rb', line 96
        +
        +def fatal?
        +  @level <= FATAL
        +end
        +
        +
        + +
        +

        + + #info(progname = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +56
        +57
        +58
        +
        +
        # File 'opal/stdlib/logger.rb', line 56
        +
        +def info(progname = nil, &block)
        +  add INFO, nil, progname, &block
        +end
        +
        +
        + +
        +

        + + #info?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +80
        +81
        +82
        +
        +
        # File 'opal/stdlib/logger.rb', line 80
        +
        +def info?
        +  @level <= INFO
        +end
        +
        +
        + +
        +

        + + #unknown(progname = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +76
        +77
        +78
        +
        +
        # File 'opal/stdlib/logger.rb', line 76
        +
        +def unknown(progname = nil, &block)
        +  add UNKNOWN, nil, progname, &block
        +end
        +
        +
        + +
        +

        + + #warn(progname = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +64
        +65
        +66
        +
        +
        # File 'opal/stdlib/logger.rb', line 64
        +
        +def warn(progname = nil, &block)
        +  add WARN, nil, progname, &block
        +end
        +
        +
        + +
        +

        + + #warn?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +88
        +89
        +90
        +
        +
        # File 'opal/stdlib/logger.rb', line 88
        +
        +def warn?
        +  @level <= WARN
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Logger/Formatter.html b/docs/api/v1.8.2/stdlib/Logger/Formatter.html new file mode 100644 index 00000000..f8b161e7 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Logger/Formatter.html @@ -0,0 +1,279 @@ + + + + + + + Class: Logger::Formatter + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Logger::Formatter + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/logger.rb
        +
        + +
        + + + +

        + Constant Summary + collapse +

        + +
        + +
        MESSAGE_FORMAT = + +
        +
        "%s, [%s] %5s -- %s: %s\n"
        + +
        DATE_TIME_FORMAT = + +
        +
        '%Y-%m-%dT%H:%M:%S.%6N'
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #call(severity, time, progname, msg) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +20
        +21
        +22
        +
        +
        # File 'opal/stdlib/logger.rb', line 20
        +
        +def call(severity, time, progname, msg)
        +  format(MESSAGE_FORMAT, severity.chr, time.strftime(DATE_TIME_FORMAT), severity, progname, message_as_string(msg))
        +end
        +
        +
        + +
        +

        + + #message_as_string(msg) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +32
        +33
        +
        +
        # File 'opal/stdlib/logger.rb', line 24
        +
        +def message_as_string(msg)
        +  case msg
        +  when ::String
        +    msg
        +  when ::Exception
        +    msg.full_message
        +  else
        +    msg.inspect
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Logger/Severity.html b/docs/api/v1.8.2/stdlib/Logger/Severity.html new file mode 100644 index 00000000..5c7f4555 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Logger/Severity.html @@ -0,0 +1,153 @@ + + + + + + + Module: Logger::Severity + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Logger::Severity + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        Logger
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/logger.rb
        +
        + +
        + + + +

        + Constant Summary + collapse +

        + +
        + +
        DEBUG = + +
        +
        0
        + +
        INFO = + +
        +
        1
        + +
        WARN = + +
        +
        2
        + +
        ERROR = + +
        +
        3
        + +
        FATAL = + +
        +
        4
        + +
        UNKNOWN = + +
        +
        5
        + +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/MatchData.html b/docs/api/v1.8.2/stdlib/MatchData.html new file mode 100644 index 00000000..4ff62357 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/MatchData.html @@ -0,0 +1,416 @@ + + + + + + + Class: MatchData + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: MatchData + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb,
        + opal/stdlib/native.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        Opal: does not have File::Stat +class File < IO # :nodoc: + class Stat # :nodoc: + def pretty_print(q) # :nodoc: + require 'etc.so' + q.object_group(self) { + q.breakable + q.text sprintf("dev=0x%x", self.dev); q.comma_breakable + q.text "ino="; q.pp self.ino; q.comma_breakable + q.group { + m = self.mode + q.text sprintf("mode=0%o", m) + q.breakable + q.text sprintf("(%s %c%c%c%c%c%c%c%c%c)", + self.ftype, + (m & 0400 == 0 ? ?- : ?r), + (m & 0200 == 0 ? ?- : ?w), + (m & 0100 == 0 ? (m & 04000 == 0 ? ?- : ?S) : + (m & 04000 == 0 ? ?x : ?s)), + (m & 0040 == 0 ? ?- : ?r), + (m & 0020 == 0 ? ?- : ?w), + (m & 0010 == 0 ? (m & 02000 == 0 ? ?- : ?S) : + (m & 02000 == 0 ? ?x : ?s)), + (m & 0004 == 0 ? ?- : ?r), + (m & 0002 == 0 ? ?- : ?w), + (m & 0001 == 0 ? (m & 01000 == 0 ? ?- : ?T) : + (m & 01000 == 0 ? ?x : ?t))) + } + q.comma_breakable + q.text "nlink="; q.pp self.nlink; q.comma_breakable + q.group { + q.text "uid="; q.pp self.uid + begin + pw = Etc.getpwuid(self.uid) + rescue ArgumentError + end + if pw + q.breakable; q.text "(#pwpw.name)" + end + } + q.comma_breakable + q.group { + q.text "gid="; q.pp self.gid + begin + gr = Etc.getgrgid(self.gid) + rescue ArgumentError + end + if gr + q.breakable; q.text "(#grgr.name)" + end + } + q.comma_breakable + q.group { + q.text sprintf("rdev=0x%x", self.rdev) + if self.rdev_major && self.rdev_minor + q.breakable + q.text sprintf('(%d, %d)', self.rdev_major, self.rdev_minor) + end + } + q.comma_breakable + q.text "size="; q.pp self.size; q.comma_breakable + q.text "blksize="; q.pp self.blksize; q.comma_breakable + q.text "blocks="; q.pp self.blocks; q.comma_breakable + q.group { + t = self.atime + q.text "atime="; q.pp t + q.breakable; q.text "(#tt.tv_sec)" + } + q.comma_breakable + q.group { + t = self.mtime + q.text "mtime="; q.pp t + q.breakable; q.text "(#tt.tv_sec)" + } + q.comma_breakable + q.group { + t = self.ctime + q.text "ctime="; q.pp t + q.breakable; q.text "(#tt.tv_sec)" + } + } + end + end +end

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #pretty_print(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +516
        +517
        +518
        +519
        +520
        +521
        +522
        +523
        +524
        +525
        +526
        +527
        +528
        +529
        +530
        +531
        +532
        +533
        +534
        +535
        +536
        +537
        +
        +
        # File 'opal/stdlib/pp.rb', line 516
        +
        +def pretty_print(q) # :nodoc:
        +  nc = []
        +  self.regexp.named_captures.each {|name, indexes|
        +    indexes.each {|i| nc[i] = name }
        +  }
        +  q.object_group(self) {
        +    q.breakable
        +    q.seplist(0...self.size, lambda { q.breakable }) {|i|
        +      if i == 0
        +        q.pp self[i]
        +      else
        +        if nc[i]
        +          q.text nc[i]
        +        else
        +          q.pp i
        +        end
        +        q.text ':'
        +        q.pp self[i]
        +      end
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Returns the array of matches.

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          the array of matches

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +477
        +478
        +479
        +
        +
        # File 'opal/stdlib/native.rb', line 477
        +
        +def to_n
        +  @matches
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Matrix.html b/docs/api/v1.8.2/stdlib/Matrix.html new file mode 100644 index 00000000..c0aef959 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Matrix.html @@ -0,0 +1,7239 @@ + + + + + + + Class: Matrix + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Matrix + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + +
        +
        Extended by:
        +
        ConversionHelper
        +
        + + + +
        +
        Includes:
        +
        Enumerable, ExceptionForMatrix, CoercionHelper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix.rb,
        + opal/stdlib/matrix/lup_decomposition.rb,
        opal/stdlib/matrix/eigenvalue_decomposition.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        The +Matrix+ class represents a mathematical matrix. It provides methods for creating +matrices, operating on them arithmetically and algebraically, +and determining their mathematical properties such as trace, rank, inverse, determinant, +or eigensystem.

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + Modules: CoercionHelper, ConversionHelper + + + + Classes: EigenvalueDecomposition, LUPDecomposition, Scalar + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        SELECTORS = + +
        +
        {all: true, diagonal: true, off_diagonal: true, lower: true, strict_lower: true, strict_upper: true, upper: true}.freeze
        + +
        + + + + + + +

        Constants included + from Exception2MessageMapper

        +

        Exception2MessageMapper::E2MM

        + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #column_count ⇒ Object + + + + (also: #column_size) + + + + + + + readonly + + + + + + + + + +

          Returns the number of columns.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #*(m) ⇒ Object + + + + + + + + + + + + + +

          Matrix multiplication.

          +
          + +
        • + + +
        • + + + #**(other) ⇒ Object + + + + + + + + + + + + + +

          Matrix exponentiation.

          +
          + +
        • + + +
        • + + + #+(m) ⇒ Object + + + + + + + + + + + + + +

          Matrix addition.

          +
          + +
        • + + +
        • + + + #+@ ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #-(m) ⇒ Object + + + + + + + + + + + + + +

          Matrix subtraction.

          +
          + +
        • + + +
        • + + + #-@ ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #/(other) ⇒ Object + + + + + + + + + + + + + +

          Matrix division (multiplication by the inverse).

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

          Returns +true+ if and only if the two matrices contain equal elements.

          +
          + +
        • + + +
        • + + + #[](i, j) ⇒ Object + + + + (also: #element, #component) + + + + + + + + + + + +

          Returns element (+i+,+j+) of the matrix.

          +
          + +
        • + + +
        • + + + #[]=(i, j, v) ⇒ Object + + + + (also: #set_element, #set_component) + + + + + + + + + + + +
          + +
        • + + +
        • + + + #adjugate ⇒ Object + + + + + + + + + + + + + +

          Returns the adjugate of the matrix.

          +
          + +
        • + + +
        • + + + #antisymmetric? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is an antisymmetric matrix.

          +
          + +
        • + + +
        • + + + #clone ⇒ Object + + + + + + + + + + + + + +

          Returns a clone of the matrix, so that the contents of each do not reference identical objects.

          +
          + +
        • + + +
        • + + + #coerce(other) ⇒ Object + + + + + + + + + + + + + +

          The coerce method provides support for Ruby type coercion.

          +
          + +
        • + + +
        • + + + #cofactor(row, column) ⇒ Object + + + + + + + + + + + + + +

          Returns the (row, column) cofactor which is obtained by multiplying the first minor by (-1)**(row + column).

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

          Returns a matrix that is the result of iteration of the given block over all elements of the matrix.

          +
          + +
        • + + +
        • + + + #column(j) ⇒ Object + + + + + + + + + + + + + +

          Returns column vector number +j+ of the matrix as a Vector (starting at 0 like an array).

          +
          + +
        • + + +
        • + + + #column_vectors ⇒ Object + + + + + + + + + + + + + +

          Returns an array of the column vectors of the matrix.

          +
          + +
        • + + +
        • + + + #combine(*matrices, &block) ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #conjugate ⇒ Object + + + + (also: #conj) + + + + + + + + + + + +

          Returns the conjugate of the matrix.

          +
          + +
        • + + +
        • + + + #determinant ⇒ Object + + + + (also: #det) + + + + + + + + + + + +

          Returns the determinant of the matrix.

          +
          + +
        • + + +
        • + + + #determinant_e ⇒ Object + + + + (also: #det_e) + + + + + + + + + + + +

          deprecated; use Matrix#determinant.

          +
          + +
        • + + +
        • + + + #diagonal? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a diagonal matrix.

          +
          + +
        • + + +
        • + + + #each(which = :all) ⇒ Object + + + + + + + + + + + + + +

          Yields all elements of the matrix, starting with those of the first row, or returns an Enumerator if no block given.

          +
          + +
        • + + +
        • + + + #each_with_index(which = :all) ⇒ Object + + + + + + + + + + + + + +

          Same as #each, but the row index and column index in addition to the element.

          +
          + +
        • + + +
        • + + + #eigensystem ⇒ Object + + + + (also: #eigen) + + + + + + + + + + + +

          Returns the Eigensystem of the matrix; see +EigenvalueDecomposition+.

          +
          + +
        • + + +
        • + + + #elements_to_f ⇒ Object + + + + + + + + + + + + + +

          Deprecated.

          +
          + +
        • + + +
        • + + + #elements_to_i ⇒ Object + + + + + + + + + + + + + +

          Deprecated.

          +
          + +
        • + + +
        • + + + #elements_to_r ⇒ Object + + + + + + + + + + + + + +

          Deprecated.

          +
          + +
        • + + +
        • + + + #empty? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is an empty matrix, i.e.

          +
          + +
        • + + +
        • + + + #eql?(other) ⇒ Boolean + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #first_minor(row, column) ⇒ Object + + + + + + + + + + + + + +

          Returns the submatrix obtained by deleting the specified row and column.

          +
          + +
        • + + +
        • + + + #hadamard_product(m) ⇒ Object + + + + (also: #entrywise_product) + + + + + + + + + + + +

          Hadamard product Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) => 1 4 9 8.

          +
          + +
        • + + +
        • + + + #hash ⇒ Object + + + + + + + + + + + + + +

          Returns a hash-code for the matrix.

          +
          + +
        • + + +
        • + + + #hermitian? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is an hermitian matrix.

          +
          + +
        • + + +
        • + + + #hstack(*matrices) ⇒ Object + + + + + + + + + + + + + +

          Returns a new matrix resulting by stacking horizontally the receiver with the given matrices.

          +
          + +
        • + + +
        • + + + #imaginary ⇒ Object + + + + (also: #imag) + + + + + + + + + + + +

          Returns the imaginary part of the matrix.

          +
          + +
        • + + +
        • + + + #index(*args) ⇒ Object + + + + (also: #find_index) + + + + + + + + + + + +

          :call-seq: index(value, selector = :all) -> [row, column] index(selector = :all){ block } -> [row, column] index(selector = :all) -> an_enumerator.

          +
          + +
        • + + +
        • + + + #initialize(rows, column_count = rows[0].size) ⇒ Matrix + + + + + + + constructor + + + + + + + + +

          Matrix.new is private; use Matrix.rows, columns, [], etc...

          +
          + +
        • + + +
        • + + + #inspect ⇒ Object + + + + + + + + + + + + + +

          Overrides Object#inspect.

          +
          + +
        • + + +
        • + + + #inverse ⇒ Object + + + + (also: #inv) + + + + + + + + + + + +

          Returns the inverse of the matrix.

          +
          + +
        • + + +
        • + + + #laplace_expansion(row: nil, column: nil) ⇒ Object + + + + (also: #cofactor_expansion) + + + + + + + + + + + +

          Returns the Laplace expansion along given row or column.

          +
          + +
        • + + +
        • + + + #lower_triangular? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a lower triangular matrix.

          +
          + +
        • + + +
        • + + + #lup ⇒ Object + + + + (also: #lup_decomposition) + + + + + + + + + + + +

          Returns the LUP decomposition of the matrix; see +LUPDecomposition+.

          +
          + +
        • + + +
        • + + + #minor(*param) ⇒ Object + + + + + + + + + + + + + +

          Returns a section of the matrix.

          +
          + +
        • + + +
        • + + + #normal? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a normal matrix.

          +
          + +
        • + + +
        • + + + #orthogonal? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is an orthogonal matrix Raises an error if matrix is not square.

          +
          + +
        • + + +
        • + + + #permutation? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a permutation matrix Raises an error if matrix is not square.

          +
          + +
        • + + +
        • + + + #rank ⇒ Object + + + + + + + + + + + + + +

          Returns the rank of the matrix.

          +
          + +
        • + + +
        • + + + #rank_e ⇒ Object + + + + + + + + + + + + + +

          deprecated; use Matrix#rank.

          +
          + +
        • + + +
        • + + + #real ⇒ Object + + + + + + + + + + + + + +

          Returns the real part of the matrix.

          +
          + +
        • + + +
        • + + + #real? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if all entries of the matrix are real.

          +
          + +
        • + + +
        • + + + #rect ⇒ Object + + + + (also: #rectangular) + + + + + + + + + + + +

          Returns an array containing matrices corresponding to the real and imaginary parts of the matrix.

          +
          + +
        • + + +
        • + + + #regular? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a regular (i.e. non-singular) matrix.

          +
          + +
        • + + +
        • + + + #round(ndigits = 0) ⇒ Object + + + + + + + + + + + + + +

          Returns a matrix with entries rounded to the given precision (see Float#round).

          +
          + +
        • + + +
        • + + + #row(i, &block) ⇒ Object + + + + + + + + + + + + + +

          Returns row vector number +i+ of the matrix as a Vector (starting at 0 like an array).

          +
          + +
        • + + +
        • + + + #row_count ⇒ Object + + + + (also: #row_size) + + + + + + + + + + + +

          Returns the number of rows.

          +
          + +
        • + + +
        • + + + #row_vectors ⇒ Object + + + + + + + + + + + + + +

          Returns an array of the row vectors of the matrix.

          +
          + +
        • + + +
        • + + + #singular? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a singular matrix.

          +
          + +
        • + + +
        • + + + #square? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a square matrix.

          +
          + +
        • + + +
        • + + + #symmetric? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a symmetric matrix.

          +
          + +
        • + + +
        • + + + #to_a ⇒ Object + + + + + + + + + + + + + +

          Returns an array of arrays that describe the rows of the matrix.

          +
          + +
        • + + +
        • + + + #to_matrix ⇒ Object + + + + + + + + + + + + + +

          Explicit conversion to a Matrix.

          +
          + +
        • + + +
        • + + + #to_s ⇒ Object + + + + + + + + + + + + + +

          Overrides Object#to_s.

          +
          + +
        • + + +
        • + + + #trace ⇒ Object + + + + (also: #tr) + + + + + + + + + + + +

          Returns the trace (sum of diagonal elements) of the matrix.

          +
          + +
        • + + +
        • + + + #transpose ⇒ Object + + + + (also: #t) + + + + + + + + + + + +

          Returns the transpose of the matrix.

          +
          + +
        • + + +
        • + + + #unitary? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a unitary matrix Raises an error if matrix is not square.

          +
          + +
        • + + +
        • + + + #upper_triangular? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is an upper triangular matrix.

          +
          + +
        • + + +
        • + + + #vstack(*matrices) ⇒ Object + + + + + + + + + + + + + +

          Returns a new matrix resulting by stacking vertically the receiver with the given matrices.

          +
          + +
        • + + +
        • + + + #zero? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if this is a matrix with only zero elements.

          +
          + +
        • + + +
        + + + + + + + + + + + + + + + + + +

        Methods included from CoercionHelper

        +

        coerce_to, coerce_to_int, coerce_to_matrix

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

        Methods included from Exception2MessageMapper

        +

        #Fail, Raise, #Raise, #bind, def_e2message, #def_e2message, #def_exception, def_exception, e2mm_message, extend_object, #fail

        + + + + + + + + + +

        Methods included from Enumerable

        +

        #each_async, #to_json

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(rows, column_count = rows[0].size) ⇒ Matrix + + + + + +

        +
        +

        Matrix.new is private; use Matrix.rows, columns, [], etc... to create.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +284
        +285
        +286
        +287
        +288
        +289
        +290
        +
        +
        # File 'opal/stdlib/matrix.rb', line 284
        +
        +def initialize(rows, column_count = rows[0].size)
        +  # No checking is done at this point. rows must be an Array of Arrays.
        +  # column_count must be the size of the first row, if there is one,
        +  # otherwise it *must* be specified and can be any integer >= 0
        +  @rows = rows
        +  @column_count = column_count
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #column_countObject (readonly) + + + + Also known as: + column_size + + + + +

        +
        +

        Returns the number of columns.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +324
        +325
        +326
        +
        +
        # File 'opal/stdlib/matrix.rb', line 324
        +
        +def column_count
        +  @column_count
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .[](*rows) ⇒ Object + + + + + +

        +
        +

        Creates a matrix where each argument is a row. + Matrix[ [25, 93], [-1, 66] ] + => 25 93 + -1 66

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +51
        +52
        +53
        +
        +
        # File 'opal/stdlib/matrix.rb', line 51
        +
        +def Matrix.[](*rows)
        +  rows(rows, false)
        +end
        +
        +
        + +
        +

        + + .build(row_count, column_count = row_count) ⇒ Object + + + + + +

        +
        +

        Creates a matrix of size +row_count+ x +column_count+. +It fills the values by calling the given block, +passing the current row and column. +Returns an enumerator if no block is given.

        + +

        m = Matrix.build(2, 4) {|row, col| col - row } + => Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]] + m = Matrix.build(3) { rand } + => a 3x3 matrix with random elements

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +96
        +97
        +98
        +99
        +100
        +101
        +102
        +103
        +104
        +105
        +106
        +107
        +
        +
        # File 'opal/stdlib/matrix.rb', line 96
        +
        +def Matrix.build(row_count, column_count = row_count)
        +  row_count = CoercionHelper.coerce_to_int(row_count)
        +  column_count = CoercionHelper.coerce_to_int(column_count)
        +  raise ArgumentError if row_count < 0 || column_count < 0
        +  return to_enum :build, row_count, column_count unless block_given?
        +  rows = Array.new(row_count) do |i|
        +    Array.new(column_count) do |j|
        +      yield i, j
        +    end
        +  end
        +  new rows, column_count
        +end
        +
        +
        + +
        +

        + + .column_vector(column) ⇒ Object + + + + + +

        +
        +

        Creates a single-column matrix where the values of that column are as given +in +column+. + Matrix.column_vector([4,5,6]) + => 4 + 5 + 6

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +182
        +183
        +184
        +185
        +
        +
        # File 'opal/stdlib/matrix.rb', line 182
        +
        +def Matrix.column_vector(column)
        +  column = convert_to_array(column)
        +  new [column].transpose, 1
        +end
        +
        +
        + +
        +

        + + .columns(columns) ⇒ Object + + + + + +

        +
        +

        Creates a matrix using +columns+ as an array of column vectors. + Matrix.columns([[25, 93], [-1, 66]]) + => 25 -1 + 93 66

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +81
        +82
        +83
        +
        +
        # File 'opal/stdlib/matrix.rb', line 81
        +
        +def Matrix.columns(columns)
        +  rows(columns, false).transpose
        +end
        +
        +
        + +
        +

        + + .combine(*matrices) ⇒ Object + + + + + +

        +
        +

        Create a matrix by combining matrices entrywise, using the given block

        + +

        x = Matrix[[6, 6], [4, 4]] + y = Matrix[[1, 2], [3, 4]] + Matrix.combine(x, y) {|a, b| a - b} # => Matrix[[5, 4], [1, 0]]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +259
        +260
        +261
        +262
        +263
        +264
        +265
        +266
        +267
        +268
        +269
        +270
        +271
        +272
        +273
        +274
        +275
        +
        +
        # File 'opal/stdlib/matrix.rb', line 259
        +
        +def Matrix.combine(*matrices)
        +  return to_enum(__method__, *matrices) unless block_given?
        +
        +  return Matrix.empty if matrices.empty?
        +  matrices.map!(&CoercionHelper.method(:coerce_to_matrix))
        +  x = matrices.first
        +  matrices.each do |m|
        +    Matrix.Raise ErrDimensionMismatch unless x.row_count == m.row_count && x.column_count == m.column_count
        +  end
        +
        +  rows = Array.new(x.row_count) do |i|
        +    Array.new(x.column_count) do |j|
        +      yield matrices.map{|m| m[i,j]}
        +    end
        +  end
        +  new rows, x.column_count
        +end
        +
        +
        + +
        +

        + + .diagonal(*values) ⇒ Object + + + + + +

        +
        +

        Creates a matrix where the diagonal elements are composed of +values+. + Matrix.diagonal(9, 5, -3) + => 9 0 0 + 0 5 0 + 0 0 -3

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +116
        +117
        +118
        +119
        +120
        +121
        +122
        +123
        +124
        +125
        +
        +
        # File 'opal/stdlib/matrix.rb', line 116
        +
        +def Matrix.diagonal(*values)
        +  size = values.size
        +  return Matrix.empty if size == 0
        +  rows = Array.new(size) {|j|
        +    row = Array.new(size, 0)
        +    row[j] = values[j]
        +    row
        +  }
        +  new rows
        +end
        +
        +
        + +
        +

        + + .empty(row_count = 0, column_count = 0) ⇒ Object + + + + + +

        +
        +

        Creates a empty matrix of +row_count+ x +column_count+. +At least one of +row_count+ or +column_count+ must be 0.

        + +

        m = Matrix.empty(2, 0) + m == Matrix[ [], [] ] + => true + n = Matrix.empty(0, 3) + n == Matrix.columns([ [], [], [] ]) + => true + m * n + => Matrix[[0, 0, 0], [0, 0, 0]]

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +200
        +201
        +202
        +203
        +204
        +205
        +
        +
        # File 'opal/stdlib/matrix.rb', line 200
        +
        +def Matrix.empty(row_count = 0, column_count = 0)
        +  raise ArgumentError, "One size must be 0" if column_count != 0 && row_count != 0
        +  raise ArgumentError, "Negative size" if column_count < 0 || row_count < 0
        +
        +  new([[]]*row_count, column_count)
        +end
        +
        +
        + +
        +

        + + .hstack(x, *matrices) ⇒ Object + + + + + +

        +
        +

        Create a matrix by stacking matrices horizontally

        + +

        x = Matrix[[1, 2], [3, 4]] + y = Matrix[[5, 6], [7, 8]] + Matrix.hstack(x, y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +235
        +236
        +237
        +238
        +239
        +240
        +241
        +242
        +243
        +244
        +245
        +246
        +247
        +248
        +249
        +250
        +
        +
        # File 'opal/stdlib/matrix.rb', line 235
        +
        +def Matrix.hstack(x, *matrices)
        +  x = CoercionHelper.coerce_to_matrix(x)
        +  result = x.send(:rows).map(&:dup)
        +  total_column_count = x.column_count
        +  matrices.each do |m|
        +    m = CoercionHelper.coerce_to_matrix(m)
        +    if m.row_count != x.row_count
        +      raise ErrDimensionMismatch, "The given matrices must have #{x.row_count} rows, but one has #{m.row_count}"
        +    end
        +    result.each_with_index do |row, i|
        +      row.concat m.send(:rows)[i]
        +    end
        +    total_column_count += m.column_count
        +  end
        +  new result, total_column_count
        +end
        +
        +
        + +
        +

        + + .identity(n) ⇒ Object + + + + Also known as: + unit, I + + + + +

        +
        +

        Creates an +n+ by +n+ identity matrix. + Matrix.identity(2) + => 1 0 + 0 1

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +144
        +145
        +146
        +
        +
        # File 'opal/stdlib/matrix.rb', line 144
        +
        +def Matrix.identity(n)
        +  scalar(n, 1)
        +end
        +
        +
        + +
        +

        + + .row_vector(row) ⇒ Object + + + + + +

        +
        +

        Creates a single-row matrix where the values of that row are as given in ++row+. + Matrix.row_vector([4,5,6]) + => 4 5 6

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +169
        +170
        +171
        +172
        +
        +
        # File 'opal/stdlib/matrix.rb', line 169
        +
        +def Matrix.row_vector(row)
        +  row = convert_to_array(row)
        +  new [row]
        +end
        +
        +
        + +
        +

        + + .rows(rows, copy = true) ⇒ Object + + + + + +

        +
        +

        Creates a matrix where +rows+ is an array of arrays, each of which is a row +of the matrix. If the optional argument +copy+ is false, use the given +arrays as the internal structure of the matrix without copying. + Matrix.rows([[25, 93], [-1, 66]]) + => 25 93 + -1 66

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +63
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +72
        +73
        +
        +
        # File 'opal/stdlib/matrix.rb', line 63
        +
        +def Matrix.rows(rows, copy = true)
        +  rows = convert_to_array(rows, copy)
        +  rows.map! do |row|
        +    convert_to_array(row, copy)
        +  end
        +  size = (rows[0] || []).size
        +  rows.each do |row|
        +    raise ErrDimensionMismatch, "row size differs (#{row.size} should be #{size})" unless row.size == size
        +  end
        +  new rows, size
        +end
        +
        +
        + +
        +

        + + .scalar(n, value) ⇒ Object + + + + + +

        +
        +

        Creates an +n+ by +n+ diagonal matrix where each diagonal element is ++value+. + Matrix.scalar(2, 5) + => 5 0 + 0 5

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +134
        +135
        +136
        +
        +
        # File 'opal/stdlib/matrix.rb', line 134
        +
        +def Matrix.scalar(n, value)
        +  diagonal(*Array.new(n, value))
        +end
        +
        +
        + +
        +

        + + .vstack(x, *matrices) ⇒ Object + + + + + +

        +
        +

        Create a matrix by stacking matrices vertically

        + +

        x = Matrix[[1, 2], [3, 4]] + y = Matrix[[5, 6], [7, 8]] + Matrix.vstack(x, y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +214
        +215
        +216
        +217
        +218
        +219
        +220
        +221
        +222
        +223
        +224
        +225
        +
        +
        # File 'opal/stdlib/matrix.rb', line 214
        +
        +def Matrix.vstack(x, *matrices)
        +  x = CoercionHelper.coerce_to_matrix(x)
        +  result = x.send(:rows).map(&:dup)
        +  matrices.each do |m|
        +    m = CoercionHelper.coerce_to_matrix(m)
        +    if m.column_count != x.column_count
        +      raise ErrDimensionMismatch, "The given matrices must have #{x.column_count} columns, but one has #{m.column_count}"
        +    end
        +    result.concat(m.send(:rows))
        +  end
        +  new result, x.column_count
        +end
        +
        +
        + +
        +

        + + .zero(row_count, column_count = row_count) ⇒ Object + + + + + +

        +
        +

        Creates a zero matrix. + Matrix.zero(2) + => 0 0 + 0 0

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +158
        +159
        +160
        +161
        +
        +
        # File 'opal/stdlib/matrix.rb', line 158
        +
        +def Matrix.zero(row_count, column_count = row_count)
        +  rows = Array.new(row_count){Array.new(column_count, 0)}
        +  new rows, column_count
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #*(m) ⇒ Object + + + + + +

        +
        +

        Matrix multiplication. + Matrix[[2,4], [6,8]] * Matrix.identity(2) + => 2 4 + 6 8

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/matrix.rb', line 893
        +
        +def *(m) # m is matrix or vector or number
        +  case(m)
        +  when Numeric
        +    rows = @rows.collect {|row|
        +      row.collect {|e| e * m }
        +    }
        +    return new_matrix rows, column_count
        +  when Vector
        +    m = self.class.column_vector(m)
        +    r = self * m
        +    return r.column(0)
        +  when Matrix
        +    Matrix.Raise ErrDimensionMismatch if column_count != m.row_count
        +
        +    rows = Array.new(row_count) {|i|
        +      Array.new(m.column_count) {|j|
        +        (0 ... column_count).inject(0) do |vij, k|
        +          vij + self[i, k] * m[k, j]
        +        end
        +      }
        +    }
        +    return new_matrix rows, m.column_count
        +  else
        +    return apply_through_coercion(m, __method__)
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        Matrix exponentiation. +Equivalent to multiplying the matrix by itself N times. +Non integer exponents will be handled by diagonalizing the matrix.

        + +

        Matrix[[7,6], [3,9]] ** 2 + => 67 96 + 48 99

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1071
        +1072
        +1073
        +1074
        +1075
        +1076
        +1077
        +1078
        +1079
        +1080
        +1081
        +1082
        +1083
        +1084
        +1085
        +1086
        +1087
        +1088
        +1089
        +1090
        +1091
        +1092
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1071
        +
        +def **(other)
        +  case other
        +  when Integer
        +    x = self
        +    if other <= 0
        +      x = self.inverse
        +      return self.class.identity(self.column_count) if other == 0
        +      other = -other
        +    end
        +    z = nil
        +    loop do
        +      z = z ? z * x : x if other[0] == 1
        +      return z if (other >>= 1).zero?
        +      x *= x
        +    end
        +  when Numeric
        +    v, d, v_inv = eigensystem
        +    v * self.class.diagonal(*d.each(:diagonal).map{|e| e ** other}) * v_inv
        +  else
        +    Matrix.Raise ErrOperationNotDefined, "**", self.class, other.class
        +  end
        +end
        +
        +
        + +
        +

        + + #+(m) ⇒ Object + + + + + +

        +
        +

        Matrix addition. + Matrix.scalar(2,5) + Matrix[[1,0], [-4,7]] + => 6 0 + -4 12

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +926
        +927
        +928
        +929
        +930
        +931
        +932
        +933
        +934
        +935
        +936
        +937
        +938
        +939
        +940
        +941
        +942
        +943
        +944
        +945
        +
        +
        # File 'opal/stdlib/matrix.rb', line 926
        +
        +def +(m)
        +  case m
        +  when Numeric
        +    Matrix.Raise ErrOperationNotDefined, "+", self.class, m.class
        +  when Vector
        +    m = self.class.column_vector(m)
        +  when Matrix
        +  else
        +    return apply_through_coercion(m, __method__)
        +  end
        +
        +  Matrix.Raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
        +
        +  rows = Array.new(row_count) {|i|
        +    Array.new(column_count) {|j|
        +      self[i, j] + m[i, j]
        +    }
        +  }
        +  new_matrix rows, column_count
        +end
        +
        +
        + +
        +

        + + #+@Object + + + + + +

        + + + + +
        +
        +
        +
        +1094
        +1095
        +1096
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1094
        +
        +def +@
        +  self
        +end
        +
        +
        + +
        +

        + + #-(m) ⇒ Object + + + + + +

        +
        +

        Matrix subtraction. + Matrix[[1,5], [4,2]] - Matrix[[9,3], [-4,1]] + => -8 2 + 8 1

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +953
        +954
        +955
        +956
        +957
        +958
        +959
        +960
        +961
        +962
        +963
        +964
        +965
        +966
        +967
        +968
        +969
        +970
        +971
        +972
        +
        +
        # File 'opal/stdlib/matrix.rb', line 953
        +
        +def -(m)
        +  case m
        +  when Numeric
        +    Matrix.Raise ErrOperationNotDefined, "-", self.class, m.class
        +  when Vector
        +    m = self.class.column_vector(m)
        +  when Matrix
        +  else
        +    return apply_through_coercion(m, __method__)
        +  end
        +
        +  Matrix.Raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
        +
        +  rows = Array.new(row_count) {|i|
        +    Array.new(column_count) {|j|
        +      self[i, j] - m[i, j]
        +    }
        +  }
        +  new_matrix rows, column_count
        +end
        +
        +
        + +
        +

        + + #-@Object + + + + + +

        + + + + +
        +
        +
        +
        +1098
        +1099
        +1100
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1098
        +
        +def -@
        +  collect {|e| -e }
        +end
        +
        +
        + +
        +

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

        +
        +

        Matrix division (multiplication by the inverse). + Matrix[[7,6], [3,9]] / Matrix[[2,9], [3,1]] + => -7 1 + -3 -6

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +980
        +981
        +982
        +983
        +984
        +985
        +986
        +987
        +988
        +989
        +990
        +991
        +992
        +
        +
        # File 'opal/stdlib/matrix.rb', line 980
        +
        +def /(other)
        +  case other
        +  when Numeric
        +    rows = @rows.collect {|row|
        +      row.collect {|e| e / other }
        +    }
        +    return new_matrix rows, column_count
        +  when Matrix
        +    return self * other.inverse
        +  else
        +    return apply_through_coercion(other, __method__)
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        Returns +true+ if and only if the two matrices contain equal elements.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +855
        +856
        +857
        +858
        +859
        +
        +
        # File 'opal/stdlib/matrix.rb', line 855
        +
        +def ==(other)
        +  return false unless Matrix === other &&
        +                      column_count == other.column_count # necessary for empty matrices
        +  rows == other.rows
        +end
        +
        +
        + +
        +

        + + #[](i, j) ⇒ Object + + + + Also known as: + element, component + + + + +

        +
        +

        Returns element (+i+,+j+) of the matrix. That is: row +i+, column +j+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +300
        +301
        +302
        +
        +
        # File 'opal/stdlib/matrix.rb', line 300
        +
        +def [](i, j)
        +  @rows.fetch(i){return nil}[j]
        +end
        +
        +
        + +
        +

        + + #[]=(i, j, v) ⇒ Object + + + + Also known as: + set_element, set_component + + + + +

        + + + + +
        +
        +
        +
        +306
        +307
        +308
        +
        +
        # File 'opal/stdlib/matrix.rb', line 306
        +
        +def []=(i, j, v)
        +  @rows[i][j] = v
        +end
        +
        +
        + +
        +

        + + #adjugateObject + + + + + +

        +
        +

        Returns the adjugate of the matrix.

        + +

        Matrix[ [7,6],[3,9] ].adjugate + => 9 -6 + -3 7

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +629
        +630
        +631
        +632
        +633
        +634
        +
        +
        # File 'opal/stdlib/matrix.rb', line 629
        +
        +def adjugate
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  Matrix.build(row_count, column_count) do |row, column|
        +    cofactor(column, row)
        +  end
        +end
        +
        +
        + +
        +

        + + #antisymmetric?Boolean + + + + + +

        +
        +

        Returns +true+ if this is an antisymmetric matrix. +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +808
        +809
        +810
        +811
        +812
        +813
        +814
        +
        +
        # File 'opal/stdlib/matrix.rb', line 808
        +
        +def antisymmetric?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  each_with_index(:upper) do |e, row, col|
        +    return false unless e == -rows[col][row]
        +  end
        +  true
        +end
        +
        +
        + +
        +

        + + #cloneObject + + + + + +

        +
        +

        Returns a clone of the matrix, so that the contents of each do not reference +identical objects. +There should be no good reason to do this since Matrices are immutable.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +872
        +873
        +874
        +
        +
        # File 'opal/stdlib/matrix.rb', line 872
        +
        +def clone
        +  new_matrix @rows.map(&:dup), column_count
        +end
        +
        +
        + +
        +

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

        +
        +

        The coerce method provides support for Ruby type coercion. +This coercion mechanism is used by Ruby to handle mixed-type +numeric operations: it is intended to find a compatible common +type between the two operands of the operator. +See also Numeric#coerce.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1408
        +1409
        +1410
        +1411
        +1412
        +1413
        +1414
        +1415
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1408
        +
        +def coerce(other)
        +  case other
        +  when Numeric
        +    return Scalar.new(other), self
        +  else
        +    raise TypeError, "#{self.class} can't be coerced into #{other.class}"
        +  end
        +end
        +
        +
        + +
        +

        + + #cofactor(row, column) ⇒ Object + + + + + +

        +
        +

        Returns the (row, column) cofactor which is obtained by multiplying +the first minor by (-1)**(row + column).

        + +

        Matrix.diagonal(9, 5, -3, 4).cofactor(1, 1) + => -108

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (RuntimeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +614
        +615
        +616
        +617
        +618
        +619
        +620
        +
        +
        # File 'opal/stdlib/matrix.rb', line 614
        +
        +def cofactor(row, column)
        +  raise RuntimeError, "cofactor of empty matrix is not defined" if empty?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +
        +  det_of_minor = first_minor(row, column).determinant
        +  det_of_minor * (-1) ** (row + column)
        +end
        +
        +
        + +
        +

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

        +
        +

        Returns a matrix that is the result of iteration of the given block over all +elements of the matrix. + Matrix[ [1,2], [3,4] ].collect { |e| e**2 } + => 1 4 + 9 16

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +368
        +369
        +370
        +371
        +372
        +
        +
        # File 'opal/stdlib/matrix.rb', line 368
        +
        +def collect(&block) # :yield: e
        +  return to_enum(:collect) unless block_given?
        +  rows = @rows.collect{|row| row.collect(&block)}
        +  new_matrix rows, column_count
        +end
        +
        +
        + +
        +

        + + #column(j) ⇒ Object + + + + + +

        +
        +

        Returns column vector number +j+ of the matrix as a Vector (starting at 0 +like an array). When a block is given, the elements of that vector are +iterated.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +345
        +346
        +347
        +348
        +349
        +350
        +351
        +352
        +353
        +354
        +355
        +356
        +357
        +358
        +359
        +
        +
        # File 'opal/stdlib/matrix.rb', line 345
        +
        +def column(j) # :yield: e
        +  if block_given?
        +    return self if j >= column_count || j < -column_count
        +    row_count.times do |i|
        +      yield @rows[i][j]
        +    end
        +    self
        +  else
        +    return nil if j >= column_count || j < -column_count
        +    col = Array.new(row_count) {|i|
        +      @rows[i][j]
        +    }
        +    Vector.elements(col, false)
        +  end
        +end
        +
        +
        + +
        +

        + + #column_vectorsObject + + + + + +

        +
        +

        Returns an array of the column vectors of the matrix. See Vector.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1429
        +1430
        +1431
        +1432
        +1433
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1429
        +
        +def column_vectors
        +  Array.new(column_count) {|i|
        +    column(i)
        +  }
        +end
        +
        +
        + +
        +

        + + #combine(*matrices, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +277
        +278
        +279
        +
        +
        # File 'opal/stdlib/matrix.rb', line 277
        +
        +def combine(*matrices, &block)
        +  Matrix.combine(self, *matrices, &block)
        +end
        +
        +
        + +
        +

        + + #conjugateObject + + + + Also known as: + conj + + + + +

        +
        +

        Returns the conjugate of the matrix. + Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] + => 1+2i i 0 + 1 2 3 + Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].conjugate + => 1-2i -i 0 + 1 2 3

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1354
        +1355
        +1356
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1354
        +
        +def conjugate
        +  collect(&:conjugate)
        +end
        +
        +
        + +
        +

        + + #determinantObject + + + + Also known as: + det + + + + +

        +
        +

        Returns the determinant of the matrix.

        + +

        Beware that using Float values can yield erroneous results +because of their lack of precision. +Consider using exact types like Rational or BigDecimal instead.

        + +

        Matrix[[7,6], [3,9]].determinant + => 45

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1116
        +1117
        +1118
        +1119
        +1120
        +1121
        +1122
        +1123
        +1124
        +1125
        +1126
        +1127
        +1128
        +1129
        +1130
        +1131
        +1132
        +1133
        +1134
        +1135
        +1136
        +1137
        +1138
        +1139
        +1140
        +1141
        +1142
        +1143
        +1144
        +1145
        +1146
        +1147
        +1148
        +1149
        +1150
        +1151
        +1152
        +1153
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1116
        +
        +def determinant
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  m = @rows
        +  case row_count
        +    # Up to 4x4, give result using Laplacian expansion by minors.
        +    # This will typically be faster, as well as giving good results
        +    # in case of Floats
        +  when 0
        +    +1
        +  when 1
        +    + m[0][0]
        +  when 2
        +    + m[0][0] * m[1][1] - m[0][1] * m[1][0]
        +  when 3
        +    m0, m1, m2 = m
        +    + m0[0] * m1[1] * m2[2] - m0[0] * m1[2] * m2[1] \
        +    - m0[1] * m1[0] * m2[2] + m0[1] * m1[2] * m2[0] \
        +    + m0[2] * m1[0] * m2[1] - m0[2] * m1[1] * m2[0]
        +  when 4
        +    m0, m1, m2, m3 = m
        +    + m0[0] * m1[1] * m2[2] * m3[3] - m0[0] * m1[1] * m2[3] * m3[2] \
        +    - m0[0] * m1[2] * m2[1] * m3[3] + m0[0] * m1[2] * m2[3] * m3[1] \
        +    + m0[0] * m1[3] * m2[1] * m3[2] - m0[0] * m1[3] * m2[2] * m3[1] \
        +    - m0[1] * m1[0] * m2[2] * m3[3] + m0[1] * m1[0] * m2[3] * m3[2] \
        +    + m0[1] * m1[2] * m2[0] * m3[3] - m0[1] * m1[2] * m2[3] * m3[0] \
        +    - m0[1] * m1[3] * m2[0] * m3[2] + m0[1] * m1[3] * m2[2] * m3[0] \
        +    + m0[2] * m1[0] * m2[1] * m3[3] - m0[2] * m1[0] * m2[3] * m3[1] \
        +    - m0[2] * m1[1] * m2[0] * m3[3] + m0[2] * m1[1] * m2[3] * m3[0] \
        +    + m0[2] * m1[3] * m2[0] * m3[1] - m0[2] * m1[3] * m2[1] * m3[0] \
        +    - m0[3] * m1[0] * m2[1] * m3[2] + m0[3] * m1[0] * m2[2] * m3[1] \
        +    + m0[3] * m1[1] * m2[0] * m3[2] - m0[3] * m1[1] * m2[2] * m3[0] \
        +    - m0[3] * m1[2] * m2[0] * m3[1] + m0[3] * m1[2] * m2[1] * m3[0]
        +  else
        +    # For bigger matrices, use an efficient and general algorithm.
        +    # Currently, we use the Gauss-Bareiss algorithm
        +    determinant_bareiss
        +  end
        +end
        +
        +
        + +
        +

        + + #determinant_eObject + + + + Also known as: + det_e + + + + +

        +
        +

        deprecated; use Matrix#determinant

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1198
        +1199
        +1200
        +1201
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1198
        +
        +def determinant_e
        +  warn "Matrix#determinant_e is deprecated; use #determinant", uplevel: 1
        +  determinant
        +end
        +
        +
        + +
        +

        + + #diagonal?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a diagonal matrix. +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +675
        +676
        +677
        +678
        +
        +
        # File 'opal/stdlib/matrix.rb', line 675
        +
        +def diagonal?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  each(:off_diagonal).all?(&:zero?)
        +end
        +
        +
        + +
        +

        + + #each(which = :all) ⇒ Object + + + + + +

        +
        +

        Yields all elements of the matrix, starting with those of the first row, +or returns an Enumerator if no block given. +Elements can be restricted by passing an argument:

        + +
          +
        • :all (default): yields all elements
        • +
        • :diagonal: yields only elements on the diagonal
        • +
        • :off_diagonal: yields all elements except on the diagonal
        • +
        • :lower: yields only elements on or below the diagonal
        • +
        • :strict_lower: yields only elements below the diagonal
        • +
        • :strict_upper: yields only elements above the diagonal
        • +
        • :upper: yields only elements on or above the diagonal
        • +
        + +

        Matrix[ [1,2], [3,4] ].each { |e| puts e } + # => prints the numbers 1 to 4 + Matrix[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/matrix.rb', line 391
        +
        +def each(which = :all) # :yield: e
        +  return to_enum :each, which unless block_given?
        +  last = column_count - 1
        +  case which
        +  when :all
        +    block = Proc.new
        +    @rows.each do |row|
        +      row.each(&block)
        +    end
        +  when :diagonal
        +    @rows.each_with_index do |row, row_index|
        +      yield row.fetch(row_index){return self}
        +    end
        +  when :off_diagonal
        +    @rows.each_with_index do |row, row_index|
        +      column_count.times do |col_index|
        +        yield row[col_index] unless row_index == col_index
        +      end
        +    end
        +  when :lower
        +    @rows.each_with_index do |row, row_index|
        +      0.upto([row_index, last].min) do |col_index|
        +        yield row[col_index]
        +      end
        +    end
        +  when :strict_lower
        +    @rows.each_with_index do |row, row_index|
        +      [row_index, column_count].min.times do |col_index|
        +        yield row[col_index]
        +      end
        +    end
        +  when :strict_upper
        +    @rows.each_with_index do |row, row_index|
        +      (row_index+1).upto(last) do |col_index|
        +        yield row[col_index]
        +      end
        +    end
        +  when :upper
        +    @rows.each_with_index do |row, row_index|
        +      row_index.upto(last) do |col_index|
        +        yield row[col_index]
        +      end
        +    end
        +  else
        +    raise ArgumentError, "expected #{which.inspect} to be one of :all, :diagonal, :off_diagonal, :lower, :strict_lower, :strict_upper or :upper"
        +  end
        +  self
        +end
        +
        +
        + +
        +

        + + #each_with_index(which = :all) ⇒ Object + + + + + +

        +
        +

        Same as #each, but the row index and column index in addition to the element

        + +

        Matrix[ [1,2], [3,4] ].each_with_index do |e, row, col| + puts "#e at ##row, #col" + end + # => Prints: + # 1 at 0, 0 + # 2 at 0, 1 + # 3 at 1, 0 + # 4 at 1, 1

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +487
        +488
        +489
        +490
        +491
        +492
        +493
        +494
        +495
        +496
        +497
        +498
        +499
        +500
        +
        +
        # File 'opal/stdlib/matrix.rb', line 452
        +
        +def each_with_index(which = :all) # :yield: e, row, column
        +  return to_enum :each_with_index, which unless block_given?
        +  last = column_count - 1
        +  case which
        +  when :all
        +    @rows.each_with_index do |row, row_index|
        +      row.each_with_index do |e, col_index|
        +        yield e, row_index, col_index
        +      end
        +    end
        +  when :diagonal
        +    @rows.each_with_index do |row, row_index|
        +      yield row.fetch(row_index){return self}, row_index, row_index
        +    end
        +  when :off_diagonal
        +    @rows.each_with_index do |row, row_index|
        +      column_count.times do |col_index|
        +        yield row[col_index], row_index, col_index unless row_index == col_index
        +      end
        +    end
        +  when :lower
        +    @rows.each_with_index do |row, row_index|
        +      0.upto([row_index, last].min) do |col_index|
        +        yield row[col_index], row_index, col_index
        +      end
        +    end
        +  when :strict_lower
        +    @rows.each_with_index do |row, row_index|
        +      [row_index, column_count].min.times do |col_index|
        +        yield row[col_index], row_index, col_index
        +      end
        +    end
        +  when :strict_upper
        +    @rows.each_with_index do |row, row_index|
        +      (row_index+1).upto(last) do |col_index|
        +        yield row[col_index], row_index, col_index
        +      end
        +    end
        +  when :upper
        +    @rows.each_with_index do |row, row_index|
        +      row_index.upto(last) do |col_index|
        +        yield row[col_index], row_index, col_index
        +      end
        +    end
        +  else
        +    raise ArgumentError, "expected #{which.inspect} to be one of :all, :diagonal, :off_diagonal, :lower, :strict_lower, :strict_upper or :upper"
        +  end
        +  self
        +end
        +
        +
        + +
        +

        + + #eigensystemObject + + + + Also known as: + eigen + + + + +

        +
        +

        Returns the Eigensystem of the matrix; see +EigenvalueDecomposition+. + m = Matrix[[1, 2], [3, 4]] + v, d, v_inv = m.eigensystem + d.diagonal? # => true + v.inv == v_inv # => true + (v * d * v_inv).round(5) == m # => true

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1321
        +1322
        +1323
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1321
        +
        +def eigensystem
        +  EigenvalueDecomposition.new(self)
        +end
        +
        +
        + +
        +

        + + #elements_to_fObject + + + + + +

        +
        +

        Deprecated.

        + +

        Use map(&:to_f)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1452
        +1453
        +1454
        +1455
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1452
        +
        +def elements_to_f
        +  warn "Matrix#elements_to_f is deprecated, use map(&:to_f)", uplevel: 1
        +  map(&:to_f)
        +end
        +
        +
        + +
        +

        + + #elements_to_iObject + + + + + +

        +
        +

        Deprecated.

        + +

        Use map(&:to_i)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1460
        +1461
        +1462
        +1463
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1460
        +
        +def elements_to_i
        +  warn "Matrix#elements_to_i is deprecated, use map(&:to_i)", uplevel: 1
        +  map(&:to_i)
        +end
        +
        +
        + +
        +

        + + #elements_to_rObject + + + + + +

        +
        +

        Deprecated.

        + +

        Use map(&:to_r)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1468
        +1469
        +1470
        +1471
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1468
        +
        +def elements_to_r
        +  warn "Matrix#elements_to_r is deprecated, use map(&:to_r)", uplevel: 1
        +  map(&:to_r)
        +end
        +
        +
        + +
        +

        + + #empty?Boolean + + + + + +

        +
        +

        Returns +true+ if this is an empty matrix, i.e. if the number of rows +or the number of columns is 0.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +684
        +685
        +686
        +
        +
        # File 'opal/stdlib/matrix.rb', line 684
        +
        +def empty?
        +  column_count == 0 || row_count == 0
        +end
        +
        +
        + +
        +

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

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +861
        +862
        +863
        +864
        +865
        +
        +
        # File 'opal/stdlib/matrix.rb', line 861
        +
        +def eql?(other)
        +  return false unless Matrix === other &&
        +                      column_count == other.column_count # necessary for empty matrices
        +  rows.eql? other.rows
        +end
        +
        +
        + +
        +

        + + #first_minor(row, column) ⇒ Object + + + + + +

        +
        +

        Returns the submatrix obtained by deleting the specified row and column.

        + +

        Matrix.diagonal(9, 5, -3, 4).first_minor(1, 2) + => 9 0 0 + 0 0 0 + 0 0 4

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (RuntimeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +587
        +588
        +589
        +590
        +591
        +592
        +593
        +594
        +595
        +596
        +597
        +598
        +599
        +600
        +601
        +602
        +603
        +604
        +605
        +
        +
        # File 'opal/stdlib/matrix.rb', line 587
        +
        +def first_minor(row, column)
        +  raise RuntimeError, "first_minor of empty matrix is not defined" if empty?
        +
        +  unless 0 <= row && row < row_count
        +    raise ArgumentError, "invalid row (#{row.inspect} for 0..#{row_count - 1})"
        +  end
        +
        +  unless 0 <= column && column < column_count
        +    raise ArgumentError, "invalid column (#{column.inspect} for 0..#{column_count - 1})"
        +  end
        +
        +  arrays = to_a
        +  arrays.delete_at(row)
        +  arrays.each do |array|
        +    array.delete_at(column)
        +  end
        +
        +  new_matrix arrays, column_count - 1
        +end
        +
        +
        + +
        +

        + + #hadamard_product(m) ⇒ Object + + + + Also known as: + entrywise_product + + + + +

        +
        +

        Hadamard product + Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) + => 1 4 + 9 8

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1000
        +1001
        +1002
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1000
        +
        +def hadamard_product(m)
        +  combine(m){|a, b| a * b}
        +end
        +
        +
        + +
        +

        + + #hashObject + + + + + +

        +
        +

        Returns a hash-code for the matrix.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +879
        +880
        +881
        +
        +
        # File 'opal/stdlib/matrix.rb', line 879
        +
        +def hash
        +  @rows.hash
        +end
        +
        +
        + +
        +

        + + #hermitian?Boolean + + + + + +

        +
        +

        Returns +true+ if this is an hermitian matrix. +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +692
        +693
        +694
        +695
        +696
        +697
        +
        +
        # File 'opal/stdlib/matrix.rb', line 692
        +
        +def hermitian?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  each_with_index(:upper).all? do |e, row, col|
        +    e == rows[col][row].conj
        +  end
        +end
        +
        +
        + +
        +

        + + #hstack(*matrices) ⇒ Object + + + + + +

        +
        +

        Returns a new matrix resulting by stacking horizontally +the receiver with the given matrices

        + +

        x = Matrix[[1, 2], [3, 4]] + y = Matrix[[5, 6], [7, 8]] + x.hstack(y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1212
        +1213
        +1214
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1212
        +
        +def hstack(*matrices)
        +  self.class.hstack(self, *matrices)
        +end
        +
        +
        + +
        +

        + + #imaginaryObject + + + + Also known as: + imag + + + + +

        +
        +

        Returns the imaginary part of the matrix. + Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] + => 1+2i i 0 + 1 2 3 + Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary + => 2i i 0 + 0 0 0

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1368
        +1369
        +1370
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1368
        +
        +def imaginary
        +  collect(&:imaginary)
        +end
        +
        +
        + +
        +

        + + #index(*args) ⇒ Object + + + + Also known as: + find_index + + + + +

        +
        +

        :call-seq: + index(value, selector = :all) -> [row, column] + index(selector = :all){ block } -> [row, column] + index(selector = :all) -> an_enumerator

        + +

        The index method is specialized to return the index as [row, column] +It also accepts an optional +selector+ argument, see #each for details.

        + +

        Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1] + Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0]

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +515
        +516
        +517
        +518
        +519
        +520
        +521
        +522
        +523
        +524
        +525
        +526
        +527
        +528
        +529
        +530
        +
        +
        # File 'opal/stdlib/matrix.rb', line 515
        +
        +def index(*args)
        +  raise ArgumentError, "wrong number of arguments(#{args.size} for 0-2)" if args.size > 2
        +  which = (args.size == 2 || SELECTORS.include?(args.last)) ? args.pop : :all
        +  return to_enum :find_index, which, *args unless block_given? || args.size == 1
        +  if args.size == 1
        +    value = args.first
        +    each_with_index(which) do |e, row_index, col_index|
        +      return row_index, col_index if e == value
        +    end
        +  else
        +    each_with_index(which) do |e, row_index, col_index|
        +      return row_index, col_index if yield e
        +    end
        +  end
        +  nil
        +end
        +
        +
        + +
        +

        + + #inspectObject + + + + + +

        +
        +

        Overrides Object#inspect

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1493
        +1494
        +1495
        +1496
        +1497
        +1498
        +1499
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1493
        +
        +def inspect
        +  if empty?
        +    "#{self.class}.empty(#{row_count}, #{column_count})"
        +  else
        +    "#{self.class}#{@rows.inspect}"
        +  end
        +end
        +
        +
        + +
        +

        + + #inverseObject + + + + Also known as: + inv + + + + +

        +
        +

        Returns the inverse of the matrix. + Matrix[[-1, -1], [0, -1]].inverse + => -1 1 + 0 -1

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1011
        +1012
        +1013
        +1014
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1011
        +
        +def inverse
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  self.class.I(row_count).send(:inverse_from, self)
        +end
        +
        +
        + +
        +

        + + #laplace_expansion(row: nil, column: nil) ⇒ Object + + + + Also known as: + cofactor_expansion + + + + +

        +
        +

        Returns the Laplace expansion along given row or column.

        + +

        Matrix[[7,6], [3,9]].laplace_expansion(column: 1) + => 45

        + +

        Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0) + => Vector[3, -2]

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (RuntimeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +646
        +647
        +648
        +649
        +650
        +651
        +652
        +653
        +654
        +655
        +656
        +657
        +658
        +659
        +660
        +661
        +662
        +663
        +
        +
        # File 'opal/stdlib/matrix.rb', line 646
        +
        +def laplace_expansion(row: nil, column: nil)
        +  num = row || column
        +
        +  if !num || (row && column)
        +    raise ArgumentError, "exactly one the row or column arguments must be specified"
        +  end
        +
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  raise RuntimeError, "laplace_expansion of empty matrix is not defined" if empty?
        +
        +  unless 0 <= num && num < row_count
        +    raise ArgumentError, "invalid num (#{num.inspect} for 0..#{row_count - 1})"
        +  end
        +
        +  send(row ? :row : :column, num).map.with_index { |e, k|
        +    e * cofactor(*(row ? [num, k] : [k,num]))
        +  }.inject(:+)
        +end
        +
        +
        + +
        +

        + + #lower_triangular?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a lower triangular matrix.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +702
        +703
        +704
        +
        +
        # File 'opal/stdlib/matrix.rb', line 702
        +
        +def lower_triangular?
        +  each(:strict_upper).all?(&:zero?)
        +end
        +
        +
        + +
        +

        + + #lupObject + + + + Also known as: + lup_decomposition + + + + +

        +
        +

        Returns the LUP decomposition of the matrix; see +LUPDecomposition+. + a = Matrix[[1, 2], [3, 4]] + l, u, p = a.lup + l.lower_triangular? # => true + u.upper_triangular? # => true + p.permutation? # => true + l * u == p * a # => true + a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1336
        +1337
        +1338
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1336
        +
        +def lup
        +  LUPDecomposition.new(self)
        +end
        +
        +
        + +
        +

        + + #minor(*param) ⇒ Object + + + + + +

        +
        +

        Returns a section of the matrix. The parameters are either:

        + +
          +
        • start_row, nrows, start_col, ncols; OR
        • +
        • row_range, col_range
        • +
        + +

        Matrix.diagonal(9, 5, -3).minor(0..1, 0..2) + => 9 0 0 + 0 5 0

        + +

        Like Array#[], negative indices count backward from the end of the +row or column (-1 is the last element). Returns nil if the starting +row or column is greater than row_count or column_count respectively.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +577
        +
        +
        # File 'opal/stdlib/matrix.rb', line 546
        +
        +def minor(*param)
        +  case param.size
        +  when 2
        +    row_range, col_range = param
        +    from_row = row_range.first
        +    from_row += row_count if from_row < 0
        +    to_row = row_range.end
        +    to_row += row_count if to_row < 0
        +    to_row += 1 unless row_range.exclude_end?
        +    size_row = to_row - from_row
        +
        +    from_col = col_range.first
        +    from_col += column_count if from_col < 0
        +    to_col = col_range.end
        +    to_col += column_count if to_col < 0
        +    to_col += 1 unless col_range.exclude_end?
        +    size_col = to_col - from_col
        +  when 4
        +    from_row, size_row, from_col, size_col = param
        +    return nil if size_row < 0 || size_col < 0
        +    from_row += row_count if from_row < 0
        +    from_col += column_count if from_col < 0
        +  else
        +    raise ArgumentError, param.inspect
        +  end
        +
        +  return nil if from_row > row_count || from_col > column_count || from_row < 0 || from_col < 0
        +  rows = @rows[from_row, size_row].collect{|row|
        +    row[from_col, size_col]
        +  }
        +  new_matrix rows, [column_count - from_col, size_col].min
        +end
        +
        +
        + +
        +

        + + #normal?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a normal matrix. +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +710
        +711
        +712
        +713
        +714
        +715
        +716
        +717
        +718
        +719
        +720
        +721
        +722
        +
        +
        # File 'opal/stdlib/matrix.rb', line 710
        +
        +def normal?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  rows.each_with_index do |row_i, i|
        +    rows.each_with_index do |row_j, j|
        +      s = 0
        +      rows.each_with_index do |row_k, k|
        +        s += row_i[k] * row_j[k].conj - row_k[i].conj * row_k[j]
        +      end
        +      return false unless s == 0
        +    end
        +  end
        +  true
        +end
        +
        +
        + +
        +

        + + #orthogonal?Boolean + + + + + +

        +
        +

        Returns +true+ if this is an orthogonal matrix +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +728
        +729
        +730
        +731
        +732
        +733
        +734
        +735
        +736
        +737
        +738
        +739
        +740
        +
        +
        # File 'opal/stdlib/matrix.rb', line 728
        +
        +def orthogonal?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  rows.each_with_index do |row, i|
        +    column_count.times do |j|
        +      s = 0
        +      row_count.times do |k|
        +        s += row[k] * rows[k][j]
        +      end
        +      return false unless s == (i == j ? 1 : 0)
        +    end
        +  end
        +  true
        +end
        +
        +
        + +
        +

        + + #permutation?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a permutation matrix +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +746
        +747
        +748
        +749
        +750
        +751
        +752
        +753
        +754
        +755
        +756
        +757
        +758
        +759
        +760
        +761
        +762
        +
        +
        # File 'opal/stdlib/matrix.rb', line 746
        +
        +def permutation?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  cols = Array.new(column_count)
        +  rows.each_with_index do |row, i|
        +    found = false
        +    row.each_with_index do |e, j|
        +      if e == 1
        +        return false if found || cols[j]
        +        found = cols[j] = true
        +      elsif e != 0
        +        return false
        +      end
        +    end
        +    return false unless found
        +  end
        +  true
        +end
        +
        +
        + +
        +

        + + #rankObject + + + + + +

        +
        +

        Returns the rank of the matrix. +Beware that using Float values can yield erroneous results +because of their lack of precision. +Consider using exact types like Rational or BigDecimal instead.

        + +

        Matrix[[7,6], [3,9]].rank + => 2

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1225
        +1226
        +1227
        +1228
        +1229
        +1230
        +1231
        +1232
        +1233
        +1234
        +1235
        +1236
        +1237
        +1238
        +1239
        +1240
        +1241
        +1242
        +1243
        +1244
        +1245
        +1246
        +1247
        +1248
        +1249
        +1250
        +1251
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1225
        +
        +def rank
        +  # We currently use Bareiss' multistep integer-preserving gaussian elimination
        +  # (see comments on determinant)
        +  a = to_a
        +  last_column = column_count - 1
        +  last_row = row_count - 1
        +  pivot_row = 0
        +  previous_pivot = 1
        +  0.upto(last_column) do |k|
        +    switch_row = (pivot_row .. last_row).find {|row|
        +      a[row][k] != 0
        +    }
        +    if switch_row
        +      a[switch_row], a[pivot_row] = a[pivot_row], a[switch_row] unless pivot_row == switch_row
        +      pivot = a[pivot_row][k]
        +      (pivot_row+1).upto(last_row) do |i|
        +         ai = a[i]
        +         (k+1).upto(last_column) do |j|
        +           ai[j] =  (pivot * ai[j] - ai[k] * a[pivot_row][j]) / previous_pivot
        +         end
        +       end
        +      pivot_row += 1
        +      previous_pivot = pivot
        +    end
        +  end
        +  pivot_row
        +end
        +
        +
        + +
        +

        + + #rank_eObject + + + + + +

        +
        +

        deprecated; use Matrix#rank

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1256
        +1257
        +1258
        +1259
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1256
        +
        +def rank_e
        +  warn "Matrix#rank_e is deprecated; use #rank", uplevel: 1
        +  rank
        +end
        +
        +
        + +
        +

        + + #realObject + + + + + +

        +
        +

        Returns the real part of the matrix. + Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] + => 1+2i i 0 + 1 2 3 + Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].real + => 1 0 0 + 1 2 3

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1382
        +1383
        +1384
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1382
        +
        +def real
        +  collect(&:real)
        +end
        +
        +
        + +
        +

        + + #real?Boolean + + + + + +

        +
        +

        Returns +true+ if all entries of the matrix are real.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +767
        +768
        +769
        +
        +
        # File 'opal/stdlib/matrix.rb', line 767
        +
        +def real?
        +  all?(&:real?)
        +end
        +
        +
        + +
        +

        + + #rectObject + + + + Also known as: + rectangular + + + + +

        +
        +

        Returns an array containing matrices corresponding to the real and imaginary +parts of the matrix

        + +

        m.rect == [m.real, m.imag] # ==> true for all matrices m

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1392
        +1393
        +1394
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1392
        +
        +def rect
        +  [real, imag]
        +end
        +
        +
        + +
        +

        + + #regular?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a regular (i.e. non-singular) matrix.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +774
        +775
        +776
        +
        +
        # File 'opal/stdlib/matrix.rb', line 774
        +
        +def regular?
        +  not singular?
        +end
        +
        +
        + +
        +

        + + #round(ndigits = 0) ⇒ Object + + + + + +

        +
        +

        Returns a matrix with entries rounded to the given precision +(see Float#round)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1264
        +1265
        +1266
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1264
        +
        +def round(ndigits=0)
        +  map{|e| e.round(ndigits)}
        +end
        +
        +
        + +
        +

        + + #row(i, &block) ⇒ Object + + + + + +

        +
        +

        Returns row vector number +i+ of the matrix as a Vector (starting at 0 like +an array). When a block is given, the elements of that vector are iterated.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +331
        +332
        +333
        +334
        +335
        +336
        +337
        +338
        +
        +
        # File 'opal/stdlib/matrix.rb', line 331
        +
        +def row(i, &block) # :yield: e
        +  if block_given?
        +    @rows.fetch(i){return self}.each(&block)
        +    self
        +  else
        +    Vector.elements(@rows.fetch(i){return nil})
        +  end
        +end
        +
        +
        + +
        +

        + + #row_countObject + + + + Also known as: + row_size + + + + +

        +
        +

        Returns the number of rows.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +316
        +317
        +318
        +
        +
        # File 'opal/stdlib/matrix.rb', line 316
        +
        +def row_count
        +  @rows.size
        +end
        +
        +
        + +
        +

        + + #row_vectorsObject + + + + + +

        +
        +

        Returns an array of the row vectors of the matrix. See Vector.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1420
        +1421
        +1422
        +1423
        +1424
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1420
        +
        +def row_vectors
        +  Array.new(row_count) {|i|
        +    row(i)
        +  }
        +end
        +
        +
        + +
        +

        + + #singular?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a singular matrix.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +781
        +782
        +783
        +
        +
        # File 'opal/stdlib/matrix.rb', line 781
        +
        +def singular?
        +  determinant == 0
        +end
        +
        +
        + +
        +

        + + #square?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a square matrix.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +788
        +789
        +790
        +
        +
        # File 'opal/stdlib/matrix.rb', line 788
        +
        +def square?
        +  column_count == row_count
        +end
        +
        +
        + +
        +

        + + #symmetric?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a symmetric matrix. +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +796
        +797
        +798
        +799
        +800
        +801
        +802
        +
        +
        # File 'opal/stdlib/matrix.rb', line 796
        +
        +def symmetric?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  each_with_index(:strict_upper) do |e, row, col|
        +    return false if e != rows[col][row]
        +  end
        +  true
        +end
        +
        +
        + +
        +

        + + #to_aObject + + + + + +

        +
        +

        Returns an array of arrays that describe the rows of the matrix.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1445
        +1446
        +1447
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1445
        +
        +def to_a
        +  @rows.collect(&:dup)
        +end
        +
        +
        + +
        +

        + + #to_matrixObject + + + + + +

        +
        +

        Explicit conversion to a Matrix. Returns self

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1438
        +1439
        +1440
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1438
        +
        +def to_matrix
        +  self
        +end
        +
        +
        + +
        +

        + + #to_sObject + + + + + +

        +
        +

        Overrides Object#to_s

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1480
        +1481
        +1482
        +1483
        +1484
        +1485
        +1486
        +1487
        +1488
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1480
        +
        +def to_s
        +  if empty?
        +    "#{self.class}.empty(#{row_count}, #{column_count})"
        +  else
        +    "#{self.class}[" + @rows.collect{|row|
        +      "[" + row.collect{|e| e.to_s}.join(", ") + "]"
        +    }.join(", ")+"]"
        +  end
        +end
        +
        +
        + +
        +

        + + #traceObject + + + + Also known as: + tr + + + + +

        +
        +

        Returns the trace (sum of diagonal elements) of the matrix. + Matrix[[7,6], [3,9]].trace + => 16

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1273
        +1274
        +1275
        +1276
        +1277
        +1278
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1273
        +
        +def trace
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  (0...column_count).inject(0) do |tr, i|
        +    tr + @rows[i][i]
        +  end
        +end
        +
        +
        + +
        +

        + + #transposeObject + + + + Also known as: + t + + + + +

        +
        +

        Returns the transpose of the matrix. + Matrix[[1,2], [3,4], [5,6]] + => 1 2 + 3 4 + 5 6 + Matrix[[1,2], [3,4], [5,6]].transpose + => 1 3 5 + 2 4 6

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1291
        +1292
        +1293
        +1294
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1291
        +
        +def transpose
        +  return self.class.empty(column_count, 0) if row_count.zero?
        +  new_matrix @rows.transpose, row_count
        +end
        +
        +
        + +
        +

        + + #unitary?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a unitary matrix +Raises an error if matrix is not square.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +820
        +821
        +822
        +823
        +824
        +825
        +826
        +827
        +828
        +829
        +830
        +831
        +832
        +
        +
        # File 'opal/stdlib/matrix.rb', line 820
        +
        +def unitary?
        +  Matrix.Raise ErrDimensionMismatch unless square?
        +  rows.each_with_index do |row, i|
        +    column_count.times do |j|
        +      s = 0
        +      row_count.times do |k|
        +        s += row[k].conj * rows[k][j]
        +      end
        +      return false unless s == (i == j ? 1 : 0)
        +    end
        +  end
        +  true
        +end
        +
        +
        + +
        +

        + + #upper_triangular?Boolean + + + + + +

        +
        +

        Returns +true+ if this is an upper triangular matrix.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +837
        +838
        +839
        +
        +
        # File 'opal/stdlib/matrix.rb', line 837
        +
        +def upper_triangular?
        +  each(:strict_lower).all?(&:zero?)
        +end
        +
        +
        + +
        +

        + + #vstack(*matrices) ⇒ Object + + + + + +

        +
        +

        Returns a new matrix resulting by stacking vertically +the receiver with the given matrices

        + +

        x = Matrix[[1, 2], [3, 4]] + y = Matrix[[5, 6], [7, 8]] + x.vstack(y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1305
        +1306
        +1307
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1305
        +
        +def vstack(*matrices)
        +  self.class.vstack(self, *matrices)
        +end
        +
        +
        + +
        +

        + + #zero?Boolean + + + + + +

        +
        +

        Returns +true+ if this is a matrix with only zero elements

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +844
        +845
        +846
        +
        +
        # File 'opal/stdlib/matrix.rb', line 844
        +
        +def zero?
        +  all?(&:zero?)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Matrix/CoercionHelper.html b/docs/api/v1.8.2/stdlib/Matrix/CoercionHelper.html new file mode 100644 index 00000000..f4d59222 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Matrix/CoercionHelper.html @@ -0,0 +1,340 @@ + + + + + + + Module: Matrix::CoercionHelper + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Matrix::CoercionHelper + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        Matrix, Scalar, Vector
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix.rb
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .coerce_to(obj, cls, meth) ⇒ Object + + + + + +

        +
        +

        Helper method to coerce a value into a specific class. +Raises a TypeError if the coercion fails or the returned value +is not of the right class. +(from Rubinius)

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +1549
        +1550
        +1551
        +1552
        +1553
        +1554
        +1555
        +1556
        +1557
        +1558
        +1559
        +1560
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1549
        +
        +def self.coerce_to(obj, cls, meth) # :nodoc:
        +  return obj if obj.kind_of?(cls)
        +  raise TypeError, "Expected a #{cls} but got a #{obj.class}" unless obj.respond_to? meth
        +  begin
        +    ret = obj.__send__(meth)
        +  rescue Exception => e
        +    raise TypeError, "Coercion error: #{obj.inspect}.#{meth} => #{cls} failed:\n" \
        +                     "(#{e.message})"
        +  end
        +  raise TypeError, "Coercion error: obj.#{meth} did NOT return a #{cls} (was #{ret.class})" unless ret.kind_of? cls
        +  ret
        +end
        +
        +
        + +
        +

        + + .coerce_to_int(obj) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +1562
        +1563
        +1564
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1562
        +
        +def self.coerce_to_int(obj)
        +  coerce_to(obj, Integer, :to_int)
        +end
        +
        +
        + +
        +

        + + .coerce_to_matrix(obj) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +1566
        +1567
        +1568
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1566
        +
        +def self.coerce_to_matrix(obj)
        +  coerce_to(obj, Matrix, :to_matrix)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Matrix/ConversionHelper.html b/docs/api/v1.8.2/stdlib/Matrix/ConversionHelper.html new file mode 100644 index 00000000..b5c050c3 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Matrix/ConversionHelper.html @@ -0,0 +1,122 @@ + + + + + + + Module: Matrix::ConversionHelper + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Matrix::ConversionHelper + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        Matrix, LUPDecomposition, Vector
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix.rb
        +
        + +
        + +

        Overview

        +
        +

        Private helper modules

        + + +
        +
        +
        + + +
        + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Matrix/EigenvalueDecomposition.html b/docs/api/v1.8.2/stdlib/Matrix/EigenvalueDecomposition.html new file mode 100644 index 00000000..02d3d912 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Matrix/EigenvalueDecomposition.html @@ -0,0 +1,686 @@ + + + + + + + Class: Matrix::EigenvalueDecomposition + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Matrix::EigenvalueDecomposition + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix/eigenvalue_decomposition.rb
        +
        + +
        + +

        Overview

        +
        +

        Eigenvalues and eigenvectors of a real matrix.

        + +

        Computes the eigenvalues and eigenvectors of a matrix A.

        + +

        If A is diagonalizable, this provides matrices V and D +such that A = V*D*V.inv, where D is the diagonal matrix with entries +equal to the eigenvalues and V is formed by the eigenvectors.

        + +

        If A is symmetric, then V is orthogonal and thus A = V*D*V.t

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

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(a) ⇒ EigenvalueDecomposition + + + + + +

        +
        +

        Constructs the eigenvalue decomposition for a square matrix +A+

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +19
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +32
        +33
        +34
        +35
        +36
        +37
        +38
        +39
        +
        +
        # File 'opal/stdlib/matrix/eigenvalue_decomposition.rb', line 19
        +
        +def initialize(a)
        +  # @d, @e: Arrays for internal storage of eigenvalues.
        +  # @v: Array for internal storage of eigenvectors.
        +  # @h: Array for internal storage of nonsymmetric Hessenberg form.
        +  raise TypeError, "Expected Matrix but got #{a.class}" unless a.is_a?(Matrix)
        +  @size = a.row_count
        +  @d = Array.new(@size, 0)
        +  @e = Array.new(@size, 0)
        +
        +  if (@symmetric = a.symmetric?)
        +    @v = a.to_a
        +    tridiagonalize
        +    diagonalize
        +  else
        +    @v = Array.new(@size) { Array.new(@size, 0) }
        +    @h = a.to_a
        +    @ort = Array.new(@size, 0)
        +    reduce_to_hessenberg
        +    hessenberg_to_real_schur
        +  end
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #eigenvalue_matrixObject + + + + Also known as: + d + + + + +

        +
        +

        Returns the block diagonal eigenvalue matrix +D+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +73
        +74
        +75
        +
        +
        # File 'opal/stdlib/matrix/eigenvalue_decomposition.rb', line 73
        +
        +def eigenvalue_matrix
        +  Matrix.diagonal(*eigenvalues)
        +end
        +
        +
        + +
        +

        + + #eigenvaluesObject + + + + + +

        +
        +

        Returns the eigenvalues in an array

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +59
        +60
        +61
        +62
        +63
        +
        +
        # File 'opal/stdlib/matrix/eigenvalue_decomposition.rb', line 59
        +
        +def eigenvalues
        +  values = @d.dup
        +  @e.each_with_index{|imag, i| values[i] = Complex(values[i], imag) unless imag == 0}
        +  values
        +end
        +
        +
        + +
        +

        + + #eigenvector_matrixObject + + + + Also known as: + v + + + + +

        +
        +

        Returns the eigenvector matrix +V+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +43
        +44
        +45
        +
        +
        # File 'opal/stdlib/matrix/eigenvalue_decomposition.rb', line 43
        +
        +def eigenvector_matrix
        +  Matrix.send(:new, build_eigenvectors.transpose)
        +end
        +
        +
        + +
        +

        + + #eigenvector_matrix_invObject + + + + Also known as: + v_inv + + + + +

        +
        +

        Returns the inverse of the eigenvector matrix +V+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +50
        +51
        +52
        +53
        +54
        +
        +
        # File 'opal/stdlib/matrix/eigenvalue_decomposition.rb', line 50
        +
        +def eigenvector_matrix_inv
        +  r = Matrix.send(:new, build_eigenvectors)
        +  r = r.transpose.inverse unless @symmetric
        +  r
        +end
        +
        +
        + +
        +

        + + #eigenvectorsObject + + + + + +

        +
        +

        Returns an array of the eigenvectors

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +67
        +68
        +69
        +
        +
        # File 'opal/stdlib/matrix/eigenvalue_decomposition.rb', line 67
        +
        +def eigenvectors
        +  build_eigenvectors.map{|ev| Vector.send(:new, ev)}
        +end
        +
        +
        + +
        +

        + + #to_aryObject + + + + Also known as: + to_a + + + + +

        +
        +

        Returns [eigenvector_matrix, eigenvalue_matrix, eigenvector_matrix_inv]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +80
        +81
        +82
        +
        +
        # File 'opal/stdlib/matrix/eigenvalue_decomposition.rb', line 80
        +
        +def to_ary
        +  [v, d, v_inv]
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Matrix/LUPDecomposition.html b/docs/api/v1.8.2/stdlib/Matrix/LUPDecomposition.html new file mode 100644 index 00000000..b1165eee --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Matrix/LUPDecomposition.html @@ -0,0 +1,1077 @@ + + + + + + + Class: Matrix::LUPDecomposition + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Matrix::LUPDecomposition + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        ConversionHelper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix/lup_decomposition.rb
        +
        + +
        + +

        Overview

        +
        +

        For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n +unit lower triangular matrix L, an n-by-n upper triangular matrix U, +and a m-by-m permutation matrix P so that L*U = P*A. +If m < n, then L is m-by-m and U is m-by-n.

        + +

        The LUP decomposition with pivoting always exists, even if the matrix is +singular, so the constructor will never fail. The primary use of the +LU decomposition is in the solution of square systems of simultaneous +linear equations. This will fail if singular? returns true.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #pivots ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the pivoting indices.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #det ⇒ Object + + + + (also: #determinant) + + + + + + + + + + + +

          Returns the determinant of +A+, calculated efficiently from the factorization.

          +
          + +
        • + + +
        • + + + #initialize(a) ⇒ LUPDecomposition + + + + + + + constructor + + + + + + + + +

          A new instance of LUPDecomposition.

          +
          + +
        • + + +
        • + + + #l ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #p ⇒ Object + + + + + + + + + + + + + +

          Returns the permutation matrix +P+.

          +
          + +
        • + + +
        • + + + #singular? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ if +U+, and hence +A+, is singular.

          +
          + +
        • + + +
        • + + + #solve(b) ⇒ Object + + + + + + + + + + + + + +

          Returns +m+ so that A*m = b, or equivalently so that L*U*m = P*b +b+ can be a Matrix or a Vector.

          +
          + +
        • + + +
        • + + + #to_ary ⇒ Object + + + + (also: #to_a) + + + + + + + + + + + +

          Returns +L+, +U+, +P+ in an array.

          +
          + +
        • + + +
        • + + + #u ⇒ Object + + + + + + + + + + + + + +

          Returns the upper triangular factor +U+.

          +
          + +
        • + + +
        + + + + + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(a) ⇒ LUPDecomposition + + + + + +

        +
        +

        Returns a new instance of LUPDecomposition.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +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
        +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
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 154
        +
        +def initialize a
        +  raise TypeError, "Expected Matrix but got #{a.class}" unless a.is_a?(Matrix)
        +  # Use a "left-looking", dot-product, Crout/Doolittle algorithm.
        +  @lu = a.to_a
        +  @row_count = a.row_count
        +  @column_count = a.column_count
        +  @pivots = Array.new(@row_count)
        +  @row_count.times do |i|
        +     @pivots[i] = i
        +  end
        +  @pivot_sign = 1
        +  lu_col_j = Array.new(@row_count)
        +
        +  # Outer loop.
        +
        +  @column_count.times do |j|
        +
        +    # Make a copy of the j-th column to localize references.
        +
        +    @row_count.times do |i|
        +      lu_col_j[i] = @lu[i][j]
        +    end
        +
        +    # Apply previous transformations.
        +
        +    @row_count.times do |i|
        +      lu_row_i = @lu[i]
        +
        +      # Most of the time is spent in the following dot product.
        +
        +      kmax = [i, j].min
        +      s = 0
        +      kmax.times do |k|
        +        s += lu_row_i[k]*lu_col_j[k]
        +      end
        +
        +      lu_row_i[j] = lu_col_j[i] -= s
        +    end
        +
        +    # Find pivot and exchange if necessary.
        +
        +    p = j
        +    (j+1).upto(@row_count-1) do |i|
        +      if (lu_col_j[i].abs > lu_col_j[p].abs)
        +        p = i
        +      end
        +    end
        +    if (p != j)
        +      @column_count.times do |k|
        +        t = @lu[p][k]; @lu[p][k] = @lu[j][k]; @lu[j][k] = t
        +      end
        +      k = @pivots[p]; @pivots[p] = @pivots[j]; @pivots[j] = k
        +      @pivot_sign = -@pivot_sign
        +    end
        +
        +    # Compute multipliers.
        +
        +    if (j < @row_count && @lu[j][j] != 0)
        +      (j+1).upto(@row_count-1) do |i|
        +        @lu[i][j] = @lu[i][j].quo(@lu[j][j])
        +      end
        +    end
        +  end
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #pivotsObject (readonly) + + + + + +

        +
        +

        Returns the pivoting indices

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +63
        +64
        +65
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 63
        +
        +def pivots
        +  @pivots
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #detObject + + + + Also known as: + determinant + + + + +

        +
        +

        Returns the determinant of +A+, calculated efficiently +from the factorization.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +79
        +80
        +81
        +82
        +83
        +84
        +85
        +86
        +87
        +88
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 79
        +
        +def det
        +  if (@row_count != @column_count)
        +    Matrix.Raise Matrix::ErrDimensionMismatch
        +  end
        +  d = @pivot_sign
        +  @column_count.times do |j|
        +    d *= @lu[j][j]
        +  end
        +  d
        +end
        +
        +
        + +
        +

        + + #lObject + + + + + +

        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +32
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 22
        +
        +def l
        +  Matrix.build(@row_count, [@column_count, @row_count].min) do |i, j|
        +    if (i > j)
        +      @lu[i][j]
        +    elsif (i == j)
        +      1
        +    else
        +      0
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #pObject + + + + + +

        +
        +

        Returns the permutation matrix +P+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +48
        +49
        +50
        +51
        +52
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 48
        +
        +def p
        +  rows = Array.new(@row_count){Array.new(@row_count, 0)}
        +  @pivots.each_with_index{|p, i| rows[i][p] = 1}
        +  Matrix.send :new, rows, @row_count
        +end
        +
        +
        + +
        +

        + + #singular?Boolean + + + + + +

        +
        +

        Returns +true+ if +U+, and hence +A+, is singular.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +67
        +68
        +69
        +70
        +71
        +72
        +73
        +74
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 67
        +
        +def singular?
        +  @column_count.times do |j|
        +    if (@lu[j][j] == 0)
        +      return true
        +    end
        +  end
        +  false
        +end
        +
        +
        + +
        +

        + + #solve(b) ⇒ Object + + + + + +

        +
        +

        Returns +m+ so that A*m = b, +or equivalently so that L*U*m = P*b ++b+ can be a Matrix or a Vector

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +136
        +137
        +138
        +139
        +140
        +141
        +142
        +143
        +144
        +145
        +146
        +147
        +148
        +149
        +150
        +151
        +152
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 95
        +
        +def solve b
        +  if (singular?)
        +    Matrix.Raise Matrix::ErrNotRegular, "Matrix is singular."
        +  end
        +  if b.is_a? Matrix
        +    if (b.row_count != @row_count)
        +      Matrix.Raise Matrix::ErrDimensionMismatch
        +    end
        +
        +    # Copy right hand side with pivoting
        +    nx = b.column_count
        +    m = @pivots.map{|row| b.row(row).to_a}
        +
        +    # Solve L*Y = P*b
        +    @column_count.times do |k|
        +      (k+1).upto(@column_count-1) do |i|
        +        nx.times do |j|
        +          m[i][j] -= m[k][j]*@lu[i][k]
        +        end
        +      end
        +    end
        +    # Solve U*m = Y
        +    (@column_count-1).downto(0) do |k|
        +      nx.times do |j|
        +        m[k][j] = m[k][j].quo(@lu[k][k])
        +      end
        +      k.times do |i|
        +        nx.times do |j|
        +          m[i][j] -= m[k][j]*@lu[i][k]
        +        end
        +      end
        +    end
        +    Matrix.send :new, m, nx
        +  else # same algorithm, specialized for simpler case of a vector
        +    b = convert_to_array(b)
        +    if (b.size != @row_count)
        +      Matrix.Raise Matrix::ErrDimensionMismatch
        +    end
        +
        +    # Copy right hand side with pivoting
        +    m = b.values_at(*@pivots)
        +
        +    # Solve L*Y = P*b
        +    @column_count.times do |k|
        +      (k+1).upto(@column_count-1) do |i|
        +        m[i] -= m[k]*@lu[i][k]
        +      end
        +    end
        +    # Solve U*m = Y
        +    (@column_count-1).downto(0) do |k|
        +      m[k] = m[k].quo(@lu[k][k])
        +      k.times do |i|
        +        m[i] -= m[k]*@lu[i][k]
        +      end
        +    end
        +    Vector.elements(m, false)
        +  end
        +end
        +
        +
        + +
        +

        + + #to_aryObject + + + + Also known as: + to_a + + + + +

        +
        +

        Returns +L+, +U+, +P+ in an array

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +56
        +57
        +58
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 56
        +
        +def to_ary
        +  [l, u, p]
        +end
        +
        +
        + +
        +

        + + #uObject + + + + + +

        +
        +

        Returns the upper triangular factor +U+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +36
        +37
        +38
        +39
        +40
        +41
        +42
        +43
        +44
        +
        +
        # File 'opal/stdlib/matrix/lup_decomposition.rb', line 36
        +
        +def u
        +  Matrix.build([@column_count, @row_count].min, @column_count) do |i, j|
        +    if (i <= j)
        +      @lu[i][j]
        +    else
        +      0
        +    end
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Matrix/Scalar.html b/docs/api/v1.8.2/stdlib/Matrix/Scalar.html new file mode 100644 index 00000000..7927af33 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Matrix/Scalar.html @@ -0,0 +1,622 @@ + + + + + + + Class: Matrix::Scalar + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Matrix::Scalar + + + +

        +
        + +
        +
        Inherits:
        +
        + Numeric + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        ExceptionForMatrix, CoercionHelper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix.rb
        +
        + +
        + +

        Overview

        +
        +

        Private CLASS

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants included + from Exception2MessageMapper

        +

        Exception2MessageMapper::E2MM

        + + + + + + +

        + Instance Method Summary + collapse +

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

        Methods included from CoercionHelper

        +

        coerce_to, coerce_to_int, coerce_to_matrix

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

        Methods included from Exception2MessageMapper

        +

        #Fail, Raise, #Raise, #bind, def_e2message, #def_e2message, #def_exception, def_exception, e2mm_message, extend_object, #fail

        + + + + + + + + + +

        Methods inherited from Numeric

        +

        #to_json, #to_n

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(value) ⇒ Scalar + + + + + +

        +
        +

        Returns a new instance of Scalar.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1579
        +1580
        +1581
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1579
        +
        +def initialize(value)
        +  @value = value
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +1606
        +1607
        +1608
        +1609
        +1610
        +1611
        +1612
        +1613
        +1614
        +1615
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1606
        +
        +def *(other)
        +  case other
        +  when Numeric
        +    Scalar.new(@value * other)
        +  when Vector, Matrix
        +    other.collect{|e| @value * e}
        +  else
        +    apply_through_coercion(other, __method__)
        +  end
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +1630
        +1631
        +1632
        +1633
        +1634
        +1635
        +1636
        +1637
        +1638
        +1639
        +1640
        +1641
        +1642
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1630
        +
        +def **(other)
        +  case other
        +  when Numeric
        +    Scalar.new(@value ** other)
        +  when Vector
        +    Scalar.Raise ErrOperationNotDefined, "**", @value.class, other.class
        +  when Matrix
        +    #other.powered_by(self)
        +    Scalar.Raise ErrOperationNotImplemented, "**", @value.class, other.class
        +  else
        +    apply_through_coercion(other, __method__)
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        ARITHMETIC

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1584
        +1585
        +1586
        +1587
        +1588
        +1589
        +1590
        +1591
        +1592
        +1593
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1584
        +
        +def +(other)
        +  case other
        +  when Numeric
        +    Scalar.new(@value + other)
        +  when Vector, Matrix
        +    Scalar.Raise ErrOperationNotDefined, "+", @value.class, other.class
        +  else
        +    apply_through_coercion(other, __method__)
        +  end
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +1595
        +1596
        +1597
        +1598
        +1599
        +1600
        +1601
        +1602
        +1603
        +1604
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1595
        +
        +def -(other)
        +  case other
        +  when Numeric
        +    Scalar.new(@value - other)
        +  when Vector, Matrix
        +    Scalar.Raise ErrOperationNotDefined, "-", @value.class, other.class
        +  else
        +    apply_through_coercion(other, __method__)
        +  end
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +1617
        +1618
        +1619
        +1620
        +1621
        +1622
        +1623
        +1624
        +1625
        +1626
        +1627
        +1628
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1617
        +
        +def /(other)
        +  case other
        +  when Numeric
        +    Scalar.new(@value / other)
        +  when Vector
        +    Scalar.Raise ErrOperationNotDefined, "/", @value.class, other.class
        +  when Matrix
        +    self * other.inverse
        +  else
        +    apply_through_coercion(other, __method__)
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Method.html b/docs/api/v1.8.2/stdlib/Method.html new file mode 100644 index 00000000..58e936fd --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Method.html @@ -0,0 +1,214 @@ + + + + + + + Class: Method + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Method + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/await.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #async?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +76
        +77
        +78
        +
        +
        # File 'opal/stdlib/await.rb', line 76
        +
        +def async?
        +  @method.async?
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Module.html b/docs/api/v1.8.2/stdlib/Module.html new file mode 100644 index 00000000..27d13684 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Module.html @@ -0,0 +1,217 @@ + + + + + + + Class: Module + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Module + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/ruby2_keywords.rb,
        + opal/stdlib/native.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        This file ended up in Opal as a port of: +https://github.com/ruby/ruby2_keywords/blob/master/lib/ruby2_keywords.rb

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

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #native_module ⇒ Object + + + + + + + + + + + + + +

          Exposes the current module as a property of the global object (e.g. window).

          +
          + +
        • + + +
        + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #native_moduleObject + + + + + +

        +
        +

        Exposes the current module as a property of +the global object (e.g. window).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +610
        +611
        +612
        +
        +
        # File 'opal/stdlib/native.rb', line 610
        +
        +def native_module
        +  `Opal.global[#{name}] = #{self}`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Mutex.html b/docs/api/v1.8.2/stdlib/Mutex.html new file mode 100644 index 00000000..a27ea806 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Mutex.html @@ -0,0 +1,643 @@ + + + + + + + Class: Mutex + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Mutex + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/thread.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initializeMutex + + + + + +

        +
        +

        Returns a new instance of Mutex.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +146
        +147
        +148
        +149
        +150
        +
        +
        # File 'opal/stdlib/thread.rb', line 146
        +
        +def initialize
        +  # We still keep the @locked state so any logic based on try_lock while
        +  # held yields reasonable results.
        +  @locked = false
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #lockObject + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        + + +
        + + + + +
        +
        +
        +
        +152
        +153
        +154
        +155
        +156
        +
        +
        # File 'opal/stdlib/thread.rb', line 152
        +
        +def lock
        +  raise ThreadError, 'Deadlock' if @locked
        +  @locked = true
        +  self
        +end
        +
        +
        + +
        +

        + + #locked?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +158
        +159
        +160
        +
        +
        # File 'opal/stdlib/thread.rb', line 158
        +
        +def locked?
        +  @locked
        +end
        +
        +
        + +
        +

        + + #owned?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +162
        +163
        +164
        +165
        +
        +
        # File 'opal/stdlib/thread.rb', line 162
        +
        +def owned?
        +  # Being the only "thread", we implicitly own any locked mutex.
        +  @locked
        +end
        +
        +
        + +
        +

        + + #synchronizeObject + + + + + +

        + + + + +
        +
        +
        +
        +182
        +183
        +184
        +185
        +186
        +187
        +188
        +189
        +
        +
        # File 'opal/stdlib/thread.rb', line 182
        +
        +def synchronize
        +  lock
        +  begin
        +    yield
        +  ensure
        +    unlock
        +  end
        +end
        +
        +
        + +
        +

        + + #try_lockObject + + + + + +

        + + + + +
        +
        +
        +
        +167
        +168
        +169
        +170
        +171
        +172
        +173
        +174
        +
        +
        # File 'opal/stdlib/thread.rb', line 167
        +
        +def try_lock
        +  if locked?
        +    false
        +  else
        +    lock
        +    true
        +  end
        +end
        +
        +
        + +
        +

        + + #unlockObject + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        + + +
        + + + + +
        +
        +
        +
        +176
        +177
        +178
        +179
        +180
        +
        +
        # File 'opal/stdlib/thread.rb', line 176
        +
        +def unlock
        +  raise ThreadError, 'Mutex not locked' unless @locked
        +  @locked = false
        +  self
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Nashorn.html b/docs/api/v1.8.2/stdlib/Nashorn.html new file mode 100644 index 00000000..e37fd4a3 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Nashorn.html @@ -0,0 +1,107 @@ + + + + + + + Module: Nashorn + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Nashorn + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/nashorn.rb
        +
        + +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Native.html b/docs/api/v1.8.2/stdlib/Native.html new file mode 100644 index 00000000..7b2c0768 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Native.html @@ -0,0 +1,666 @@ + + + + + + + Module: Native + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Native + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/native.rb
        +
        + +
        + +

        Overview

        +
        +

        Provides a complete set of tools to wrap native JavaScript +into nice Ruby objects.

        + +

        $$ and $global wrap Opal.global, which the Opal JS runtime +sets to the global this object.

        + + +
        +
        +
        + +
        +

        Examples:

        + + +
        
        +$$.document.querySelector('p').classList.add('blue')
        +# => adds "blue" class to <p>
        +
        +$$.location.href = 'https://google.com'
        +# => changes page location
        +
        +do_later = $$[:setTimeout] # Accessing the "setTimeout" property
        +do_later.call(->{ puts :hello}, 500)
        + +
        + + +

        Defined Under Namespace

        +

        + + + Modules: Helpers, Wrapper + + + + Classes: Array, Object + + +

        + + + + + + + + +

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .call(obj, key, *args, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/native.rb', line 61
        +
        +def self.call(obj, key, *args, &block)
        +  %x{
        +    var prop = #{obj}[#{key}];
        +
        +    if (prop instanceof Function) {
        +      var converted = new Array(args.length);
        +
        +      for (var i = 0, l = args.length; i < l; i++) {
        +        var item = args[i],
        +            conv = #{try_convert(`item`)};
        +
        +        converted[i] = conv === nil ? item : conv;
        +      }
        +
        +      if (block !== nil) {
        +        converted.push(block);
        +      }
        +
        +      return #{Native(`prop.apply(#{obj}, converted)`)};
        +    }
        +    else {
        +      return #{Native(`prop`)};
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + .convert(value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +57
        +58
        +59
        +
        +
        # File 'opal/stdlib/native.rb', line 47
        +
        +def self.convert(value)
        +  %x{
        +    if (#{native?(value)}) {
        +      return #{value};
        +    }
        +    else if (#{value.respond_to? :to_n}) {
        +      return #{value.to_n};
        +    }
        +    else {
        +      #{raise ArgumentError, "#{value.inspect} isn't native"};
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + .included(base) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +211
        +212
        +213
        +214
        +
        +
        # File 'opal/stdlib/native.rb', line 211
        +
        +def self.included(base)
        +  warn 'Including ::Native is deprecated. Please include Native::Wrapper instead.'
        +  base.include Wrapper
        +end
        +
        +
        + +
        +

        + + .is_a?(object, klass) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +
        +
        # File 'opal/stdlib/native.rb', line 22
        +
        +def self.is_a?(object, klass)
        +  %x{
        +    try {
        +      return #{object} instanceof #{try_convert(klass)};
        +    }
        +    catch (e) {
        +      return false;
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + .proc(&block) ⇒ Object + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (LocalJumpError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/native.rb', line 87
        +
        +def self.proc(&block)
        +  raise LocalJumpError, 'no block given' unless block
        +
        +  ::Kernel.proc { |*args|
        +    args.map! { |arg| Native(arg) }
        +    instance = Native(`this`)
        +
        +    %x{
        +      // if global is current scope, run the block in the scope it was defined
        +      if (this === Opal.global) {
        +        return block.apply(self, #{args});
        +      }
        +
        +      var self_ = block.$$s;
        +      block.$$s = null;
        +
        +      try {
        +        return block.apply(#{instance}, #{args});
        +      }
        +      finally {
        +        block.$$s = self_;
        +      }
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + .try_convert(value, default = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +33
        +34
        +35
        +36
        +37
        +38
        +39
        +40
        +41
        +42
        +43
        +44
        +45
        +
        +
        # File 'opal/stdlib/native.rb', line 33
        +
        +def self.try_convert(value, default = nil)
        +  %x{
        +    if (#{native?(value)}) {
        +      return #{value};
        +    }
        +    else if (#{value.respond_to? :to_n}) {
        +      return #{value.to_n};
        +    }
        +    else {
        +      return #{default};
        +    }
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Native/Array.html b/docs/api/v1.8.2/stdlib/Native/Array.html new file mode 100644 index 00000000..baa30359 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Native/Array.html @@ -0,0 +1,642 @@ + + + + + + + Class: Native::Array + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Native::Array + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Enumerable, Wrapper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/native.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

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

        Methods included from Enumerable

        +

        #each_async, #to_json

        + + + + + + + + + +

        Methods included from Wrapper

        +

        included, #to_n

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(native, options = {}, &block) ⇒ Array + + + + + +

        +
        +

        Returns a new instance of Array.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +369
        +370
        +371
        +372
        +373
        +374
        +375
        +376
        +377
        +378
        +379
        +380
        +381
        +
        +
        # File 'opal/stdlib/native.rb', line 369
        +
        +def initialize(native, options = {}, &block)
        +  super(native)
        +
        +  @get    = options[:get] || options[:access]
        +  @named  = options[:named]
        +  @set    = options[:set] || options[:access]
        +  @length = options[:length] || :length
        +  @block  = block
        +
        +  if `#{length} == null`
        +    raise ArgumentError, 'no length found on the array-like object'
        +  end
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #[](index) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +395
        +396
        +397
        +398
        +399
        +400
        +401
        +402
        +403
        +404
        +405
        +406
        +407
        +408
        +409
        +410
        +
        +
        # File 'opal/stdlib/native.rb', line 395
        +
        +def [](index)
        +  result = case index
        +           when String, Symbol
        +             @named ? `#{@native}[#{@named}](#{index})` : `#{@native}[#{index}]`
        +           when Integer
        +             @get ? `#{@native}[#{@get}](#{index})` : `#{@native}[#{index}]`
        +           end
        +
        +  if result
        +    if @block
        +      @block.call(result)
        +    else
        +      Native(result)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #[]=(index, value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +412
        +413
        +414
        +415
        +416
        +417
        +418
        +
        +
        # File 'opal/stdlib/native.rb', line 412
        +
        +def []=(index, value)
        +  if @set
        +    `#{@native}[#{@set}](#{index}, #{Native.convert(value)})`
        +  else
        +    `#{@native}[#{index}] = #{Native.convert(value)}`
        +  end
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +383
        +384
        +385
        +386
        +387
        +388
        +389
        +390
        +391
        +392
        +393
        +
        +
        # File 'opal/stdlib/native.rb', line 383
        +
        +def each(&block)
        +  return enum_for :each unless block
        +
        +  %x{
        +    for (var i = 0, length = #{length}; i < length; i++) {
        +      Opal.yield1(block, #{self[`i`]});
        +    }
        +  }
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #inspectObject + + + + + +

        + + + + +
        +
        +
        +
        +440
        +441
        +442
        +
        +
        # File 'opal/stdlib/native.rb', line 440
        +
        +def inspect
        +  to_a.inspect
        +end
        +
        +
        + +
        +

        + + #last(count = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +420
        +421
        +422
        +423
        +424
        +425
        +426
        +427
        +428
        +429
        +430
        +431
        +432
        +433
        +434
        +
        +
        # File 'opal/stdlib/native.rb', line 420
        +
        +def last(count = nil)
        +  if count
        +    index  = length - 1
        +    result = []
        +
        +    while index >= 0
        +      result << self[index]
        +      index  -= 1
        +    end
        +
        +    result
        +  else
        +    self[length - 1]
        +  end
        +end
        +
        +
        + +
        +

        + + #lengthObject + + + + + +

        + + + + +
        +
        +
        +
        +436
        +437
        +438
        +
        +
        # File 'opal/stdlib/native.rb', line 436
        +
        +def length
        +  `#{@native}[#{@length}]`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Native/Helpers.html b/docs/api/v1.8.2/stdlib/Native/Helpers.html new file mode 100644 index 00000000..f4877dc4 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Native/Helpers.html @@ -0,0 +1,476 @@ + + + + + + + Module: Native::Helpers + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Native::Helpers + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/native.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #alias_native(new, old = new, as: nil) ⇒ Object + + + + + +

        +
        +

        Exposes a native JavaScript method to Ruby

        + + +
        +
        +
        + +
        +

        Examples:

        + + +
        
        +class Element
        +  extend Native::Helpers
        +
        +  alias_native :add_class, :addClass
        +  alias_native :show
        +  alias_native :hide
        +
        +  def initialize(selector)
        +    @native = `$(#{selector})`
        +  end
        +end
        +
        +titles = Element.new('h1')
        +titles.add_class :foo
        +titles.hide
        +titles.show
        + +
        +

        Parameters:

        +
          + +
        • + + new + + + (String) + + + + — +

          The name of the newly created method.

          +
          + +
        • + +
        • + + old + + + (String) + + + (defaults to: new) + + + — +

          The name of the native JavaScript method to be exposed. +If the name ends with "=" (e.g. foo=) it will be interpreted as +a property setter. (default: the value of "new")

          +
          + +
        • + +
        • + + as + + + (Class) + + + (defaults to: nil) + + + — +

          If provided the values returned by the original method will be +returned as instances of the passed class. The class passed to "as" +is expected to accept a native JavaScript value.

          +
          + +
        • + +
        + + +
        + + + + +
        +
        +
        +
        +149
        +150
        +151
        +152
        +153
        +154
        +155
        +156
        +157
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +
        +
        # File 'opal/stdlib/native.rb', line 149
        +
        +def alias_native(new, old = new, as: nil)
        +  if old.end_with? '='
        +    define_method new do |value|
        +      `#{@native}[#{old[0..-2]}] = #{Native.convert(value)}`
        +
        +      value
        +    end
        +  elsif as
        +    define_method new do |*args, &block|
        +      value = Native.call(@native, old, *args, &block)
        +      if value
        +        as.new(value.to_n)
        +      end
        +    end
        +  else
        +    define_method new do |*args, &block|
        +      Native.call(@native, old, *args, &block)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #native_accessor(*names) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +186
        +187
        +188
        +189
        +
        +
        # File 'opal/stdlib/native.rb', line 186
        +
        +def native_accessor(*names)
        +  native_reader(*names)
        +  native_writer(*names)
        +end
        +
        +
        + +
        +

        + + #native_reader(*names) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +170
        +171
        +172
        +173
        +174
        +175
        +176
        +
        +
        # File 'opal/stdlib/native.rb', line 170
        +
        +def native_reader(*names)
        +  names.each do |name|
        +    define_method name do
        +      Native(`#{@native}[name]`)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #native_writer(*names) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +178
        +179
        +180
        +181
        +182
        +183
        +184
        +
        +
        # File 'opal/stdlib/native.rb', line 178
        +
        +def native_writer(*names)
        +  names.each do |name|
        +    define_method "#{name}=" do |value|
        +      Native(`#{@native}[name] = value`)
        +    end
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Native/Object.html b/docs/api/v1.8.2/stdlib/Native/Object.html new file mode 100644 index 00000000..169df71d --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Native/Object.html @@ -0,0 +1,1160 @@ + + + + + + + Class: Native::Object + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Native::Object + + + +

        +
        + +
        +
        Inherits:
        +
        + BasicObject + +
        +
        + + + + + + +
        +
        Includes:
        +
        Wrapper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/native.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

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

        Methods included from Wrapper

        +

        included, #initialize, #to_n

        +
        +

        Dynamic Method Handling

        +

        + This class handles dynamic methods through the method_missing method + +

        + +
        +

        + + #method_missing(mid, *args, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +324
        +325
        +326
        +327
        +328
        +329
        +330
        +331
        +332
        +333
        +
        +
        # File 'opal/stdlib/native.rb', line 324
        +
        +def method_missing(mid, *args, &block)
        +  %x{
        +    if (mid.charAt(mid.length - 1) === '=') {
        +      return #{self[mid.slice(0, mid.length - 1)] = args[0]};
        +    }
        +    else {
        +      return #{::Native.call(@native, mid, *args, &block)};
        +    }
        +  }
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +259
        +260
        +261
        +
        +
        # File 'opal/stdlib/native.rb', line 259
        +
        +def ==(other)
        +  `#{@native} === #{::Native.try_convert(other)}`
        +end
        +
        +
        + +
        +

        + + #[](key) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +281
        +282
        +283
        +284
        +285
        +286
        +287
        +288
        +289
        +290
        +291
        +292
        +
        +
        # File 'opal/stdlib/native.rb', line 281
        +
        +def [](key)
        +  %x{
        +    var prop = #{@native}[key];
        +
        +    if (prop instanceof Function) {
        +      return prop;
        +    }
        +    else {
        +      return #{::Native.call(@native, key)}
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #[]=(key, value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +294
        +295
        +296
        +297
        +298
        +299
        +300
        +301
        +302
        +
        +
        # File 'opal/stdlib/native.rb', line 294
        +
        +def []=(key, value)
        +  native = ::Native.try_convert(value)
        +
        +  if `#{native} === nil`
        +    `#{@native}[key] = #{value}`
        +  else
        +    `#{@native}[key] = #{native}`
        +  end
        +end
        +
        +
        + +
        +

        + + #classObject + + + + + +

        + + + + +
        +
        +
        +
        +347
        +348
        +349
        +
        +
        # File 'opal/stdlib/native.rb', line 347
        +
        +def class
        +  `self.$$class`
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +267
        +268
        +269
        +270
        +271
        +272
        +273
        +274
        +275
        +276
        +277
        +278
        +279
        +
        +
        # File 'opal/stdlib/native.rb', line 267
        +
        +def each(*args)
        +  if block_given?
        +    %x{
        +      for (var key in #{@native}) {
        +        #{yield `key`, `#{@native}[key]`}
        +      }
        +    }
        +
        +    self
        +  else
        +    method_missing(:each, *args)
        +  end
        +end
        +
        +
        + +
        +

        + + #has_key?(name) ⇒ Boolean + + + + Also known as: + include?, key?, member? + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +263
        +264
        +265
        +
        +
        # File 'opal/stdlib/native.rb', line 263
        +
        +def has_key?(name)
        +  `Opal.hasOwnProperty.call(#{@native}, #{name})`
        +end
        +
        +
        + +
        +

        + + #inspectObject + + + + + +

        + + + + +
        +
        +
        +
        +355
        +356
        +357
        +
        +
        # File 'opal/stdlib/native.rb', line 355
        +
        +def inspect
        +  "#<Native:#{`String(#{@native})`}>"
        +end
        +
        +
        + +
        +

        + + #instance_of?(klass) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +343
        +344
        +345
        +
        +
        # File 'opal/stdlib/native.rb', line 343
        +
        +def instance_of?(klass)
        +  `self.$$class === klass`
        +end
        +
        +
        + +
        +

        + + #is_a?(klass) ⇒ Boolean + + + + Also known as: + kind_of? + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +339
        +340
        +341
        +
        +
        # File 'opal/stdlib/native.rb', line 339
        +
        +def is_a?(klass)
        +  `Opal.is_a(self, klass)`
        +end
        +
        +
        + +
        +

        + + #merge!(other) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +304
        +305
        +306
        +307
        +308
        +309
        +310
        +311
        +312
        +313
        +314
        +
        +
        # File 'opal/stdlib/native.rb', line 304
        +
        +def merge!(other)
        +  %x{
        +    other = #{::Native.convert(other)};
        +
        +    for (var prop in other) {
        +      #{@native}[prop] = other[prop];
        +    }
        +  }
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #nil?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +335
        +336
        +337
        +
        +
        # File 'opal/stdlib/native.rb', line 335
        +
        +def nil?
        +  false
        +end
        +
        +
        + +
        +

        + + #respond_to?(name, include_all = false) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +316
        +317
        +318
        +
        +
        # File 'opal/stdlib/native.rb', line 316
        +
        +def respond_to?(name, include_all = false)
        +  ::Kernel.instance_method(:respond_to?).bind(self).call(name, include_all)
        +end
        +
        +
        + +
        +

        + + #respond_to_missing?(name, include_all = false) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +320
        +321
        +322
        +
        +
        # File 'opal/stdlib/native.rb', line 320
        +
        +def respond_to_missing?(name, include_all = false)
        +  `Opal.hasOwnProperty.call(#{@native}, #{name})`
        +end
        +
        +
        + +
        +

        + + #to_a(options = {}, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +351
        +352
        +353
        +
        +
        # File 'opal/stdlib/native.rb', line 351
        +
        +def to_a(options = {}, &block)
        +  ::Native::Array.new(@native, options, &block).to_a
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Native/Wrapper.html b/docs/api/v1.8.2/stdlib/Native/Wrapper.html new file mode 100644 index 00000000..b1dc5a16 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Native/Wrapper.html @@ -0,0 +1,319 @@ + + + + + + + Module: Native::Wrapper + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Native::Wrapper + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        Buffer, Buffer::Array, Buffer::View, Console, Array, Object
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/native.rb
        +
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .included(klass) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +206
        +207
        +208
        +
        +
        # File 'opal/stdlib/native.rb', line 206
        +
        +def self.included(klass)
        +  klass.extend Helpers
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #initialize(native) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +193
        +194
        +195
        +196
        +197
        +198
        +199
        +
        +
        # File 'opal/stdlib/native.rb', line 193
        +
        +def initialize(native)
        +  unless ::Kernel.native?(native)
        +    ::Kernel.raise ArgumentError, "#{native.inspect} isn't native"
        +  end
        +
        +  @native = native
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Returns the internal native JavaScript value

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +202
        +203
        +204
        +
        +
        # File 'opal/stdlib/native.rb', line 202
        +
        +def to_n
        +  @native
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/NilClass.html b/docs/api/v1.8.2/stdlib/NilClass.html new file mode 100644 index 00000000..270593ac --- /dev/null +++ b/docs/api/v1.8.2/stdlib/NilClass.html @@ -0,0 +1,346 @@ + + + + + + + Class: NilClass + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: NilClass + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/json.rb,
        + opal/stdlib/native.rb,
        opal/stdlib/bigdecimal/util.rb
        +
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #to_d ⇒ Object + + + + + + + + + + + + + +

          call-seq: nil.to_d -> bigdecimal.

          +
          + +
        • + + +
        • + + + #to_json ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #to_n ⇒ Object + + + + + + + + + + + + + +

          The corresponding JavaScript value (null).

          +
          + +
        • + + +
        + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_dObject + + + + + +

        +
        +

        call-seq: + nil.to_d -> bigdecimal

        + +

        Returns nil represented as a BigDecimal.

        + +
        require 'bigdecimal'
        +require 'bigdecimal/util'
        +
        +nil.to_d   # => 0.0
        +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +146
        +147
        +148
        +
        +
        # File 'opal/stdlib/bigdecimal/util.rb', line 146
        +
        +def to_d
        +  BigDecimal(0)
        +end
        +
        +
        + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +171
        +172
        +173
        +
        +
        # File 'opal/stdlib/json.rb', line 171
        +
        +def to_json
        +  'null'
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Returns the corresponding JavaScript value (null).

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          the corresponding JavaScript value (null).

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +529
        +530
        +531
        +
        +
        # File 'opal/stdlib/native.rb', line 529
        +
        +def to_n
        +  `null`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/NodeJS.html b/docs/api/v1.8.2/stdlib/NodeJS.html new file mode 100644 index 00000000..a8e52fa5 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/NodeJS.html @@ -0,0 +1,133 @@ + + + + + + + Module: NodeJS + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: NodeJS + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/nodejs/base.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +
        + +

        + Constant Summary + collapse +

        + +
        + +
        VERSION = + +
        +
        `process.version`
        + +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Numeric.html b/docs/api/v1.8.2/stdlib/Numeric.html new file mode 100644 index 00000000..169da650 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Numeric.html @@ -0,0 +1,278 @@ + + + + + + + Class: Numeric + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Numeric + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/json.rb,
        + opal/stdlib/native.rb
        +
        +
        + +
        + +
        +

        Direct Known Subclasses

        +

        BigDecimal, Date::Infinity, Float, Integer, Matrix::Scalar, Rational

        +
        + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +177
        +178
        +179
        +
        +
        # File 'opal/stdlib/json.rb', line 177
        +
        +def to_json
        +  `self.toString()`
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Returns the internal JavaScript value (with valueOf).

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          the internal JavaScript value (with valueOf).

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +449
        +450
        +451
        +
        +
        # File 'opal/stdlib/native.rb', line 449
        +
        +def to_n
        +  `self.valueOf()`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Object.html b/docs/api/v1.8.2/stdlib/Object.html new file mode 100644 index 00000000..bcc7a6f9 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Object.html @@ -0,0 +1,245 @@ + + + + + + + Class: Object + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Object + + + +

        +
        + +
        +
        Inherits:
        +
        + BasicObject + +
        +
        + + + + + + +
        +
        Includes:
        +
        PP::ObjectMixin
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb,
        + opal/stdlib/json.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        Opal: does not have RubyVM +class RubyVM::AbstractSyntaxTree::Node + def pretty_print_children(q, names = []) + children.zip(names) do |c, n| + if n + q.breakable + q.text "#n:" + end + q.group(2) do + q.breakable + q.pp c + end + end + end

        + +

        def pretty_print(q) + q.group(1, "(#type@#first_lineno:#first_column-#last_lineno:#last_column", ")") { + case type + when :SCOPE + pretty_print_children(q, %w"tbl args body") + when :ARGS + pretty_print_children(q, %w[pre_num pre_init opt first_post post_num post_init rest kw kwrest block]) + when :DEFN + pretty_print_children(q, %w[mid body]) + when :ARYPTN + pretty_print_children(q, %w[const pre rest post]) + when :HSHPTN + pretty_print_children(q, %w[const kw kwrest]) + else + pretty_print_children(q) + end + } + end +end

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

        + Instance Method Summary + collapse +

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

        Methods included from PP::ObjectMixin

        +

        #pretty_print, #pretty_print_cycle, #pretty_print_inspect, #pretty_print_instance_variables

        + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +122
        +123
        +124
        +
        +
        # File 'opal/stdlib/json.rb', line 122
        +
        +def to_json
        +  to_s.to_json
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Observable.html b/docs/api/v1.8.2/stdlib/Observable.html new file mode 100644 index 00000000..f3171c6f --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Observable.html @@ -0,0 +1,759 @@ + + + + + + + Module: Observable + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Observable + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/observer.rb
        +
        + +
        + +

        Overview

        +
        +

        The Observer pattern (also known as publish/subscribe) provides a simple +mechanism for one object to inform a set of interested third-party objects +when its state changes.

        + +

        == Mechanism

        + +

        The notifying class mixes in the +Observable+ +module, which provides the methods for managing the associated observer +objects.

        + +

        The observers must implement a method called +update+ to receive +notifications.

        + +

        The observable object must:

        + +
          +
        • assert that it has +#changed+
        • +
        • call +#notify_observers+
        • +
        + +

        === Example

        + +

        The following example demonstrates this nicely. A +Ticker+, when run, +continually receives the stock +Price+ for its @symbol. A +Warner+ +is a general observer of the price, and two warners are demonstrated, a ++WarnLow+ and a +WarnHigh+, which print a warning if the price is below or +above their set limits, respectively.

        + +

        The +update+ callback allows the warners to run without being explicitly +called. The system is set up with the +Ticker+ and several observers, and the +observers do their duty without the top-level code having to interfere.

        + +

        Note that the contract between publisher and subscriber (observable and +observer) is not declared or enforced. The +Ticker+ publishes a time and a +price, and the warners receive that. But if you don't ensure that your +contracts are correct, nothing else can warn you.

        + +

        require "observer"

        + +

        class Ticker ### Periodically fetch a stock price. + include Observable

        + +
        def initialize(symbol)
        +  @symbol = symbol
        +end
        +
        +def run
        +  lastPrice = nil
        +  loop do
        +    price = Price.fetch(@symbol)
        +    print "Current price: #{price}\n"
        +    if price != lastPrice
        +      changed                 # notify observers
        +      lastPrice = price
        +      notify_observers(Time.now, price)
        +    end
        +    sleep 1
        +  end
        +end
        +
        + +

        end

        + +

        class Price ### A mock class to fetch a stock price (60 - 140). + def Price.fetch(symbol) + 60 + rand(80) + end + end

        + +

        class Warner ### An abstract observer of Ticker objects. + def initialize(ticker, limit) + @limit = limit + ticker.add_observer(self) + end + end

        + +

        class WarnLow < Warner + def update(time, price) # callback for observer + if price < @limit + print "--- #timetime.to_s: Price below #@limit: #price\n" + end + end + end

        + +

        class WarnHigh < Warner + def update(time, price) # callback for observer + if price > @limit + print "+++ #timetime.to_s: Price above #@limit: #price\n" + end + end + end

        + +

        ticker = Ticker.new("MSFT") + WarnLow.new(ticker, 80) + WarnHigh.new(ticker, 120) + ticker.run

        + +

        Produces:

        + +

        Current price: 83 + Current price: 75 + --- Sun Jun 09 00:10:25 CDT 2002: Price below 80: 75 + Current price: 90 + Current price: 134 + +++ Sun Jun 09 00:10:25 CDT 2002: Price above 120: 134 + Current price: 134 + Current price: 112 + Current price: 79 + --- Sun Jun 09 00:10:25 CDT 2002: Price below 80: 79

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #add_observer(observer, func = :update) ⇒ Object + + + + + +

        +
        +

        Add +observer+ as an observer on this object. so that it will receive +notifications.

        + +

        +observer+:: the object that will be notified of changes. ++func+:: Symbol naming the method that will be called when this Observable + has changes.

        + +
             This method must return true for +observer.respond_to?+ and will
        +     receive <tt>*arg</tt> when #notify_observers is called, where
        +     <tt>*arg</tt> is the value passed to #notify_observers by this
        +     Observable
        +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +126
        +127
        +128
        +129
        +130
        +131
        +132
        +
        +
        # File 'opal/stdlib/observer.rb', line 126
        +
        +def add_observer(observer, func=:update)
        +  @observer_peers = {} unless defined? @observer_peers
        +  unless observer.respond_to? func
        +    raise NoMethodError.new("observer does not respond to `#{func.to_s}'", func.to_s)
        +  end
        +  @observer_peers[observer] = func
        +end
        +
        +
        + +
        +

        + + #changed(state = true) ⇒ Object + + + + + +

        +
        +

        Set the changed state of this object. Notifications will be sent only if +the changed +state+ is +true+.

        + +

        +state+:: Boolean indicating the changed state of this Observable.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +167
        +168
        +169
        +
        +
        # File 'opal/stdlib/observer.rb', line 167
        +
        +def changed(state=true)
        +  @observer_state = state
        +end
        +
        +
        + +
        +

        + + #changed?Boolean + + + + + +

        +
        +

        Returns true if this object's state has been changed since the last

        + +

        notify_observers call.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +175
        +176
        +177
        +178
        +179
        +180
        +181
        +
        +
        # File 'opal/stdlib/observer.rb', line 175
        +
        +def changed?
        +  if defined? @observer_state and @observer_state
        +    true
        +  else
        +    false
        +  end
        +end
        +
        +
        + +
        +

        + + #count_observersObject + + + + + +

        +
        +

        Return the number of observers associated with this object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +153
        +154
        +155
        +156
        +157
        +158
        +159
        +
        +
        # File 'opal/stdlib/observer.rb', line 153
        +
        +def count_observers
        +  if defined? @observer_peers
        +    @observer_peers.size
        +  else
        +    0
        +  end
        +end
        +
        +
        + +
        +

        + + #delete_observer(observer) ⇒ Object + + + + + +

        +
        +

        Remove +observer+ as an observer on this object so that it will no longer +receive notifications.

        + +

        +observer+:: An observer of this Observable

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +139
        +140
        +141
        +
        +
        # File 'opal/stdlib/observer.rb', line 139
        +
        +def delete_observer(observer)
        +  @observer_peers.delete observer if defined? @observer_peers
        +end
        +
        +
        + +
        +

        + + #delete_observersObject + + + + + +

        +
        +

        Remove all observers associated with this object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +146
        +147
        +148
        +
        +
        # File 'opal/stdlib/observer.rb', line 146
        +
        +def delete_observers
        +  @observer_peers.clear if defined? @observer_peers
        +end
        +
        +
        + +
        +

        + + #notify_observers(*arg) ⇒ Object + + + + + +

        +
        +

        Notify observers of a change in state if this object's changed state is ++true+.

        + +

        This will invoke the method named in #add_observer, passing *arg. +The changed state is then set to +false+.

        + +

        *arg:: Any arguments to pass to the observers.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +191
        +192
        +193
        +194
        +195
        +196
        +197
        +198
        +199
        +200
        +
        +
        # File 'opal/stdlib/observer.rb', line 191
        +
        +def notify_observers(*arg)
        +  if defined? @observer_state and @observer_state
        +    if defined? @observer_peers
        +      @observer_peers.each do |k, v|
        +        k.send v, *arg
        +      end
        +    end
        +    @observer_state = false
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OpenStruct.html b/docs/api/v1.8.2/stdlib/OpenStruct.html new file mode 100644 index 00000000..d170f0bd --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OpenStruct.html @@ -0,0 +1,1223 @@ + + + + + + + Class: OpenStruct + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OpenStruct + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/ostruct.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #table ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute table.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(hash = nil) ⇒ OpenStruct + + + + + +

        +
        +

        Returns a new instance of OpenStruct.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +4
        +5
        +6
        +7
        +8
        +9
        +10
        +11
        +12
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 4
        +
        +def initialize(hash = nil)
        +  @table = {}
        +
        +  if hash
        +    hash.each_pair do |key, value|
        +      @table[new_ostruct_member(key)] = value
        +    end
        +  end
        +end
        +
        +
        + +
        +
        +

        Dynamic Method Handling

        +

        + This class handles dynamic methods through the method_missing method + +

        + +
        +

        + + #method_missing(name, *args) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +32
        +33
        +34
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 22
        +
        +def method_missing(name, *args)
        +  if args.length > 2
        +    raise NoMethodError.new("undefined method `#{name}' for #<OpenStruct>", name)
        +  end
        +  if name.end_with? '='
        +    if args.length != 1
        +      raise ArgumentError, 'wrong number of arguments (0 for 1)'
        +    end
        +    @table[new_ostruct_member(name[0..-2])] = args[0]
        +  else
        +    @table[name.to_sym]
        +  end
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #tableObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute table.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +79
        +80
        +81
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 79
        +
        +def table
        +  @table
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +49
        +50
        +51
        +52
        +53
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 49
        +
        +def ==(other)
        +  return false unless other.is_a?(OpenStruct)
        +
        +  @table == other.instance_variable_get(:@table)
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +55
        +56
        +57
        +58
        +59
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 55
        +
        +def ===(other)
        +  return false unless other.is_a?(OpenStruct)
        +
        +  @table === other.instance_variable_get(:@table)
        +end
        +
        +
        + +
        +

        + + #[](name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 14
        +
        +def [](name)
        +  @table[name.to_sym]
        +end
        +
        +
        + +
        +

        + + #[]=(name, value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +18
        +19
        +20
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 18
        +
        +def []=(name, value)
        +  @table[new_ostruct_member(name)] = value
        +end
        +
        +
        + +
        +

        + + #delete_field(name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +81
        +82
        +83
        +84
        +85
        +86
        +87
        +88
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 81
        +
        +def delete_field(name)
        +  sym = name.to_sym
        +  begin
        +    singleton_class.__send__(:remove_method, sym, "#{sym}=")
        +  rescue NameError
        +  end
        +  @table.delete sym
        +end
        +
        +
        + +
        +

        + + #each_pairObject + + + + + +

        + + + + +
        +
        +
        +
        +41
        +42
        +43
        +44
        +45
        +46
        +47
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 41
        +
        +def each_pair
        +  return enum_for :each_pair unless block_given?
        +
        +  @table.each_pair do |pair|
        +    yield pair
        +  end
        +end
        +
        +
        + +
        +

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

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +61
        +62
        +63
        +64
        +65
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 61
        +
        +def eql?(other)
        +  return false unless other.is_a?(OpenStruct)
        +
        +  @table.eql? other.instance_variable_get(:@table)
        +end
        +
        +
        + +
        +

        + + #hashObject + + + + + +

        + + + + +
        +
        +
        +
        +75
        +76
        +77
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 75
        +
        +def hash
        +  @table.hash
        +end
        +
        +
        + +
        +

        + + #inspectObject + + + + Also known as: + to_s + + + + +

        + + + + +
        +
        +
        +
        +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 'opal/stdlib/ostruct.rb', line 101
        +
        +def inspect
        +  %x{
        +    var top = (ostruct_ids === undefined),
        +        ostruct_id = #{__id__};
        +  }
        +  begin
        +    result = "#<#{self.class}"
        +    %x{
        +      if (top) {
        +        ostruct_ids = {};
        +      }
        +      if (ostruct_ids.hasOwnProperty(ostruct_id)) {
        +        return result + ' ...>';
        +      }
        +      ostruct_ids[ostruct_id] = true;
        +    }
        +
        +    result += ' ' if @table.any?
        +
        +    result += each_pair.map do |name, value|
        +      "#{name}=#{value.inspect}"
        +    end.join ', '
        +
        +    result += '>'
        +
        +    result
        +  ensure
        +    %x{
        +      if (top) {
        +        ostruct_ids = undefined;
        +      }
        +    }
        +  end
        +end
        +
        +
        + +
        +

        + + #new_ostruct_member(name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +90
        +91
        +92
        +93
        +94
        +95
        +96
        +97
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 90
        +
        +def new_ostruct_member(name)
        +  name = name.to_sym
        +  unless respond_to?(name)
        +    define_singleton_method(name) { @table[name] }
        +    define_singleton_method("#{name}=") { |x| @table[name] = x }
        +  end
        +  name
        +end
        +
        +
        + +
        +

        + + #respond_to_missing?(mid, include_private = false) ⇒ Boolean + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +36
        +37
        +38
        +39
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 36
        +
        +def respond_to_missing?(mid, include_private = false) # :nodoc:
        +  mname = mid.to_s.chomp('=').to_sym
        +  @table&.key?(mname) || super
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +67
        +68
        +69
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 67
        +
        +def to_h(&block)
        +  block_given? ? @table.to_h(&block) : @table.dup
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        + + + + +
        +
        +
        +
        +71
        +72
        +73
        +
        +
        # File 'opal/stdlib/ostruct.rb', line 71
        +
        +def to_n
        +  @table.to_n
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OpenURI.html b/docs/api/v1.8.2/stdlib/OpenURI.html new file mode 100644 index 00000000..620d7878 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OpenURI.html @@ -0,0 +1,584 @@ + + + + + + + Module: OpenURI + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: OpenURI + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/open-uri.rb,
        + opal/stdlib/nodejs/open-uri.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + Modules: Meta, OpenRead + + + + Classes: Buffer, HTTPError + + +

        + + + + + + + + +

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .build_response(req, status, status_text) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +133
        +134
        +135
        +136
        +137
        +138
        +139
        +140
        +141
        +142
        +143
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 133
        +
        +def self.build_response(req, status, status_text)
        +  buf = Buffer.new
        +  buf << data(req).pack('c*')
        +  io = buf.io
        +  #io.base_uri = uri # TODO: Generate a URI object from the uri String
        +  io.status = "#{status} #{status_text}"
        +  io.meta_add_field('content-type', `req.getResponseHeader("Content-Type") || ''`)
        +  last_modified = `req.getResponseHeader("Last-Modified")`
        +  io.meta_add_field('last-modified', last_modified) if last_modified
        +  io
        +end
        +
        +
        + +
        +

        + + .close_io(io) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +113
        +114
        +115
        +116
        +117
        +118
        +119
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 113
        +
        +def self.close_io(io)
        +  if io.respond_to? :close!
        +    io.close! # Tempfile
        +  else
        +    io.close unless io.closed?
        +  end
        +end
        +
        +
        + +
        +

        + + .data(req) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +145
        +146
        +147
        +148
        +149
        +150
        +151
        +152
        +153
        +154
        +155
        +156
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 145
        +
        +def self.data(req)
        +  %x{
        +    var binStr = req.responseText;
        +    var byteArray = [];
        +    for (var i = 0, len = binStr.length; i < len; ++i) {
        +      var c = binStr.charCodeAt(i);
        +      var byteCode = c & 0xff; // byte at offset i
        +      byteArray.push(byteCode);
        +    }
        +    return byteArray;
        +  }
        +end
        +
        +
        + +
        +

        + + .open_loop(uri, options) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +121
        +122
        +123
        +124
        +125
        +126
        +127
        +128
        +129
        +130
        +131
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 121
        +
        +def self.open_loop(uri, options) # :nodoc:
        +  req = request(uri)
        +  data = `req.responseText`
        +  status = `req.status`
        +  status_text = `req.statusText && req.statusText.errno ? req.statusText.errno : req.statusText`
        +  if status == 200 || (status == 0 && data)
        +    build_response(req, status, status_text)
        +  else
        +    raise OpenURI::HTTPError.new("#{status} #{status_text}", '')
        +  end
        +end
        +
        +
        + +
        +

        + + .open_uri(name, *rest) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +99
        +100
        +101
        +102
        +103
        +104
        +105
        +106
        +107
        +108
        +109
        +110
        +111
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 99
        +
        +def self.open_uri(name, *rest) # :nodoc:
        +  io = open_loop(name, {})
        +  io.rewind
        +  if block_given?
        +    begin
        +      yield io
        +    ensure
        +      close_io(io)
        +    end
        +  else
        +    io
        +  end
        +end
        +
        +
        + +
        +

        + + .request(uri) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +169
        +170
        +171
        +172
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 158
        +
        +def self.request(uri)
        +  %x{
        +    try {
        +      var xhr = new XMLHttpRequest();
        +      xhr.open('GET', uri, false);
        +      // We cannot use xhr.responseType = "arraybuffer" because XMLHttpRequest is used in synchronous mode.
        +      // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType#Synchronous_XHR_restrictions
        +      xhr.overrideMimeType('text/plain; charset=x-user-defined');
        +      xhr.send();
        +      return xhr;
        +    } catch (error) {
        +      #{raise OpenURI::HTTPError.new(`error.message`, '')}
        +    }
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OpenURI/Buffer.html b/docs/api/v1.8.2/stdlib/OpenURI/Buffer.html new file mode 100644 index 00000000..d3725142 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OpenURI/Buffer.html @@ -0,0 +1,409 @@ + + + + + + + Class: OpenURI::Buffer + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OpenURI::Buffer + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/open-uri.rb
        +
        + +
        + +

        Overview

        +
        +

        :nodoc: all

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #size ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute size.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initializeBuffer + + + + + +

        +
        +

        Returns a new instance of Buffer.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +183
        +184
        +185
        +186
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 183
        +
        +def initialize
        +  @io = StringIO.new
        +  @size = 0
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #sizeObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute size.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +187
        +188
        +189
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 187
        +
        +def size
        +  @size
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #<<(str) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +189
        +190
        +191
        +192
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 189
        +
        +def <<(str)
        +  @io << str
        +  @size += str.length
        +end
        +
        +
        + +
        +

        + + #ioObject + + + + + +

        + + + + +
        +
        +
        +
        +194
        +195
        +196
        +197
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 194
        +
        +def io
        +  Meta.init @io unless Meta === @io
        +  @io
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OpenURI/HTTPError.html b/docs/api/v1.8.2/stdlib/OpenURI/HTTPError.html new file mode 100644 index 00000000..ebbea3e7 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OpenURI/HTTPError.html @@ -0,0 +1,288 @@ + + + + + + + Exception: OpenURI::HTTPError + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OpenURI::HTTPError + + + +

        +
        + +
        +
        Inherits:
        +
        + StandardError + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/open-uri.rb
        +
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #io ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute io.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(message, io) ⇒ HTTPError + + + + + +

        +
        +

        Returns a new instance of HTTPError.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +175
        +176
        +177
        +178
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 175
        +
        +def initialize(message, io)
        +  super(message, io)
        +  @io = io
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #ioObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute io.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +179
        +180
        +181
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 179
        +
        +def io
        +  @io
        +end
        +
        +
        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OpenURI/Meta.html b/docs/api/v1.8.2/stdlib/OpenURI/Meta.html new file mode 100644 index 00000000..02455d62 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OpenURI/Meta.html @@ -0,0 +1,1136 @@ + + + + + + + Module: OpenURI::Meta + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: OpenURI::Meta + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/open-uri.rb
        +
        + +
        + +

        Overview

        +
        +

        Mixin for holding meta-information.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #base_uri ⇒ Object + + + + + + + + + + + + + + + + +

          returns a URI that is the base of relative URIs in the data.

          +
          + +
        • + + +
        • + + + #meta ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          returns a Hash that represents header fields.

          +
          + +
        • + + +
        • + + + #metas ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          returns a Hash that represents header fields.

          +
          + +
        • + + +
        • + + + #status ⇒ Object + + + + + + + + + + + + + + + + +

          returns an Array that consists of status code and message.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #base_uriObject + + + + + +

        +
        +

        returns a URI that is the base of relative URIs in the data. +It may differ from the URI supplied by a user due to redirection.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +223
        +224
        +225
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 223
        +
        +def base_uri
        +  @base_uri
        +end
        +
        +
        + + + +
        +

        + + #metaObject (readonly) + + + + + +

        +
        +

        returns a Hash that represents header fields. +The Hash keys are downcased for canonicalization. +The Hash values are a field body. +If there are multiple field with same field name, +the field values are concatenated with a comma.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +230
        +231
        +232
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 230
        +
        +def meta
        +  @meta
        +end
        +
        +
        + + + +
        +

        + + #metasObject (readonly) + + + + + +

        +
        +

        returns a Hash that represents header fields. +The Hash keys are downcased for canonicalization. +The Hash value are an array of field values.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +235
        +236
        +237
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 235
        +
        +def metas
        +  @metas
        +end
        +
        +
        + + + +
        +

        + + #statusObject + + + + + +

        +
        +

        returns an Array that consists of status code and message.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +219
        +220
        +221
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 219
        +
        +def status
        +  @status
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .init(obj, src = nil) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +202
        +203
        +204
        +205
        +206
        +207
        +208
        +209
        +210
        +211
        +212
        +213
        +214
        +215
        +216
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 202
        +
        +def Meta.init(obj, src=nil) # :nodoc:
        +  obj.extend Meta
        +  obj.instance_eval {
        +    @base_uri = nil
        +    @meta = {} # name to string.  legacy.
        +    @metas = {} # name to array of strings.
        +  }
        +  if src
        +    obj.status = src.status
        +    obj.base_uri = src.base_uri
        +    src.metas.each {|name, values|
        +      obj.meta_add_field2(name, values)
        +    }
        +  end
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #charsetObject + + + + + +

        +
        +

        returns a charset parameter in Content-Type field. +It is downcased for canonicalization.

        + +

        If charset parameter is not given but a block is given, +the block is called and its result is returned. +It can be used to guess charset.

        + +

        If charset parameter and block is not given, +nil is returned except text type in HTTP. +In that case, "iso-8859-1" is returned as defined by RFC2616 3.7.1.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +300
        +301
        +302
        +303
        +304
        +305
        +306
        +307
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 300
        +
        +def charset
        +  type = content_type_parse
        +  if type && %r{\Atext/} =~ type && @base_uri && /\Ahttp\z/i =~ @base_uri.scheme
        +    'iso-8859-1' # RFC2616 3.7.1
        +  else
        +    nil
        +  end
        +end
        +
        +
        + +
        +

        + + #content_typeObject + + + + + +

        +
        +

        returns "type/subtype" which is MIME Content-Type. +It is downcased for canonicalization. +Content-Type parameters are stripped.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +312
        +313
        +314
        +315
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 312
        +
        +def content_type
        +  type = content_type_parse
        +  type || 'application/octet-stream'
        +end
        +
        +
        + +
        +

        + + #content_type_parseObject + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +284
        +285
        +286
        +287
        +288
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 284
        +
        +def content_type_parse # :nodoc:
        +  content_type = @metas['content-type']
        +  # FIXME Extract type, subtype and parameters
        +  content_type.join(', ')
        +end
        +
        +
        + +
        +

        + + #find_encoding(charset) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +253
        +254
        +255
        +256
        +257
        +258
        +259
        +260
        +261
        +262
        +263
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 253
        +
        +def find_encoding(charset)
        +  enc = nil
        +  if charset
        +    begin
        +      enc = Encoding.find(charset)
        +    rescue ArgumentError
        +    end
        +  end
        +  enc = Encoding::ASCII_8BIT unless enc
        +  enc
        +end
        +
        +
        + +
        +

        + + #last_modifiedObject + + + + + +

        + + + + +
        +
        +
        +
        +276
        +277
        +278
        +279
        +280
        +281
        +282
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 276
        +
        +def last_modified
        +  if (vs = @metas['last-modified'])
        +    Time.at(`Date.parse(#{vs.join(', ')}) / 1000`).utc
        +  else
        +    nil
        +  end
        +end
        +
        +
        + +
        +

        + + #meta_add_field(name, value) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +272
        +273
        +274
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 272
        +
        +def meta_add_field(name, value) # :nodoc:
        +  meta_add_field2(name, [value])
        +end
        +
        +
        + +
        +

        + + #meta_add_field2(name, values) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +265
        +266
        +267
        +268
        +269
        +270
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 265
        +
        +def meta_add_field2(name, values) # :nodoc:
        +  name = name.downcase
        +  @metas[name] = values
        +  @meta[name] = values.join(', ')
        +  meta_setup_encoding if name == 'content-type'
        +end
        +
        +
        + +
        +

        + + #meta_setup_encodingObject + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +237
        +238
        +239
        +240
        +241
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 237
        +
        +def meta_setup_encoding # :nodoc:
        +  charset = self.charset
        +  enc = find_encoding(charset)
        +  set_encoding(enc)
        +end
        +
        +
        + +
        +

        + + #set_encoding(enc) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +243
        +244
        +245
        +246
        +247
        +248
        +249
        +250
        +251
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 243
        +
        +def set_encoding(enc)
        +  if self.respond_to? :force_encoding
        +    self.force_encoding(enc)
        +  elsif self.respond_to? :string
        +    self.string.force_encoding(enc)
        +  else # Tempfile
        +    self.set_encoding enc
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OpenURI/OpenRead.html b/docs/api/v1.8.2/stdlib/OpenURI/OpenRead.html new file mode 100644 index 00000000..948941be --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OpenURI/OpenRead.html @@ -0,0 +1,285 @@ + + + + + + + Module: OpenURI::OpenRead + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: OpenURI::OpenRead + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/open-uri.rb
        +
        + +
        + +

        Overview

        +
        +

        Mixin for HTTP and FTP URIs.

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

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #open(*rest, &block) ⇒ Object + + + + + + + + + + + + + +

          OpenURI::OpenRead#open provides `open' for URI::HTTP and URI::FTP.

          +
          + +
        • + + +
        • + + + #read(options = {}) ⇒ Object + + + + + + + + + + + + + +

          OpenURI::OpenRead#read([options]) reads a content referenced by self and returns the content as string.

          +
          + +
        • + + +
        + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #open(*rest, &block) ⇒ Object + + + + + +

        +
        +

        OpenURI::OpenRead#open provides `open' for URI::HTTP and URI::FTP.

        + +

        OpenURI::OpenRead#open takes optional 3 arguments as:

        + +

        OpenURI::OpenRead#open([mode [, perm]] [, options]) [{|io| ... }]

        + +

        OpenURI::OpenRead#open returns an IO-like object if block is not given. +Otherwise it yields the IO object and return the value of the block. +The IO object is extended with OpenURI::Meta.

        + +

        +mode+ and +perm+ are the same as Kernel#open.

        + +

        However, +mode+ must be read mode because OpenURI::OpenRead#open doesn't +support write mode (yet). +Also +perm+ is ignored because it is meaningful only for file creation.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +336
        +337
        +338
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 336
        +
        +def open(*rest, &block)
        +  OpenURI.open_uri(self, *rest, &block)
        +end
        +
        +
        + +
        +

        + + #read(options = {}) ⇒ Object + + + + + +

        +
        +

        OpenURI::OpenRead#read([options]) reads a content referenced by self and +returns the content as string. +The string is extended with OpenURI::Meta. +The argument +options+ is same as OpenURI::OpenRead#open.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +344
        +345
        +346
        +347
        +348
        +349
        +350
        +
        +
        # File 'opal/stdlib/open-uri.rb', line 344
        +
        +def read(options={})
        +  self.open(options) {|f|
        +    str = f.read
        +    Meta.init str, f
        +    str
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser.html b/docs/api/v1.8.2/stdlib/OptionParser.html new file mode 100644 index 00000000..4d57ee80 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser.html @@ -0,0 +1,5045 @@ + + + + + + + Class: OptionParser + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb,
        + opal/stdlib/optparse/kwargs.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        -- +== Developer Documentation (not for RDoc output)

        + +

        === Class tree

        + +
          +
        • OptionParser:: front end
        • +
        • OptionParser::Switch:: each switches
        • +
        • OptionParser::List:: options list
        • +
        • OptionParser::ParseError:: errors on parsing + +
            +
          • OptionParser::AmbiguousOption
          • +
          • OptionParser::NeedlessArgument
          • +
          • OptionParser::MissingArgument
          • +
          • OptionParser::InvalidOption
          • +
          • OptionParser::InvalidArgument
          • +
          • OptionParser::AmbiguousArgument
          • +
        • +
        + +

        === Object relationship diagram

        + +

        +--------------+ + | OptionParser |<>-----+ + +--------------+ | +--------+ + | ,-| Switch | + on_head -------->+---------------+ / +--------+ + accept/reject -->| List |<|>- + | |<|>- +----------+ + on ------------->+---------------+ `-| argument | + : : | class | + +---------------+ |==========| + on_tail -------->| | |pattern | + +---------------+ |----------| + OptionParser.accept ->| DefaultList | |converter | + reject |(shared between| +----------+ + | all instances)| + +---------------+

        + +

        ++

        + +

        == OptionParser

        + +

        === New to \OptionParser?

        + +

        See the Tutorial[./doc/optparse/tutorial_rdoc.html].

        + +

        === Introduction

        + +

        OptionParser is a class for command-line option analysis. It is much more +advanced, yet also easier to use, than GetoptLong, and is a more Ruby-oriented +solution.

        + +

        === Features

        + +
          +
        1. The argument specification and the code to handle it are written in the +same place.
        2. +
        3. It can output an option summary; you don't need to maintain this string +separately.
        4. +
        5. Optional and mandatory arguments are specified very gracefully.
        6. +
        7. Arguments can be automatically converted to a specified class.
        8. +
        9. Arguments can be restricted to a certain set.
        10. +
        + +

        All of these features are demonstrated in the examples below. See

        + +

        make_switch for full documentation.

        + +

        === Minimal example

        + +

        require 'optparse'

        + +

        options = {} + OptionParser.new do |parser| + parser.banner = "Usage: example.rb [options]"

        + +
        parser.on("-v", "--[no-]verbose", "Run verbosely") do |v|
        +  options[:verbose] = v
        +end
        +
        + +

        end.parse!

        + +

        p options + p ARGV

        + +

        === Generating Help

        + +

        OptionParser can be used to automatically generate help for the commands you +write:

        + +

        require 'optparse'

        + +

        Options = Struct.new(:name)

        + +

        class Parser + def self.parse(options) + args = Options.new("world")

        + +
          opt_parser = OptionParser.new do |parser|
        +    parser.banner = "Usage: example.rb [options]"
        +
        +    parser.on("-nNAME", "--name=NAME", "Name to say hello to") do |n|
        +      args.name = n
        +    end
        +
        +    parser.on("-h", "--help", "Prints this help") do
        +      puts parser
        +      exit
        +    end
        +  end
        +
        +  opt_parser.parse!(options)
        +  return args
        +end
        +
        + +

        end + options = Parser.parse %w[--help]

        + +

        #=> + # Usage: example.rb [options] + # -n, --name=NAME Name to say hello to + # -h, --help Prints this help

        + +

        === Required Arguments

        + +

        For options that require an argument, option specification strings may include an +option name in all caps. If an option is used without the required argument, +an exception will be raised.

        + +

        require 'optparse'

        + +

        options = {} + OptionParser.new do |parser| + parser.on("-r", "--require LIBRARY", + "Require the LIBRARY before executing your script") do |lib| + puts "You required #lib!" + end + end.parse!

        + +

        Used:

        + +

        $ ruby optparse-test.rb -r + optparse-test.rb:9:in `

        ': missing argument: -r (OptionParser::MissingArgument) + $ ruby optparse-test.rb -r my-library + You required my-library!

        + +

        === Type Coercion

        + +

        OptionParser supports the ability to coerce command line arguments +into objects for us.

        + +

        OptionParser comes with a few ready-to-use kinds of type +coercion. They are:

        + +
          +
        • Date -- Anything accepted by +Date.parse+
        • +
        • DateTime -- Anything accepted by +DateTime.parse+
        • +
        • Time -- Anything accepted by +Time.httpdate+ or +Time.parse+
        • +
        • URI -- Anything accepted by +URI.parse+
        • +
        • Shellwords -- Anything accepted by +Shellwords.shellwords+
        • +
        • String -- Any non-empty string
        • +
        • Integer -- Any integer. Will convert octal. (e.g. 124, -3, 040)
        • +
        • Float -- Any float. (e.g. 10, 3.14, -100E+13)
        • +
        • Numeric -- Any integer, float, or rational (1, 3.4, 1/3)
        • +
        • DecimalInteger -- Like +Integer+, but no octal format.
        • +
        • OctalInteger -- Like +Integer+, but no decimal format.
        • +
        • DecimalNumeric -- Decimal integer or float.
        • +
        • TrueClass -- Accepts '+, yes, true, -, no, false' and +defaults as +true+
        • +
        • FalseClass -- Same as +TrueClass+, but defaults to +false+
        • +
        • Array -- Strings separated by ',' (e.g. 1,2,3)
        • +
        • Regexp -- Regular expressions. Also includes options.
        • +
        + +

        We can also add our own coercions, which we will cover below.

        + +

        ==== Using Built-in Conversions

        + +

        As an example, the built-in +Time+ conversion is used. The other built-in +conversions behave in the same way. +OptionParser will attempt to parse the argument +as a +Time+. If it succeeds, that time will be passed to the +handler block. Otherwise, an exception will be raised.

        + +

        require 'optparse' + require 'optparse/time' + OptionParser.new do |parser| + parser.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time| + p time + end + end.parse!

        + +

        Used:

        + +

        $ ruby optparse-test.rb -t nonsense + ... invalid argument: -t nonsense (OptionParser::InvalidArgument) + $ ruby optparse-test.rb -t 10-11-12 + 2010-11-12 00:00:00 -0500 + $ ruby optparse-test.rb -t 9:30 + 2014-08-13 09:30:00 -0400

        + +

        ==== Creating Custom Conversions

        + +

        The +accept+ method on OptionParser may be used to create converters. +It specifies which conversion block to call whenever a class is specified. +The example below uses it to fetch a +User+ object before the +on+ handler receives it.

        + +

        require 'optparse'

        + +

        User = Struct.new(:id, :name)

        + +

        def find_user id + not_found = ->{ raise "No User Found for id #id" } + [ User.new(1, "Sam"), + User.new(2, "Gandalf") ].find(not_found) do |u| + u.id == id + end + end

        + +

        op = OptionParser.new + op.accept(User) do |user_id| + find_user user_id.to_i + end

        + +

        op.on("--user ID", User) do |user| + puts user + end

        + +

        op.parse!

        + +

        Used:

        + +

        $ ruby optparse-test.rb --user 1 + # + $ ruby optparse-test.rb --user 2 + # + $ ruby optparse-test.rb --user 3 + optparse-test.rb:15:in `block in find_user': No User Found for id 3 (RuntimeError)

        + +

        === Store options to a Hash

        + +

        The +into+ option of +order+, +parse+ and so on methods stores command line options into a Hash.

        + +

        require 'optparse'

        + +

        options = {} + OptionParser.new do |parser| + parser.on('-a') + parser.on('-b NUM', Integer) + parser.on('-v', '--verbose') + end.parse!(into: options)

        + +

        p options

        + +

        Used:

        + +

        $ ruby optparse-test.rb -a + :a=>true + $ ruby optparse-test.rb -a -v + :verbose=>true + $ ruby optparse-test.rb -a -b 100 + :b=>100

        + +

        === Complete example

        + +

        The following example is a complete Ruby program. You can run it and see the +effect of specifying various options. This is probably the best way to learn +the features of +optparse+.

        + +

        require 'optparse' + require 'optparse/time' + require 'ostruct' + require 'pp'

        + +

        class OptparseExample + Version = '1.0.0'

        + +
        CODES = %w[iso-2022-jp shift_jis euc-jp utf8 binary]
        +CODE_ALIASES = { "jis" => "iso-2022-jp", "sjis" => "shift_jis" }
        +
        +class ScriptOptions
        +  attr_accessor :library, :inplace, :encoding, :transfer_type,
        +                :verbose, :extension, :delay, :time, :record_separator,
        +                :list
        +
        +  def initialize
        +    self.library = []
        +    self.inplace = false
        +    self.encoding = "utf8"
        +    self.transfer_type = :auto
        +    self.verbose = false
        +  end
        +
        +  def define_options(parser)
        +    parser.banner = "Usage: example.rb [options]"
        +    parser.separator ""
        +    parser.separator "Specific options:"
        +
        +    # add additional options
        +    perform_inplace_option(parser)
        +    delay_execution_option(parser)
        +    execute_at_time_option(parser)
        +    specify_record_separator_option(parser)
        +    list_example_option(parser)
        +    specify_encoding_option(parser)
        +    optional_option_argument_with_keyword_completion_option(parser)
        +    boolean_verbose_option(parser)
        +
        +    parser.separator ""
        +    parser.separator "Common options:"
        +    # No argument, shows at tail.  This will print an options summary.
        +    # Try it and see!
        +    parser.on_tail("-h", "--help", "Show this message") do
        +      puts parser
        +      exit
        +    end
        +    # Another typical switch to print the version.
        +    parser.on_tail("--version", "Show version") do
        +      puts Version
        +      exit
        +    end
        +  end
        +
        +  def perform_inplace_option(parser)
        +    # Specifies an optional option argument
        +    parser.on("-i", "--inplace [EXTENSION]",
        +              "Edit ARGV files in place",
        +              "(make backup if EXTENSION supplied)") do |ext|
        +      self.inplace = true
        +      self.extension = ext || ''
        +      self.extension.sub!(/\A\.?(?=.)/, ".")  # Ensure extension begins with dot.
        +    end
        +  end
        +
        +  def delay_execution_option(parser)
        +    # Cast 'delay' argument to a Float.
        +    parser.on("--delay N", Float, "Delay N seconds before executing") do |n|
        +      self.delay = n
        +    end
        +  end
        +
        +  def execute_at_time_option(parser)
        +    # Cast 'time' argument to a Time object.
        +    parser.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time|
        +      self.time = time
        +    end
        +  end
        +
        +  def specify_record_separator_option(parser)
        +    # Cast to octal integer.
        +    parser.on("-F", "--irs [OCTAL]", OptionParser::OctalInteger,
        +              "Specify record separator (default \\0)") do |rs|
        +      self.record_separator = rs
        +    end
        +  end
        +
        +  def list_example_option(parser)
        +    # List of arguments.
        +    parser.on("--list x,y,z", Array, "Example 'list' of arguments") do |list|
        +      self.list = list
        +    end
        +  end
        +
        +  def specify_encoding_option(parser)
        +    # Keyword completion.  We are specifying a specific set of arguments (CODES
        +    # and CODE_ALIASES - notice the latter is a Hash), and the user may provide
        +    # the shortest unambiguous text.
        +    code_list = (CODE_ALIASES.keys + CODES).join(', ')
        +    parser.on("--code CODE", CODES, CODE_ALIASES, "Select encoding",
        +              "(#{code_list})") do |encoding|
        +      self.encoding = encoding
        +    end
        +  end
        +
        +  def optional_option_argument_with_keyword_completion_option(parser)
        +    # Optional '--type' option argument with keyword completion.
        +    parser.on("--type [TYPE]", [:text, :binary, :auto],
        +              "Select transfer type (text, binary, auto)") do |t|
        +      self.transfer_type = t
        +    end
        +  end
        +
        +  def boolean_verbose_option(parser)
        +    # Boolean switch.
        +    parser.on("-v", "--[no-]verbose", "Run verbosely") do |v|
        +      self.verbose = v
        +    end
        +  end
        +end
        +
        +#
        +# Return a structure describing the options.
        +#
        +def parse(args)
        +  # The options specified on the command line will be collected in
        +  # *options*.
        +
        +  @options = ScriptOptions.new
        +  @args = OptionParser.new do |parser|
        +    @options.define_options(parser)
        +    parser.parse!(args)
        +  end
        +  @options
        +end
        +
        +attr_reader :parser, :options
        +
        + +

        end # class OptparseExample

        + +

        example = OptparseExample.new + options = example.parse(ARGV) + pp options # example.options + pp ARGV

        + +

        === Shell Completion

        + +

        For modern shells (e.g. bash, zsh, etc.), you can use shell +completion for command line options.

        + +

        === Further documentation

        + +

        The above examples, along with the accompanying +Tutorial[./doc/optparse/tutorial_rdoc.html], +should be enough to learn how to use this class. +If you have any questions, file a ticket at http://bugs.ruby-lang.org.

        + + +
        +
        +
        + + +
        +

        Direct Known Subclasses

        +

        AC

        +
        +

        Defined Under Namespace

        +

        + + + Modules: Acceptables, Arguable, Completion + + + + Classes: AC, AmbiguousArgument, AmbiguousOption, CompletingHash, InvalidArgument, InvalidOption, List, MissingArgument, NeedlessArgument, OptionMap, ParseError, Switch + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        Version = + +
        +
        '0.1.1'
        + +
        NoArgument = +
        +
        +

        :stopdoc:

        + + +
        +
        +
        + + +
        +
        +
        [NO_ARGUMENT = :NONE, nil].freeze
        + +
        RequiredArgument = + +
        +
        [REQUIRED_ARGUMENT = :REQUIRED, true].freeze
        + +
        OptionalArgument = + +
        +
        [OPTIONAL_ARGUMENT = :OPTIONAL, false].freeze
        + +
        ArgumentStyle = +
        +
        +

        Enumeration of acceptable argument styles. Possible values are:

        + +

        NO_ARGUMENT:: The switch takes no arguments. (:NONE) +REQUIRED_ARGUMENT:: The switch requires an argument. (:REQUIRED) +OPTIONAL_ARGUMENT:: The switch requires an optional argument. (:OPTIONAL)

        + +

        Use like --switch=argument (long style) or -Xargument (short style). For +short style, only portion matched to argument pattern is treated as +argument.

        + + +
        +
        +
        + + +
        +
        +
        {}
        + +
        DefaultList = +
        +
        +

        Switches common used such as '--', and also provides default +argument classes

        + + +
        +
        +
        + + +
        +
        +
        List.new
        + +
        COMPSYS_HEADER = +
        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        +
        +
        <<'XXX'      # :nodoc:
        +
        +typeset -A opt_args
        +local context state line
        +
        +_argume
        + +
        Officious = +
        +
        +

        Default options for ARGV, which never appear in option summary.

        + + +
        +
        +
        + + +
        +
        +
        {}
        + +
        SPLAT_PROC = +
        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        +
        +
        proc { |*a| a.length <= 1 ? a.first : a }
        + +
        DecimalInteger = +
        +
        +

        Decimal integer format, to be converted to Integer.

        + + +
        +
        +
        + + +
        +
        +
        /\A[-+]?#{decimal}\z/io
        + +
        OctalInteger = +
        +
        +

        Ruby/C like octal/hexadecimal/binary integer format, to be converted to +Integer.

        + + +
        +
        +
        + + +
        +
        +
        /\A[-+]?(?:[0-7]+(?:_[0-7]+)*|0(?:#{binary}|#{hex}))\z/io
        + +
        DecimalNumeric = +
        +
        +

        Decimal integer/float number format, to be converted to Integer for +integer format, Float for float format.

        + + +
        +
        +
        + + +
        +
        +
        floatpat
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #banner ⇒ Object + + + + + + + + + + + + + + + + +

          Heading banner preceding summary.

          +
          + +
        • + + +
        • + + + #default_argv ⇒ Object + + + + + + + + + + + + + + + + +

          Strings to be parsed in default.

          +
          + +
        • + + +
        • + + + #program_name ⇒ Object + + + + + + + + + + + + + + + + +

          Program name to be emitted in error message and default banner, defaults to $0.

          +
          + +
        • + + +
        • + + + #release ⇒ Object + + + + + + + + + + + + + + + + +

          Release code.

          +
          + +
        • + + +
        • + + + #require_exact ⇒ Object + + + + + + + + + + + + + + + + +

          Whether to require that options match exactly (disallows providing abbreviated long option as short option).

          +
          + +
        • + + +
        • + + + #summary_indent ⇒ Object + + + + + + + + + + + + + + + + +

          Indentation for summary.

          +
          + +
        • + + +
        • + + + #summary_width ⇒ Object + + + + + + + + + + + + + + + + +

          Width for option list portion of summary.

          +
          + +
        • + + +
        • + + + #version ⇒ Object + + + + + + + + + + + + + + + + +

          Version.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(banner = nil, width = 32, indent = ' ' * 4) {|_self| ... } ⇒ OptionParser + + + + + +

        +
        +

        Initializes the instance and yields itself if called with a block.

        + +

        +banner+:: Banner message. ++width+:: Summary width. ++indent+:: Summary indent.

        + + +
        +
        +
        + +

        Yields:

        +
          + +
        • + + + (_self) + + + +
        • + +
        +

        Yield Parameters:

        +
          + +
        • + + _self + + + (OptionParser) + + + + — +

          the object that the method was called on

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +1092
        +1093
        +1094
        +1095
        +1096
        +1097
        +1098
        +1099
        +1100
        +1101
        +1102
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1092
        +
        +def initialize(banner = nil, width = 32, indent = ' ' * 4)
        +  @stack = [DefaultList, List.new, List.new]
        +  @program_name = nil
        +  @banner = banner
        +  @summary_width = width
        +  @summary_indent = indent
        +  @default_argv = ARGV
        +  @require_exact = false
        +  add_officious
        +  yield self if block_given?
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +
        +
        +

        Heading banner preceding summary.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1193
        +1194
        +1195
        +1196
        +1197
        +1198
        +1199
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1193
        +
        +def banner
        +  unless @banner
        +    @banner = +"Usage: #{program_name} [options]"
        +    visit(:add_banner, @banner)
        +  end
        +  @banner
        +end
        +
        +
        + + + +
        +

        + + #default_argvObject + + + + + +

        +
        +

        Strings to be parsed in default.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1184
        +1185
        +1186
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1184
        +
        +def default_argv
        +  @default_argv
        +end
        +
        +
        + + + +
        +

        + + #program_nameObject + + + + + +

        +
        +

        Program name to be emitted in error message and default banner, defaults +to $0.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1205
        +1206
        +1207
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1205
        +
        +def program_name
        +  @program_name || File.basename($0, '.*')
        +end
        +
        +
        + + + +
        +

        + + #releaseObject + + + + + +

        +
        +

        Release code

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1230
        +1231
        +1232
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1230
        +
        +def release
        +  (defined?(@release) && @release) || (defined?(::Release) && ::Release) || (defined?(::RELEASE) && ::RELEASE)
        +end
        +
        +
        + + + +
        +

        + + #require_exactObject + + + + + +

        +
        +

        Whether to require that options match exactly (disallows providing +abbreviated long option as short option).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1188
        +1189
        +1190
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1188
        +
        +def require_exact
        +  @require_exact
        +end
        +
        +
        + + + +
        +

        + + #summary_indentObject + + + + + +

        +
        +

        Indentation for summary. Must be String (or have + String method).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1181
        +1182
        +1183
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1181
        +
        +def summary_indent
        +  @summary_indent
        +end
        +
        +
        + + + +
        +

        + + #summary_widthObject + + + + + +

        +
        +

        Width for option list portion of summary. Must be Numeric.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1178
        +1179
        +1180
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1178
        +
        +def summary_width
        +  @summary_width
        +end
        +
        +
        + + + +
        +

        + + #versionObject + + + + + +

        +
        +

        Version

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1223
        +1224
        +1225
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1223
        +
        +def version
        +  (defined?(@version) && @version) || (defined?(::Version) && ::Version)
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .accept(*args, &blk) ⇒ Object + + + + + +

        +
        +

        See #accept.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1144
        +1145
        +1146
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1144
        +
        +def self.accept(*args, &blk)
        +  top.accept(*args, &blk)
        +end
        +
        +
        + +
        +

        + + .each_const(path, base = ::Object) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +
        +
        # File 'opal/stdlib/optparse/version.rb', line 48
        +
        +def each_const(path, base = ::Object)
        +  path.split(/::|\//).inject(base) do |klass, name|
        +    raise NameError, path unless Module === klass
        +    klass.constants.grep(/#{name}/i) do |c|
        +      klass.const_defined?(c) || next
        +      klass.const_get(c)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + .getopts(*args) ⇒ Object + + + + + +

        +
        +

        See #getopts.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1755
        +1756
        +1757
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1755
        +
        +def self.getopts(*args)
        +  new.getopts(*args)
        +end
        +
        +
        + +
        +

        + + .inc(arg, default = nil) ⇒ Object + + + + + +

        +
        +

        Returns an incremented value of +default+ according to +arg+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1072
        +1073
        +1074
        +1075
        +1076
        +1077
        +1078
        +1079
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1072
        +
        +def self.inc(arg, default = nil)
        +  case arg
        +  when Integer
        +    arg.nonzero?
        +  when nil
        +    default.to_i + 1
        +  end
        +end
        +
        +
        + +
        +

        + + .reject(*args, &blk) ⇒ Object + + + + + +

        +
        +

        See #reject.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1162
        +1163
        +1164
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1162
        +
        +def self.reject(*args, &blk)
        +  top.reject(*args, &blk)
        +end
        +
        +
        + +
        +

        + + .search_const(klass, name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +58
        +59
        +60
        +61
        +62
        +63
        +64
        +65
        +66
        +67
        +68
        +
        +
        # File 'opal/stdlib/optparse/version.rb', line 58
        +
        +def search_const(klass, name)
        +  klasses = [klass]
        +  while klass = klasses.shift
        +    klass.constants.each do |cname|
        +      klass.const_defined?(cname) || next
        +      const = klass.const_get(cname)
        +      yield klass, cname, const if name === cname
        +      klasses << const if (Module === const) && (const != ::Object)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + .show_version(*pkgs) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +5
        +6
        +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
        +
        +
        # File 'opal/stdlib/optparse/version.rb', line 5
        +
        +def show_version(*pkgs)
        +  progname = ARGV.options.program_name
        +  result = false
        +  show = proc do |klass, cname, version|
        +    str = progname.to_s
        +    unless (klass == ::Object) && (cname == :VERSION)
        +      version = version.join('.') if Array === version
        +      str << ": #{klass}" unless klass == Object
        +      str << " version #{version}"
        +    end
        +    %i[Release RELEASE].find do |rel|
        +      if klass.const_defined?(rel)
        +        str << " (#{klass.const_get(rel)})"
        +      end
        +    end
        +    puts str
        +    result = true
        +  end
        +  if (pkgs.size == 1) && (pkgs[0] == 'all')
        +    search_const(::Object, /\AV(?:ERSION|ersion)\z/) do |klass, cname, version|
        +      unless (cname[1] == 'e') && klass.const_defined?(:Version)
        +        show.call(klass, cname.intern, version)
        +      end
        +    end
        +  else
        +    pkgs.each do |pkg|
        +      pkg = pkg.split(/::|\//).inject(::Object) { |m, c| m.const_get(c) }
        +      v = case
        +          when pkg.const_defined?(:Version)
        +            pkg.const_get(n = :Version)
        +          when pkg.const_defined?(:VERSION)
        +            pkg.const_get(n = :VERSION)
        +          else
        +            n = nil
        +            'unknown'
        +          end
        +      show.call(pkg, n, v)
        +    rescue NameError
        +    end
        +  end
        +  result
        +end
        +
        +
        + +
        +

        + + .terminate(arg = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +1119
        +1120
        +1121
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1119
        +
        +def self.terminate(arg = nil)
        +  throw :terminate, arg
        +end
        +
        +
        + +
        +

        + + .topObject + + + + + +

        + + + + +
        +
        +
        +
        +1124
        +1125
        +1126
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1124
        +
        +def self.top
        +  DefaultList
        +end
        +
        +
        + +
        +

        + + .with(*args, &block) ⇒ Object + + + + + +

        +
        +

        Initializes a new instance and evaluates the optional block in context +of the instance. Arguments +args+ are passed to #new, see there for +description of parameters.

        + +

        This method is deprecated, its behavior corresponds to the older #new +method.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1063
        +1064
        +1065
        +1066
        +1067
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1063
        +
        +def self.with(*args, &block)
        +  opts = new(*args)
        +  opts.instance_eval(&block)
        +  opts
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #abort(mesg = $!) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +1249
        +1250
        +1251
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1249
        +
        +def abort(mesg = $!)
        +  super("#{program_name}: #{mesg}")
        +end
        +
        +
        + +
        +

        + + #accept(*args, &blk) ⇒ Object + + + + + +

        +
        +

        Directs to accept specified class +t+. The argument string is passed to +the block in which it should be converted to the desired class.

        + +

        +t+:: Argument class specifier, any object including Class. ++pat+:: Pattern for argument, defaults to +t+ if it responds to match.

        + +

        accept(t, pat, &block)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1137
        +1138
        +1139
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1137
        +
        +def accept(*args, &blk)
        +  top.accept(*args, &blk)
        +end
        +
        +
        + +
        +

        + + #add_officiousObject + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1104
        +1105
        +1106
        +1107
        +1108
        +1109
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1104
        +
        +def add_officious # :nodoc:
        +  list = base
        +  Officious.each do |opt, block|
        +    list.long[opt] ||= block.call(self)
        +  end
        +end
        +
        +
        + +
        +

        + + #additional_message(typ, opt) ⇒ Object + + + + + +

        +
        +

        Returns additional info.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1813
        +1814
        +1815
        +1816
        +1817
        +1818
        +1819
        +1820
        +1821
        +1822
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1813
        +
        +def additional_message(typ, opt)
        +  return unless typ && opt && defined?(DidYouMean::SpellChecker)
        +  all_candidates = []
        +  visit(:get_candidates, typ) do |candidates|
        +    all_candidates.concat(candidates)
        +  end
        +  all_candidates.select! { |cand| cand.is_a?(String) }
        +  checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
        +  DidYouMean.formatter.message_for(all_candidates & checker.correct(opt))
        +end
        +
        +
        + +
        +

        + + #baseObject + + + + + +

        +
        +

        Subject of #on_tail.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1263
        +1264
        +1265
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1263
        +
        +def base
        +  @stack[1]
        +end
        +
        +
        + +
        +

        + + #candidate(word) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +1824
        +1825
        +1826
        +1827
        +1828
        +1829
        +1830
        +1831
        +1832
        +1833
        +1834
        +1835
        +1836
        +1837
        +1838
        +1839
        +1840
        +1841
        +1842
        +1843
        +1844
        +1845
        +1846
        +1847
        +1848
        +1849
        +1850
        +1851
        +1852
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1824
        +
        +def candidate(word)
        +  list = []
        +  case word
        +  when '-'
        +    long = short = true
        +  when /\A--/
        +    word, arg = word.split(/=/, 2)
        +    argpat = Completion.regexp(arg, false) if arg && !arg.empty?
        +    long = true
        +  when /\A-/
        +    short = true
        +  end
        +  pat = Completion.regexp(word, long)
        +  visit(:each_option) do |opt|
        +    next unless Switch === opt
        +    opts = (long ? opt.long : []) + (short ? opt.short : [])
        +    opts = Completion.candidate(word, true, pat, &opts.method(:each)).map(&:first) if pat
        +    if /\A=/ =~ opt.arg
        +      opts.map! { |sw| sw + '=' }
        +      if arg && (CompletingHash === opt.pattern)
        +        if opts = opt.pattern.candidate(arg, false, argpat)
        +          opts.map!(&:last)
        +        end
        +      end
        +    end
        +    list.concat(opts)
        +  end
        +  list
        +end
        +
        +
        + +
        +

        + + #compsys(to, name = File.basename($0)) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +980
        +981
        +982
        +983
        +984
        +985
        +986
        +987
        +
        +
        # File 'opal/stdlib/optparse.rb', line 980
        +
        +def compsys(to, name = File.basename($0)) # :nodoc:
        +  to << "#compdef #{name}\n"
        +  to << COMPSYS_HEADER
        +  visit(:compsys, {}, {}) do |o, d|
        +    to << %[  "#{o}[#{d.gsub(/[\"\[\]]/, '\\\\\&')}]" \\\n]
        +  end
        +  to << "  '*:file:_files' && return 0\n"
        +end
        +
        +
        + +
        +

        + + #define(*opts, &block) ⇒ Object + + + + Also known as: + def_option + + + + +

        +
        +

        :call-seq: + define(*params, &block)

        + +

        :include: ../doc/optparse/creates_option.rdoc

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1483
        +1484
        +1485
        +1486
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1483
        +
        +def define(*opts, &block)
        +  top.append(*(sw = make_switch(opts, block)))
        +  sw[0]
        +end
        +
        +
        + +
        +

        + + #define_by_keywords(options, meth, **opts) ⇒ Object + + + + + +

        +
        +

        :call-seq: + define_by_keywords(options, method, **params)

        + +

        :include: ../../doc/optparse/creates_option.rdoc

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +10
        +11
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +
        +
        # File 'opal/stdlib/optparse/kwargs.rb', line 10
        +
        +def define_by_keywords(options, meth, **opts)
        +  meth.parameters.each do |type, name|
        +    case type
        +    when :key, :keyreq
        +      op, cl = *(type == :key ? %w"[ ]" : ['', ''])
        +      define("--#{name}=#{op}#{name.upcase}#{cl}", *opts[name]) do |o|
        +        options[name] = o
        +      end
        +    end
        +  end
        +  options
        +end
        +
        +
        + +
        +

        + + #define_head(*opts, &block) ⇒ Object + + + + Also known as: + def_head_option + + + + +

        +
        +

        :call-seq: + define_head(*params, &block)

        + +

        :include: ../doc/optparse/creates_option.rdoc

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1504
        +1505
        +1506
        +1507
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1504
        +
        +def define_head(*opts, &block)
        +  top.prepend(*(sw = make_switch(opts, block)))
        +  sw[0]
        +end
        +
        +
        + +
        +

        + + #define_tail(*opts, &block) ⇒ Object + + + + Also known as: + def_tail_option + + + + +

        +
        +

        :call-seq: + define_tail(*params, &block)

        + +

        :include: ../doc/optparse/creates_option.rdoc

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1527
        +1528
        +1529
        +1530
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1527
        +
        +def define_tail(*opts, &block)
        +  base.append(*(sw = make_switch(opts, block)))
        +  sw[0]
        +end
        +
        +
        + +
        +

        + + #environment(env = File.basename($0, '.*')) ⇒ Object + + + + + +

        +
        +

        Parses environment variable +env+ or its uppercase with splitting like a +shell.

        + +

        +env+ defaults to the basename of the program.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1902
        +1903
        +1904
        +1905
        +1906
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1902
        +
        +def environment(env = File.basename($0, '.*'))
        +  (env = ENV[env] || ENV[env.upcase]) || return
        +  require 'shellwords'
        +  parse(*Shellwords.shellwords(env))
        +end
        +
        +
        + +
        +

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

        +
        +

        Wrapper method for getopts.rb.

        + +

        params = ARGV.getopts("ab:", "foo", "bar:", "zot:Z;zot option") + # params["a"] = true # -a + # params["b"] = "1" # -b1 + # params["foo"] = "1" # --foo + # params["bar"] = "x" # --bar x + # params["zot"] = "z" # --zot Z

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1718
        +1719
        +1720
        +1721
        +1722
        +1723
        +1724
        +1725
        +1726
        +1727
        +1728
        +1729
        +1730
        +1731
        +1732
        +1733
        +1734
        +1735
        +1736
        +1737
        +1738
        +1739
        +1740
        +1741
        +1742
        +1743
        +1744
        +1745
        +1746
        +1747
        +1748
        +1749
        +1750
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1718
        +
        +def getopts(*args)
        +  argv = Array === args.first ? args.shift : default_argv
        +  single_options, *long_options = *args
        +
        +  result = {}
        +
        +  if single_options
        +    single_options.scan(/(.)(:)?/) do |opt, val|
        +      if val
        +        result[opt] = nil
        +        define("-#{opt} VAL")
        +      else
        +        result[opt] = false
        +        define("-#{opt}")
        +      end
        +    end
        +  end
        +
        +  long_options.each do |arg|
        +    arg, desc = arg.split(';', 2)
        +    opt, val = arg.split(':', 2)
        +    if val
        +      result[opt] = val.empty? ? nil : val
        +      define("--#{opt}=#{result[opt] || 'VAL'}", *[desc].compact)
        +    else
        +      result[opt] = false
        +      define("--#{opt}", *[desc].compact)
        +    end
        +  end
        +
        +  parse_in_order(argv, result.method(:[]=))
        +  result
        +end
        +
        +
        + +
        +

        + + #helpObject + + + + Also known as: + to_s + + + + +

        +
        +

        Returns option summary string.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1305
        +1306
        +1307
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1305
        +
        +def help
        +  summarize([banner.to_s.sub(/\n?\z/, "\n")]).join
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +1081
        +1082
        +1083
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1081
        +
        +def inc(*args)
        +  self.class.inc(*args)
        +end
        +
        +
        + +
        +

        + + #load(filename = nil) ⇒ Object + + + + + +

        +
        +

        Loads options from file names as +filename+. Does nothing when the file +is not present. Returns whether successfully loaded.

        + +

        +filename+ defaults to basename of the program without suffix in a +directory ~/.options, then the basename with '.options' suffix +under XDG and Haiku standard places.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1862
        +1863
        +1864
        +1865
        +1866
        +1867
        +1868
        +1869
        +1870
        +1871
        +1872
        +1873
        +1874
        +1875
        +1876
        +1877
        +1878
        +1879
        +1880
        +1881
        +1882
        +1883
        +1884
        +1885
        +1886
        +1887
        +1888
        +1889
        +1890
        +1891
        +1892
        +1893
        +1894
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1862
        +
        +def load(filename = nil)
        +  unless filename
        +    basename = File.basename($0, '.*')
        +    begin
        +      return true if load(File.expand_path(basename, '~/.options'))
        +    rescue
        +      nil
        +    end
        +    basename << '.options'
        +    return [
        +      # XDG
        +      ENV['XDG_CONFIG_HOME'],
        +      '~/.config',
        +      *ENV['XDG_CONFIG_DIRS']&.split(File::PATH_SEPARATOR),
        +
        +      # Haiku
        +      '~/config/settings',
        +    ].any? do |dir|
        +      next if !dir || dir.empty?
        +      begin
        +        load(File.expand_path(basename, dir))
        +      rescue
        +        nil
        +      end
        +    end
        +  end
        +  begin
        +    parse(*IO.readlines(filename).each(&:chomp!))
        +    true
        +  rescue Errno::ENOENT, Errno::ENOTDIR
        +    false
        +  end
        +end
        +
        +
        + +
        +

        + + #make_switch(opts, block = nil) ⇒ Object + + + + + +

        +
        +

        :call-seq: + make_switch(params, block = nil)

        + +

        :include: ../doc/optparse/creates_option.rdoc

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1342
        +1343
        +1344
        +1345
        +1346
        +1347
        +1348
        +1349
        +1350
        +1351
        +1352
        +1353
        +1354
        +1355
        +1356
        +1357
        +1358
        +1359
        +1360
        +1361
        +1362
        +1363
        +1364
        +1365
        +1366
        +1367
        +1368
        +1369
        +1370
        +1371
        +1372
        +1373
        +1374
        +1375
        +1376
        +1377
        +1378
        +1379
        +1380
        +1381
        +1382
        +1383
        +1384
        +1385
        +1386
        +1387
        +1388
        +1389
        +1390
        +1391
        +1392
        +1393
        +1394
        +1395
        +1396
        +1397
        +1398
        +1399
        +1400
        +1401
        +1402
        +1403
        +1404
        +1405
        +1406
        +1407
        +1408
        +1409
        +1410
        +1411
        +1412
        +1413
        +1414
        +1415
        +1416
        +1417
        +1418
        +1419
        +1420
        +1421
        +1422
        +1423
        +1424
        +1425
        +1426
        +1427
        +1428
        +1429
        +1430
        +1431
        +1432
        +1433
        +1434
        +1435
        +1436
        +1437
        +1438
        +1439
        +1440
        +1441
        +1442
        +1443
        +1444
        +1445
        +1446
        +1447
        +1448
        +1449
        +1450
        +1451
        +1452
        +1453
        +1454
        +1455
        +1456
        +1457
        +1458
        +1459
        +1460
        +1461
        +1462
        +1463
        +1464
        +1465
        +1466
        +1467
        +1468
        +1469
        +1470
        +1471
        +1472
        +1473
        +1474
        +1475
        +1476
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1342
        +
        +def make_switch(opts, block = nil)
        +  short, long, nolong, style, pattern, conv, not_pattern, not_conv, not_style = [], [], []
        +  ldesc, sdesc, desc, arg = [], [], []
        +  default_style = Switch::NoArgument
        +  default_pattern = nil
        +  klass = nil
        +  q, a = nil
        +  has_arg = false
        +
        +  opts.each do |o|
        +    # argument class
        +    next if search(:atype, o) do |pat, c|
        +      klass = notwice(o, klass, 'type')
        +      if not_style && (not_style != Switch::NoArgument)
        +        not_pattern, not_conv = pat, c
        +      else
        +        default_pattern, conv = pat, c
        +      end
        +    end
        +
        +    # directly specified pattern(any object possible to match)
        +    if !(String === o || Symbol === o) && o.respond_to?(:match)
        +      pattern = notwice(o, pattern, 'pattern')
        +      if pattern.respond_to?(:convert)
        +        conv = pattern.method(:convert).to_proc
        +      else
        +        conv = SPLAT_PROC
        +      end
        +      next
        +    end
        +
        +    # anything others
        +    case o
        +    when Proc, Method
        +      block = notwice(o, block, 'block')
        +    when Array, Hash
        +      case pattern
        +      when CompletingHash
        +      when nil
        +        pattern = CompletingHash.new
        +        conv = pattern.method(:convert).to_proc if pattern.respond_to?(:convert)
        +      else
        +        raise ArgumentError, 'argument pattern given twice'
        +      end
        +      o.each { |pat, *v| pattern[pat] = v.fetch(0) { pat } }
        +    when Module
        +      raise ArgumentError, "unsupported argument type: #{o}", ParseError.filter_backtrace(caller(4))
        +    when *ArgumentStyle.keys
        +      style = notwice(ArgumentStyle[o], style, 'style')
        +    when /^--no-([^\[\]=\s]*)(.+)?/
        +      q, a = Regexp.last_match(1), Regexp.last_match(2)
        +      o = notwice(a ? Object : TrueClass, klass, 'type')
        +      not_pattern, not_conv = search(:atype, o) unless not_style
        +      not_style = (not_style || default_style).guess(arg = a) if a
        +      default_style = Switch::NoArgument
        +      default_pattern, conv = search(:atype, FalseClass) unless default_pattern
        +      ldesc << "--no-#{q}"
        +      q = q.downcase.tr('_', '-')
        +      long << "no-#{q}"
        +      nolong << q
        +    when /^--\[no-\]([^\[\]=\s]*)(.+)?/
        +      q, a = Regexp.last_match(1), Regexp.last_match(2)
        +      o = notwice(a ? Object : TrueClass, klass, 'type')
        +      if a
        +        default_style = default_style.guess(arg = a)
        +        default_pattern, conv = search(:atype, o) unless default_pattern
        +      end
        +      ldesc << "--[no-]#{q}"
        +      o = q.downcase.tr('_', '-')
        +      long << o
        +      not_pattern, not_conv = search(:atype, FalseClass) unless not_style
        +      not_style = Switch::NoArgument
        +      nolong << "no-#{o}"
        +    when /^--([^\[\]=\s]*)(.+)?/
        +      q, a = Regexp.last_match(1), Regexp.last_match(2)
        +      if a
        +        o = notwice(NilClass, klass, 'type')
        +        default_style = default_style.guess(arg = a)
        +        default_pattern, conv = search(:atype, o) unless default_pattern
        +      end
        +      ldesc << "--#{q}"
        +      # Opal patch:
        +      o = q.downcase.tr('_', '-')
        +      long << o
        +    when /^-(\[\^?\]?(?:[^\\\]]|\\.)*\])(.+)?/
        +      q, a = Regexp.last_match(1), Regexp.last_match(2)
        +      o = notwice(Object, klass, 'type')
        +      if a
        +        default_style = default_style.guess(arg = a)
        +        default_pattern, conv = search(:atype, o) unless default_pattern
        +      else
        +        has_arg = true
        +      end
        +      sdesc << "-#{q}"
        +      short << Regexp.new(q)
        +    when /^-(.)(.+)?/
        +      q, a = Regexp.last_match(1), Regexp.last_match(2)
        +      if a
        +        o = notwice(NilClass, klass, 'type')
        +        default_style = default_style.guess(arg = a)
        +        default_pattern, conv = search(:atype, o) unless default_pattern
        +      end
        +      sdesc << "-#{q}"
        +      short << q
        +    when /^=/
        +      style = notwice(default_style.guess(arg = o), style, 'style')
        +      default_pattern, conv = search(:atype, Object) unless default_pattern
        +    else
        +      desc.push(o)
        +    end
        +  end
        +
        +  default_pattern, conv = search(:atype, default_style.pattern) unless default_pattern
        +  if !(short.empty? && long.empty?)
        +    if has_arg && (default_style == Switch::NoArgument)
        +      default_style = Switch::RequiredArgument
        +    end
        +    s = (style || default_style).new(pattern || default_pattern,
        +      conv, sdesc, ldesc, arg, desc, block
        +    )
        +  elsif !block
        +    if style || pattern
        +      raise ArgumentError, 'no switch given', ParseError.filter_backtrace(caller)
        +    end
        +    s = desc
        +  else
        +    short << pattern
        +    s = (style || default_style).new(pattern,
        +      conv, nil, nil, arg, desc, block
        +    )
        +  end
        +  [s, short, long,
        +   (not_style.new(not_pattern, not_conv, sdesc, ldesc, nil, desc, block) if not_style),
        +   nolong]
        +end
        +
        +
        + +
        +

        + + #newObject + + + + + +

        +
        +

        Pushes a new List.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1270
        +1271
        +1272
        +1273
        +1274
        +1275
        +1276
        +1277
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1270
        +
        +def new
        +  @stack.push(List.new)
        +  if block_given?
        +    yield self
        +  else
        +    self
        +  end
        +end
        +
        +
        + +
        +

        + + #on(*opts, &block) ⇒ Object + + + + + +

        +
        +

        :call-seq: + on(*params, &block)

        + +

        :include: ../doc/optparse/creates_option.rdoc

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1493
        +1494
        +1495
        +1496
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1493
        +
        +def on(*opts, &block)
        +  define(*opts, &block)
        +  self
        +end
        +
        +
        + +
        +

        + + #on_head(*opts, &block) ⇒ Object + + + + + +

        +
        +

        :call-seq: + on_head(*params, &block)

        + +

        :include: ../doc/optparse/creates_option.rdoc

        + +

        The new option is added at the head of the summary.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1516
        +1517
        +1518
        +1519
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1516
        +
        +def on_head(*opts, &block)
        +  define_head(*opts, &block)
        +  self
        +end
        +
        +
        + +
        +

        + + #on_tail(*opts, &block) ⇒ Object + + + + + +

        +
        +

        :call-seq: + on_tail(*params, &block)

        + +

        :include: ../doc/optparse/creates_option.rdoc

        + +

        The new option is added at the tail of the summary.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1540
        +1541
        +1542
        +1543
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1540
        +
        +def on_tail(*opts, &block)
        +  define_tail(*opts, &block)
        +  self
        +end
        +
        +
        + +
        +

        + + #order(*argv, into: nil, &nonopt) ⇒ Object + + + + + +

        +
        +

        Parses command line arguments +argv+ in order. When a block is given, +each non-option argument is yielded. When optional +into+ keyword +argument is provided, the parsed option values are stored there via +[]= method (so it can be Hash, or OpenStruct, or other +similar object).

        + +

        Returns the rest of +argv+ left unparsed.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1562
        +1563
        +1564
        +1565
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1562
        +
        +def order(*argv, into: nil, &nonopt)
        +  argv = argv[0].dup if (argv.size == 1) && (Array === argv[0])
        +  order!(argv, into: into, &nonopt)
        +end
        +
        +
        + +
        +

        + + #order!(argv = default_argv, into: nil, &nonopt) ⇒ Object + + + + + +

        +
        +

        Same as #order, but removes switches destructively. +Non-option arguments remain in +argv+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1571
        +1572
        +1573
        +1574
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1571
        +
        +def order!(argv = default_argv, into: nil, &nonopt)
        +  setter = ->(name, val) { into[name.to_sym] = val } if into
        +  parse_in_order(argv, setter, &nonopt)
        +end
        +
        +
        + +
        +

        + + #parse(*argv, into: nil) ⇒ Object + + + + + +

        +
        +

        Parses command line arguments +argv+ in order when environment variable +POSIXLY_CORRECT is set, and in permutation mode otherwise. +When optional +into+ keyword argument is provided, the parsed option +values are stored there via []= method (so it can be Hash, +or OpenStruct, or other similar object).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1691
        +1692
        +1693
        +1694
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1691
        +
        +def parse(*argv, into: nil)
        +  argv = argv[0].dup if (argv.size == 1) && (Array === argv[0])
        +  parse!(argv, into: into)
        +end
        +
        +
        + +
        +

        + + #parse!(argv = default_argv, into: nil) ⇒ Object + + + + + +

        +
        +

        Same as #parse, but removes switches destructively. +Non-option arguments remain in +argv+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1700
        +1701
        +1702
        +1703
        +1704
        +1705
        +1706
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1700
        +
        +def parse!(argv = default_argv, into: nil)
        +  if ENV.include?('POSIXLY_CORRECT')
        +    order!(argv, into: into)
        +  else
        +    permute!(argv, into: into)
        +  end
        +end
        +
        +
        + +
        +

        + + #permute(*argv, into: nil) ⇒ Object + + + + + +

        +
        +

        Parses command line arguments +argv+ in permutation mode and returns +list of non-option arguments. When optional +into+ keyword +argument is provided, the parsed option values are stored there via +[]= method (so it can be Hash, or OpenStruct, or other +similar object).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1668
        +1669
        +1670
        +1671
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1668
        +
        +def permute(*argv, into: nil)
        +  argv = argv[0].dup if (argv.size == 1) && (Array === argv[0])
        +  permute!(argv, into: into)
        +end
        +
        +
        + +
        +

        + + #permute!(argv = default_argv, into: nil) ⇒ Object + + + + + +

        +
        +

        Same as #permute, but removes switches destructively. +Non-option arguments remain in +argv+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1677
        +1678
        +1679
        +1680
        +1681
        +1682
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1677
        +
        +def permute!(argv = default_argv, into: nil)
        +  nonopts = []
        +  order!(argv, into: into, &nonopts.method(:<<))
        +  argv[0, 0] = nonopts
        +  argv
        +end
        +
        +
        + +
        +

        + + #reject(*args, &blk) ⇒ Object + + + + + +

        +
        +

        Directs to reject specified class argument.

        + +

        +t+:: Argument class specifier, any object including Class.

        + +

        reject(t)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1155
        +1156
        +1157
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1155
        +
        +def reject(*args, &blk)
        +  top.reject(*args, &blk)
        +end
        +
        +
        + +
        +

        + + #removeObject + + + + + +

        +
        +

        Removes the last List.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1282
        +1283
        +1284
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1282
        +
        +def remove
        +  @stack.pop
        +end
        +
        +
        + +
        +

        + + #separator(string) ⇒ Object + + + + + +

        +
        +

        Add separator in summary.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1549
        +1550
        +1551
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1549
        +
        +def separator(string)
        +  top.append(string, nil, nil)
        +end
        +
        +
        + +
        +

        + + #summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk) ⇒ Object + + + + + +

        +
        +

        Puts option summary into +to+ and returns +to+. Yields each line if +a block is given.

        + +

        +to+:: Output destination, which must have method <<. Defaults to []. ++width+:: Width of left side, defaults to @summary_width. ++max+:: Maximum length allowed for left side, defaults to +width+ - 1. ++indent+:: Indentation, defaults to @summary_indent.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1295
        +1296
        +1297
        +1298
        +1299
        +1300
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1295
        +
        +def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk)
        +  nl = "\n"
        +  blk ||= proc { |l| to << (l.index(nl, -1) ? l : l + nl) }
        +  visit(:summarize, {}, {}, width, max, indent, &blk)
        +  to
        +end
        +
        +
        + +
        +

        + + #terminate(arg = nil) ⇒ Object + + + + + +

        +
        +

        Terminates option parsing. Optional parameter +arg+ is a string pushed +back to be the first non-option argument.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1115
        +1116
        +1117
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1115
        +
        +def terminate(arg = nil)
        +  self.class.terminate(arg)
        +end
        +
        +
        + +
        +

        + + #to_aObject + + + + + +

        +
        +

        Returns option summary list.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1313
        +1314
        +1315
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1313
        +
        +def to_a
        +  summarize([banner.to_s.split(/^/)]).join
        +end
        +
        +
        + +
        +

        + + #topObject + + + + + +

        +
        +

        Subject of #on / #on_head, #accept / #reject

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1256
        +1257
        +1258
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1256
        +
        +def top
        +  @stack[-1]
        +end
        +
        +
        + +
        +

        + + #verObject + + + + + +

        +
        +

        Returns version string from program_name, version and release.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1237
        +1238
        +1239
        +1240
        +1241
        +1242
        +1243
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1237
        +
        +def ver
        +  if v = version
        +    str = +"#{program_name} #{[v].join('.')}"
        +    str << " (#{v})" if v = release
        +    str
        +  end
        +end
        +
        +
        + +
        +

        + + #warn(mesg = $!) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +1245
        +1246
        +1247
        +
        +
        # File 'opal/stdlib/optparse.rb', line 1245
        +
        +def warn(mesg = $!)
        +  super("#{program_name}: #{mesg}")
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/AC.html b/docs/api/v1.8.2/stdlib/OptionParser/AC.html new file mode 100644 index 00000000..f3a3f6f8 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/AC.html @@ -0,0 +1,344 @@ + + + + + + + Class: OptionParser::AC + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::AC + + + +

        +
        + +
        +
        Inherits:
        +
        + OptionParser + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse/ac.rb
        +
        + +
        + + + + +

        Constant Summary

        + +

        Constants inherited + from OptionParser

        +

        ArgumentStyle, COMPSYS_HEADER, DecimalInteger, DecimalNumeric, DefaultList, NoArgument, OctalInteger, Officious, OptionalArgument, RequiredArgument, SPLAT_PROC, Version

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from OptionParser

        +

        #banner, #default_argv, #program_name, #release, #require_exact, #summary_indent, #summary_width, #version

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from OptionParser

        +

        #abort, #accept, accept, #add_officious, #additional_message, #base, #candidate, #compsys, #define, #define_by_keywords, #define_head, #define_tail, each_const, #environment, getopts, #getopts, #help, inc, #inc, #initialize, #load, #make_switch, #new, #on, #on_head, #on_tail, #order, #order!, #parse, #parse!, #permute, #permute!, reject, #reject, #remove, search_const, #separator, show_version, #summarize, terminate, #terminate, #to_a, top, #top, #ver, #warn, with

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser

        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #ac_arg_disable(name, help_string, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +38
        +39
        +40
        +
        +
        # File 'opal/stdlib/optparse/ac.rb', line 38
        +
        +def ac_arg_disable(name, help_string, &block)
        +  _ac_arg_enable('disable', name, help_string, block)
        +end
        +
        +
        + +
        +

        + + #ac_arg_enable(name, help_string, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +34
        +35
        +36
        +
        +
        # File 'opal/stdlib/optparse/ac.rb', line 34
        +
        +def ac_arg_enable(name, help_string, &block)
        +  _ac_arg_enable('enable', name, help_string, block)
        +end
        +
        +
        + +
        +

        + + #ac_arg_with(name, help_string, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +42
        +43
        +44
        +45
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +
        +
        # File 'opal/stdlib/optparse/ac.rb', line 42
        +
        +def ac_arg_with(name, help_string, &block)
        +  _check_ac_args(name, block)
        +
        +  sdesc = []
        +  ldesc = ["--with-#{name}"]
        +  desc = [help_string]
        +  q = name.downcase
        +  with = Switch::PlacedArgument.new(*search(:atype, String), sdesc, ldesc, nil, desc, block)
        +  without = Switch::NoArgument.new(nil, proc {}, sdesc, ldesc, nil, desc, block)
        +  top.append(with, [], ['with-' + q], without, ['without-' + q])
        +  with
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Acceptables.html b/docs/api/v1.8.2/stdlib/OptionParser/Acceptables.html new file mode 100644 index 00000000..4e259b66 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Acceptables.html @@ -0,0 +1,118 @@ + + + + + + + Module: OptionParser::Acceptables + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: OptionParser::Acceptables + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Acceptable argument classes. Now contains DecimalInteger, OctalInteger +and DecimalNumeric. See Acceptable argument classes (in source code).

        + + +
        +
        +
        + + +
        + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/AmbiguousArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/AmbiguousArgument.html new file mode 100644 index 00000000..ee6b2774 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/AmbiguousArgument.html @@ -0,0 +1,174 @@ + + + + + + + Exception: OptionParser::AmbiguousArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OptionParser::AmbiguousArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + InvalidArgument + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Raises when the given argument word can't be completed uniquely.

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants inherited + from ParseError

        +

        ParseError::Reason

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from ParseError

        +

        #additional, #args, #reason

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

        Method Summary

        + +

        Methods inherited from ParseError

        +

        filter_backtrace, #initialize, #inspect, #message, #recover, #set_backtrace, #set_option

        + +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::ParseError

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/AmbiguousOption.html b/docs/api/v1.8.2/stdlib/OptionParser/AmbiguousOption.html new file mode 100644 index 00000000..3836b046 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/AmbiguousOption.html @@ -0,0 +1,166 @@ + + + + + + + Exception: OptionParser::AmbiguousOption + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OptionParser::AmbiguousOption + + + +

        +
        + +
        +
        Inherits:
        +
        + ParseError + +
          +
        • Object
        • + + + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Raises when ambiguously completable string is encountered.

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants inherited + from ParseError

        +

        ParseError::Reason

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from ParseError

        +

        #additional, #args, #reason

        + + + + + + + + + +

        Method Summary

        + +

        Methods inherited from ParseError

        +

        filter_backtrace, #initialize, #inspect, #message, #recover, #set_backtrace, #set_option

        + +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::ParseError

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Arguable.html b/docs/api/v1.8.2/stdlib/OptionParser/Arguable.html new file mode 100644 index 00000000..77eaf7e7 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Arguable.html @@ -0,0 +1,691 @@ + + + + + + + Module: OptionParser::Arguable + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: OptionParser::Arguable + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Extends command line arguments array (ARGV) to parse itself.

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

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #getopts(*args) ⇒ Object + + + + + + + + + + + + + +

          Substitution of getopts is possible as follows.

          +
          + +
        • + + +
        • + + + #initialize(*args) ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #options ⇒ Object + + + + + + + + + + + + + +

          Actual OptionParser object, automatically created if nonexistent.

          +
          + +
        • + + +
        • + + + #options=(opt) ⇒ Object + + + + + + + + + + + + + +

          Sets OptionParser object, when +opt+ is +false+ or +nil+, methods OptionParser::Arguable#options and OptionParser::Arguable#options= are undefined.

          +
          + +
        • + + +
        • + + + #order!(&blk) ⇒ Object + + + + + + + + + + + + + +

          Parses +self+ destructively in order and returns +self+ containing the rest arguments left unparsed.

          +
          + +
        • + + +
        • + + + #parse! ⇒ Object + + + + + + + + + + + + + +

          Parses +self+ destructively and returns +self+ containing the rest arguments left unparsed.

          +
          + +
        • + + +
        • + + + #permute! ⇒ Object + + + + + + + + + + + + + +

          Parses +self+ destructively in permutation mode and returns +self+ containing the rest arguments left unparsed.

          +
          + +
        • + + +
        + + + + +
        +

        Class Method Details

        + + +
        +

        + + .extend_object(obj) ⇒ Object + + + + + +

        +
        +

        Initializes instance variable.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2253
        +2254
        +2255
        +2256
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2253
        +
        +def self.extend_object(obj)
        +  super
        +  obj.instance_eval { @optparse = nil }
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

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

        +
        +

        Substitution of getopts is possible as follows. Also see +OptionParser#getopts.

        + +

        def getopts(*args) + ($OPT = ARGV.getopts(*args)).each do |opt, val| + eval "$OPT_#'_') = val" + end + rescue OptionParser::ParseError + end

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2246
        +2247
        +2248
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2246
        +
        +def getopts(*args)
        +  options.getopts(self, *args)
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +2258
        +2259
        +2260
        +2261
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2258
        +
        +def initialize(*args)
        +  super
        +  @optparse = nil
        +end
        +
        +
        + +
        +

        + + #optionsObject + + + + + +

        +
        +

        Actual OptionParser object, automatically created if nonexistent.

        + +

        If called with a block, yields the OptionParser object and returns the +result of the block. If an OptionParser::ParseError exception occurs +in the block, it is rescued, a error message printed to STDERR and ++nil+ returned.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2199
        +2200
        +2201
        +2202
        +2203
        +2204
        +2205
        +2206
        +2207
        +2208
        +2209
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2199
        +
        +def options
        +  @optparse ||= OptionParser.new
        +  @optparse.default_argv = self
        +  block_given? || (return @optparse)
        +  begin
        +    yield @optparse
        +  rescue ParseError
        +    @optparse.warn $!
        +    nil
        +  end
        +end
        +
        +
        + +
        +

        + + #options=(opt) ⇒ Object + + + + + +

        +
        +

        Sets OptionParser object, when +opt+ is +false+ or +nil+, methods +OptionParser::Arguable#options and OptionParser::Arguable#options= are +undefined. Thus, there is no ways to access the OptionParser object +via the receiver object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2182
        +2183
        +2184
        +2185
        +2186
        +2187
        +2188
        +2189
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2182
        +
        +def options=(opt)
        +  unless @optparse = opt
        +    class << self
        +      undef_method(:options)
        +      undef_method(:options=)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #order!(&blk) ⇒ Object + + + + + +

        +
        +

        Parses +self+ destructively in order and returns +self+ containing the +rest arguments left unparsed.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2215
        +2216
        +2217
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2215
        +
        +def order!(&blk)
        +  options.order!(self, &blk)
        +end
        +
        +
        + +
        +

        + + #parse!Object + + + + + +

        +
        +

        Parses +self+ destructively and returns +self+ containing the +rest arguments left unparsed.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2231
        +2232
        +2233
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2231
        +
        +def parse!
        +  options.parse!(self)
        +end
        +
        +
        + +
        +

        + + #permute!Object + + + + + +

        +
        +

        Parses +self+ destructively in permutation mode and returns +self+ +containing the rest arguments left unparsed.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2223
        +2224
        +2225
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2223
        +
        +def permute!
        +  options.permute!(self)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/CompletingHash.html b/docs/api/v1.8.2/stdlib/OptionParser/CompletingHash.html new file mode 100644 index 00000000..f03da6be --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/CompletingHash.html @@ -0,0 +1,254 @@ + + + + + + + Class: OptionParser::CompletingHash + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::CompletingHash + + + +

        +
        + +
        +
        Inherits:
        +
        + Hash + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Completion
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Hash with completion search feature. See OptionParser::Completion.

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

        + Instance Method Summary + collapse +

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

        Methods included from Completion

        +

        candidate, #candidate, #complete, #convert, regexp

        + + + + + + + + + +

        Methods inherited from Hash

        +

        #_initialize, #initialize, #pretty_print, #pretty_print_cycle, #ruby2_keywords_hash, #ruby2_keywords_hash?, #to_json, #to_n

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from Hash

        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #match(key) ⇒ Object + + + + + +

        +
        +

        Completion for hash key.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +936
        +937
        +938
        +939
        +940
        +941
        +
        +
        # File 'opal/stdlib/optparse.rb', line 936
        +
        +def match(key)
        +  *values = fetch(key) do
        +    raise AmbiguousArgument, catch(:ambiguous) { return complete(key) }
        +  end
        +  [key, *values]
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Completion.html b/docs/api/v1.8.2/stdlib/OptionParser/Completion.html new file mode 100644 index 00000000..68e35936 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Completion.html @@ -0,0 +1,483 @@ + + + + + + + Module: OptionParser::Completion + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: OptionParser::Completion + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        CompletingHash, OptionMap
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Keyword completion module. This allows partial arguments to be specified +and resolved against a list of acceptable values.

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

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .candidate(key, icase = false, pat = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +445
        +446
        +447
        +448
        +449
        +450
        +451
        +452
        +453
        +454
        +455
        +456
        +457
        +458
        +459
        +460
        +
        +
        # File 'opal/stdlib/optparse.rb', line 445
        +
        +def self.candidate(key, icase = false, pat = nil, &block)
        +  pat ||= Completion.regexp(key, icase)
        +  candidates = []
        +  block.call do |k, *v|
        +    (if Regexp === k
        +       kn = ''
        +       k === key
        +     else
        +       kn = defined?(k.id2name) ? k.id2name : k
        +       pat === kn
        +     end) || next
        +    v << k if v.empty?
        +    candidates << [k, v, kn]
        +  end
        +  candidates
        +end
        +
        +
        + +
        +

        + + .regexp(key, icase) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +441
        +442
        +443
        +
        +
        # File 'opal/stdlib/optparse.rb', line 441
        +
        +def self.regexp(key, icase)
        +  Regexp.new('\A' + Regexp.quote(key).gsub(/\w+\b/, '\&\w*'), icase)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #candidate(key, icase = false, pat = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +462
        +463
        +464
        +
        +
        # File 'opal/stdlib/optparse.rb', line 462
        +
        +def candidate(key, icase = false, pat = nil)
        +  Completion.candidate(key, icase, pat, &method(:each))
        +end
        +
        +
        + +
        +

        + + #complete(key, icase = false, pat = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +468
        +469
        +470
        +471
        +472
        +473
        +474
        +475
        +476
        +477
        +478
        +479
        +480
        +481
        +482
        +483
        +484
        +485
        +486
        +487
        +488
        +489
        +490
        +491
        +
        +
        # File 'opal/stdlib/optparse.rb', line 468
        +
        +def complete(key, icase = false, pat = nil)
        +  candidates = candidate(key, icase, pat, &method(:each)).sort_by { |k, v, kn| kn.size }
        +  if candidates.size == 1
        +    canon, sw, * = candidates[0]
        +  elsif candidates.size > 1
        +    canon, sw, cn = candidates.shift
        +    candidates.each do |k, v, kn|
        +      next if sw == v
        +      if (String === cn) && (String === kn)
        +        if cn.rindex(kn, 0)
        +          canon, sw, cn = k, v, kn
        +          next
        +        elsif kn.rindex(cn, 0)
        +          next
        +        end
        +      end
        +      throw :ambiguous, key
        +    end
        +  end
        +  if canon
        +    block_given? || (return key, *sw)
        +    yield(key, *sw)
        +  end
        +end
        +
        +
        + +
        +

        + + #convert(opt = nil, val = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +493
        +494
        +495
        +
        +
        # File 'opal/stdlib/optparse.rb', line 493
        +
        +def convert(opt = nil, val = nil, *)
        +  val
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/InvalidArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/InvalidArgument.html new file mode 100644 index 00000000..0ca378f7 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/InvalidArgument.html @@ -0,0 +1,170 @@ + + + + + + + Exception: OptionParser::InvalidArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OptionParser::InvalidArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + ParseError + +
          +
        • Object
        • + + + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Raises when the given argument does not match required format.

        + + +
        +
        +
        + + +
        +

        Direct Known Subclasses

        +

        AmbiguousArgument

        +
        + + + +

        Constant Summary

        + +

        Constants inherited + from ParseError

        +

        ParseError::Reason

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from ParseError

        +

        #additional, #args, #reason

        + + + + + + + + + +

        Method Summary

        + +

        Methods inherited from ParseError

        +

        filter_backtrace, #initialize, #inspect, #message, #recover, #set_backtrace, #set_option

        + +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::ParseError

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/InvalidOption.html b/docs/api/v1.8.2/stdlib/OptionParser/InvalidOption.html new file mode 100644 index 00000000..e4b20b9a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/InvalidOption.html @@ -0,0 +1,166 @@ + + + + + + + Exception: OptionParser::InvalidOption + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OptionParser::InvalidOption + + + +

        +
        + +
        +
        Inherits:
        +
        + ParseError + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Raises when switch is undefined.

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants inherited + from ParseError

        +

        ParseError::Reason

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from ParseError

        +

        #additional, #args, #reason

        + + + + + + + + + +

        Method Summary

        + +

        Methods inherited from ParseError

        +

        filter_backtrace, #initialize, #inspect, #message, #recover, #set_backtrace, #set_option

        + +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::ParseError

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/List.html b/docs/api/v1.8.2/stdlib/OptionParser/List.html new file mode 100644 index 00000000..1e50f158 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/List.html @@ -0,0 +1,1317 @@ + + + + + + + Class: OptionParser::List + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::List + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Simple option list providing mapping from short and/or long option +string to OptionParser::Switch and mapping from acceptable argument to +matching pattern and converter pair. Also provides summary feature.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #atype ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Map from acceptable argument types to pattern and converter pairs.

          +
          + +
        • + + +
        • + + + #list ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          List of all switches and summary string.

          +
          + +
        • + + +
        • + + + #long ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Map from long style option switches to actual switch objects.

          +
          + +
        • + + +
        • + + + #short ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Map from short style option switches to actual switch objects.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initializeList + + + + + +

        +
        +

        Just initializes all instance variables.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +775
        +776
        +777
        +778
        +779
        +780
        +
        +
        # File 'opal/stdlib/optparse.rb', line 775
        +
        +def initialize
        +  @atype = {}
        +  @short = OptionMap.new
        +  @long = OptionMap.new
        +  @list = []
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #atypeObject (readonly) + + + + + +

        +
        +

        Map from acceptable argument types to pattern and converter pairs.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +761
        +762
        +763
        +
        +
        # File 'opal/stdlib/optparse.rb', line 761
        +
        +def atype
        +  @atype
        +end
        +
        +
        + + + +
        +

        + + #listObject (readonly) + + + + + +

        +
        +

        List of all switches and summary string.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +770
        +771
        +772
        +
        +
        # File 'opal/stdlib/optparse.rb', line 770
        +
        +def list
        +  @list
        +end
        +
        +
        + + + +
        +

        + + #longObject (readonly) + + + + + +

        +
        +

        Map from long style option switches to actual switch objects.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +767
        +768
        +769
        +
        +
        # File 'opal/stdlib/optparse.rb', line 767
        +
        +def long
        +  @long
        +end
        +
        +
        + + + +
        +

        + + #shortObject (readonly) + + + + + +

        +
        +

        Map from short style option switches to actual switch objects.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +764
        +765
        +766
        +
        +
        # File 'opal/stdlib/optparse.rb', line 764
        +
        +def short
        +  @short
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #accept(t, pat = /.*/m, &block) ⇒ Object + + + + + +

        +
        +

        See OptionParser.accept.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +785
        +786
        +787
        +788
        +789
        +790
        +791
        +792
        +793
        +794
        +795
        +796
        +
        +
        # File 'opal/stdlib/optparse.rb', line 785
        +
        +def accept(t, pat = /.*/m, &block)
        +  if pat
        +    pat.respond_to?(:match) ||
        +      raise(TypeError, "has no `match'", ParseError.filter_backtrace(caller(2)))
        +  else
        +    pat = t if t.respond_to?(:match)
        +  end
        +  unless block
        +    block = pat.method(:convert).to_proc if pat.respond_to?(:convert)
        +  end
        +  @atype[t] = [pat, block]
        +end
        +
        +
        + +
        +

        + + #add_banner(to) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +909
        +910
        +911
        +912
        +913
        +914
        +915
        +916
        +
        +
        # File 'opal/stdlib/optparse.rb', line 909
        +
        +def add_banner(to) # :nodoc:
        +  list.each do |opt|
        +    if opt.respond_to?(:add_banner)
        +      opt.add_banner(to)
        +    end
        +  end
        +  to
        +end
        +
        +
        + +
        +

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

        +
        +

        Appends +switch+ at the tail of the list, and associates short, long +and negated long options. Arguments are:

        + +

        +switch+:: OptionParser::Switch instance to be inserted. ++short_opts+:: List of short style options. ++long_opts+:: List of long style options. ++nolong_opts+:: List of long style options with "no-" prefix.

        + +

        append(switch, short_opts, long_opts, nolong_opts)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +849
        +850
        +851
        +852
        +
        +
        # File 'opal/stdlib/optparse.rb', line 849
        +
        +def append(*args)
        +  update(*args)
        +  @list.push(args[0])
        +end
        +
        +
        + +
        +

        + + #complete(id, opt, icase = false, *pat, &block) ⇒ Object + + + + + +

        +
        +

        Searches list +id+ for +opt+ and the optional patterns for completion ++pat+. If +icase+ is true, the search is case insensitive. The result +is returned or yielded if a block is given. If it isn't found, nil is +returned.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +871
        +872
        +873
        +
        +
        # File 'opal/stdlib/optparse.rb', line 871
        +
        +def complete(id, opt, icase = false, *pat, &block)
        +  __send__(id).complete(opt, icase, *pat, &block)
        +end
        +
        +
        + +
        +

        + + #compsys(*args, &block) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +918
        +919
        +920
        +921
        +922
        +923
        +924
        +
        +
        # File 'opal/stdlib/optparse.rb', line 918
        +
        +def compsys(*args, &block) # :nodoc:
        +  list.each do |opt|
        +    if opt.respond_to?(:compsys)
        +      opt.compsys(*args, &block)
        +    end
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        Iterates over each option, passing the option to the +block+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +882
        +883
        +884
        +
        +
        # File 'opal/stdlib/optparse.rb', line 882
        +
        +def each_option(&block)
        +  list.each(&block)
        +end
        +
        +
        + +
        +

        + + #get_candidates(id) {|__send__(id).keys| ... } ⇒ Object + + + + + +

        +
        + + +
        +
        +
        + +

        Yields:

        +
          + +
        • + + + (__send__(id).keys) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +875
        +876
        +877
        +
        +
        # File 'opal/stdlib/optparse.rb', line 875
        +
        +def get_candidates(id)
        +  yield __send__(id).keys
        +end
        +
        +
        + +
        +

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

        +
        +

        Inserts +switch+ at the head of the list, and associates short, long +and negated long options. Arguments are:

        + +

        +switch+:: OptionParser::Switch instance to be inserted. ++short_opts+:: List of short style options. ++long_opts+:: List of long style options. ++nolong_opts+:: List of long style options with "no-" prefix.

        + +

        prepend(switch, short_opts, long_opts, nolong_opts)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +833
        +834
        +835
        +836
        +
        +
        # File 'opal/stdlib/optparse.rb', line 833
        +
        +def prepend(*args)
        +  update(*args)
        +  @list.unshift(args[0])
        +end
        +
        +
        + +
        +

        + + #reject(t) ⇒ Object + + + + + +

        +
        +

        See OptionParser.reject.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +801
        +802
        +803
        +
        +
        # File 'opal/stdlib/optparse.rb', line 801
        +
        +def reject(t)
        +  @atype.delete(t)
        +end
        +
        +
        + +
        +

        + + #search(id, key) ⇒ Object + + + + + +

        +
        +

        Searches +key+ in +id+ list. The result is returned or yielded if a +block is given. If it isn't found, nil is returned.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +858
        +859
        +860
        +861
        +862
        +863
        +
        +
        # File 'opal/stdlib/optparse.rb', line 858
        +
        +def search(id, key)
        +  if list = __send__(id)
        +    val = list.fetch(key) { return nil }
        +    block_given? ? yield(val) : val
        +  end
        +end
        +
        +
        + +
        +

        + + #summarize(*args, &block) ⇒ Object + + + + + +

        +
        +

        Creates the summary table, passing each line to the +block+ (without +newline). The arguments +args+ are passed along to the summarize +method which is called on every option.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +891
        +892
        +893
        +894
        +895
        +896
        +897
        +898
        +899
        +900
        +901
        +902
        +903
        +904
        +905
        +906
        +907
        +
        +
        # File 'opal/stdlib/optparse.rb', line 891
        +
        +def summarize(*args, &block)
        +  sum = []
        +  list.reverse_each do |opt|
        +    if opt.respond_to?(:summarize) # perhaps OptionParser::Switch
        +      s = []
        +      opt.summarize(*args) { |l| s << l }
        +      sum.concat(s.reverse)
        +    elsif !opt || opt.empty?
        +      sum << ''
        +    elsif opt.respond_to?(:each_line)
        +      sum.concat([*opt.each_line].reverse)
        +    else
        +      sum.concat([*opt.each].reverse)
        +    end
        +  end
        +  sum.reverse_each(&block)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/MissingArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/MissingArgument.html new file mode 100644 index 00000000..d7f781f5 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/MissingArgument.html @@ -0,0 +1,166 @@ + + + + + + + Exception: OptionParser::MissingArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OptionParser::MissingArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + ParseError + +
          +
        • Object
        • + + + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Raises when a switch with mandatory argument has no argument.

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants inherited + from ParseError

        +

        ParseError::Reason

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from ParseError

        +

        #additional, #args, #reason

        + + + + + + + + + +

        Method Summary

        + +

        Methods inherited from ParseError

        +

        filter_backtrace, #initialize, #inspect, #message, #recover, #set_backtrace, #set_option

        + +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::ParseError

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/NeedlessArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/NeedlessArgument.html new file mode 100644 index 00000000..6d57442c --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/NeedlessArgument.html @@ -0,0 +1,166 @@ + + + + + + + Exception: OptionParser::NeedlessArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OptionParser::NeedlessArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + ParseError + +
          +
        • Object
        • + + + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Raises when there is an argument for a switch which takes no argument.

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants inherited + from ParseError

        +

        ParseError::Reason

        + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from ParseError

        +

        #additional, #args, #reason

        + + + + + + + + + +

        Method Summary

        + +

        Methods inherited from ParseError

        +

        filter_backtrace, #initialize, #inspect, #message, #recover, #set_backtrace, #set_option

        + +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::ParseError

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/OptionMap.html b/docs/api/v1.8.2/stdlib/OptionParser/OptionMap.html new file mode 100644 index 00000000..6b0f5147 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/OptionMap.html @@ -0,0 +1,168 @@ + + + + + + + Class: OptionParser::OptionMap + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::OptionMap + + + +

        +
        + +
        +
        Inherits:
        +
        + Hash + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Completion
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Map from option/keyword string to object with completion.

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

        Method Summary

        + +

        Methods included from Completion

        +

        candidate, #candidate, #complete, #convert, regexp

        + + + + + + + + + +

        Methods inherited from Hash

        +

        #_initialize, #initialize, #pretty_print, #pretty_print_cycle, #ruby2_keywords_hash, #ruby2_keywords_hash?, #to_json, #to_n

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from Hash

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/ParseError.html b/docs/api/v1.8.2/stdlib/OptionParser/ParseError.html new file mode 100644 index 00000000..598e680f --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/ParseError.html @@ -0,0 +1,847 @@ + + + + + + + Exception: OptionParser::ParseError + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: OptionParser::ParseError + + + +

        +
        + +
        +
        Inherits:
        +
        + RuntimeError + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Base class of exceptions from OptionParser.

        + + +
        +
        +
        + + +
        + + +

        + Constant Summary + collapse +

        + +
        + +
        Reason = +
        +
        +

        Reason which caused the error.

        + + +
        +
        +
        + + +
        +
        +
        'parse error'
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #additional ⇒ Object + + + + + + + + + + + + + + + + +

          Returns the value of attribute additional.

          +
          + +
        • + + +
        • + + + #args ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute args.

          +
          + +
        • + + +
        • + + + #reason ⇒ Object + + + + + + + + + + + + + + + + +

          Returns error reason.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(*args, additional: nil) ⇒ ParseError + + + + + +

        +
        +

        Returns a new instance of ParseError.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2066
        +2067
        +2068
        +2069
        +2070
        +2071
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2066
        +
        +def initialize(*args, additional: nil)
        +  @additional = additional
        +  @arg0, = args
        +  @args = args
        +  @reason = nil
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #additionalObject + + + + + +

        +
        +

        Returns the value of attribute additional.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2075
        +2076
        +2077
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2075
        +
        +def additional
        +  @additional
        +end
        +
        +
        + + + +
        +

        + + #argsObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute args.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2073
        +2074
        +2075
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2073
        +
        +def args
        +  @args
        +end
        +
        +
        + + + +
        +

        + + #reasonObject + + + + + +

        +
        +

        Returns error reason. Override this for I18N.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2108
        +2109
        +2110
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2108
        +
        +def reason
        +  @reason || self.class::Reason
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .filter_backtrace(array) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +2085
        +2086
        +2087
        +2088
        +2089
        +2090
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2085
        +
        +def self.filter_backtrace(array)
        +  unless $DEBUG
        +    array.delete_if(&%r"\A#{Regexp.quote(__FILE__)}:"o.method(:=~))
        +  end
        +  array
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #inspectObject + + + + + +

        + + + + +
        +
        +
        +
        +2112
        +2113
        +2114
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2112
        +
        +def inspect
        +  "#<#{self.class}: #{args.join(' ')}>"
        +end
        +
        +
        + +
        +

        + + #messageObject + + + + Also known as: + to_s + + + + +

        +
        +

        Default stringizing method to emit standard error message.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2119
        +2120
        +2121
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2119
        +
        +def message
        +  "#{reason}: #{args.join(' ')}#{additional[@arg0] if additional}"
        +end
        +
        +
        + +
        +

        + + #recover(argv) ⇒ Object + + + + + +

        +
        +

        Pushes back erred argument(s) to +argv+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2080
        +2081
        +2082
        +2083
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2080
        +
        +def recover(argv)
        +  argv[0, 0] = @args
        +  argv
        +end
        +
        +
        + +
        +

        + + #set_backtrace(array) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +2092
        +2093
        +2094
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2092
        +
        +def set_backtrace(array)
        +  super(self.class.filter_backtrace(array))
        +end
        +
        +
        + +
        +

        + + #set_option(opt, eq) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +2096
        +2097
        +2098
        +2099
        +2100
        +2101
        +2102
        +2103
        +
        +
        # File 'opal/stdlib/optparse.rb', line 2096
        +
        +def set_option(opt, eq)
        +  if eq
        +    @args[0] = opt
        +  else
        +    @args.unshift(opt)
        +  end
        +  self
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Switch.html b/docs/api/v1.8.2/stdlib/OptionParser/Switch.html new file mode 100644 index 00000000..a8f20748 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Switch.html @@ -0,0 +1,1416 @@ + + + + + + + Class: OptionParser::Switch + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::Switch + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Individual switch class. Not important to the user.

        + +

        Defined within Switch are several Switch-derived classes: NoArgument, +RequiredArgument, etc.

        + + +
        +
        +
        + + +
        +

        Defined Under Namespace

        +

        + + + + + Classes: NoArgument, OptionalArgument, PlacedArgument, RequiredArgument + + +

        + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #arg ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute arg.

          +
          + +
        • + + +
        • + + + #block ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute block.

          +
          + +
        • + + +
        • + + + #conv ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute conv.

          +
          + +
        • + + +
        • + + + #desc ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute desc.

          +
          + +
        • + + +
        • + + + #long ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute long.

          +
          + +
        • + + +
        • + + + #pattern ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute pattern.

          +
          + +
        • + + +
        • + + + #short ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute short.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(pattern = nil, conv = nil, short = nil, long = nil, arg = nil, desc = ([] if short || long), block = nil, &_block) ⇒ Switch + + + + + +

        +
        +

        Returns a new instance of Switch.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +545
        +546
        +547
        +548
        +549
        +550
        +551
        +552
        +
        +
        # File 'opal/stdlib/optparse.rb', line 545
        +
        +def initialize(pattern = nil, conv = nil,
        +  short = nil, long = nil, arg = nil,
        +  desc = ([] if short || long), block = nil, &_block)
        +  raise if Array === pattern
        +  block ||= _block
        +  @pattern, @conv, @short, @long, @arg, @desc, @block =
        +    pattern, conv, short, long, arg, desc, block
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #argObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute arg.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/optparse.rb', line 514
        +
        +def arg
        +  @arg
        +end
        +
        +
        + + + +
        +

        + + #blockObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute block.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/optparse.rb', line 514
        +
        +def block
        +  @block
        +end
        +
        +
        + + + +
        +

        + + #convObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute conv.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/optparse.rb', line 514
        +
        +def conv
        +  @conv
        +end
        +
        +
        + + + +
        +

        + + #descObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute desc.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/optparse.rb', line 514
        +
        +def desc
        +  @desc
        +end
        +
        +
        + + + +
        +

        + + #longObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute long.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/optparse.rb', line 514
        +
        +def long
        +  @long
        +end
        +
        +
        + + + +
        +

        + + #patternObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute pattern.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/optparse.rb', line 514
        +
        +def pattern
        +  @pattern
        +end
        +
        +
        + + + +
        +

        + + #shortObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute short.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/optparse.rb', line 514
        +
        +def short
        +  @short
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .guess(arg) ⇒ Object + + + + + +

        +
        +

        Guesses argument style from +arg+. Returns corresponding +OptionParser::Switch class (OptionalArgument, etc.).

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +520
        +521
        +522
        +523
        +524
        +525
        +526
        +527
        +528
        +529
        +530
        +531
        +532
        +533
        +
        +
        # File 'opal/stdlib/optparse.rb', line 520
        +
        +def self.guess(arg)
        +  case arg
        +  when ''
        +    t = self
        +  when /\A=?\[/
        +    t = Switch::OptionalArgument
        +  when /\A\s+\[/
        +    t = Switch::PlacedArgument
        +  else
        +    t = Switch::RequiredArgument
        +  end
        +  (self >= t) || incompatible_argument_styles(arg, t)
        +  t
        +end
        +
        +
        + +
        +

        + + .incompatible_argument_styles(arg, t) ⇒ Object + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +535
        +536
        +537
        +538
        +539
        +
        +
        # File 'opal/stdlib/optparse.rb', line 535
        +
        +def self.incompatible_argument_styles(arg, t)
        +  raise(ArgumentError, "#{arg}: incompatible argument styles\n  #{self}, #{t}",
        +    ParseError.filter_backtrace(caller(2))
        +  )
        +end
        +
        +
        + +
        +

        + + .patternObject + + + + + +

        + + + + +
        +
        +
        +
        +541
        +542
        +543
        +
        +
        # File 'opal/stdlib/optparse.rb', line 541
        +
        +def self.pattern
        +  NilClass
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #add_banner(to) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +642
        +643
        +644
        +645
        +646
        +647
        +648
        +
        +
        # File 'opal/stdlib/optparse.rb', line 642
        +
        +def add_banner(to) # :nodoc:
        +  unless @short || @long
        +    s = desc.join
        +    to << ' [' + s + ']...' unless s.empty?
        +  end
        +  to
        +end
        +
        +
        + +
        +

        + + #compsys(sdone, ldone) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +661
        +662
        +663
        +664
        +665
        +666
        +667
        +668
        +669
        +670
        +671
        +672
        +673
        +674
        +675
        +676
        +677
        +
        +
        # File 'opal/stdlib/optparse.rb', line 661
        +
        +def compsys(sdone, ldone) # :nodoc:
        +  sopts, lopts = [], []
        +  @short.each { |s| sdone.fetch(s) { sopts << s }; sdone[s] = true } if @short
        +  @long.each { |s| ldone.fetch(s) { lopts << s }; ldone[s] = true } if @long
        +  return if sopts.empty? && lopts.empty? # completely hidden
        +
        +  (sopts + lopts).each do |opt|
        +    # "(-x -c -r)-l[left justify]"
        +    if /^--\[no-\](.+)$/ =~ opt
        +      o = Regexp.last_match(1)
        +      yield("--#{o}", desc.join(''))
        +      yield("--no-#{o}", desc.join(''))
        +    else
        +      yield(opt.to_s, desc.join(''))
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #match_nonswitch?(str) ⇒ Boolean + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +650
        +651
        +652
        +
        +
        # File 'opal/stdlib/optparse.rb', line 650
        +
        +def match_nonswitch?(str) # :nodoc:
        +  @pattern =~ str unless @short || @long
        +end
        +
        +
        + +
        +

        + + #summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = '') ⇒ Object + + + + + +

        +
        +

        Produces the summary text. Each line of the summary is yielded to the +block (without newline).

        + +

        +sdone+:: Already summarized short style options keyed hash. ++ldone+:: Already summarized long style options keyed hash. ++width+:: Width of left side (option part). In other words, the right + side (description part) starts after +width+ columns. ++max+:: Maximum width of left side -> the options are filled within + +max+ columns. ++indent+:: Prefix string indents all summarized lines.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +637
        +638
        +639
        +640
        +
        +
        # File 'opal/stdlib/optparse.rb', line 605
        +
        +def summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = '')
        +  sopts, lopts = [], [], nil
        +  @short.each { |s| sdone.fetch(s) { sopts << s }; sdone[s] = true } if @short
        +  @long.each { |s| ldone.fetch(s) { lopts << s }; ldone[s] = true } if @long
        +  return if sopts.empty? && lopts.empty? # completely hidden
        +
        +  left = [sopts.join(', ')]
        +  right = desc.dup
        +
        +  while s = lopts.shift
        +    l = left[-1].length + s.length
        +    l += arg.length if left.size == 1 && arg
        +    (l < max) || sopts.empty? || left << +''
        +    left[-1] += (left[-1].empty? ? ' ' * 4 : ', ') + s
        +  end
        +
        +  if arg
        +    left[0] += (left[1] ? arg.sub(/\A(\[?)=/, '\1') + ',' : arg)
        +  end
        +  mlen = left.collect(&:length).max.to_i
        +  while (mlen > width) && (l = left.shift)
        +    mlen = left.collect(&:length).max.to_i if l.length == mlen
        +    if (l.length < width) && (r = right[0]) && !r.empty?
        +      l = l.to_s.ljust(width) + ' ' + r
        +      right.shift
        +    end
        +    yield(indent + l)
        +  end
        +
        +  while begin l = left.shift; r = right.shift; l || r end
        +    l = l.to_s.ljust(width) + ' ' + r if r && !r.empty?
        +    yield(indent + l)
        +  end
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #switch_nameObject + + + + + +

        +
        +

        Main name of the switch.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +657
        +658
        +659
        +
        +
        # File 'opal/stdlib/optparse.rb', line 657
        +
        +def switch_name
        +  (long.first || short.first).sub(/\A-+(?:\[no-\])?/, '')
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Switch/NoArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/Switch/NoArgument.html new file mode 100644 index 00000000..7d6ccab3 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Switch/NoArgument.html @@ -0,0 +1,369 @@ + + + + + + + Class: OptionParser::Switch::NoArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::Switch::NoArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + OptionParser::Switch + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Switch that takes no arguments.

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

        Instance Attribute Summary

        + +

        Attributes inherited from OptionParser::Switch

        +

        #arg, #block, #conv, #desc, #long, #pattern, #short

        + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from OptionParser::Switch

        +

        #add_banner, #compsys, guess, #initialize, #match_nonswitch?, #summarize, #switch_name

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::Switch

        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .incompatible_argument_stylesObject + + + + + +

        + + + + +
        +
        +
        +
        +691
        +692
        +
        +
        # File 'opal/stdlib/optparse.rb', line 691
        +
        +def self.incompatible_argument_styles(*)
        +end
        +
        +
        + +
        +

        + + .patternObject + + + + + +

        + + + + +
        +
        +
        +
        +694
        +695
        +696
        +
        +
        # File 'opal/stdlib/optparse.rb', line 694
        +
        +def self.pattern
        +  Object
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #parse(arg, argv) {|NeedlessArgument, arg| ... } ⇒ Object + + + + + +

        +
        +

        Raises an exception if any arguments given.

        + + +
        +
        +
        + +

        Yields:

        + + +
        + + + + +
        +
        +
        +
        +686
        +687
        +688
        +689
        +
        +
        # File 'opal/stdlib/optparse.rb', line 686
        +
        +def parse(arg, argv)
        +  yield(NeedlessArgument, arg) if arg
        +  conv_arg(arg)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Switch/OptionalArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/Switch/OptionalArgument.html new file mode 100644 index 00000000..8ff7229f --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Switch/OptionalArgument.html @@ -0,0 +1,245 @@ + + + + + + + Class: OptionParser::Switch::OptionalArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::Switch::OptionalArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + OptionParser::Switch + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Switch that can omit argument.

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

        Instance Attribute Summary

        + +

        Attributes inherited from OptionParser::Switch

        +

        #arg, #block, #conv, #desc, #long, #pattern, #short

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from OptionParser::Switch

        +

        #add_banner, #compsys, guess, incompatible_argument_styles, #initialize, #match_nonswitch?, pattern, #summarize, #switch_name

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::Switch

        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #parse(arg, argv, &error) ⇒ Object + + + + + +

        +
        +

        Parses argument if given, or uses default value.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +722
        +723
        +724
        +725
        +726
        +727
        +728
        +
        +
        # File 'opal/stdlib/optparse.rb', line 722
        +
        +def parse(arg, argv, &error)
        +  if arg
        +    conv_arg(*parse_arg(arg, &error))
        +  else
        +    conv_arg(arg)
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Switch/PlacedArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/Switch/PlacedArgument.html new file mode 100644 index 00000000..0d6fd122 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Switch/PlacedArgument.html @@ -0,0 +1,257 @@ + + + + + + + Class: OptionParser::Switch::PlacedArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::Switch::PlacedArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + OptionParser::Switch + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Switch that takes an argument, which does not begin with '-'.

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

        Instance Attribute Summary

        + +

        Attributes inherited from OptionParser::Switch

        +

        #arg, #block, #conv, #desc, #long, #pattern, #short

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from OptionParser::Switch

        +

        #add_banner, #compsys, guess, incompatible_argument_styles, #initialize, #match_nonswitch?, pattern, #summarize, #switch_name

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::Switch

        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #parse(arg, argv, &error) ⇒ Object + + + + + +

        +
        +

        Returns nil if argument is not present or begins with '-'.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +738
        +739
        +740
        +741
        +742
        +743
        +744
        +745
        +746
        +747
        +748
        +749
        +750
        +
        +
        # File 'opal/stdlib/optparse.rb', line 738
        +
        +def parse(arg, argv, &error)
        +  if !(val = arg) && (argv.empty? || /\A-/ =~ (val = argv[0]))
        +    return nil, block, nil
        +  end
        +  opt = (val = parse_arg(val, &error))[1]
        +  val = conv_arg(*val)
        +  if opt && !arg
        +    argv.shift
        +  else
        +    val[0] = nil
        +  end
        +  val
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/OptionParser/Switch/RequiredArgument.html b/docs/api/v1.8.2/stdlib/OptionParser/Switch/RequiredArgument.html new file mode 100644 index 00000000..47596a01 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/OptionParser/Switch/RequiredArgument.html @@ -0,0 +1,245 @@ + + + + + + + Class: OptionParser::Switch::RequiredArgument + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: OptionParser::Switch::RequiredArgument + + + +

        +
        + +
        +
        Inherits:
        +
        + OptionParser::Switch + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/optparse.rb
        +
        + +
        + +

        Overview

        +
        +

        Switch that takes an argument.

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

        Instance Attribute Summary

        + +

        Attributes inherited from OptionParser::Switch

        +

        #arg, #block, #conv, #desc, #long, #pattern, #short

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from OptionParser::Switch

        +

        #add_banner, #compsys, guess, incompatible_argument_styles, #initialize, #match_nonswitch?, pattern, #summarize, #switch_name

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from OptionParser::Switch

        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #parse(arg, argv) ⇒ Object + + + + + +

        +
        +

        Raises an exception if argument is not present.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +706
        +707
        +708
        +709
        +710
        +711
        +712
        +
        +
        # File 'opal/stdlib/optparse.rb', line 706
        +
        +def parse(arg, argv)
        +  unless arg
        +    raise MissingArgument if argv.empty?
        +    arg = argv.shift
        +  end
        +  conv_arg(*parse_arg(arg, &method(:raise)))
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PP.html b/docs/api/v1.8.2/stdlib/PP.html new file mode 100644 index 00000000..8c6a551a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PP.html @@ -0,0 +1,547 @@ + + + + + + + Class: PP + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PP + + + +

        +
        + +
        +
        Inherits:
        +
        + PrettyPrint + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        PPMethods
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb
        +
        + +
        + +

        Overview

        +
        +

        A pretty-printer for Ruby objects.

        + +

        == What PP Does

        + +

        Standard output by #p returns this: + #, @group_queue=#], []]>, @buffer=[], @newline="\n", @group_stack=[#], @buffer_width=0, @indent=0, @maxwidth=79, @output_width=2, @output=#IO:0x8114ee4>

        + +

        Pretty-printed output returns this: + #, + @group_queue= + #], + []]>, + @group_stack= + [#], + @indent=0, + @maxwidth=79, + @newline="\n", + @output=#IO:0x8114ee4, + @output_width=2>

        + +

        == Usage

        + +

        pp(obj) #=> obj + pp obj #=> obj + pp(obj1, obj2, ...) #=> [obj1, obj2, ...] + pp() #=> nil

        + +

        Output obj(s) to $> in pretty printed format.

        + +

        It returns obj(s).

        + +

        == Output Customization

        + +

        To define a customized pretty printing function for your classes, +redefine method #pretty_print(pp) in the class.

        + +

        #pretty_print takes the +pp+ argument, which is an instance of the PP class. +The method uses #text, #breakable, #nest, #group and #pp to print the +object.

        + +

        == Pretty-Print JSON

        + +

        To pretty-print JSON refer to JSON#pretty_generate.

        + +

        == Author +Tanaka Akira akr@fsij.org

        + + +
        +
        +
        + + +
        +

        Direct Known Subclasses

        +

        REPLUtils::ColorPrinter

        +
        +

        Defined Under Namespace

        +

        + + + Modules: ObjectMixin, PPMethods + + + + Classes: SingleLine + + +

        + + + + +

        Class Attribute Summary collapse

        + + + + + + +

        Attributes inherited from PrettyPrint

        +

        #genspace, #group_queue, #indent, #maxwidth, #newline, #output

        + + + +

        + Class Method Summary + collapse +

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

        Methods included from PPMethods

        +

        #check_inspect_key, #comma_breakable, #guard_inspect_key, #object_address_group, #object_group, #pop_inspect_key, #pp, #pp_hash, #pp_object, #push_inspect_key, #seplist

        + + + + + + + + + +

        Methods inherited from PrettyPrint

        +

        #break_outmost_groups, #breakable, #current_group, #fill_breakable, #flush, format, #group, #group_sub, #initialize, #nest, singleline_format, #text

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from PrettyPrint

        + +
        + +
        +

        Class Attribute Details

        + + + +
        +

        + + .sharing_detectionObject + + + + + +

        +
        +

        Returns the sharing detection flag as a boolean value. +It is false by default.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +104
        +105
        +106
        +
        +
        # File 'opal/stdlib/pp.rb', line 104
        +
        +def sharing_detection
        +  @sharing_detection
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .mcall(obj, mod, meth, *args, &block) ⇒ Object + + + + + +

        +
        +

        :stopdoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +95
        +96
        +97
        +
        +
        # File 'opal/stdlib/pp.rb', line 95
        +
        +def PP.mcall(obj, mod, meth, *args, &block)
        +  mod.instance_method(meth).bind_call(obj, *args, &block)
        +end
        +
        +
        + +
        +

        + + .pp(obj, out = $stdout, width = 79) ⇒ Object + + + + + +

        +
        +

        Outputs +obj+ to +out+ in pretty printed format of ++width+ columns in width.

        + +

        If +out+ is omitted, $> is assumed. +If +width+ is omitted, 79 is assumed.

        + +

        PP.pp returns +out+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +75
        +76
        +77
        +78
        +79
        +80
        +81
        +
        +
        # File 'opal/stdlib/pp.rb', line 75
        +
        +def PP.pp(obj, out=$stdout, width=79)  # Opal: replace $> with $stdout
        +  q = PP.new(out, width)
        +  q.guard_inspect_key {q.pp obj}
        +  q.flush
        +  #$pp = q
        +  out << "\n"
        +end
        +
        +
        + +
        +

        + + .singleline_pp(obj, out = $stdout) ⇒ Object + + + + + +

        +
        +

        Outputs +obj+ to +out+ like PP.pp but with no indent and +newline.

        + +

        PP.singleline_pp returns +out+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +87
        +88
        +89
        +90
        +91
        +92
        +
        +
        # File 'opal/stdlib/pp.rb', line 87
        +
        +def PP.singleline_pp(obj, out=$stdout)  # Opal: replace $> with $stdout
        +  q = SingleLine.new(out)
        +  q.guard_inspect_key {q.pp obj}
        +  q.flush
        +  out
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PP/ObjectMixin.html b/docs/api/v1.8.2/stdlib/PP/ObjectMixin.html new file mode 100644 index 00000000..e1e95f00 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PP/ObjectMixin.html @@ -0,0 +1,443 @@ + + + + + + + Module: PP::ObjectMixin + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: PP::ObjectMixin + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        Object
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #pretty_print(q) ⇒ Object + + + + + +

        +
        +

        A default pretty printing method for general objects. +It calls #pretty_print_instance_variables to list instance variables.

        + +

        If +self+ has a customized (redefined) #inspect method, +the result of self.inspect is used but it obviously has no +line break hints.

        + +

        This module provides predefined #pretty_print methods for some of +the most commonly used built-in classes for convenience.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +303
        +304
        +305
        +306
        +307
        +308
        +309
        +310
        +311
        +312
        +313
        +314
        +315
        +316
        +
        +
        # File 'opal/stdlib/pp.rb', line 303
        +
        +def pretty_print(q)
        +  umethod_method = Object.instance_method(:method)
        +  begin
        +    inspect_method = umethod_method.bind_call(self, :inspect)
        +  rescue NameError
        +  end
        +  if inspect_method && inspect_method.owner != Kernel
        +    q.text self.inspect
        +  elsif !inspect_method && self.respond_to?(:inspect)
        +    q.text self.inspect
        +  else
        +    q.pp_object(self)
        +  end
        +end
        +
        +
        + +
        +

        + + #pretty_print_cycle(q) ⇒ Object + + + + + +

        +
        +

        A default pretty printing method for general objects that are +detected as part of a cycle.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +320
        +321
        +322
        +323
        +324
        +325
        +
        +
        # File 'opal/stdlib/pp.rb', line 320
        +
        +def pretty_print_cycle(q)
        +  q.object_address_group(self) {
        +    q.breakable
        +    q.text '...'
        +  }
        +end
        +
        +
        + +
        +

        + + #pretty_print_inspectObject + + + + + +

        +
        +

        Is #inspect implementation using #pretty_print. +If you implement #pretty_print, it can be used as follows.

        + +

        alias inspect pretty_print_inspect

        + +

        However, doing this requires that every class that #inspect is called on +implement #pretty_print, or a RuntimeError will be raised.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +342
        +343
        +344
        +345
        +346
        +347
        +
        +
        # File 'opal/stdlib/pp.rb', line 342
        +
        +def pretty_print_inspect
        +  if Object.instance_method(:method).bind_call(self, :pretty_print).owner == PP::ObjectMixin
        +    raise "pretty_print is not overridden for #{self.class}"
        +  end
        +  PP.singleline_pp(self, ''.dup)
        +end
        +
        +
        + +
        +

        + + #pretty_print_instance_variablesObject + + + + + +

        +
        +

        Returns a sorted array of instance variable names.

        + +

        This method should return an array of names of instance variables as symbols or strings as: ++[:@a, :@b]+.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +331
        +332
        +333
        +
        +
        # File 'opal/stdlib/pp.rb', line 331
        +
        +def pretty_print_instance_variables
        +  instance_variables.sort
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PP/PPMethods.html b/docs/api/v1.8.2/stdlib/PP/PPMethods.html new file mode 100644 index 00000000..91b06389 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PP/PPMethods.html @@ -0,0 +1,1022 @@ + + + + + + + Module: PP::PPMethods + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: PP::PPMethods + + + +

        +
        + + + + + + + + + +
        +
        Included in:
        +
        PP, SingleLine
        +
        + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #check_inspect_key(id) ⇒ Object + + + + + +

        +
        +

        Check whether the object_id +id+ is in the current buffer of objects +to be pretty printed. Used to break cycles in chains of objects to be +pretty printed.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +133
        +134
        +135
        +136
        +137
        +
        +
        # File 'opal/stdlib/pp.rb', line 133
        +
        +def check_inspect_key(id)
        +  Thread.current[:__recursive_key__] &&
        +  Thread.current[:__recursive_key__][:inspect] &&
        +  Thread.current[:__recursive_key__][:inspect].include?(id)
        +end
        +
        +
        + +
        +

        + + #comma_breakableObject + + + + + +

        +
        +

        A convenience method which is same as follows:

        + +

        text ',' + breakable

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +208
        +209
        +210
        +211
        +
        +
        # File 'opal/stdlib/pp.rb', line 208
        +
        +def comma_breakable
        +  text ','
        +  breakable
        +end
        +
        +
        + +
        +

        + + #guard_inspect_keyObject + + + + + +

        +
        +

        Yields to a block +and preserves the previous set of objects being printed.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +111
        +112
        +113
        +114
        +115
        +116
        +117
        +118
        +119
        +120
        +121
        +122
        +123
        +124
        +125
        +126
        +127
        +128
        +
        +
        # File 'opal/stdlib/pp.rb', line 111
        +
        +def guard_inspect_key
        +  if Thread.current[:__recursive_key__] == nil
        +    Thread.current[:__recursive_key__] = {}.compare_by_identity
        +  end
        +
        +  if Thread.current[:__recursive_key__][:inspect] == nil
        +    Thread.current[:__recursive_key__][:inspect] = {}.compare_by_identity
        +  end
        +
        +  save = Thread.current[:__recursive_key__][:inspect]
        +
        +  begin
        +    Thread.current[:__recursive_key__][:inspect] = {}.compare_by_identity
        +    yield
        +  ensure
        +    Thread.current[:__recursive_key__][:inspect] = save
        +  end
        +end
        +
        +
        + +
        +

        + + #object_address_group(obj, &block) ⇒ Object + + + + + +

        +
        +

        A convenience method, like object_group, but also reformats the Object's +object_id.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +198
        +199
        +200
        +201
        +202
        +
        +
        # File 'opal/stdlib/pp.rb', line 198
        +
        +def object_address_group(obj, &block)
        +  str = Kernel.instance_method(:to_s).bind_call(obj)
        +  str = str.chomp('>')
        +  group(1, str, '>', &block)
        +end
        +
        +
        + +
        +

        + + #object_group(obj, &block) ⇒ Object + + + + + +

        +
        +

        A convenience method which is same as follows:

        + +

        group(1, '#<' + obj.class.name, '>') { ... }

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +192
        +193
        +194
        +
        +
        # File 'opal/stdlib/pp.rb', line 192
        +
        +def object_group(obj, &block) # :yield:
        +  group(1, '#<' + obj.class.name, '>', &block)
        +end
        +
        +
        + +
        +

        + + #pop_inspect_key(id) ⇒ Object + + + + + +

        +
        +

        Removes an object from the set of objects being pretty printed.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +146
        +147
        +148
        +
        +
        # File 'opal/stdlib/pp.rb', line 146
        +
        +def pop_inspect_key(id)
        +  Thread.current[:__recursive_key__][:inspect].delete id
        +end
        +
        +
        + +
        +

        + + #pp(obj = undefined) ⇒ Object + + + + + +

        +
        +

        Adds +obj+ to the pretty printing buffer +using Object#pretty_print or Object#pretty_print_cycle.

        + +

        Object#pretty_print_cycle is used when +obj+ is already +printed, a.k.a the object reference chain has a cycle.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +187
        +
        +
        # File 'opal/stdlib/pp.rb', line 155
        +
        +def pp(obj = undefined)
        +  # Opal: consider JS-native variables:
        +  %x{
        +    if (obj === null) {
        +      #{text "null"}
        +      #{return}
        +    }
        +    else if (obj === undefined) {
        +      #{text "undefined"}
        +      #{return}
        +    }
        +    else if (obj.$$class === undefined) {
        +      #{text `Object.prototype.toString.apply(obj)`}
        +      #{return}
        +    }
        +  }
        +
        +  # If obj is a Delegator then use the object being delegated to for cycle
        +  # detection
        +  obj = obj.__getobj__ if defined?(::Delegator) and obj.is_a?(::Delegator)
        +
        +  if check_inspect_key(obj)
        +    group {obj.pretty_print_cycle self}
        +    return
        +  end
        +
        +  begin
        +    push_inspect_key(obj)
        +    group {obj.pretty_print self}
        +  ensure
        +    pop_inspect_key(obj) unless PP.sharing_detection
        +  end
        +end
        +
        +
        + +
        +

        + + #pp_hash(obj) ⇒ Object + + + + + +

        +
        +

        A pretty print for a Hash

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +267
        +268
        +269
        +270
        +271
        +272
        +273
        +274
        +275
        +276
        +277
        +278
        +279
        +280
        +
        +
        # File 'opal/stdlib/pp.rb', line 267
        +
        +def pp_hash(obj)
        +  group(1, '{', '}') {
        +    seplist(obj, nil, :each_pair) {|k, v|
        +      group {
        +        pp k
        +        text '=>'
        +        group(1) {
        +          breakable ''
        +          pp v
        +        }
        +      }
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #pp_object(obj) ⇒ Object + + + + + +

        +
        +

        A present standard failsafe for pretty printing any given Object

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +251
        +252
        +253
        +254
        +255
        +256
        +257
        +258
        +259
        +260
        +261
        +262
        +263
        +264
        +
        +
        # File 'opal/stdlib/pp.rb', line 251
        +
        +def pp_object(obj)
        +  object_address_group(obj) {
        +    seplist(obj.pretty_print_instance_variables, lambda { text ',' }) {|v|
        +      breakable
        +      v = v.to_s if Symbol === v
        +      text v
        +      text '='
        +      group(1) {
        +        breakable ''
        +        pp(obj.instance_eval(v))
        +      }
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #push_inspect_key(id) ⇒ Object + + + + + +

        +
        +

        Adds the object_id +id+ to the set of objects being pretty printed, so +as to not repeat objects.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +141
        +142
        +143
        +
        +
        # File 'opal/stdlib/pp.rb', line 141
        +
        +def push_inspect_key(id)
        +  Thread.current[:__recursive_key__][:inspect][id] = true
        +end
        +
        +
        + +
        +

        + + #seplist(list, sep = nil, iter_method = :each) ⇒ Object + + + + + +

        +
        +

        Adds a separated list. +The list is separated by comma with breakable space, by default.

        + +

        seplist iterates the +list+ using +iter_method+.

        + +

        It yields each object to the block given for #seplist. +The procedure +separator_proc+ is called between each yields.

        + +

        If the iteration is zero times, +separator_proc+ is not called at all.

        + +

        If +separator_proc+ is nil or not given, ++lambda { comma_breakable }+ is used. +If +iter_method+ is not given, :each is used.

        + +

        For example, following 3 code fragments has similar effect.

        + +

        q.seplist([1,2,3]) {|v| xxx v }

        + +

        q.seplist([1,2,3], lambda { q.comma_breakable }, :each) {|v| xxx v }

        + +

        xxx 1 + q.comma_breakable + xxx 2 + q.comma_breakable + xxx 3

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +237
        +238
        +239
        +240
        +241
        +242
        +243
        +244
        +245
        +246
        +247
        +248
        +
        +
        # File 'opal/stdlib/pp.rb', line 237
        +
        +def seplist(list, sep=nil, iter_method=:each) # :yield: element
        +  sep ||= lambda { comma_breakable }
        +  first = true
        +  list.__send__(iter_method) {|*v|
        +    if first
        +      first = false
        +    else
        +      sep.call
        +    end
        +    yield(*v)
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PP/SingleLine.html b/docs/api/v1.8.2/stdlib/PP/SingleLine.html new file mode 100644 index 00000000..4bedbf93 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PP/SingleLine.html @@ -0,0 +1,168 @@ + + + + + + + Class: PP::SingleLine + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PP::SingleLine + + + +

        +
        + +
        +
        Inherits:
        +
        + PrettyPrint::SingleLine + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        PPMethods
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        Method Summary

        + +

        Methods included from PPMethods

        +

        #check_inspect_key, #comma_breakable, #guard_inspect_key, #object_address_group, #object_group, #pop_inspect_key, #pp, #pp_hash, #pp_object, #push_inspect_key, #seplist

        + + + + + + + + + +

        Methods inherited from PrettyPrint::SingleLine

        +

        #breakable, #first?, #flush, #group, #initialize, #nest, #text

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from PrettyPrint::SingleLine

        + +
        + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Pathname.html b/docs/api/v1.8.2/stdlib/Pathname.html new file mode 100644 index 00000000..0dda6f03 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Pathname.html @@ -0,0 +1,1981 @@ + + + + + + + Class: Pathname + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Pathname + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + +
        +
        Includes:
        +
        Comparable
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pathname.rb,
        + opal/stdlib/nodejs/pathname.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        Portions from Author:: Tanaka Akira akr@m17n.org

        + + +
        +
        +
        + + +
        + +

        + Constant Summary + collapse +

        + +
        + +
        SEPARATOR_PAT = + +
        +
        /#{Regexp.quote File::SEPARATOR}/
        + +
        SAME_PATHS = + +
        +
        if File::FNM_SYSCASE.nonzero?
        +  # Avoid #zero? here because #casecmp can return nil.
        +  proc { |a, b| a.casecmp(b) == 0 }
        +else
        +  proc { |a, b| a == b }
        +end
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #path ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute path.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(path) ⇒ Pathname + + + + + +

        +
        +

        Returns a new instance of Pathname.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +10
        +11
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +
        +
        # File 'opal/stdlib/pathname.rb', line 10
        +
        +def initialize(path)
        +  if Pathname === path
        +    @path = path.path.to_s
        +  elsif path.respond_to?(:to_path)
        +    @path = path.to_path
        +  elsif path.is_a?(String)
        +    @path = path
        +  elsif path.nil?
        +    raise TypeError, 'no implicit conversion of nil into String'
        +  else
        +    raise TypeError, "no implicit conversion of #{path.class} into String"
        +  end
        +  raise ArgumentError if @path == "\0"
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #pathObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute path.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +29
        +30
        +31
        +
        +
        # File 'opal/stdlib/pathname.rb', line 29
        +
        +def path
        +  @path
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .pwdObject + + + + + +

        + + + + +
        +
        +
        +
        +25
        +26
        +27
        +
        +
        # File 'opal/stdlib/pathname.rb', line 25
        +
        +def self.pwd
        +  new(Dir.pwd)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

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

        + + + + +
        +
        +
        +
        +87
        +88
        +89
        +90
        +
        +
        # File 'opal/stdlib/pathname.rb', line 87
        +
        +def +(other)
        +  other = Pathname.new(other) unless Pathname === other
        +  Pathname.new(plus(@path, other.to_s))
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +166
        +167
        +168
        +
        +
        # File 'opal/stdlib/pathname.rb', line 166
        +
        +def <=>(other)
        +  path <=> other.path
        +end
        +
        +
        + +
        +

        + + #==(other) ⇒ Object + + + + Also known as: + ===, eql? + + + + +

        + + + + +
        +
        +
        +
        +31
        +32
        +33
        +
        +
        # File 'opal/stdlib/pathname.rb', line 31
        +
        +def ==(other)
        +  other.path == @path
        +end
        +
        +
        + +
        +

        + + #absolute?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +35
        +36
        +37
        +
        +
        # File 'opal/stdlib/pathname.rb', line 35
        +
        +def absolute?
        +  !relative?
        +end
        +
        +
        + +
        +

        + + #basenameObject + + + + + +

        + + + + +
        +
        +
        +
        +154
        +155
        +156
        +
        +
        # File 'opal/stdlib/pathname.rb', line 154
        +
        +def basename
        +  Pathname.new(File.basename(@path))
        +end
        +
        +
        + +
        +

        + + #chop_basename(path) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +
        +
        # File 'opal/stdlib/pathname.rb', line 47
        +
        +def chop_basename(path) # :nodoc:
        +  base = File.basename(path)
        +  # ruby uses /^#{SEPARATOR_PAT}?$/o but having issues with interpolation
        +  if Regexp.new("^#{Pathname::SEPARATOR_PAT.source}?$") =~ base
        +    return nil
        +  else
        +    return path[0, path.rindex(base)], base
        +  end
        +end
        +
        +
        + +
        +

        + + #cleanpathObject + + + + + +

        + + + + +
        +
        +
        +
        +71
        +72
        +73
        +
        +
        # File 'opal/stdlib/pathname.rb', line 71
        +
        +def cleanpath
        +  `return Opal.normalize(#{@path})`
        +end
        +
        +
        + +
        +

        + + #directory?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +158
        +159
        +160
        +
        +
        # File 'opal/stdlib/pathname.rb', line 158
        +
        +def directory?
        +  File.directory?(@path)
        +end
        +
        +
        + +
        +

        + + #dirnameObject + + + + + +

        + + + + +
        +
        +
        +
        +150
        +151
        +152
        +
        +
        # File 'opal/stdlib/pathname.rb', line 150
        +
        +def dirname
        +  Pathname.new(File.dirname(@path))
        +end
        +
        +
        + +
        +

        + + #entriesObject + + + + + +

        + + + + +
        +
        +
        +
        +213
        +214
        +215
        +
        +
        # File 'opal/stdlib/pathname.rb', line 213
        +
        +def entries
        +  Dir.entries(@path).map { |f| self.class.new(f) }
        +end
        +
        +
        + +
        +

        + + #expand_pathObject + + + + + +

        + + + + +
        +
        +
        +
        +83
        +84
        +85
        +
        +
        # File 'opal/stdlib/pathname.rb', line 83
        +
        +def expand_path
        +  Pathname.new(File.expand_path(@path))
        +end
        +
        +
        + +
        +

        + + #extnameObject + + + + + +

        + + + + +
        +
        +
        +
        +162
        +163
        +164
        +
        +
        # File 'opal/stdlib/pathname.rb', line 162
        +
        +def extname
        +  File.extname(@path)
        +end
        +
        +
        + +
        +

        + + #hashObject + + + + + +

        + + + + +
        +
        +
        +
        +79
        +80
        +81
        +
        +
        # File 'opal/stdlib/pathname.rb', line 79
        +
        +def hash
        +  @path.hash
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +133
        +134
        +135
        +136
        +137
        +138
        +139
        +140
        +141
        +142
        +143
        +144
        +
        +
        # File 'opal/stdlib/pathname.rb', line 133
        +
        +def join(*args)
        +  return self if args.empty?
        +  result = args.pop
        +  result = Pathname.new(result) unless Pathname === result
        +  return result if result.absolute?
        +  args.reverse_each do |arg|
        +    arg = Pathname.new(arg) unless Pathname === arg
        +    result = arg + result
        +    return result if result.absolute?
        +  end
        +  self + result
        +end
        +
        +
        + +
        +

        + + #parentObject + + + + + +

        + + + + +
        +
        +
        +
        +61
        +62
        +63
        +64
        +65
        +
        +
        # File 'opal/stdlib/pathname.rb', line 61
        +
        +def parent
        +  new_path = @path.sub(%r{/([^/]+/?$)}, '')
        +  new_path = absolute? ? '/' : '.' if new_path == ''
        +  Pathname.new(new_path)
        +end
        +
        +
        + +
        +

        + + #plus(path1, path2) ⇒ Object + + + + + +

        +
        +

        -> path # :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/pathname.rb', line 92
        +
        +def plus(path1, path2) # -> path # :nodoc:
        +  prefix2 = path2
        +  index_list2 = []
        +  basename_list2 = []
        +  while (r2 = chop_basename(prefix2))
        +    prefix2, basename2 = r2
        +    index_list2.unshift prefix2.length
        +    basename_list2.unshift basename2
        +  end
        +  return path2 if prefix2 != ''
        +  prefix1 = path1
        +  while true
        +    while !basename_list2.empty? && basename_list2.first == '.'
        +      index_list2.shift
        +      basename_list2.shift
        +    end
        +    break unless (r1 = chop_basename(prefix1))
        +    prefix1, basename1 = r1
        +    next if basename1 == '.'
        +    if basename1 == '..' || basename_list2.empty? || basename_list2.first != '..'
        +      prefix1 += basename1
        +      break
        +    end
        +    index_list2.shift
        +    basename_list2.shift
        +  end
        +  r1 = chop_basename(prefix1)
        +  if !r1 && /#{SEPARATOR_PAT}/ =~ File.basename(prefix1)
        +    while !basename_list2.empty? && basename_list2.first == '..'
        +      index_list2.shift
        +      basename_list2.shift
        +    end
        +  end
        +  if !basename_list2.empty?
        +    suffix2 = path2[index_list2.first..-1]
        +    r1 ? File.join(prefix1, suffix2) : prefix1 + suffix2
        +  else
        +    r1 ? prefix1 : File.dirname(prefix1)
        +  end
        +end
        +
        +
        + +
        +

        + + #relative?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +39
        +40
        +41
        +42
        +43
        +44
        +45
        +
        +
        # File 'opal/stdlib/pathname.rb', line 39
        +
        +def relative?
        +  path = @path
        +  while (r = chop_basename(path))
        +    path, = r
        +  end
        +  path == ''
        +end
        +
        +
        + +
        +

        + + #relative_path_from(base_directory) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +177
        +178
        +179
        +180
        +181
        +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
        +
        +
        # File 'opal/stdlib/pathname.rb', line 177
        +
        +def relative_path_from(base_directory)
        +  dest_directory = cleanpath.to_s
        +  base_directory = base_directory.cleanpath.to_s
        +  dest_prefix = dest_directory
        +  dest_names = []
        +  while (r = chop_basename(dest_prefix))
        +    dest_prefix, basename = r
        +    dest_names.unshift basename if basename != '.'
        +  end
        +  base_prefix = base_directory
        +  base_names = []
        +  while (r = chop_basename(base_prefix))
        +    base_prefix, basename = r
        +    base_names.unshift basename if basename != '.'
        +  end
        +  unless SAME_PATHS[dest_prefix, base_prefix]
        +    raise ArgumentError, "different prefix: #{dest_prefix.inspect} and #{base_directory.inspect}"
        +  end
        +  while !dest_names.empty? &&
        +        !base_names.empty? &&
        +        SAME_PATHS[dest_names.first, base_names.first]
        +    dest_names.shift
        +    base_names.shift
        +  end
        +  if base_names.include? '..'
        +    raise ArgumentError, "base_directory has ..: #{base_directory.inspect}"
        +  end
        +  base_names.fill('..')
        +  relpath_names = base_names + dest_names
        +  if relpath_names.empty?
        +    Pathname.new('.')
        +  else
        +    Pathname.new(File.join(*relpath_names))
        +  end
        +end
        +
        +
        + +
        +

        + + #root?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +57
        +58
        +59
        +
        +
        # File 'opal/stdlib/pathname.rb', line 57
        +
        +def root?
        +  @path == '/'
        +end
        +
        +
        + +
        +

        + + #splitObject + + + + + +

        + + + + +
        +
        +
        +
        +146
        +147
        +148
        +
        +
        # File 'opal/stdlib/pathname.rb', line 146
        +
        +def split
        +  [dirname, basename]
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +67
        +68
        +69
        +
        +
        # File 'opal/stdlib/pathname.rb', line 67
        +
        +def sub(*args)
        +  Pathname.new(@path.sub(*args))
        +end
        +
        +
        + +
        +

        + + #to_pathObject + + + + + +

        + + + + +
        +
        +
        +
        +75
        +76
        +77
        +
        +
        # File 'opal/stdlib/pathname.rb', line 75
        +
        +def to_path
        +  @path
        +end
        +
        +
        + +
        +

        + + #to_sObject + + + + + +

        + + + + +
        +
        +
        +
        +219
        +220
        +221
        +
        +
        # File 'opal/stdlib/pathname.rb', line 219
        +
        +def to_path
        +  @path
        +end
        +
        +
        + +
        +

        + + #to_strObject + + + + + +

        + + + + +
        +
        +
        +
        +220
        +221
        +222
        +
        +
        # File 'opal/stdlib/pathname.rb', line 220
        +
        +def to_path
        +  @path
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PrettyPrint.html b/docs/api/v1.8.2/stdlib/PrettyPrint.html new file mode 100644 index 00000000..9fd19a17 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PrettyPrint.html @@ -0,0 +1,1685 @@ + + + + + + + Class: PrettyPrint + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PrettyPrint + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/prettyprint.rb
        +
        + +
        + +

        Overview

        +
        +

        This class implements a pretty printing algorithm. It finds line breaks and +nice indentations for grouped structure.

        + +

        By default, the class assumes that primitive elements are strings and each +byte in the strings have single column in width. But it can be used for +other situations by giving suitable arguments for some methods:

        + +
          +
        • newline object and space generation block for PrettyPrint.new
        • +
        • optional width argument for PrettyPrint#text
        • +
        • PrettyPrint#breakable
        • +
        + +

        There are several candidate uses:

        + +
          +
        • text formatting using proportional fonts
        • +
        • multibyte characters which has columns different to number of bytes
        • +
        • non-string formatting
        • +
        + +

        == Bugs

        + +
          +
        • Box based formatting?
        • +
        • Other (better) model/algorithm?
        • +
        + +

        Report any bugs at http://bugs.ruby-lang.org

        + +

        == References +Christian Lindig, Strictly Pretty, March 2000, +http://www.st.cs.uni-sb.de/~lindig/papers/#pretty

        + +

        Philip Wadler, A prettier printer, March 1998, +http://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier

        + +

        == Author +Tanaka Akira akr@fsij.org

        + + +
        +
        +
        + + +
        +

        Direct Known Subclasses

        +

        PP

        +
        +

        Defined Under Namespace

        +

        + + + + + Classes: Breakable, Group, GroupQueue, SingleLine, Text + + +

        + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #genspace ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          A lambda or Proc, that takes one argument, of a Fixnum, and returns the corresponding number of spaces.

          +
          + +
        • + + +
        • + + + #group_queue ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The PrettyPrint::GroupQueue of groups in stack to be pretty printed.

          +
          + +
        • + + +
        • + + + #indent ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The number of spaces to be indented.

          +
          + +
        • + + +
        • + + + #maxwidth ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The maximum width of a line, before it is separated in to a newline.

          +
          + +
        • + + +
        • + + + #newline ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The value that is appended to +output+ to add a new line.

          +
          + +
        • + + +
        • + + + #output ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The output object.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(output = ''.dup, maxwidth = 79, newline = "\n", &genspace) ⇒ PrettyPrint + + + + + +

        +
        +

        Creates a buffer for pretty printing.

        + +

        +output+ is an output target. If it is not specified, '' is assumed. It +should have a << method which accepts the first argument +obj+ of +PrettyPrint#text, the first argument +sep+ of PrettyPrint#breakable, the +first argument +newline+ of PrettyPrint.new, and the result of a given +block for PrettyPrint.new.

        + +

        +maxwidth+ specifies maximum line length. If it is not specified, 79 is +assumed. However actual outputs may overflow +maxwidth+ if long +non-breakable texts are provided.

        + +

        +newline+ is used for line breaks. "\n" is used if it is not specified.

        + +

        The block is used to generate spaces. {|width| ' ' * width} is used if it +is not given.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +82
        +83
        +84
        +85
        +86
        +87
        +88
        +89
        +90
        +91
        +92
        +93
        +94
        +95
        +96
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 82
        +
        +def initialize(output=''.dup, maxwidth=79, newline="\n", &genspace)
        +  @output = output
        +  @maxwidth = maxwidth
        +  @newline = newline
        +  @genspace = genspace || lambda {|n| ' ' * n}
        +
        +  @output_width = 0
        +  @buffer_width = 0
        +  @buffer = []
        +
        +  root_group = Group.new(0)
        +  @group_stack = [root_group]
        +  @group_queue = GroupQueue.new(root_group)
        +  @indent = 0
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #genspaceObject (readonly) + + + + + +

        +
        +

        A lambda or Proc, that takes one argument, of a Fixnum, and returns +the corresponding number of spaces.

        + +

        By default this is: + lambda {|n| ' ' * n}

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +118
        +119
        +120
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 118
        +
        +def genspace
        +  @genspace
        +end
        +
        +
        + + + +
        +

        + + #group_queueObject (readonly) + + + + + +

        +
        +

        The PrettyPrint::GroupQueue of groups in stack to be pretty printed

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +124
        +125
        +126
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 124
        +
        +def group_queue
        +  @group_queue
        +end
        +
        +
        + + + +
        +

        + + #indentObject (readonly) + + + + + +

        +
        +

        The number of spaces to be indented

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +121
        +122
        +123
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 121
        +
        +def indent
        +  @indent
        +end
        +
        +
        + + + +
        +

        + + #maxwidthObject (readonly) + + + + + +

        +
        +

        The maximum width of a line, before it is separated in to a newline

        + +

        This defaults to 79, and should be a Fixnum

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +106
        +107
        +108
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 106
        +
        +def maxwidth
        +  @maxwidth
        +end
        +
        +
        + + + +
        +

        + + #newlineObject (readonly) + + + + + +

        +
        +

        The value that is appended to +output+ to add a new line.

        + +

        This defaults to "\n", and should be String

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +111
        +112
        +113
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 111
        +
        +def newline
        +  @newline
        +end
        +
        +
        + + + +
        +

        + + #outputObject (readonly) + + + + + +

        +
        +

        The output object.

        + +

        This defaults to '', and should accept the << method

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +101
        +102
        +103
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 101
        +
        +def output
        +  @output
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .format(output = ''.dup, maxwidth = 79, newline = "\n", genspace = lambda {|n| ' ' * n}) {|q| ... } ⇒ Object + + + + + +

        +
        +

        This is a convenience method which is same as follows:

        + +

        begin + q = PrettyPrint.new(output, maxwidth, newline, &genspace) + ... + q.flush + output + end

        + + +
        +
        +
        + +

        Yields:

        +
          + +
        • + + + (q) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +45
        +46
        +47
        +48
        +49
        +50
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 45
        +
        +def PrettyPrint.format(output=''.dup, maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n})
        +  q = PrettyPrint.new(output, maxwidth, newline, &genspace)
        +  yield q
        +  q.flush
        +  output
        +end
        +
        +
        + +
        +

        + + .singleline_format(output = ''.dup, maxwidth = nil, newline = nil, genspace = nil) {|q| ... } ⇒ Object + + + + + +

        +
        +

        This is similar to PrettyPrint::format but the result has no breaks.

        + +

        +maxwidth+, +newline+ and +genspace+ are ignored.

        + +

        The invocation of +breakable+ in the block doesn't break a line and is +treated as just an invocation of +text+.

        + + +
        +
        +
        + +

        Yields:

        +
          + +
        • + + + (q) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +59
        +60
        +61
        +62
        +63
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 59
        +
        +def PrettyPrint.singleline_format(output=''.dup, maxwidth=nil, newline=nil, genspace=nil)
        +  q = SingleLine.new(output)
        +  yield q
        +  output
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #break_outmost_groupsObject + + + + + +

        +
        +

        Breaks the buffer into lines that are shorter than #maxwidth

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +169
        +170
        +171
        +172
        +173
        +174
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 160
        +
        +def break_outmost_groups
        +  while @maxwidth < @output_width + @buffer_width
        +    return unless group = @group_queue.deq
        +    until group.breakables.empty?
        +      data = @buffer.shift
        +      @output_width = data.output(@output, @output_width)
        +      @buffer_width -= data.width
        +    end
        +    while !@buffer.empty? && Text === @buffer.first
        +      text = @buffer.shift
        +      @output_width = text.output(@output, @output_width)
        +      @buffer_width -= text.width
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #breakable(sep = ' ', width = sep.length) ⇒ Object + + + + + +

        +
        +

        This says "you can break a line here if necessary", and a +width+-column +text +sep+ is inserted if a line is not broken at the point.

        + +

        If +sep+ is not specified, " " is used.

        + +

        If +width+ is not specified, +sep.length+ is used. You will have to +specify this when +sep+ is a multibyte character, for example.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +224
        +225
        +226
        +227
        +228
        +229
        +230
        +231
        +232
        +233
        +234
        +235
        +236
        +237
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 224
        +
        +def breakable(sep=' ', width=sep.length)
        +  group = @group_stack.last
        +  if group.break?
        +    flush
        +    @output << @newline
        +    @output << @genspace.call(@indent)
        +    @output_width = @indent
        +    @buffer_width = 0
        +  else
        +    @buffer << Breakable.new(sep, width, self)
        +    @buffer_width += width
        +    break_outmost_groups
        +  end
        +end
        +
        +
        + +
        +

        + + #current_groupObject + + + + + +

        +
        +

        Returns the group most recently added to the stack.

        + +

        Contrived example: + out = "" + => "" + q = PrettyPrint.new(out) + => #, @output_width=0, @buffer_width=0, @buffer=[], @group_stack=[#], @group_queue=#]]>, @indent=0> + q.group { + q.text q.current_group.inspect + q.text q.newline + q.group(q.current_group.depth + 1) { + q.text q.current_group.inspect + q.text q.newline + q.group(q.current_group.depth + 1) { + q.text q.current_group.inspect + q.text q.newline + q.group(q.current_group.depth + 1) { + q.text q.current_group.inspect + q.text q.newline + } + } + } + } + => 284 + puts out + # + # + # + #

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +155
        +156
        +157
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 155
        +
        +def current_group
        +  @group_stack.last
        +end
        +
        +
        + +
        +

        + + #fill_breakable(sep = ' ', width = sep.length) ⇒ Object + + + + + +

        +
        +

        This is similar to #breakable except +the decision to break or not is determined individually.

        + +

        Two #fill_breakable under a group may cause 4 results: +(break,break), (break,non-break), (non-break,break), (non-break,non-break). +This is different to #breakable because two #breakable under a group +may cause 2 results: +(break,break), (non-break,non-break).

        + +

        The text +sep+ is inserted if a line is not broken at this point.

        + +

        If +sep+ is not specified, " " is used.

        + +

        If +width+ is not specified, +sep.length+ is used. You will have to +specify this when +sep+ is a multibyte character, for example.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +212
        +213
        +214
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 212
        +
        +def fill_breakable(sep=' ', width=sep.length)
        +  group { breakable sep, width }
        +end
        +
        +
        + +
        +

        + + #flushObject + + + + + +

        +
        +

        outputs buffered data.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +288
        +289
        +290
        +291
        +292
        +293
        +294
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 288
        +
        +def flush
        +  @buffer.each {|data|
        +    @output_width = data.output(@output, @output_width)
        +  }
        +  @buffer.clear
        +  @buffer_width = 0
        +end
        +
        +
        + +
        +

        + + #group(indent = 0, open_obj = '', close_obj = '', open_width = open_obj.length, close_width = close_obj.length) ⇒ Object + + + + + +

        +
        +

        Groups line break hints added in the block. The line break hints are all +to be used or not.

        + +

        If +indent+ is specified, the method call is regarded as nested by +nest(indent) { ... }.

        + +

        If +open_obj+ is specified, text open_obj, open_width is called +before grouping. If +close_obj+ is specified, text close_obj, +close_width is called after grouping.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +249
        +250
        +251
        +252
        +253
        +254
        +255
        +256
        +257
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 249
        +
        +def group(indent=0, open_obj='', close_obj='', open_width=open_obj.length, close_width=close_obj.length)
        +  text open_obj, open_width
        +  group_sub {
        +    nest(indent) {
        +      yield
        +    }
        +  }
        +  text close_obj, close_width
        +end
        +
        +
        + +
        +

        + + #group_subObject + + + + + +

        +
        +

        Takes a block and queues a new group that is indented 1 level further.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +260
        +261
        +262
        +263
        +264
        +265
        +266
        +267
        +268
        +269
        +270
        +271
        +272
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 260
        +
        +def group_sub
        +  group = Group.new(@group_stack.last.depth + 1)
        +  @group_stack.push group
        +  @group_queue.enq group
        +  begin
        +    yield
        +  ensure
        +    @group_stack.pop
        +    if group.breakables.empty?
        +      @group_queue.delete group
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #nest(indent) ⇒ Object + + + + + +

        +
        +

        Increases left margin after newline with +indent+ for line breaks added in +the block.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +277
        +278
        +279
        +280
        +281
        +282
        +283
        +284
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 277
        +
        +def nest(indent)
        +  @indent += indent
        +  begin
        +    yield
        +  ensure
        +    @indent -= indent
        +  end
        +end
        +
        +
        + +
        +

        + + #text(obj, width = obj.length) ⇒ Object + + + + + +

        +
        +

        This adds +obj+ as a text of +width+ columns in width.

        + +

        If +width+ is not specified, obj.length is used.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +180
        +181
        +182
        +183
        +184
        +185
        +186
        +187
        +188
        +189
        +190
        +191
        +192
        +193
        +194
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 180
        +
        +def text(obj, width=obj.length)
        +  if @buffer.empty?
        +    @output << obj
        +    @output_width += width
        +  else
        +    text = @buffer.last
        +    unless Text === text
        +      text = Text.new
        +      @buffer << text
        +    end
        +    text.add(obj, width)
        +    @buffer_width += width
        +    break_outmost_groups
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PrettyPrint/Breakable.html b/docs/api/v1.8.2/stdlib/PrettyPrint/Breakable.html new file mode 100644 index 00000000..efa5e416 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PrettyPrint/Breakable.html @@ -0,0 +1,547 @@ + + + + + + + Class: PrettyPrint::Breakable + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PrettyPrint::Breakable + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/prettyprint.rb
        +
        + +
        + +

        Overview

        +
        +

        The Breakable class is used for breaking up object information

        + +

        This class is intended for internal use of the PrettyPrint buffers.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #indent ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The number of spaces to indent.

          +
          + +
        • + + +
        • + + + #obj ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Holds the separator String.

          +
          + +
        • + + +
        • + + + #width ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The width of +obj+ / +sep+.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(sep, width, q) ⇒ Breakable + + + + + +

        +
        +

        Create a new Breakable object.

        + +

        Arguments:

        + +
          +
        • +sep+ String of the separator
        • +
        • +width+ Fixnum width of the +sep+
        • +
        • +q+ parent PrettyPrint object, to base from
        • +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +345
        +346
        +347
        +348
        +349
        +350
        +351
        +352
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 345
        +
        +def initialize(sep, width, q)
        +  @obj = sep
        +  @width = width
        +  @pp = q
        +  @indent = q.indent
        +  @group = q.current_group
        +  @group.breakables.push self
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #indentObject (readonly) + + + + + +

        +
        +

        The number of spaces to indent.

        + +

        This is inferred from +q+ within PrettyPrint, passed in ::new

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +365
        +366
        +367
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 365
        +
        +def indent
        +  @indent
        +end
        +
        +
        + + + +
        +

        + + #objObject (readonly) + + + + + +

        +
        +

        Holds the separator String

        + +

        The +sep+ argument from ::new

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +357
        +358
        +359
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 357
        +
        +def obj
        +  @obj
        +end
        +
        +
        + + + +
        +

        + + #widthObject (readonly) + + + + + +

        +
        +

        The width of +obj+ / +sep+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +360
        +361
        +362
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 360
        +
        +def width
        +  @width
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #output(out, output_width) ⇒ Object + + + + + +

        +
        +

        Render the String text of the objects that have been added to this +Breakable object.

        + +

        Output the text to +out+, and increment the width to +output_width+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +371
        +372
        +373
        +374
        +375
        +376
        +377
        +378
        +379
        +380
        +381
        +382
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 371
        +
        +def output(out, output_width)
        +  @group.breakables.shift
        +  if @group.break?
        +    out << @pp.newline
        +    out << @pp.genspace.call(@indent)
        +    @indent
        +  else
        +    @pp.group_queue.delete @group if @group.breakables.empty?
        +    out << @obj
        +    output_width + @width
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PrettyPrint/Group.html b/docs/api/v1.8.2/stdlib/PrettyPrint/Group.html new file mode 100644 index 00000000..bfa99b03 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PrettyPrint/Group.html @@ -0,0 +1,614 @@ + + + + + + + Class: PrettyPrint::Group + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PrettyPrint::Group + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/prettyprint.rb
        +
        + +
        + +

        Overview

        +
        +

        The Group class is used for making indentation easier.

        + +

        While this class does neither the breaking into newlines nor indentation, +it is used in a stack (as well as a queue) within PrettyPrint, to group +objects.

        + +

        For information on using groups, see PrettyPrint#group

        + +

        This class is intended for internal use of the PrettyPrint buffers.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #breakables ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Array to hold the Breakable objects for this Group.

          +
          + +
        • + + +
        • + + + #depth ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          This group's relation to previous groups.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #break ⇒ Object + + + + + + + + + + + + + +

          Makes a break for this Group, and returns true.

          +
          + +
        • + + +
        • + + + #break? ⇒ Boolean + + + + + + + + + + + + + +

          Boolean of whether this Group has made a break.

          +
          + +
        • + + +
        • + + + #first? ⇒ Boolean + + + + + + + + + + + + + +

          Boolean of whether this Group has been queried for being first.

          +
          + +
        • + + +
        • + + + #initialize(depth) ⇒ Group + + + + + + + constructor + + + + + + + + +

          Create a Group object.

          +
          + +
        • + + +
        + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(depth) ⇒ Group + + + + + +

        +
        +

        Create a Group object

        + +

        Arguments:

        + +
          +
        • +depth+ - this group's relation to previous groups
        • +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +399
        +400
        +401
        +402
        +403
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 399
        +
        +def initialize(depth)
        +  @depth = depth
        +  @breakables = []
        +  @break = false
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #breakablesObject (readonly) + + + + + +

        +
        +

        Array to hold the Breakable objects for this Group

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +409
        +410
        +411
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 409
        +
        +def breakables
        +  @breakables
        +end
        +
        +
        + + + +
        +

        + + #depthObject (readonly) + + + + + +

        +
        +

        This group's relation to previous groups

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +406
        +407
        +408
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 406
        +
        +def depth
        +  @depth
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #breakObject + + + + + +

        +
        +

        Makes a break for this Group, and returns true

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +412
        +413
        +414
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 412
        +
        +def break
        +  @break = true
        +end
        +
        +
        + +
        +

        + + #break?Boolean + + + + + +

        +
        +

        Boolean of whether this Group has made a break

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +417
        +418
        +419
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 417
        +
        +def break?
        +  @break
        +end
        +
        +
        + +
        +

        + + #first?Boolean + + + + + +

        +
        +

        Boolean of whether this Group has been queried for being first

        + +

        This is used as a predicate, and ought to be called first.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +424
        +425
        +426
        +427
        +428
        +429
        +430
        +431
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 424
        +
        +def first?
        +  if defined? @first
        +    false
        +  else
        +    @first = false
        +    true
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PrettyPrint/GroupQueue.html b/docs/api/v1.8.2/stdlib/PrettyPrint/GroupQueue.html new file mode 100644 index 00000000..57d7aac0 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PrettyPrint/GroupQueue.html @@ -0,0 +1,450 @@ + + + + + + + Class: PrettyPrint::GroupQueue + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PrettyPrint::GroupQueue + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/prettyprint.rb
        +
        + +
        + +

        Overview

        +
        +

        The GroupQueue class is used for managing the queue of Group to be pretty +printed.

        + +

        This queue groups the Group objects, based on their depth.

        + +

        This class is intended for internal use of the PrettyPrint buffers.

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

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(*groups) ⇒ GroupQueue + + + + + +

        +
        +

        Create a GroupQueue object

        + +

        Arguments:

        + +
          +
        • +groups+ - one or more PrettyPrint::Group objects
        • +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +445
        +446
        +447
        +448
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 445
        +
        +def initialize(*groups)
        +  @queue = []
        +  groups.each {|g| enq g}
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #delete(group) ⇒ Object + + + + + +

        +
        +

        Remote +group+ from this queue

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +477
        +478
        +479
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 477
        +
        +def delete(group)
        +  @queue[group.depth].delete(group)
        +end
        +
        +
        + +
        +

        + + #deqObject + + + + + +

        +
        +

        Returns the outer group of the queue

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +461
        +462
        +463
        +464
        +465
        +466
        +467
        +468
        +469
        +470
        +471
        +472
        +473
        +474
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 461
        +
        +def deq
        +  @queue.each {|gs|
        +    (gs.length-1).downto(0) {|i|
        +      unless gs[i].breakables.empty?
        +        group = gs.slice!(i, 1).first
        +        group.break
        +        return group
        +      end
        +    }
        +    gs.each {|group| group.break}
        +    gs.clear
        +  }
        +  return nil
        +end
        +
        +
        + +
        +

        + + #enq(group) ⇒ Object + + + + + +

        +
        +

        Enqueue +group+

        + +

        This does not strictly append the group to the end of the queue, +but instead adds it in line, base on the +group.depth+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +454
        +455
        +456
        +457
        +458
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 454
        +
        +def enq(group)
        +  depth = group.depth
        +  @queue << [] until depth < @queue.length
        +  @queue[depth] << group
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PrettyPrint/SingleLine.html b/docs/api/v1.8.2/stdlib/PrettyPrint/SingleLine.html new file mode 100644 index 00000000..1382bca7 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PrettyPrint/SingleLine.html @@ -0,0 +1,665 @@ + + + + + + + Class: PrettyPrint::SingleLine + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PrettyPrint::SingleLine + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/prettyprint.rb
        +
        + +
        + +

        Overview

        +
        +

        PrettyPrint::SingleLine is used by PrettyPrint.singleline_format

        + +

        It is passed to be similar to a PrettyPrint object itself, by responding to:

        + +
          +
        • #text
        • +
        • #breakable
        • +
        • #nest
        • +
        • #group
        • +
        • #flush
        • +
        • #first?
        • +
        + +

        but instead, the output has no line breaks

        + + +
        +
        +
        + + +
        +

        Direct Known Subclasses

        +

        PP::SingleLine

        +
        + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(output, maxwidth = nil, newline = nil) ⇒ SingleLine + + + + + +

        +
        +

        Create a PrettyPrint::SingleLine object

        + +

        Arguments:

        + +
          +
        • +output+ - String (or similar) to store rendered text. Needs to respond to '<<'
        • +
        • +maxwidth+ - Argument position expected to be here for compatibility. + This argument is a noop.
        • +
        • +newline+ - Argument position expected to be here for compatibility. + This argument is a noop.
        • +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +503
        +504
        +505
        +506
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 503
        +
        +def initialize(output, maxwidth=nil, newline=nil)
        +  @output = output
        +  @first = [true]
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #breakable(sep = ' ', width = nil) ⇒ Object + + + + + +

        +
        +

        Appends +sep+ to the text to be output. By default +sep+ is ' '

        + +

        +width+ argument is here for compatibility. It is a noop argument.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +518
        +519
        +520
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 518
        +
        +def breakable(sep=' ', width=nil)
        +  @output << sep
        +end
        +
        +
        + +
        +

        + + #first?Boolean + + + + + +

        +
        +

        This is used as a predicate, and ought to be called first.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +550
        +551
        +552
        +553
        +554
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 550
        +
        +def first?
        +  result = @first[-1]
        +  @first[-1] = false
        +  result
        +end
        +
        +
        + +
        +

        + + #flushObject + + + + + +

        +
        +

        Method present for compatibility, but is a noop

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +546
        +547
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 546
        +
        +def flush # :nodoc:
        +end
        +
        +
        + +
        +

        + + #group(indent = nil, open_obj = '', close_obj = '', open_width = nil, close_width = nil) ⇒ Object + + + + + +

        +
        +

        Opens a block for grouping objects to be pretty printed.

        + +

        Arguments:

        + +
          +
        • +indent+ - noop argument. Present for compatibility.
        • +
        • +open_obj+ - text appended before the &blok. Default is ''
        • +
        • +close_obj+ - text appended after the &blok. Default is ''
        • +
        • +open_width+ - noop argument. Present for compatibility.
        • +
        • +close_width+ - noop argument. Present for compatibility.
        • +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +537
        +538
        +539
        +540
        +541
        +542
        +543
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 537
        +
        +def group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil)
        +  @first.push true
        +  @output << open_obj
        +  yield
        +  @output << close_obj
        +  @first.pop
        +end
        +
        +
        + +
        +

        + + #nest(indent) ⇒ Object + + + + + +

        +
        +

        Takes +indent+ arg, but does nothing with it.

        + +

        Yields to a block.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +525
        +526
        +527
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 525
        +
        +def nest(indent) # :nodoc:
        +  yield
        +end
        +
        +
        + +
        +

        + + #text(obj, width = nil) ⇒ Object + + + + + +

        +
        +

        Add +obj+ to the text to be output.

        + +

        +width+ argument is here for compatibility. It is a noop argument.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +511
        +512
        +513
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 511
        +
        +def text(obj, width=nil)
        +  @output << obj
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PrettyPrint/Text.html b/docs/api/v1.8.2/stdlib/PrettyPrint/Text.html new file mode 100644 index 00000000..67a6c48b --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PrettyPrint/Text.html @@ -0,0 +1,444 @@ + + + + + + + Class: PrettyPrint::Text + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PrettyPrint::Text + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/prettyprint.rb
        +
        + +
        + +

        Overview

        +
        +

        The Text class is the means by which to collect strings from objects.

        + +

        This class is intended for internal use of the PrettyPrint buffers.

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #width ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          The total width of the objects included in this Text object.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #add(obj, width) ⇒ Object + + + + + + + + + + + + + +

          Include +obj+ in the objects to be pretty printed, and increment this Text object's total width by +width+.

          +
          + +
        • + + +
        • + + + #initialize ⇒ Text + + + + + + + constructor + + + + + + + + +

          Creates a new text object.

          +
          + +
        • + + +
        • + + + #output(out, output_width) ⇒ Object + + + + + + + + + + + + + +

          Render the String text of the objects that have been added to this Text object.

          +
          + +
        • + + +
        + + +
        +

        Constructor Details

        + +
        +

        + + #initializeText + + + + + +

        +
        +

        Creates a new text object.

        + +

        This constructor takes no arguments.

        + +

        The workflow is to append a PrettyPrint::Text object to the buffer, and +being able to call the buffer.last() to reference it.

        + +

        As there are objects, use PrettyPrint::Text#add to include the objects +and the width to utilized by the String version of this object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +310
        +311
        +312
        +313
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 310
        +
        +def initialize
        +  @objs = []
        +  @width = 0
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #widthObject (readonly) + + + + + +

        +
        +

        The total width of the objects included in this Text object.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +316
        +317
        +318
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 316
        +
        +def width
        +  @width
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #add(obj, width) ⇒ Object + + + + + +

        +
        +

        Include +obj+ in the objects to be pretty printed, and increment +this Text object's total width by +width+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +328
        +329
        +330
        +331
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 328
        +
        +def add(obj, width)
        +  @objs << obj
        +  @width += width
        +end
        +
        +
        + +
        +

        + + #output(out, output_width) ⇒ Object + + + + + +

        +
        +

        Render the String text of the objects that have been added to this Text object.

        + +

        Output the text to +out+, and increment the width to +output_width+

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +321
        +322
        +323
        +324
        +
        +
        # File 'opal/stdlib/prettyprint.rb', line 321
        +
        +def output(out, output_width)
        +  @objs.each {|obj| out << obj}
        +  output_width + @width
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Proc.html b/docs/api/v1.8.2/stdlib/Proc.html new file mode 100644 index 00000000..2ee0f232 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Proc.html @@ -0,0 +1,334 @@ + + + + + + + Class: Proc + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Proc + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/await.rb,
        + opal/stdlib/native.rb,
        opal/stdlib/ruby2_keywords.rb
        +
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #async?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +70
        +71
        +72
        +
        +
        # File 'opal/stdlib/await.rb', line 70
        +
        +def async?
        +  `self instanceof AsyncFunction`
        +end
        +
        +
        + +
        +

        + + #ruby2_keywordsObject + + + + + +

        +
        +

        call-seq: + proc.ruby2_keywords -> proc

        + +

        Does nothing and just returns the receiver.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +34
        +35
        +36
        +
        +
        # File 'opal/stdlib/ruby2_keywords.rb', line 34
        +
        +def ruby2_keywords
        +  self
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        + + + + +
        +
        +
        +
        +456
        +457
        +458
        +
        +
        # File 'opal/stdlib/native.rb', line 456
        +
        +def to_n
        +  self
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Promise.html b/docs/api/v1.8.2/stdlib/Promise.html new file mode 100644 index 00000000..1b5d612a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Promise.html @@ -0,0 +1,2456 @@ + + + + + + + Class: Promise + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Promise + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/promise.rb
        +
        + +
        + +

        Overview

        +
        +

        Promise is used to help structure asynchronous code.

        + +

        It is available in the Opal standard library, and can be required in any Opal +application:

        + +
        require 'promise'
        +
        + +

        Basic Usage

        + +

        Promises are created and returned as objects with the assumption that they +will eventually be resolved or rejected, but never both. A Promise has +a #then and #fail method (or one of their aliases) that can be used to +register a block that gets called once resolved or rejected.

        + +
        promise = Promise.new
        +
        +promise.then {
        +  puts "resolved!"
        +}.fail {
        +  puts "rejected!"
        +}
        +
        +# some time later
        +promise.resolve
        +
        +# => "resolved!"
        +
        + +

        It is important to remember that a promise can only be resolved or rejected +once, so the block will only ever be called once (or not at all).

        + +

        Resolving Promises

        + +

        To resolve a promise, means to inform the Promise that it has succeeded +or evaluated to a useful value. #resolve can be passed a value which is +then passed into the block handler:

        + +
        def get_json
        +  promise = Promise.new
        +
        +  HTTP.get("some_url") do |req|
        +    promise.resolve req.json
        +  end
        +
        +  promise
        +end
        +
        +get_json.then do |json|
        +  puts "got some JSON from server"
        +end
        +
        + +

        Rejecting Promises

        + +

        Promises are also designed to handle error cases, or situations where an +outcome is not as expected. Taking the previous example, we can also pass +a value to a #reject call, which passes that object to the registered +#fail handler:

        + +
        def get_json
        +  promise = Promise.new
        +
        +  HTTP.get("some_url") do |req|
        +    if req.ok?
        +      promise.resolve req.json
        +    else
        +      promise.reject req
        +    end
        +
        +  promise
        +end
        +
        +get_json.then {
        +  # ...
        +}.fail { |req|
        +  puts "it went wrong: #{req.message}"
        +}
        +
        + +

        Chaining Promises

        + +

        Promises become even more useful when chained together. Each #then or +#fail call returns a new Promise which can be used to chain more and more +handlers together.

        + +
        promise.then { wait_for_something }.then { do_something_else }
        +
        + +

        Rejections are propagated through the entire chain, so a "catch all" handler +can be attached at the end of the tail:

        + +
        promise.then { ... }.then { ... }.fail { ... }
        +
        + +

        Composing Promises

        + +

        Promise.when can be used to wait for more than one promise to resolve (or +reject). Using the previous example, we could request two different json +requests and wait for both to finish:

        + +
        Promise.when(get_json, get_json2).then |first, second|
        +  puts "got two json payloads: #{first}, #{second}"
        +end
        +
        + + +
        +
        +
        + + +
        +

        Direct Known Subclasses

        +

        Trace, When

        +
        +

        Defined Under Namespace

        +

        + + + + + Classes: Trace, When + + +

        + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #error ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute error.

          +
          + +
        • + + +
        • + + + #next ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute next.

          +
          + +
        • + + +
        • + + + #prev ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute prev.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(action = {}) ⇒ Promise + + + + + +

        +
        +

        Returns a new instance of Promise.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +115
        +116
        +117
        +118
        +119
        +120
        +121
        +122
        +123
        +124
        +125
        +126
        +
        +
        # File 'opal/stdlib/promise.rb', line 115
        +
        +def initialize(action = {})
        +  @action = action
        +
        +  @realized  = false
        +  @exception = false
        +  @value     = nil
        +  @error     = nil
        +  @delayed   = false
        +
        +  @prev = nil
        +  @next = []
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #errorObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute error.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +113
        +114
        +115
        +
        +
        # File 'opal/stdlib/promise.rb', line 113
        +
        +def error
        +  @error
        +end
        +
        +
        + + + +
        +

        + + #nextObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute next.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +113
        +114
        +115
        +
        +
        # File 'opal/stdlib/promise.rb', line 113
        +
        +def next
        +  @next
        +end
        +
        +
        + + + +
        +

        + + #prevObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute prev.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +113
        +114
        +115
        +
        +
        # File 'opal/stdlib/promise.rb', line 113
        +
        +def prev
        +  @prev
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .error(value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +105
        +106
        +107
        +
        +
        # File 'opal/stdlib/promise.rb', line 105
        +
        +def self.error(value)
        +  new.reject(value)
        +end
        +
        +
        + +
        +

        + + .value(value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +101
        +102
        +103
        +
        +
        # File 'opal/stdlib/promise.rb', line 101
        +
        +def self.value(value)
        +  new.resolve(value)
        +end
        +
        +
        + +
        +

        + + .when(*promises) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +109
        +110
        +111
        +
        +
        # File 'opal/stdlib/promise.rb', line 109
        +
        +def self.when(*promises)
        +  When.new(promises)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #<<(promise) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +167
        +168
        +169
        +170
        +171
        +
        +
        # File 'opal/stdlib/promise.rb', line 167
        +
        +def <<(promise)
        +  @prev = promise
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #>>(promise) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +173
        +174
        +175
        +176
        +177
        +178
        +179
        +180
        +181
        +182
        +183
        +184
        +185
        +186
        +187
        +188
        +189
        +
        +
        # File 'opal/stdlib/promise.rb', line 173
        +
        +def >>(promise)
        +  @next << promise
        +
        +  if exception?
        +    promise.reject(@delayed[0])
        +  elsif resolved?
        +    promise.resolve(@delayed ? @delayed[0] : value)
        +  elsif rejected?
        +    if !@action.key?(:failure) || Promise === (@delayed ? @delayed[0] : @error)
        +      promise.reject(@delayed ? @delayed[0] : error)
        +    elsif promise.action.include?(:always)
        +      promise.reject(@delayed ? @delayed[0] : error)
        +    end
        +  end
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #^(promise) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +160
        +161
        +162
        +163
        +164
        +165
        +
        +
        # File 'opal/stdlib/promise.rb', line 160
        +
        +def ^(promise)
        +  promise << self
        +  self >> promise
        +
        +  promise
        +end
        +
        +
        + +
        +

        + + #act?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +136
        +137
        +138
        +
        +
        # File 'opal/stdlib/promise.rb', line 136
        +
        +def act?
        +  @action.key?(:success) || @action.key?(:always)
        +end
        +
        +
        + +
        +

        + + #actionObject + + + + + +

        + + + + +
        +
        +
        +
        +140
        +141
        +142
        +
        +
        # File 'opal/stdlib/promise.rb', line 140
        +
        +def action
        +  @action.keys
        +end
        +
        +
        + +
        +

        + + #always(&block) ⇒ Object + + + + Also known as: + ensure, finally + + + + +

        + + + + +
        +
        +
        +
        +287
        +288
        +289
        +
        +
        # File 'opal/stdlib/promise.rb', line 287
        +
        +def always(&block)
        +  self ^ Promise.new(always: block)
        +end
        +
        +
        + +
        +

        + + #always!(&block) ⇒ Object + + + + Also known as: + ensure!, finally! + + + + +

        + + + + +
        +
        +
        +
        +291
        +292
        +293
        +294
        +
        +
        # File 'opal/stdlib/promise.rb', line 291
        +
        +def always!(&block)
        +  there_can_be_only_one!
        +  always(&block)
        +end
        +
        +
        + +
        +

        + + #exception!(error) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +263
        +264
        +265
        +266
        +267
        +
        +
        # File 'opal/stdlib/promise.rb', line 263
        +
        +def exception!(error)
        +  @exception = true
        +
        +  reject!(error)
        +end
        +
        +
        + +
        +

        + + #exception?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +144
        +145
        +146
        +
        +
        # File 'opal/stdlib/promise.rb', line 144
        +
        +def exception?
        +  @exception
        +end
        +
        +
        + +
        +

        + + #fail(&block) ⇒ Object + + + + Also known as: + catch, rescue + + + + +

        + + + + +
        +
        +
        +
        +278
        +279
        +280
        +
        +
        # File 'opal/stdlib/promise.rb', line 278
        +
        +def fail(&block)
        +  self ^ Promise.new(failure: block)
        +end
        +
        +
        + +
        +

        + + #fail!(&block) ⇒ Object + + + + Also known as: + catch!, rescue! + + + + +

        + + + + +
        +
        +
        +
        +282
        +283
        +284
        +285
        +
        +
        # File 'opal/stdlib/promise.rb', line 282
        +
        +def fail!(&block)
        +  there_can_be_only_one!
        +  fail(&block)
        +end
        +
        +
        + +
        +

        + + #inspectObject + + + + + +

        + + + + +
        +
        +
        +
        +311
        +312
        +313
        +314
        +315
        +316
        +317
        +318
        +319
        +320
        +321
        +322
        +323
        +324
        +325
        +
        +
        # File 'opal/stdlib/promise.rb', line 311
        +
        +def inspect
        +  result = "#<#{self.class}(#{object_id})"
        +
        +  if @next.any?
        +    result += " >> #{@next.inspect}"
        +  end
        +
        +  result += if realized?
        +              ": #{(@value || @error).inspect}>"
        +            else
        +              '>'
        +            end
        +
        +  result
        +end
        +
        +
        + +
        +

        + + #realized?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +148
        +149
        +150
        +
        +
        # File 'opal/stdlib/promise.rb', line 148
        +
        +def realized?
        +  @realized != false
        +end
        +
        +
        + +
        +

        + + #reject(value = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/promise.rb', line 225
        +
        +def reject(value = nil)
        +  if realized?
        +    raise ArgumentError, 'the promise has already been realized'
        +  end
        +
        +  if Promise === value
        +    return (value << @prev) ^ self
        +  end
        +
        +  begin
        +    block = @action[:failure] || @action[:always]
        +    if block
        +      value = block.call(value)
        +    end
        +
        +    if @action.key?(:always)
        +      resolve!(value)
        +    else
        +      reject!(value)
        +    end
        +  rescue Exception => e
        +    exception!(e)
        +  end
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #reject!(value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +252
        +253
        +254
        +255
        +256
        +257
        +258
        +259
        +260
        +261
        +
        +
        # File 'opal/stdlib/promise.rb', line 252
        +
        +def reject!(value)
        +  @realized = :reject
        +  @error    = value
        +
        +  if @next.any?
        +    @next.each { |p| p.reject(value) }
        +  else
        +    @delayed = [value]
        +  end
        +end
        +
        +
        + +
        +

        + + #rejected?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +156
        +157
        +158
        +
        +
        # File 'opal/stdlib/promise.rb', line 156
        +
        +def rejected?
        +  @realized == :reject
        +end
        +
        +
        + +
        +

        + + #resolve(value = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +191
        +192
        +193
        +194
        +195
        +196
        +197
        +198
        +199
        +200
        +201
        +202
        +203
        +204
        +205
        +206
        +207
        +208
        +209
        +210
        +211
        +212
        +
        +
        # File 'opal/stdlib/promise.rb', line 191
        +
        +def resolve(value = nil)
        +  if realized?
        +    raise ArgumentError, 'the promise has already been realized'
        +  end
        +
        +  if Promise === value
        +    return (value << @prev) ^ self
        +  end
        +
        +  begin
        +    block = @action[:success] || @action[:always]
        +    if block
        +      value = block.call(value)
        +    end
        +
        +    resolve!(value)
        +  rescue Exception => e
        +    exception!(e)
        +  end
        +
        +  self
        +end
        +
        +
        + +
        +

        + + #resolve!(value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +214
        +215
        +216
        +217
        +218
        +219
        +220
        +221
        +222
        +223
        +
        +
        # File 'opal/stdlib/promise.rb', line 214
        +
        +def resolve!(value)
        +  @realized = :resolve
        +  @value    = value
        +
        +  if @next.any?
        +    @next.each { |p| p.resolve(value) }
        +  else
        +    @delayed = [value]
        +  end
        +end
        +
        +
        + +
        +

        + + #resolved?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +152
        +153
        +154
        +
        +
        # File 'opal/stdlib/promise.rb', line 152
        +
        +def resolved?
        +  @realized == :resolve
        +end
        +
        +
        + +
        +

        + + #then(&block) ⇒ Object + + + + Also known as: + do + + + + +

        + + + + +
        +
        +
        +
        +269
        +270
        +271
        +
        +
        # File 'opal/stdlib/promise.rb', line 269
        +
        +def then(&block)
        +  self ^ Promise.new(success: block)
        +end
        +
        +
        + +
        +

        + + #then!(&block) ⇒ Object + + + + Also known as: + do! + + + + +

        + + + + +
        +
        +
        +
        +273
        +274
        +275
        +276
        +
        +
        # File 'opal/stdlib/promise.rb', line 273
        +
        +def then!(&block)
        +  there_can_be_only_one!
        +  self.then(&block)
        +end
        +
        +
        + +
        +

        + + #there_can_be_only_one!Object + + + + + +

        + + + + +
        +
        +
        +
        +305
        +306
        +307
        +308
        +309
        +
        +
        # File 'opal/stdlib/promise.rb', line 305
        +
        +def there_can_be_only_one!
        +  if @next.any?
        +    raise ArgumentError, 'a promise has already been chained'
        +  end
        +end
        +
        +
        + +
        +

        + + #to_v2Object + + + + Also known as: + await, to_n + + + + +

        + + + + +
        +
        +
        +
        +327
        +328
        +329
        +330
        +331
        +332
        +333
        +
        +
        # File 'opal/stdlib/promise.rb', line 327
        +
        +def to_v2
        +  v2 = PromiseV2.new
        +
        +  self.then { |i| v2.resolve(i) }.rescue { |i| v2.reject(i) }
        +
        +  v2
        +end
        +
        +
        + +
        +

        + + #trace(depth = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +296
        +297
        +298
        +
        +
        # File 'opal/stdlib/promise.rb', line 296
        +
        +def trace(depth = nil, &block)
        +  self ^ Trace.new(depth, block)
        +end
        +
        +
        + +
        +

        + + #trace!(*args, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +300
        +301
        +302
        +303
        +
        +
        # File 'opal/stdlib/promise.rb', line 300
        +
        +def trace!(*args, &block)
        +  there_can_be_only_one!
        +  trace(*args, &block)
        +end
        +
        +
        + +
        +

        + + #valueObject + + + + + +

        + + + + +
        +
        +
        +
        +128
        +129
        +130
        +131
        +132
        +133
        +134
        +
        +
        # File 'opal/stdlib/promise.rb', line 128
        +
        +def value
        +  if Promise === @value
        +    @value.value
        +  else
        +    @value
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Promise/Trace.html b/docs/api/v1.8.2/stdlib/Promise/Trace.html new file mode 100644 index 00000000..e9b40093 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Promise/Trace.html @@ -0,0 +1,332 @@ + + + + + + + Class: Promise::Trace + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Promise::Trace + + + +

        +
        + +
        +
        Inherits:
        +
        + Promise + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/promise.rb
        +
        + +
        + + + + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from Promise

        +

        #error, #next, #prev

        + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Promise

        +

        #<<, #>>, #^, #act?, #action, #always, #always!, error, #exception!, #exception?, #fail, #fail!, #inspect, #realized?, #reject, #reject!, #rejected?, #resolve, #resolve!, #resolved?, #then, #then!, #there_can_be_only_one!, #to_v2, #trace, #trace!, #value, value, when

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(depth, block) ⇒ Trace + + + + + +

        +
        +

        Returns a new instance of Trace.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +367
        +368
        +369
        +370
        +371
        +372
        +373
        +374
        +375
        +376
        +377
        +378
        +379
        +380
        +
        +
        # File 'opal/stdlib/promise.rb', line 367
        +
        +def initialize(depth, block)
        +  @depth = depth
        +
        +  super success: proc {
        +    trace = Trace.it(self).reverse
        +    trace.pop
        +
        +    if depth && depth <= trace.length
        +      trace.shift(trace.length - depth)
        +    end
        +
        +    block.call(*trace)
        +  }
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .it(promise) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +352
        +353
        +354
        +355
        +356
        +357
        +358
        +359
        +360
        +361
        +362
        +363
        +364
        +365
        +
        +
        # File 'opal/stdlib/promise.rb', line 352
        +
        +def self.it(promise)
        +  current = []
        +
        +  if promise.act? || promise.prev.nil?
        +    current.push(promise.value)
        +  end
        +
        +  prev = promise.prev
        +  if prev
        +    current.concat(it(prev))
        +  else
        +    current
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Promise/When.html b/docs/api/v1.8.2/stdlib/Promise/When.html new file mode 100644 index 00000000..ad796800 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Promise/When.html @@ -0,0 +1,679 @@ + + + + + + + Class: Promise::When + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Promise::When + + + +

        +
        + +
        +
        Inherits:
        +
        + Promise + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/promise.rb
        +
        + +
        + + + + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from Promise

        +

        #error, #next, #prev

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Promise

        +

        #<<, #^, #act?, #action, #always, #always!, error, #exception!, #exception?, #fail, #fail!, #inspect, #realized?, #reject, #reject!, #rejected?, #resolve, #resolve!, #resolved?, #then, #then!, #there_can_be_only_one!, #to_v2, #trace, #trace!, #value, value, when

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(promises = []) ⇒ When + + + + + +

        +
        +

        Returns a new instance of When.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +384
        +385
        +386
        +387
        +388
        +389
        +390
        +391
        +392
        +
        +
        # File 'opal/stdlib/promise.rb', line 384
        +
        +def initialize(promises = [])
        +  super()
        +
        +  @wait = []
        +
        +  promises.each do |promise|
        +    wait promise
        +  end
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #>>Object + + + + + +

        + + + + +
        +
        +
        +
        +434
        +435
        +436
        +437
        +438
        +
        +
        # File 'opal/stdlib/promise.rb', line 434
        +
        +def >>(*)
        +  super.tap do
        +    try
        +  end
        +end
        +
        +
        + +
        +

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

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +402
        +403
        +404
        +405
        +406
        +407
        +408
        +
        +
        # File 'opal/stdlib/promise.rb', line 402
        +
        +def collect(&block)
        +  raise ArgumentError, 'no block given' unless block
        +
        +  self.then do |values|
        +    When.new(values.map(&block))
        +  end
        +end
        +
        +
        + +
        +

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

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +394
        +395
        +396
        +397
        +398
        +399
        +400
        +
        +
        # File 'opal/stdlib/promise.rb', line 394
        +
        +def each(&block)
        +  raise ArgumentError, 'no block given' unless block
        +
        +  self.then do |values|
        +    values.each(&block)
        +  end
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +410
        +411
        +412
        +413
        +414
        +
        +
        # File 'opal/stdlib/promise.rb', line 410
        +
        +def inject(*args, &block)
        +  self.then do |values|
        +    values.reduce(*args, &block)
        +  end
        +end
        +
        +
        + +
        +

        + + #tryObject + + + + + +

        + + + + +
        +
        +
        +
        +440
        +441
        +442
        +443
        +444
        +445
        +446
        +447
        +448
        +449
        +
        +
        # File 'opal/stdlib/promise.rb', line 440
        +
        +def try
        +  if @wait.all?(&:realized?)
        +    promise = @wait.find(&:rejected?)
        +    if promise
        +      reject(promise.error)
        +    else
        +      resolve(@wait.map(&:value))
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #wait(promise) ⇒ Object + + + + Also known as: + and + + + + +

        + + + + +
        +
        +
        +
        +416
        +417
        +418
        +419
        +420
        +421
        +422
        +423
        +424
        +425
        +426
        +427
        +428
        +429
        +430
        +431
        +432
        +
        +
        # File 'opal/stdlib/promise.rb', line 416
        +
        +def wait(promise)
        +  unless Promise === promise
        +    promise = Promise.value(promise)
        +  end
        +
        +  if promise.act?
        +    promise = promise.then
        +  end
        +
        +  @wait << promise
        +
        +  promise.always do
        +    try if @next.any?
        +  end
        +
        +  self
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/PromiseV2.html b/docs/api/v1.8.2/stdlib/PromiseV2.html new file mode 100644 index 00000000..15740e50 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/PromiseV2.html @@ -0,0 +1,2736 @@ + + + + + + + Class: PromiseV2 + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: PromiseV2 + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/promise/v2.rb
        +
        + +
        + +

        Overview

        +
        +

        Promise is used to help structure asynchronous code.

        + +

        It is available in the Opal standard library, and can be required in any Opal +application:

        + +
        require 'promise/v2'
        +
        + +

        Basic Usage

        + +

        Promises are created and returned as objects with the assumption that they +will eventually be resolved or rejected, but never both. A Promise has +a #then and #fail method (or one of their aliases) that can be used to +register a block that gets called once resolved or rejected.

        + +
        promise = PromiseV2.new
        +
        +promise.then {
        +  puts "resolved!"
        +}.fail {
        +  puts "rejected!"
        +}
        +
        +# some time later
        +promise.resolve
        +
        +# => "resolved!"
        +
        + +

        It is important to remember that a promise can only be resolved or rejected +once, so the block will only ever be called once (or not at all).

        + +

        Resolving Promises

        + +

        To resolve a promise, means to inform the Promise that it has succeeded +or evaluated to a useful value. #resolve can be passed a value which is +then passed into the block handler:

        + +
        def get_json
        +  promise = PromiseV2.new
        +
        +  HTTP.get("some_url") do |req|
        +    promise.resolve req.json
        +  end
        +
        +  promise
        +end
        +
        +get_json.then do |json|
        +  puts "got some JSON from server"
        +end
        +
        + +

        Rejecting Promises

        + +

        Promises are also designed to handle error cases, or situations where an +outcome is not as expected. Taking the previous example, we can also pass +a value to a #reject call, which passes that object to the registered +#fail handler:

        + +
        def get_json
        +  promise = PromiseV2.new
        +
        +  HTTP.get("some_url") do |req|
        +    if req.ok?
        +      promise.resolve req.json
        +    else
        +      promise.reject req
        +    end
        +
        +  promise
        +end
        +
        +get_json.then {
        +  # ...
        +}.fail { |req|
        +  puts "it went wrong: #{req.message}"
        +}
        +
        + +

        Chaining Promises

        + +

        Promises become even more useful when chained together. Each #then or +#fail call returns a new PromiseV2 which can be used to chain more and more +handlers together.

        + +
        promise.then { wait_for_something }.then { do_something_else }
        +
        + +

        Rejections are propagated through the entire chain, so a "catch all" handler +can be attached at the end of the tail:

        + +
        promise.then { ... }.then { ... }.fail { ... }
        +
        + +

        Composing Promises

        + +

        PromiseV2.when can be used to wait for more than one promise to resolve (or +reject). Using the previous example, we could request two different json +requests and wait for both to finish:

        + +
        PromiseV2.when(get_json, get_json2).then |first, second|
        +  puts "got two json payloads: #{first}, #{second}"
        +end
        +
        + + +
        +
        +
        + + +
        + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #next ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute next.

          +
          + +
        • + + +
        • + + + #prev ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute prev.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize {|_self| ... } ⇒ PromiseV2 + + + + + +

        +
        +

        Returns a new instance of PromiseV2.

        + + +
        +
        +
        + +

        Yields:

        +
          + +
        • + + + (_self) + + + +
        • + +
        +

        Yield Parameters:

        +
          + +
        • + + _self + + + (PromiseV2) + + + + — +

          the object that the method was called on

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +344
        +345
        +346
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 344
        +
        +def initialize(&block)
        +  yield self if block_given?
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #nextObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute next.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +166
        +167
        +168
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 166
        +
        +def next
        +  @next
        +end
        +
        +
        + + + +
        +

        + + #prevObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute prev.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +166
        +167
        +168
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 166
        +
        +def prev
        +  @prev
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .all_resolved(*promises) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +122
        +123
        +124
        +125
        +126
        +127
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 122
        +
        +def all_resolved(*promises)
        +  promises = Array(promises.length == 1 ? promises.first : promises)
        +  `Promise.allResolved(#{promises})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :all_resolved)
        +  end
        +end
        +
        +
        + +
        +

        + + .allocateObject + + + + + +

        + + + + +
        +
        +
        +
        +105
        +106
        +107
        +108
        +109
        +110
        +111
        +112
        +113
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 105
        +
        +def allocate
        +  ok, fail = nil, nil
        +
        +  prom = `new self.$$constructor(function(_ok, _fail) { #{ok} = _ok; #{fail} = _fail; })`
        +  prom.instance_variable_set(:@type, :opal)
        +  prom.instance_variable_set(:@resolve_proc, ok)
        +  prom.instance_variable_set(:@reject_proc, fail)
        +  prom
        +end
        +
        +
        + +
        +

        + + .any(*promises) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +129
        +130
        +131
        +132
        +133
        +134
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 129
        +
        +def any(*promises)
        +  promises = Array(promises.length == 1 ? promises.first : promises)
        +  `Promise.any(#{promises})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :any)
        +  end
        +end
        +
        +
        + +
        +

        + + .errorObject + + + + + +

        + + + + +
        +
        +
        +
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +169
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 162
        +
        +def reject(value = nil)
        +  `Promise.reject(#{value})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :reject)
        +    prom.instance_variable_set(:@realized, :reject)
        +    prom.instance_variable_set(:@value_set, true)
        +    prom.instance_variable_set(:@value, value)
        +  end
        +end
        +
        +
        + +
        +

        + + .race(*promises) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +136
        +137
        +138
        +139
        +140
        +141
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 136
        +
        +def race(*promises)
        +  promises = Array(promises.length == 1 ? promises.first : promises)
        +  `Promise.race(#{promises})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :race)
        +  end
        +end
        +
        +
        + +
        +

        + + .reject(value = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +152
        +153
        +154
        +155
        +156
        +157
        +158
        +159
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 152
        +
        +def reject(value = nil)
        +  `Promise.reject(#{value})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :reject)
        +    prom.instance_variable_set(:@realized, :reject)
        +    prom.instance_variable_set(:@value_set, true)
        +    prom.instance_variable_set(:@value, value)
        +  end
        +end
        +
        +
        + +
        +

        + + .resolve(value = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +143
        +144
        +145
        +146
        +147
        +148
        +149
        +150
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 143
        +
        +def resolve(value = nil)
        +  `Promise.resolve(#{value})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :resolve)
        +    prom.instance_variable_set(:@realized, :resolve)
        +    prom.instance_variable_set(:@value_set, true)
        +    prom.instance_variable_set(:@value, value)
        +  end
        +end
        +
        +
        + +
        +

        + + .valueObject + + + + + +

        + + + + +
        +
        +
        +
        +163
        +164
        +165
        +166
        +167
        +168
        +169
        +170
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 163
        +
        +def resolve(value = nil)
        +  `Promise.resolve(#{value})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :resolve)
        +    prom.instance_variable_set(:@realized, :resolve)
        +    prom.instance_variable_set(:@value_set, true)
        +    prom.instance_variable_set(:@value, value)
        +  end
        +end
        +
        +
        + +
        +

        + + .when(*promises) ⇒ Object + + + + Also known as: + all + + + + +

        + + + + +
        +
        +
        +
        +115
        +116
        +117
        +118
        +119
        +120
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 115
        +
        +def when(*promises)
        +  promises = Array(promises.length == 1 ? promises.first : promises)
        +  `Promise.all(#{promises})`.tap do |prom|
        +    prom.instance_variable_set(:@type, :when)
        +  end
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #always(&block) ⇒ Object + + + + Also known as: + ensure, finally + + + + +

        + + + + +
        +
        +
        +
        +259
        +260
        +261
        +262
        +263
        +264
        +265
        +266
        +267
        +268
        +269
        +270
        +271
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 259
        +
        +def always(&block)
        +  prom = nil
        +  blk = gen_tracing_proc(block) do |val|
        +    prom.instance_variable_set(:@realized, :resolve)
        +    prom.instance_variable_set(:@value_set, true)
        +    prom.instance_variable_set(:@value, val)
        +  end
        +  prom = `self.finally(function() { return blk(self.$value_internal()); })`
        +  prom.instance_variable_set(:@prev, self)
        +  prom.instance_variable_set(:@type, :always)
        +  (@next ||= []) << prom
        +  prom
        +end
        +
        +
        + +
        +

        + + #always!(&block) ⇒ Object + + + + Also known as: + ensure!, finally! + + + + +

        + + + + +
        +
        +
        +
        +273
        +274
        +275
        +276
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 273
        +
        +def always!(&block)
        +  there_can_be_only_one!
        +  always(&block)
        +end
        +
        +
        + +
        +

        + + #and(*promises) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +331
        +332
        +333
        +334
        +335
        +336
        +337
        +338
        +339
        +340
        +341
        +342
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 331
        +
        +def and(*promises)
        +  promises = promises.map do |i|
        +    if PromiseV2 === i
        +      i
        +    else
        +      PromiseV2.value(i)
        +    end
        +  end
        +  PromiseV2.when(self, *promises).then do |a, *b|
        +    [*a, *b]
        +  end
        +end
        +
        +
        + +
        +

        + + #errorObject + + + + + +

        + + + + +
        +
        +
        +
        +326
        +327
        +328
        +329
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 326
        +
        +def error
        +  light_nativity_check!
        +  @value if rejected?
        +end
        +
        +
        + +
        +

        + + #fail(&block) ⇒ Object + + + + Also known as: + catch, rescue + + + + +

        + + + + +
        +
        +
        +
        +240
        +241
        +242
        +243
        +244
        +245
        +246
        +247
        +248
        +249
        +250
        +251
        +252
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 240
        +
        +def fail(&block)
        +  prom = nil
        +  blk = gen_tracing_proc(block) do |val|
        +    prom.instance_variable_set(:@realized, :resolve)
        +    prom.instance_variable_set(:@value_set, true)
        +    prom.instance_variable_set(:@value, val)
        +  end
        +  prom = `self.catch(#{blk})`
        +  prom.instance_variable_set(:@prev, self)
        +  prom.instance_variable_set(:@type, :fail)
        +  (@next ||= []) << prom
        +  prom
        +end
        +
        +
        + +
        +

        + + #fail!(&block) ⇒ Object + + + + Also known as: + catch!, rescue! + + + + +

        + + + + +
        +
        +
        +
        +254
        +255
        +256
        +257
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 254
        +
        +def fail!(&block)
        +  there_can_be_only_one!
        +  fail(&block)
        +end
        +
        +
        + +
        +

        + + #gen_tracing_proc(passing, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +193
        +194
        +195
        +196
        +197
        +198
        +199
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 193
        +
        +def gen_tracing_proc(passing, &block)
        +  proc do |i|
        +    res = passing.call(i)
        +    yield(res)
        +    res
        +  end
        +end
        +
        +
        + +
        +

        + + #inspectObject + + + + + +

        + + + + +
        +
        +
        +
        +356
        +357
        +358
        +359
        +360
        +361
        +362
        +363
        +364
        +365
        +366
        +367
        +368
        +369
        +370
        +371
        +372
        +373
        +374
        +375
        +376
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 356
        +
        +def inspect
        +  result = "#<#{self.class}"
        +
        +  if @type
        +    result += ":#{@type}" unless %i[opal resolve reject].include? @type
        +  else
        +    result += ':native'
        +  end
        +
        +  result += ":#{@realized}" if @realized
        +  result += "(#{object_id})"
        +
        +  if @next && @next.any?
        +    result += " >> #{@next.inspect}"
        +  end
        +
        +  result += ": #{value.inspect}"
        +  result += '>'
        +
        +  result
        +end
        +
        +
        + +
        +

        + + #light_nativity_check!Object + + + + + +

        +
        +

        Raise an exception when a non-JS-native method is called on a JS-native promise +but permits some typed promises

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +181
        +182
        +183
        +184
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 181
        +
        +def light_nativity_check!
        +  return if %i[reject resolve trace always fail then].include? @type
        +  raise ArgumentError, 'this promise is native to JavaScript' if native?
        +end
        +
        +
        + +
        +

        + + #native?Boolean + + + + + +

        +
        +

        Is this promise native to JavaScript? This means, that methods like resolve +or reject won't be available.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +170
        +171
        +172
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 170
        +
        +def native?
        +  @type != :opal
        +end
        +
        +
        + +
        +

        + + #nativity_check!Object + + + + + +

        +
        +

        Raise an exception when a non-JS-native method is called on a JS-native promise

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +175
        +176
        +177
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 175
        +
        +def nativity_check!
        +  raise ArgumentError, 'this promise is native to JavaScript' if native?
        +end
        +
        +
        + +
        +

        + + #realized?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +315
        +316
        +317
        +318
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 315
        +
        +def realized?
        +  light_nativity_check!
        +  !@realized.nil?
        +end
        +
        +
        + +
        +

        + + #reject(value = nil) ⇒ Object + + + + Also known as: + reject! + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +211
        +212
        +213
        +214
        +215
        +216
        +217
        +218
        +219
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 211
        +
        +def reject(value = nil)
        +  nativity_check!
        +  raise ArgumentError, 'this promise was already resolved' if @realized
        +  @value_set = true
        +  @value = value
        +  @realized = :reject
        +  @reject_proc.call(value)
        +  self
        +end
        +
        +
        + +
        +

        + + #rejected?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +310
        +311
        +312
        +313
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 310
        +
        +def rejected?
        +  light_nativity_check!
        +  @realized == :reject
        +end
        +
        +
        + +
        +

        + + #resolve(value = nil) ⇒ Object + + + + Also known as: + resolve! + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +201
        +202
        +203
        +204
        +205
        +206
        +207
        +208
        +209
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 201
        +
        +def resolve(value = nil)
        +  nativity_check!
        +  raise ArgumentError, 'this promise was already resolved' if @realized
        +  @value_set = true
        +  @value = value
        +  @realized = :resolve
        +  @resolve_proc.call(value)
        +  self
        +end
        +
        +
        + +
        +

        + + #resolved?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +305
        +306
        +307
        +308
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 305
        +
        +def resolved?
        +  light_nativity_check!
        +  @realized == :resolve
        +end
        +
        +
        + +
        +

        + + #then(&block) ⇒ Object + + + + Also known as: + do + + + + +

        + + + + +
        +
        +
        +
        +221
        +222
        +223
        +224
        +225
        +226
        +227
        +228
        +229
        +230
        +231
        +232
        +233
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 221
        +
        +def then(&block)
        +  prom = nil
        +  blk = gen_tracing_proc(block) do |val|
        +    prom.instance_variable_set(:@realized, :resolve)
        +    prom.instance_variable_set(:@value_set, true)
        +    prom.instance_variable_set(:@value, val)
        +  end
        +  prom = `self.then(#{blk})`
        +  prom.instance_variable_set(:@prev, self)
        +  prom.instance_variable_set(:@type, :then)
        +  (@next ||= []) << prom
        +  prom
        +end
        +
        +
        + +
        +

        + + #then!(&block) ⇒ Object + + + + Also known as: + do! + + + + +

        + + + + +
        +
        +
        +
        +235
        +236
        +237
        +238
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 235
        +
        +def then!(&block)
        +  there_can_be_only_one!
        +  self.then(&block)
        +end
        +
        +
        + +
        +

        + + #there_can_be_only_one!Object + + + + + +

        +
        +

        Allow only one chain to be present, as needed by the previous implementation. +This isn't a strict check - it's always possible on the JS side to chain a +given block.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +189
        +190
        +191
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 189
        +
        +def there_can_be_only_one!
        +  raise ArgumentError, 'a promise has already been chained' if @next && @next.any?
        +end
        +
        +
        + +
        +

        + + #to_v1Object + + + + + +

        + + + + +
        +
        +
        +
        +348
        +349
        +350
        +351
        +352
        +353
        +354
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 348
        +
        +def to_v1
        +  v1 = PromiseV1.new
        +
        +  self.then { |i| v1.resolve(i) }.rescue { |i| v1.reject(i) }
        +
        +  v1
        +end
        +
        +
        + +
        +

        + + #trace(depth = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +278
        +279
        +280
        +281
        +282
        +283
        +284
        +285
        +286
        +287
        +288
        +289
        +290
        +291
        +292
        +293
        +294
        +295
        +296
        +297
        +298
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 278
        +
        +def trace(depth = nil, &block)
        +  prom = self.then do
        +    values = []
        +    prom = self
        +    while prom && (!depth || depth > 0)
        +      val = nil
        +      begin
        +        val = prom.value
        +      rescue ArgumentError
        +        val = :native
        +      end
        +      values.unshift(val)
        +      depth -= 1 if depth
        +      prom = prom.prev
        +    end
        +    yield(*values)
        +  end
        +
        +  prom.instance_variable_set(:@type, :trace)
        +  prom
        +end
        +
        +
        + +
        +

        + + #trace!(*args, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +300
        +301
        +302
        +303
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 300
        +
        +def trace!(*args, &block)
        +  there_can_be_only_one!
        +  trace(*args, &block)
        +end
        +
        +
        + +
        +

        + + #valueObject + + + + + +

        + + + + +
        +
        +
        +
        +320
        +321
        +322
        +323
        +324
        +
        +
        # File 'opal/stdlib/promise/v2.rb', line 320
        +
        +def value
        +  if resolved?
        +    value_internal
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/REPLUtils.html b/docs/api/v1.8.2/stdlib/REPLUtils.html new file mode 100644 index 00000000..29301922 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/REPLUtils.html @@ -0,0 +1,470 @@ + + + + + + + Module: REPLUtils + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: REPLUtils + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/opal-replutils.rb
        +
        + +
        + +

        Defined Under Namespace

        +

        + + + + + Classes: ColorPrinter + + +

        + + + + + + + + +

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .eval_and_print(func, mode, colorize, binding = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +57
        +58
        +59
        +60
        +61
        +62
        +63
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +72
        +73
        +74
        +75
        +76
        +77
        +78
        +79
        +80
        +81
        +82
        +83
        +84
        +85
        +86
        +87
        +88
        +89
        +90
        +91
        +92
        +93
        +94
        +95
        +96
        +97
        +98
        +99
        +100
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 48
        +
        +def eval_and_print(func, mode, colorize, binding = nil)
        +  printer = if colorize
        +              ->(i) do
        +                ColorPrinter.default(i)
        +              rescue => e
        +                ColorPrinter.colorize(Opal.inspect(i))
        +              end
        +            else
        +              ->(i) do
        +                out = []
        +                PP.pp(i, out)
        +                out.join
        +              rescue
        +                Opal.inspect(i)
        +              end
        +            end
        +
        +  %x{
        +    var $_result = binding === nil ? eval(func) : binding.$js_eval(func);
        +
        +    if (mode == 'silent') return nil;
        +
        +    if ($_result === null) {
        +      return "=> null";
        +    }
        +    else if (typeof $_result === 'undefined') {
        +      return "=> undefined";
        +    }
        +    else if (typeof $_result.$$class === 'undefined') {
        +      try {
        +        var json = JSON.stringify($_result, null, 2);
        +        if (!colorize) json = #{ColorPrinter.colorize(`json`)}
        +        return "=> " + $_result.toString() + " => " + json;
        +      }
        +      catch(e) {
        +        return "=> " + $_result.toString();
        +      }
        +    }
        +    else {
        +      if (mode == 'ls') {
        +        return #{ls(`$_result`, colorize)};
        +      }
        +      else {
        +        var pretty = #{printer.call(`$_result`)};
        +        // Is it multiline? If yes, add a linebreak
        +        if (pretty.match(/\n.*?\n/)) pretty = "\n" + pretty;
        +        return "=> " + pretty;
        +      }
        +    }
        +  }
        +rescue Exception => e # rubocop:disable Lint/RescueException
        +  e.full_message(highlight: true)
        +end
        +
        +
        + +
        +

        + + .js_replObject + + + + + +

        + + + + +
        +
        +
        +
        +102
        +103
        +104
        +105
        +106
        +107
        +108
        +109
        +110
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 102
        +
        +def js_repl
        +  while (line = gets)
        +    input = JSON.parse(line)
        +
        +    out = eval_and_print(input[:code], input[:mode], input[:colors])
        +    puts out if out
        +    puts '<<<ready>>>'
        +  end
        +end
        +
        +
        + +
        +

        + + .ls(object, colorize) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 10
        +
        +def ls(object, colorize)
        +  methods = imethods = object.methods
        +  ancestors = object.class.ancestors
        +  constants = []
        +  ivs = object.instance_variables
        +  cvs = []
        +
        +  if [Class, Module].include? object.class
        +    imethods = object.instance_methods
        +    ancestors = object.ancestors
        +    constants = object.constants
        +    cvs = object.class_variables
        +  end
        +
        +  if colorize
        +    blue      = ->(i) { "\e[1;34m#{i}\e[0m" }
        +    dark_blue = ->(i) { "\e[34m#{i}\e[0m" }
        +  else
        +    blue = dark_blue = ->(i) { i }
        +  end
        +
        +  out = ''
        +  out = "#{blue['class variables']}: #{cvs.map { |i| dark_blue[i] }.sort.join('  ')}\n" + out unless cvs.empty?
        +  out = "#{blue['instance variables']}: #{ivs.map { |i| dark_blue[i] }.sort.join('  ')}\n" + out unless ivs.empty?
        +  ancestors.each do |a|
        +    im = a.instance_methods(false)
        +    meths = (im & imethods)
        +    methods -= meths
        +    imethods -= meths
        +    next if meths.empty? || [Object, BasicObject, Kernel, PP::ObjectMixin].include?(a)
        +    out = "#{blue["#{a.name}#methods"]}: #{meths.sort.join('  ')}\n" + out
        +  end
        +  methods &= object.methods(false)
        +  out = "#{blue['self.methods']}: #{methods.sort.join('  ')}\n" + out unless methods.empty?
        +  out = "#{blue['constants']}: #{constants.map { |i| dark_blue[i] }.sort.join('  ')}\n" + out unless constants.empty?
        +  out
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/REPLUtils/ColorPrinter.html b/docs/api/v1.8.2/stdlib/REPLUtils/ColorPrinter.html new file mode 100644 index 00000000..be8b2281 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/REPLUtils/ColorPrinter.html @@ -0,0 +1,737 @@ + + + + + + + Class: REPLUtils::ColorPrinter + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: REPLUtils::ColorPrinter + + + +

        +
        + +
        +
        Inherits:
        +
        + PP + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/opal-replutils.rb
        +
        + +
        + +

        Overview

        +
        +

        Slightly based on Pry's implementation

        + + +
        +
        +
        + + +
        + +

        + Constant Summary + collapse +

        + +
        + +
        TOKEN_COLORS = +
        +
        +

        Taken from CodeRay

        + + +
        +
        +
        + + +
        +
        +
        {
        +  debug: "\e[1;37;44m",
        +
        +  annotation: "\e[34m",
        +  attribute_name: "\e[35m",
        +  attribute_value: "\e[31m",
        +  binary: {
        +    self: "\e[31m",
        +    char: "\e[1;31m",
        +    delimiter: "\e[1;31m",
        +  },
        +  char: {
        +    self: "\e[35m",
        +    delimiter: "\e[1;35m"
        +  },
        +  class: "\e[1;35;4m",
        +  class_variable: "\e[36m",
        +  color: "\e[32m",
        +  comment: {
        +    self: "\e[1;30m",
        +    char: "\e[37m",
        +    delimiter: "\e[37m",
        +  },
        +  constant: "\e[1;34;4m",
        +  decorator: "\e[35m",
        +  definition: "\e[1;33m",
        +  directive: "\e[33m",
        +  docstring: "\e[31m",
        +  doctype: "\e[1;34m",
        +  done: "\e[1;30;2m",
        +  entity: "\e[31m",
        +  error: "\e[1;37;41m",
        +  exception: "\e[1;31m",
        +  float: "\e[1;35m",
        +  function: "\e[1;34m",
        +  global_variable: "\e[1;32m",
        +  hex: "\e[1;36m",
        +  id: "\e[1;34m",
        +  include: "\e[31m",
        +  integer: "\e[1;34m",
        +  imaginary: "\e[1;34m",
        +  important: "\e[1;31m",
        +  key: {
        +    self: "\e[35m",
        +    char: "\e[1;35m",
        +    delimiter: "\e[1;35m",
        +  },
        +  keyword: "\e[32m",
        +  label: "\e[1;33m",
        +  local_variable: "\e[33m",
        +  namespace: "\e[1;35m",
        +  octal: "\e[1;34m",
        +  predefined: "\e[36m",
        +  predefined_constant: "\e[1;36m",
        +  predefined_type: "\e[1;32m",
        +  preprocessor: "\e[1;36m",
        +  pseudo_class: "\e[1;34m",
        +  regexp: {
        +    self: "\e[35m",
        +    delimiter: "\e[1;35m",
        +    modifier: "\e[35m",
        +    char: "\e[1;35m",
        +  },
        +  reserved: "\e[32m",
        +  shell: {
        +    self: "\e[33m",
        +    char: "\e[1;33m",
        +    delimiter: "\e[1;33m",
        +    escape: "\e[1;33m",
        +  },
        +  string: {
        +    self: "\e[31m",
        +    modifier: "\e[1;31m",
        +    char: "\e[1;35m",
        +    delimiter: "\e[1;31m",
        +    escape: "\e[1;31m",
        +  },
        +  symbol: {
        +    self: "\e[33m",
        +    delimiter: "\e[1;33m",
        +  },
        +  tag: "\e[32m",
        +  type: "\e[1;34m",
        +  value: "\e[36m",
        +  variable: "\e[34m",
        +
        +  insert: {
        +    self: "\e[42m",
        +    insert: "\e[1;32;42m",
        +    eyecatcher: "\e[102m",
        +  },
        +  delete: {
        +    self: "\e[41m",
        +    delete: "\e[1;31;41m",
        +    eyecatcher: "\e[101m",
        +  },
        +  change: {
        +    self: "\e[44m",
        +    change: "\e[37;44m",
        +  },
        +  head: {
        +    self: "\e[45m",
        +    filename: "\e[37;45m",
        +  },
        +
        +  reset: "\e[0m",
        +}
        + +
        NUMBER = + +
        +
        '[+-]?(?:0x[0-9a-fA-F]+|[0-9.]+(?:e[+-][0-9]+|i)?)'
        + +
        REGEXP = + +
        +
        '/.*?/[iesu]*'
        + +
        STRING = + +
        +
        '".*?"'
        + +
        TOKEN_REGEXP = + +
        +
        /(\s+|=>|[@$:]?[a-z]\w+|[A-Z]\w+|#{NUMBER}|#{REGEXP}|#{STRING}|#<.*?[> ]|.)/
        + +
        + + + + + + + +

        Instance Attribute Summary

        + +

        Attributes inherited from PrettyPrint

        +

        #genspace, #group_queue, #indent, #maxwidth, #newline, #output

        + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from PP

        +

        mcall, singleline_pp

        + + + + + + + + + +

        Methods included from PP::PPMethods

        +

        #check_inspect_key, #comma_breakable, #guard_inspect_key, #object_address_group, #object_group, #pop_inspect_key, #pp, #pp_hash, #pp_object, #push_inspect_key, #seplist

        + + + + + + + + + +

        Methods inherited from PrettyPrint

        +

        #break_outmost_groups, #breakable, #current_group, #fill_breakable, #flush, format, #group, #group_sub, #initialize, #nest, singleline_format

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from PrettyPrint

        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .colorize(str) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +257
        +258
        +259
        +260
        +261
        +262
        +263
        +264
        +265
        +266
        +267
        +268
        +269
        +270
        +271
        +272
        +273
        +274
        +275
        +276
        +277
        +278
        +279
        +280
        +281
        +282
        +283
        +284
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 257
        +
        +def self.colorize(str)
        +  tokens = tokenize(str)
        +
        +  tokens.map do |tok|
        +    case tok
        +    when /^[0-9+-]/
        +      if /[.e]/ =~ tok
        +        token(tok, :float)
        +      else
        +        token(tok, :integer)
        +      end
        +    when /^"/
        +      token(tok, :string, :self)
        +    when /^:/
        +      token(tok, :symbol, :self)
        +    when /^[A-Z]/
        +      token(tok, :constant)
        +    when '<', '#', /^#</, '=', '>'
        +      token(tok, :keyword)
        +    when /^\/./
        +      token(tok, :regexp, :self)
        +    when 'true', 'false', 'nil'
        +      token(tok, :predefined_constant)
        +    else
        +      token(tok, :reset)
        +    end
        +  end.join
        +end
        +
        +
        + +
        +

        + + .default(obj, width = 79) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +227
        +228
        +229
        +230
        +231
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 227
        +
        +def self.default(obj, width = 79)
        +  pager = StringIO.new
        +  pp(obj, pager, width)
        +  pager.string
        +end
        +
        +
        + +
        +

        + + .pp(obj, output = $DEFAULT_OUTPUT, max_width = 79) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +233
        +234
        +235
        +236
        +237
        +238
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 233
        +
        +def self.pp(obj, output = $DEFAULT_OUTPUT, max_width = 79)
        +  queue = ColorPrinter.new(output, max_width, "\n")
        +  queue.guard_inspect_key { queue.pp(obj) }
        +  queue.flush
        +  output << "\n"
        +end
        +
        +
        + +
        +

        + + .token(string, *name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +244
        +245
        +246
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 244
        +
        +def self.token(string, *name)
        +  TOKEN_COLORS.dig(*name) + string + TOKEN_COLORS[:reset]
        +end
        +
        +
        + +
        +

        + + .tokenize(str) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +253
        +254
        +255
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 253
        +
        +def self.tokenize(str)
        +  str.scan(TOKEN_REGEXP).map(&:first)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #text(str, max_width = str.length) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +240
        +241
        +242
        +
        +
        # File 'opal/stdlib/opal-replutils.rb', line 240
        +
        +def text(str, max_width = str.length)
        +  super(ColorPrinter.colorize(str), max_width)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Racc.html b/docs/api/v1.8.2/stdlib/Racc.html new file mode 100644 index 00000000..7e7e1d2c --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Racc.html @@ -0,0 +1,311 @@ + + + + + + + Module: Racc + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Racc + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/racc/parser.rb,
        + opal/stdlib/racc/parser.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        Racc is a LALR(1) parser generator. +It is written in Ruby itself, and generates Ruby programs.

        + +

        == Command-line Reference

        + +
        racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
        +     [-e<var>rubypath</var>] [--embedded=<var>rubypath</var>]
        +     [-v] [--verbose]
        +     [-O<var>filename</var>] [--log-file=<var>filename</var>]
        +     [-g] [--debug]
        +     [-E] [--embedded]
        +     [-l] [--no-line-convert]
        +     [-c] [--line-convert-all]
        +     [-a] [--no-omit-actions]
        +     [-C] [--check-only]
        +     [-S] [--output-status]
        +     [--version] [--copyright] [--help] <var>grammarfile</var>
        +
        + +

        [+filename+] + Racc grammar file. Any extension is permitted. +[-o+outfile+, --output-file=+outfile+] + A filename for output. default is <+filename+>.tab.rb +[-O+filename+, --log-file=+filename+] + Place logging output in file +filename+. + Default log file name is <+filename+>.output. +[-e+rubypath+, --executable=+rubypath+] + output executable file(mode 755). where +path+ is the Ruby interpreter. +[-v, --verbose] + verbose mode. create +filename+.output file, like yacc's y.output file. +[-g, --debug] + add debug code to parser class. To display debugging information, + use this '-g' option and set @yydebug true in parser class. +[-E, --embedded] + Output parser which doesn't need runtime files (racc/parser.rb). +[-C, --check-only] + Check syntax of racc grammar file and quit. +[-S, --output-status] + Print messages time to time while compiling. +[-l, --no-line-convert] + turns off line number converting. +[-c, --line-convert-all] + Convert line number of actions, inner, header and footer. +[-a, --no-omit-actions] + Call all actions, even if an action is empty. +[--version] + print Racc version and quit. +[--copyright] + Print copyright and quit. +[--help] + Print usage and quit.

        + +

        == Generating Parser Using Racc

        + +

        To compile Racc grammar file, simply type:

        + +

        $ racc parse.y

        + +

        This creates Ruby script file "parse.tab.y". The -o option can change the output filename.

        + +

        == Writing A Racc Grammar File

        + +

        If you want your own parser, you have to write a grammar file. +A grammar file contains the name of your parser class, grammar for the parser, +user code, and anything else. +When writing a grammar file, yacc's knowledge is helpful. +If you have not used yacc before, Racc is not too difficult.

        + +

        Here's an example Racc grammar file.

        + +

        class Calcparser + rule + target: exp { print val[0] }

        + +
        exp: exp '+' exp
        +   | exp '*' exp
        +   | '(' exp ')'
        +   | NUMBER
        +
        + +

        end

        + +

        Racc grammar files resemble yacc files. +But (of course), this is Ruby code. +yacc's $$ is the 'result', $0, $1... is +an array called 'val', and $-1, $-2... is an array called '_values'.

        + +

        See the File Reference[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for +more information on grammar files.

        + +

        == Parser

        + +

        Then you must prepare the parse entry method. There are two types of +parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse

        + +

        Racc::Parser#do_parse is simple.

        + +

        It's yyparse() of yacc, and Racc::Parser#next_token is yylex(). +This method must returns an array like [TOKENSYMBOL, ITS_VALUE]. +EOF is [false, false]. +(TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default. +If you want to change this, see the grammar reference.

        + +

        Racc::Parser#yyparse is little complicated, but useful. +It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.

        + +

        For example, yyparse(obj, :scan) causes +calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.

        + +

        == Debugging

        + +

        When debugging, "-v" or/and the "-g" option is helpful.

        + +

        "-v" creates verbose log file (.output). +"-g" creates a "Verbose Parser". +Verbose Parser prints the internal status when parsing. +But it's not automatic. +You must use -g option and set +@yydebug+ to +true+ in order to get output. +-g option only creates the verbose parser.

        + +

        === Racc reported syntax error.

        + +

        Isn't there too many "end"? +grammar of racc file is changed in v0.10.

        + +

        Racc does not use '%' mark, while yacc uses huge number of '%' marks..

        + +

        === Racc reported "XXXX conflicts".

        + +

        Try "racc -v xxxx.y". +It causes producing racc's internal log file, xxxx.output.

        + +

        === Generated parsers does not work correctly

        + +

        Try "racc -g xxxx.y". +This command let racc generate "debugging parser". +Then set @yydebug=true in your parser. +It produces a working log of your parser.

        + +

        == Re-distributing Racc runtime

        + +

        A parser, which is created by Racc, requires the Racc runtime module; +racc/parser.rb.

        + +

        Ruby 1.8.x comes with Racc runtime module, +you need NOT distribute Racc runtime files.

        + +

        If you want to include the Racc runtime module with your parser. +This can be done by using '-E' option:

        + +

        $ racc -E -omyparser.rb myparser.y

        + +

        This command creates myparser.rb which `includes' Racc runtime. +Only you must do is to distribute your parser file (myparser.rb).

        + +

        Note: parser.rb is LGPL, but your parser is not. +Your own parser is completely yours.

        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + + + Classes: ParseError, Parser + + +

        + + +

        + Constant Summary + collapse +

        + +
        + +
        Racc_No_Extensions = +
        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        +
        +
        false
        + +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Racc/ParseError.html b/docs/api/v1.8.2/stdlib/Racc/ParseError.html new file mode 100644 index 00000000..8353147c --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Racc/ParseError.html @@ -0,0 +1,126 @@ + + + + + + + Exception: Racc::ParseError + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: Racc::ParseError + + + +

        +
        + +
        +
        Inherits:
        +
        + StandardError + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/racc/parser.rb
        +
        + +
        + + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Racc/Parser.html b/docs/api/v1.8.2/stdlib/Racc/Parser.html new file mode 100644 index 00000000..e24978dc --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Racc/Parser.html @@ -0,0 +1,2195 @@ + + + + + + + Class: Racc::Parser + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Racc::Parser + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/racc/parser.rb
        +
        + +
        + + + +

        + Constant Summary + collapse +

        + +
        + +
        Racc_Runtime_Version = + +
        +
        '1.4.6'
        + +
        Racc_Runtime_Revision = + +
        +
        %w$originalRevision: 1.8 $[1]
        + +
        Racc_Runtime_Core_Version_R = + +
        +
        '1.4.6'
        + +
        Racc_Runtime_Core_Revision_R = + +
        +
        %w$originalRevision: 1.8 $[1]
        + +
        Racc_Main_Parsing_Routine = +
        +
        +

        DISABLED: opal has no racc/cparse +begin + require 'racc/cparse'

        + +

        Racc_Runtime_Core_Version_C = (defined in extension)

        + +

        Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2] + unless new.respond_to?(:_racc_do_parse_c, true) + raise LoadError, 'old cparse.so' + end + if Racc_No_Extensions + raise LoadError, 'selecting ruby version of racc runtime core' + end

        + +

        Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc: + Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc: + Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc: + Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C # :nodoc: + Racc_Runtime_Type = 'c' # :nodoc: +rescue LoadError

        + + +
        +
        +
        + + +
        +
        +
        :_racc_do_parse_rb
        + +
        Racc_YY_Parse_Method = + +
        +
        :_racc_yyparse_rb
        + +
        Racc_Runtime_Core_Version = + +
        +
        Racc_Runtime_Core_Version_R
        + +
        Racc_Runtime_Core_Revision = + +
        +
        Racc_Runtime_Core_Revision_R
        + +
        Racc_Runtime_Type = + +
        +
        'ruby'
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .racc_runtime_typeObject + + + + + +

        +
        +

        end

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +218
        +219
        +220
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 218
        +
        +def Parser.racc_runtime_type # :nodoc:
        +  Racc_Runtime_Type
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #_racc_do_parse_rb(arg, in_debug) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +279
        +280
        +281
        +282
        +283
        +284
        +285
        +286
        +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
        +314
        +315
        +316
        +317
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 279
        +
        +def _racc_do_parse_rb(arg, in_debug)
        +  action_table, action_check, action_default, action_pointer,
        +  _,            _,            _,              _,
        +  _,            _,            token_table,    _,
        +  _,            _,            * = arg
        +
        +  _racc_init_sysvars
        +  tok = act = i = nil
        +
        +  catch(:racc_end_parse) {
        +    while true
        +      if i = action_pointer[@racc_state[-1]]
        +        if @racc_read_next
        +          if @racc_t != 0   # not EOF
        +            tok, @racc_val = next_token()
        +            unless tok      # EOF
        +              @racc_t = 0
        +            else
        +              @racc_t = (token_table[tok] or 1)   # error token
        +            end
        +            racc_read_token(@racc_t, tok, @racc_val) if @yydebug
        +            @racc_read_next = false
        +          end
        +        end
        +        i += @racc_t
        +        unless i >= 0 and
        +               act = action_table[i] and
        +               action_check[i] == @racc_state[-1]
        +          act = action_default[@racc_state[-1]]
        +        end
        +      else
        +        act = action_default[@racc_state[-1]]
        +      end
        +      while act = _racc_evalact(act, arg)
        +        ;
        +      end
        +    end
        +  }
        +end
        +
        +
        + +
        +

        + + #_racc_do_reduce(arg, act) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +477
        +478
        +479
        +480
        +481
        +482
        +483
        +484
        +485
        +486
        +487
        +488
        +489
        +490
        +491
        +492
        +493
        +494
        +495
        +496
        +497
        +498
        +499
        +500
        +501
        +502
        +503
        +504
        +505
        +506
        +507
        +508
        +509
        +510
        +511
        +512
        +513
        +514
        +515
        +516
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 477
        +
        +def _racc_do_reduce(arg, act)
        +  _, _, _, _,
        +  goto_table,   goto_check,   goto_default,   goto_pointer,
        +  nt_base,      reduce_table, _,    _,
        +  _,     use_result,   * = arg
        +  state = @racc_state
        +  vstack = @racc_vstack
        +  tstack = @racc_tstack
        +
        +  i = act * -3
        +  len       = reduce_table[i]
        +  reduce_to = reduce_table[i+1]
        +  method_id = reduce_table[i+2]
        +  void_array = []
        +
        +  tmp_t = tstack[-len, len] if @yydebug
        +  tmp_v = vstack[-len, len]
        +  tstack[-len, len] = void_array if @yydebug
        +  vstack[-len, len] = void_array
        +  state[-len, len]  = void_array
        +
        +  # tstack must be updated AFTER method call
        +  if use_result
        +    vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
        +  else
        +    vstack.push __send__(method_id, tmp_v, vstack)
        +  end
        +  tstack.push reduce_to
        +
        +  racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
        +
        +  k1 = reduce_to - nt_base
        +  if i = goto_pointer[k1]
        +    i += state[-1]
        +    if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
        +      return curstate
        +    end
        +  end
        +  goto_default[k1]
        +end
        +
        +
        + +
        +

        + + #_racc_evalact(act, arg) ⇒ Object + + + + + +

        +
        +

        common

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +384
        +385
        +386
        +387
        +388
        +389
        +390
        +391
        +392
        +393
        +394
        +395
        +396
        +397
        +398
        +399
        +400
        +401
        +402
        +403
        +404
        +405
        +406
        +407
        +408
        +409
        +410
        +411
        +412
        +413
        +414
        +415
        +416
        +417
        +418
        +419
        +420
        +421
        +422
        +423
        +424
        +425
        +426
        +427
        +428
        +429
        +430
        +431
        +432
        +433
        +434
        +435
        +436
        +437
        +438
        +439
        +440
        +441
        +442
        +443
        +444
        +445
        +446
        +447
        +448
        +449
        +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
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 384
        +
        +def _racc_evalact(act, arg)
        +  action_table, action_check, _, action_pointer,
        +  _,   _, _, _,
        +  _,   _, _, shift_n,  reduce_n,
        +  _,   _, * = arg
        +
        +  if act > 0 and act < shift_n
        +    #
        +    # shift
        +    #
        +    if @racc_error_status > 0
        +      @racc_error_status -= 1 unless @racc_t == 1   # error token
        +    end
        +    @racc_vstack.push @racc_val
        +    @racc_state.push act
        +    @racc_read_next = true
        +    if @yydebug
        +      @racc_tstack.push @racc_t
        +      racc_shift @racc_t, @racc_tstack, @racc_vstack
        +    end
        +
        +  elsif act < 0 and act > -reduce_n
        +    #
        +    # reduce
        +    #
        +    code = catch(:racc_jump) {
        +      @racc_state.push _racc_do_reduce(arg, act)
        +      false
        +    }
        +    if code
        +      case code
        +      when 1 # yyerror
        +        @racc_user_yyerror = true   # user_yyerror
        +        return -reduce_n
        +      when 2 # yyaccept
        +        return shift_n
        +      else
        +        raise '[Racc Bug] unknown jump code'
        +      end
        +    end
        +
        +  elsif act == shift_n
        +    #
        +    # accept
        +    #
        +    racc_accept if @yydebug
        +    throw :racc_end_parse, @racc_vstack[0]
        +
        +  elsif act == -reduce_n
        +    #
        +    # error
        +    #
        +    case @racc_error_status
        +    when 0
        +      unless arg[21]    # user_yyerror
        +        on_error @racc_t, @racc_val, @racc_vstack
        +      end
        +    when 3
        +      if @racc_t == 0   # is $
        +        throw :racc_end_parse, nil
        +      end
        +      @racc_read_next = true
        +    end
        +    @racc_user_yyerror = false
        +    @racc_error_status = 3
        +    while true
        +      if i = action_pointer[@racc_state[-1]]
        +        i += 1   # error token
        +        if  i >= 0 and
        +            (act = action_table[i]) and
        +            action_check[i] == @racc_state[-1]
        +          break
        +        end
        +      end
        +      throw :racc_end_parse, nil if @racc_state.size <= 1
        +      @racc_state.pop
        +      @racc_vstack.pop
        +      if @yydebug
        +        @racc_tstack.pop
        +        racc_e_pop @racc_state, @racc_tstack, @racc_vstack
        +      end
        +    end
        +    return act
        +
        +  else
        +    raise "[Racc Bug] unknown action #{act.inspect}"
        +  end
        +
        +  racc_next_state(@racc_state[-1], @racc_state) if @yydebug
        +
        +  nil
        +end
        +
        +
        + +
        +

        + + #_racc_init_sysvarsObject + + + + + +

        + + + + +
        +
        +
        +
        +234
        +235
        +236
        +237
        +238
        +239
        +240
        +241
        +242
        +243
        +244
        +245
        +246
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 234
        +
        +def _racc_init_sysvars
        +  @racc_state  = [0]
        +  @racc_tstack = []
        +  @racc_vstack = []
        +
        +  @racc_t = nil
        +  @racc_val = nil
        +
        +  @racc_read_next = true
        +
        +  @racc_user_yyerror = false
        +  @racc_error_status = 0
        +end
        +
        +
        + +
        +

        + + #_racc_setupObject + + + + + +

        + + + + +
        +
        +
        +
        +222
        +223
        +224
        +225
        +226
        +227
        +228
        +229
        +230
        +231
        +232
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 222
        +
        +def _racc_setup
        +  @yydebug = false unless self.class::Racc_debug_parser
        +  @yydebug = false unless defined?(@yydebug)
        +  if @yydebug
        +    @racc_debug_out = $stderr unless defined?(@racc_debug_out)
        +    @racc_debug_out ||= $stderr
        +  end
        +  arg = self.class::Racc_arg
        +  arg[13] = true if arg.size < 14
        +  arg
        +end
        +
        +
        + +
        +

        + + #_racc_yyparse_rb(recv, mid, arg, c_debug) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +328
        +329
        +330
        +331
        +332
        +333
        +334
        +335
        +336
        +337
        +338
        +339
        +340
        +341
        +342
        +343
        +344
        +345
        +346
        +347
        +348
        +349
        +350
        +351
        +352
        +353
        +354
        +355
        +356
        +357
        +358
        +359
        +360
        +361
        +362
        +363
        +364
        +365
        +366
        +367
        +368
        +369
        +370
        +371
        +372
        +373
        +374
        +375
        +376
        +377
        +378
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 328
        +
        +def _racc_yyparse_rb(recv, mid, arg, c_debug)
        +  action_table, action_check, action_default, action_pointer,
        +  _,             _,            _,              _,
        +  _,            _,            token_table,    _,
        +  _,            _,            * = arg
        +
        +  _racc_init_sysvars
        +  act = nil
        +  i = nil
        +
        +  catch(:racc_end_parse) {
        +    until i = action_pointer[@racc_state[-1]]
        +      while act = _racc_evalact(action_default[@racc_state[-1]], arg)
        +        ;
        +      end
        +    end
        +    recv.__send__(mid) do |tok, val|
        +      unless tok
        +        @racc_t = 0
        +      else
        +        @racc_t = (token_table[tok] or 1)   # error token
        +      end
        +      @racc_val = val
        +      @racc_read_next = false
        +
        +      i += @racc_t
        +      unless i >= 0 and
        +             act = action_table[i] and
        +             action_check[i] == @racc_state[-1]
        +        act = action_default[@racc_state[-1]]
        +      end
        +      while act = _racc_evalact(act, arg)
        +        ;
        +      end
        +
        +      while not(i = action_pointer[@racc_state[-1]]) or
        +            not @racc_read_next or
        +            @racc_t == 0   # $
        +        unless i and i += @racc_t and
        +               i >= 0 and
        +               act = action_table[i] and
        +               action_check[i] == @racc_state[-1]
        +          act = action_default[@racc_state[-1]]
        +        end
        +        while act = _racc_evalact(act, arg)
        +          ;
        +        end
        +      end
        +    end
        +  }
        +end
        +
        +
        + +
        +

        + + #do_parseObject + + + + + +

        +
        +

        The entry point of the parser. This method is used with #next_token. +If Racc wants to get token (and its value), calls next_token.

        + +

        Example: + def parse + @q = [[1,1], + [2,2], + [3,3], + [false, '$']] + do_parse + end

        + +
        def next_token
        +  @q.shift
        +end
        +
        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +263
        +264
        +265
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 263
        +
        +def do_parse
        +  __send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
        +end
        +
        +
        + +
        +

        + + #next_tokenObject + + + + + +

        +
        +

        The method to fetch next token. +If you use #do_parse method, you must implement #next_token.

        + +

        The format of return value is [TOKEN_SYMBOL, VALUE]. ++token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT +for 'IDENT'. ";" (String) for ';'.

        + +

        The final symbol (End of file) must be false.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (NotImplementedError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +275
        +276
        +277
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 275
        +
        +def next_token
        +  raise NotImplementedError, "#{self.class}\#next_token is not defined"
        +end
        +
        +
        + +
        +

        + + #on_error(t, val, vstack) ⇒ Object + + + + + +

        +
        +

        This method is called when a parse error is found.

        + +

        ERROR_TOKEN_ID is an internal ID of token which caused error. +You can get string representation of this ID by calling

        + +

        token_to_str.

        + +

        ERROR_VALUE is a value of error token.

        + +

        value_stack is a stack of symbol values. +DO NOT MODIFY this object.

        + +

        This method raises ParseError by default.

        + +

        If this method returns, parsers enter "error recovering mode".

        + + +
        +
        +
        + +

        Raises:

        + + +
        + + + + +
        +
        +
        +
        +532
        +533
        +534
        +535
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 532
        +
        +def on_error(t, val, vstack)
        +  raise ParseError, sprintf("\nparse error on value %s (%s)",
        +                            val.inspect, token_to_str(t) || '?')
        +end
        +
        +
        + +
        +

        + + #racc_acceptObject + + + + + +

        + + + + +
        +
        +
        +
        +582
        +583
        +584
        +585
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 582
        +
        +def racc_accept
        +  @racc_debug_out.puts 'accept'
        +  @racc_debug_out.puts
        +end
        +
        +
        + +
        +

        + + #racc_e_pop(state, tstack, vstack) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +587
        +588
        +589
        +590
        +591
        +592
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 587
        +
        +def racc_e_pop(state, tstack, vstack)
        +  @racc_debug_out.puts 'error recovering mode: pop token'
        +  racc_print_states state
        +  racc_print_stacks tstack, vstack
        +  @racc_debug_out.puts
        +end
        +
        +
        + +
        +

        + + #racc_next_state(curstate, state) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +594
        +595
        +596
        +597
        +598
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 594
        +
        +def racc_next_state(curstate, state)
        +  @racc_debug_out.puts  "goto    #{curstate}"
        +  racc_print_states state
        +  @racc_debug_out.puts
        +end
        +
        +
        + +
        +

        + + #racc_print_stacks(t, v) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +600
        +601
        +602
        +603
        +604
        +605
        +606
        +607
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 600
        +
        +def racc_print_stacks(t, v)
        +  out = @racc_debug_out
        +  out.print '        ['
        +  t.each_index do |i|
        +    out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
        +  end
        +  out.puts ' ]'
        +end
        +
        +
        + +
        +

        + + #racc_print_states(s) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +609
        +610
        +611
        +612
        +613
        +614
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 609
        +
        +def racc_print_states(s)
        +  out = @racc_debug_out
        +  out.print '        ['
        +  s.each {|st| out.print ' ', st }
        +  out.puts ' ]'
        +end
        +
        +
        + +
        +

        + + #racc_read_token(t, tok, val) ⇒ Object + + + + + +

        +
        +

        For debugging output

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +555
        +556
        +557
        +558
        +559
        +560
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 555
        +
        +def racc_read_token(t, tok, val)
        +  @racc_debug_out.print 'read    '
        +  @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
        +  @racc_debug_out.puts val.inspect
        +  @racc_debug_out.puts
        +end
        +
        +
        + +
        +

        + + #racc_reduce(toks, sim, tstack, vstack) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +568
        +569
        +570
        +571
        +572
        +573
        +574
        +575
        +576
        +577
        +578
        +579
        +580
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 568
        +
        +def racc_reduce(toks, sim, tstack, vstack)
        +  out = @racc_debug_out
        +  out.print 'reduce '
        +  if toks.empty?
        +    out.print ' <none>'
        +  else
        +    toks.each {|t| out.print ' ', racc_token2str(t) }
        +  end
        +  out.puts " --> #{racc_token2str(sim)}"
        +
        +  racc_print_stacks tstack, vstack
        +  @racc_debug_out.puts
        +end
        +
        +
        + +
        +

        + + #racc_shift(tok, tstack, vstack) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +562
        +563
        +564
        +565
        +566
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 562
        +
        +def racc_shift(tok, tstack, vstack)
        +  @racc_debug_out.puts "shift   #{racc_token2str tok}"
        +  racc_print_stacks tstack, vstack
        +  @racc_debug_out.puts
        +end
        +
        +
        + +
        +

        + + #racc_token2str(tok) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +616
        +617
        +618
        +619
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 616
        +
        +def racc_token2str(tok)
        +  self.class::Racc_token_to_s_table[tok] or
        +      raise "[Racc Bug] can't convert token #{tok} to string"
        +end
        +
        +
        + +
        +

        + + #token_to_str(t) ⇒ Object + + + + + +

        +
        +

        Convert internal ID of token symbol to the string.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +622
        +623
        +624
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 622
        +
        +def token_to_str(t)
        +  self.class::Racc_token_to_s_table[t]
        +end
        +
        +
        + +
        +

        + + #yyacceptObject + + + + + +

        +
        +

        Exit parser. +Return value is Symbol_Value_Stack[0].

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +545
        +546
        +547
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 545
        +
        +def yyaccept
        +  throw :racc_jump, 2
        +end
        +
        +
        + +
        +

        + + #yyerrokObject + + + + + +

        +
        +

        Leave error recovering mode.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +550
        +551
        +552
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 550
        +
        +def yyerrok
        +  @racc_error_status = 0
        +end
        +
        +
        + +
        +

        + + #yyerrorObject + + + + + +

        +
        +

        Enter error recovering mode. +This method does not call #on_error.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +539
        +540
        +541
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 539
        +
        +def yyerror
        +  throw :racc_jump, 1
        +end
        +
        +
        + +
        +

        + + #yyparse(recv, mid) ⇒ Object + + + + + +

        +
        +

        Another entry point for the parser. +If you use this method, you must implement RECEIVER#METHOD_ID method.

        + +

        RECEIVER#METHOD_ID is a method to get next token. +It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +324
        +325
        +326
        +
        +
        # File 'opal/stdlib/racc/parser.rb', line 324
        +
        +def yyparse(recv, mid)
        +  __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Range.html b/docs/api/v1.8.2/stdlib/Range.html new file mode 100644 index 00000000..6b191e90 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Range.html @@ -0,0 +1,221 @@ + + + + + + + Class: Range + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Range + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #pretty_print(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +406
        +407
        +408
        +409
        +410
        +411
        +412
        +
        +
        # File 'opal/stdlib/pp.rb', line 406
        +
        +def pretty_print(q) # :nodoc:
        +  q.pp self.begin
        +  q.breakable ''
        +  q.text(self.exclude_end? ? '...' : '..')
        +  q.breakable ''
        +  q.pp self.end if self.end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Rational.html b/docs/api/v1.8.2/stdlib/Rational.html new file mode 100644 index 00000000..e023a38f --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Rational.html @@ -0,0 +1,230 @@ + + + + + + + Class: Rational + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Rational + + + +

        +
        + +
        +
        Inherits:
        +
        + Numeric + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/bigdecimal/util.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Numeric

        +

        #to_json, #to_n

        + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_d(precision) ⇒ Object + + + + + +

        +
        +

        call-seq: + rat.to_d(precision) -> bigdecimal

        + +

        Returns the value as a BigDecimal.

        + +

        The required +precision+ parameter is used to determine the number of +significant digits for the result.

        + +
        require 'bigdecimal'
        +require 'bigdecimal/util'
        +
        +Rational(22, 7).to_d(3)   # => 0.314e1
        +
        + +

        See also BigDecimal::new.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +129
        +130
        +131
        +
        +
        # File 'opal/stdlib/bigdecimal/util.rb', line 129
        +
        +def to_d(precision)
        +  BigDecimal(self, precision)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/RbConfig.html b/docs/api/v1.8.2/stdlib/RbConfig.html new file mode 100644 index 00000000..cd9f76cf --- /dev/null +++ b/docs/api/v1.8.2/stdlib/RbConfig.html @@ -0,0 +1,188 @@ + + + + + + + Module: RbConfig + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: RbConfig + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/rbconfig.rb
        +
        + +
        + + + +

        + Constant Summary + collapse +

        + +
        + +
        CONFIG = + +
        +
        {
        +  'ruby_version' => RUBY_VERSION,
        +  'MAJOR'        => versions[0],
        +  'MINOR'        => versions[1],
        +  'TEENY'        => versions[2],
        +  'RUBY'         => RUBY_ENGINE,
        +  'RUBY_INSTALL_NAME' => RUBY_ENGINE,
        +  'ruby_install_name' => RUBY_ENGINE,
        +  'RUBY_SO_NAME'      => RUBY_ENGINE,
        +  'target_os'         => 'ECMA-262',
        +  'host_os'           => 'ECMA-262',
        +  'PATH_SEPARATOR'    => ':',
        +  'EXEEXT'            => '',
        +  'bindir'            => '',
        +}
        + +
        SIZEOF = + +
        +
        {
        +  'clock_t'              => 8,
        +  'double _Complex'      => 16,
        +  'double'               => 8,
        +  'float _Complex'       => 8,
        +  'float'                => 4,
        +  'int'                  => 4,
        +  'int128_t'             => 16,
        +  'int16_t'              => 2,
        +  'int32_t'              => 4,
        +  'int64_t'              => 8,
        +  'int8_t'               => 1,
        +  'intmax_t'             => 8,
        +  'intptr_t'             => 8,
        +  'int_fast16_t'         => 2,
        +  'int_fast32_t'         => 4,
        +  'int_fast64_t'         => 8,
        +  'int_fast8_t'          => 1,
        +  'int_least16_t'        => 2,
        +  'int_least32_t'        => 4,
        +  'int_least64_t'        => 8,
        +  'int_least8_t'         => 1,
        +  'long double _Complex' => 32,
        +  'long double'          => 16,
        +  'long long'            => 8,
        +  'long'                 => 8,
        +  'off_t'                => 8,
        +  'ptrdiff_t'            => 8,
        +  'short'                => 2,
        +  'sig_atomic_t'         => 4,
        +  'size_t'               => 8,
        +  'ssize_t'              => 8,
        +  'time_t'               => 8,
        +  'uint128_t'            => 16,
        +  'uint16_t'             => 2,
        +  'uint32_t'             => 4,
        +  'uint64_t'             => 8,
        +  'uint8_t'              => 1,
        +  'uintptr_t'            => 8,
        +  'void*'                => 8,
        +  'wchar_t'              => 4,
        +  'wctrans_t'            => 4,
        +  'wctype_t'             => 4,
        +  'wint_t'               => 4,
        +  '_Bool'                => 1,
        +  '__int128'             => 16,
        +}
        + +
        + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Regexp.html b/docs/api/v1.8.2/stdlib/Regexp.html new file mode 100644 index 00000000..87049c5a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Regexp.html @@ -0,0 +1,220 @@ + + + + + + + Class: Regexp + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Regexp + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/native.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #to_n ⇒ Object + + + + + + + + + + + + + +

          The internal JavaScript value (with valueOf).

          +
          + +
        • + + +
        + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Returns the internal JavaScript value (with valueOf).

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          the internal JavaScript value (with valueOf).

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +470
        +471
        +472
        +
        +
        # File 'opal/stdlib/native.rb', line 470
        +
        +def to_n
        +  `self.valueOf()`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/SecureRandom.html b/docs/api/v1.8.2/stdlib/SecureRandom.html new file mode 100644 index 00000000..8009d849 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/SecureRandom.html @@ -0,0 +1,250 @@ + + + + + + + Module: SecureRandom + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: SecureRandom + + + +

        +
        + + + + +
        +
        Extended by:
        +
        Random::Formatter
        +
        + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/securerandom.rb
        +
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .bytes(bytes = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +53
        +54
        +55
        +
        +
        # File 'opal/stdlib/securerandom.rb', line 53
        +
        +def self.bytes(bytes = nil)
        +  gen_random(bytes)
        +end
        +
        +
        + +
        +

        + + .gen_random(count = nil) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +57
        +58
        +59
        +60
        +61
        +62
        +63
        +64
        +65
        +66
        +67
        +
        +
        # File 'opal/stdlib/securerandom.rb', line 57
        +
        +def self.gen_random(count = nil)
        +  count = Random._verify_count(count)
        +  out = ''
        +  %x{
        +    var bytes = gen_random_bytes(#{count});
        +    for (var i = 0; i < #{count}; i++) {
        +      out += String.fromCharCode(bytes[i]);
        +    }
        +  }
        +  out.encode('ASCII-8BIT')
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Shellwords.html b/docs/api/v1.8.2/stdlib/Shellwords.html new file mode 100644 index 00000000..f59ff5e9 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Shellwords.html @@ -0,0 +1,658 @@ + + + + + + + Module: Shellwords + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Shellwords + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/shellwords.rb
        +
        + +
        + +

        Overview

        +
        +

        == Manipulates strings like the UNIX Bourne shell

        + +

        This module manipulates strings according to the word parsing rules +of the UNIX Bourne shell.

        + +

        The shellwords() function was originally a port of shellwords.pl, +but modified to conform to the Shell & Utilities volume of the IEEE +Std 1003.1-2008, 2016 Edition [1].

        + +

        === Usage

        + +

        You can use Shellwords to parse a string into a Bourne shell friendly Array.

        + +

        require 'shellwords'

        + +

        argv = Shellwords.split('three blind "mice"') + argv #=> ["three", "blind", "mice"]

        + +

        Once you've required Shellwords, you can use the #split alias +String#shellsplit.

        + +

        argv = "see how they run".shellsplit + argv #=> ["see", "how", "they", "run"]

        + +

        They treat quotes as special characters, so an unmatched quote will +cause an ArgumentError.

        + +

        argv = "they all ran after the farmer's wife".shellsplit + #=> ArgumentError: Unmatched quote: ...

        + +

        Shellwords also provides methods that do the opposite. +Shellwords.escape, or its alias, String#shellescape, escapes +shell metacharacters in a string for use in a command line.

        + +

        filename = "special's.txt"

        + +

        system("cat -- #filenamefilename.shellescape") + # runs "cat -- special\'s.txt"

        + +

        Note the '--'. Without it, cat(1) will treat the following argument +as a command line option if it starts with '-'. It is guaranteed +that Shellwords.escape converts a string to a form that a Bourne +shell will parse back to the original string, but it is the +programmer's responsibility to make sure that passing an arbitrary +argument to a command does no harm.

        + +

        Shellwords also comes with a core extension for Array, Array#shelljoin.

        + +

        dir = "Funny GIFs" + argv = %W[ls -lta -- #dir] + system(argv.shelljoin + " | less") + # runs "ls -lta -- Funny\ GIFs | less"

        + +

        You can use this method to build a complete command line out of an +array of arguments.

        + +

        === Authors

        + + + +

        === Contact

        + + + +

        === Resources

        + +

        1: Std 1003.1-2008, 2016 Edition, the Shell & Utilities volume[http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html]

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

        + Class Method Summary + collapse +

        + +
          + +
        • + + + .shellescape(str) ⇒ Object + + + + (also: escape) + + + + + + + + + + + +

          Escapes a string so that it can be safely used in a Bourne shell command line.

          +
          + +
        • + + +
        • + + + .shelljoin(array) ⇒ Object + + + + (also: join) + + + + + + + + + + + +

          Builds a command line string from an argument list, +array+.

          +
          + +
        • + + +
        • + + + .shellsplit(line) ⇒ Object + + + + (also: split) + + + + + + + + + + + +

          Splits a string into an array of tokens in the same way the UNIX Bourne shell does.

          +
          + +
        • + + +
        • + + + .shellwords ⇒ Object + + + + + + + + + + + + + +

          Splits a string into an array of tokens in the same way the UNIX Bourne shell does.

          +
          + +
        • + + +
        + + + + +
        +

        Class Method Details

        + + +
        +

        + + .shellescape(str) ⇒ Object + + + + Also known as: + escape + + + + +

        +
        +

        Escapes a string so that it can be safely used in a Bourne shell +command line. +str+ can be a non-string object that responds to ++to_s+.

        + +

        Note that a resulted string should be used unquoted and is not +intended for use in double quotes nor in single quotes.

        + +

        argv = Shellwords.escape("It's better to give than to receive") + argv #=> "It\'s\ better\ to\ give\ than\ to\ receive"

        + +

        String#shellescape is a shorthand for this function.

        + +

        argv = "It's better to give than to receive".shellescape + argv #=> "It\'s\ better\ to\ give\ than\ to\ receive"

        + +

        # Search files in lib for method definitions + pattern = "^[ \t]*def " + open("| grep -Ern -e #patternpattern.shellescape lib") { |grep| + grep.each_line { |line| + file, lineno, matched_line = line.split(':', 3) + # ... + } + }

        + +

        It is the caller's responsibility to encode the string in the right +encoding for the shell environment where this string is used.

        + +

        Multibyte characters are treated as multibyte characters, not as bytes.

        + +

        Returns an empty quoted String if +str+ has a length of zero.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +148
        +149
        +150
        +151
        +152
        +153
        +154
        +155
        +156
        +157
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +
        +
        # File 'opal/stdlib/shellwords.rb', line 148
        +
        +def shellescape(str)
        +  str = str.to_s
        +
        +  # An empty argument will be skipped, so return empty quotes.
        +  return "''".dup if str.empty?
        +
        +  str = str.dup
        +
        +  # Treat multibyte characters as is.  It is the caller's responsibility
        +  # to encode the string in the right encoding for the shell
        +  # environment.
        +  str = str.gsub(/[^A-Za-z0-9_\-.,:+\/@\n]/, '\\\\\\&')
        +
        +  # A LF cannot be escaped with a backslash because a backslash + LF
        +  # combo is regarded as a line continuation and simply ignored.
        +  str = str.gsub(/\n/, "'\n'")
        +
        +  str
        +end
        +
        +
        + +
        +

        + + .shelljoin(array) ⇒ Object + + + + Also known as: + join + + + + +

        +
        +

        Builds a command line string from an argument list, +array+.

        + +

        All elements are joined into a single string with fields separated by a +space, where each element is escaped for the Bourne shell and stringified +using +to_s+.

        + +

        ary = ["There's", "a", "time", "and", "place", "for", "everything"] + argv = Shellwords.join(ary) + argv #=> "There\'s a time and place for everything"

        + +

        Array#shelljoin is a shortcut for this function.

        + +

        ary = ["Don't", "rock", "the", "boat"] + argv = ary.shelljoin + argv #=> "Don\'t rock the boat"

        + +

        You can also mix non-string objects in the elements as allowed in Array#join.

        + +

        output = #{['ps', '-p', $$].shelljoin}

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +194
        +195
        +196
        +
        +
        # File 'opal/stdlib/shellwords.rb', line 194
        +
        +def shelljoin(array)
        +  array.map { |arg| shellescape(arg) }.join(' ')
        +end
        +
        +
        + +
        +

        + + .shellsplit(line) ⇒ Object + + + + Also known as: + split + + + + +

        +
        +

        Splits a string into an array of tokens in the same way the UNIX +Bourne shell does.

        + +

        argv = Shellwords.split('here are "two words"') + argv #=> ["here", "are", "two words"]

        + +

        Note, however, that this is not a command line parser. Shell +metacharacters except for the single and double quotes and +backslash are not treated as such.

        + +

        argv = Shellwords.split('ruby my_prog.rb | less') + argv #=> ["ruby", "my_prog.rb", "|", "less"]

        + +

        String#shellsplit is a shortcut for this function.

        + +

        argv = 'here are "two words"'.shellsplit + argv #=> ["here", "are", "two words"]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +88
        +89
        +90
        +91
        +92
        +93
        +94
        +95
        +96
        +97
        +98
        +99
        +100
        +101
        +102
        +103
        +104
        +105
        +106
        +107
        +108
        +
        +
        # File 'opal/stdlib/shellwords.rb', line 88
        +
        +def shellsplit(line)
        +  line += ' ' # Somehow this is needed for the JS regexp engine
        +  words = []
        +  field = String.new
        +  line.scan(/\s*(?:([^\s\\\'\"]+)|'([^\']*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\r?\n?\Z|\s)?/m) do |(word, sq, dq, esc, garbage, sep)|
        +    raise ArgumentError, "Unmatched quote: #{line.inspect}" if garbage
        +    # 2.2.3 Double-Quotes:
        +    #
        +    #   The <backslash> shall retain its special meaning as an
        +    #   escape character only when followed by one of the following
        +    #   characters when considered special:
        +    #
        +    #   $ ` " \ <newline>
        +    field += (word || sq || (dq && dq.gsub(/\\([$`"\\\n])/, '\\1')) || esc.gsub(/\\(.)/, '\\1'))
        +    if sep
        +      words << field
        +      field = String.new
        +    end
        +  end
        +  words
        +end
        +
        +
        + +
        +

        + + .shellwordsObject + + + + + +

        +
        +

        Splits a string into an array of tokens in the same way the UNIX +Bourne shell does.

        + +

        argv = Shellwords.split('here are "two words"') + argv #=> ["here", "are", "two words"]

        + +

        Note, however, that this is not a command line parser. Shell +metacharacters except for the single and double quotes and +backslash are not treated as such.

        + +

        argv = Shellwords.split('ruby my_prog.rb | less') + argv #=> ["ruby", "my_prog.rb", "|", "less"]

        + +

        String#shellsplit is a shortcut for this function.

        + +

        argv = 'here are "two words"'.shellsplit + argv #=> ["here", "are", "two words"]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +110
        +111
        +112
        +113
        +114
        +115
        +116
        +117
        +118
        +119
        +120
        +121
        +122
        +123
        +124
        +125
        +126
        +127
        +128
        +129
        +130
        +
        +
        # File 'opal/stdlib/shellwords.rb', line 110
        +
        +def shellsplit(line)
        +  line += ' ' # Somehow this is needed for the JS regexp engine
        +  words = []
        +  field = String.new
        +  line.scan(/\s*(?:([^\s\\\'\"]+)|'([^\']*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\r?\n?\Z|\s)?/m) do |(word, sq, dq, esc, garbage, sep)|
        +    raise ArgumentError, "Unmatched quote: #{line.inspect}" if garbage
        +    # 2.2.3 Double-Quotes:
        +    #
        +    #   The <backslash> shall retain its special meaning as an
        +    #   escape character only when followed by one of the following
        +    #   characters when considered special:
        +    #
        +    #   $ ` " \ <newline>
        +    field += (word || sq || (dq && dq.gsub(/\\([$`"\\\n])/, '\\1')) || esc.gsub(/\\(.)/, '\\1'))
        +    if sep
        +      words << field
        +      field = String.new
        +    end
        +  end
        +  words
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/SimpleDelegator.html b/docs/api/v1.8.2/stdlib/SimpleDelegator.html new file mode 100644 index 00000000..7278fa22 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/SimpleDelegator.html @@ -0,0 +1,390 @@ + + + + + + + Class: SimpleDelegator + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: SimpleDelegator + + + +

        +
        + +
        +
        Inherits:
        +
        + Delegator + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/delegate.rb
        +
        + +
        + +

        Overview

        +
        +

        A concrete implementation of Delegator, this class provides the means to +delegate all supported method calls to the object passed into the constructor +and even to change the object being delegated to at a later time with

        + +

        setobj.

        + +

        class User + def born_on + Date.new(1989, 9, 10) + end + end

        + +

        require 'delegate'

        + +

        class UserDecorator < SimpleDelegator + def birth_year + born_on.year + end + end

        + +

        decorated_user = UserDecorator.new(User.new) + decorated_user.birth_year #=> 1989 + decorated_user.getobj #=> #

        + +

        A SimpleDelegator instance can take advantage of the fact that SimpleDelegator +is a subclass of +Delegator+ to call super to have methods called on +the object being delegated to.

        + +

        class SuperArray < SimpleDelegator + def + super + 1 + end + end

        + +

        SuperArray.new([1])[0] #=> 2

        + +

        Here's a simple example that takes advantage of the fact that +SimpleDelegator's delegation object can be changed at any time.

        + +

        class Stats + def initialize + @source = SimpleDelegator.new([]) + end

        + +
        def stats(records)
        +  @source.__setobj__(records)
        +
        +  "Elements:  #{@source.size}\n" +
        +  " Non-Nil:  #{@source.compact.size}\n" +
        +  "  Unique:  #{@source.uniq.size}\n"
        +end
        +
        + +

        end

        + +

        s = Stats.new + puts s.stats(%wEdward Gray II) + puts + puts s.stats([1, 2, 3, nil, 4, 5, 1, 2])

        + +

        Prints:

        + +

        Elements: 4 + Non-Nil: 4 + Unique: 4

        + +

        Elements: 8 + Non-Nil: 7 + Unique: 6

        + + +
        +
        +
        + + +
        + + +

        Constant Summary

        + +

        Constants inherited + from Delegator

        +

        Delegator::VERSION

        + + + + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from Delegator

        +

        #!, #!=, #==, const_missing, delegating_block, #eql?, #freeze, #frozen?, #initialize, #marshal_dump, #marshal_load, #methods, #protected_methods, public_api, #public_methods, #respond_to_missing?

        +
        +

        Constructor Details

        + +

        This class inherits a constructor from Delegator

        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #__getobj__Object + + + + + +

        +
        +

        Returns the current object method calls are being delegated to.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +332
        +333
        +334
        +335
        +336
        +337
        +338
        +
        +
        # File 'opal/stdlib/delegate.rb', line 332
        +
        +def __getobj__
        +  unless defined?(@delegate_sd_obj)
        +    return yield if block_given?
        +    __raise__ ::ArgumentError, 'not delegated'
        +  end
        +  @delegate_sd_obj
        +end
        +
        +
        + +
        +

        + + #__setobj__(obj) ⇒ Object + + + + + +

        +
        +

        Changes the delegate object to obj.

        + +

        It's important to note that this does not cause SimpleDelegator's methods +to change. Because of this, you probably only want to change delegation +to objects of the same type as the original delegate.

        + +

        Here's an example of changing the delegation object.

        + +

        names = SimpleDelegator.new(%wEdward Gray II) + puts names[1] # => Edward + names.setobj(%wSinclair) + puts names[1] # => Sinclair

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +354
        +355
        +356
        +357
        +
        +
        # File 'opal/stdlib/delegate.rb', line 354
        +
        +def __setobj__(obj)
        +  __raise__ ::ArgumentError, 'cannot delegate to self' if equal?(obj)
        +  @delegate_sd_obj = obj
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/SingleForwardable.html b/docs/api/v1.8.2/stdlib/SingleForwardable.html new file mode 100644 index 00000000..6e0e6003 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/SingleForwardable.html @@ -0,0 +1,334 @@ + + + + + + + Module: SingleForwardable + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: SingleForwardable + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/forwardable.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #def_single_delegator(accessor, method, ali = method) ⇒ Object + + + + Also known as: + def_delegator + + + + +

        + + + + +
        +
        +
        +
        +56
        +57
        +58
        +59
        +60
        +61
        +62
        +63
        +64
        +65
        +66
        +
        +
        # File 'opal/stdlib/forwardable.rb', line 56
        +
        +def def_single_delegator(accessor, method, ali = method)
        +  if accessor.to_s.start_with? '@'
        +    define_singleton_method ali do |*args, &block|
        +      instance_variable_get(accessor).__send__(method, *args, &block)
        +    end
        +  else
        +    define_singleton_method ali do |*args, &block|
        +      __send__(accessor).__send__(method, *args, &block)
        +    end
        +  end
        +end
        +
        +
        + +
        +

        + + #def_single_delegators(accessor, *methods) ⇒ Object + + + + Also known as: + def_delegators + + + + +

        + + + + +
        +
        +
        +
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +
        +
        # File 'opal/stdlib/forwardable.rb', line 48
        +
        +def def_single_delegators(accessor, *methods)
        +  methods.each do |method|
        +    next if %w[__send__ __id__].include? method
        +
        +    def_single_delegator(accessor, method)
        +  end
        +end
        +
        +
        + +
        +

        + + #single_delegate(hash) ⇒ Object + + + + Also known as: + delegate + + + + +

        + + + + +
        +
        +
        +
        +38
        +39
        +40
        +41
        +42
        +43
        +44
        +45
        +46
        +
        +
        # File 'opal/stdlib/forwardable.rb', line 38
        +
        +def single_delegate(hash)
        +  hash.each do |methods, accessor|
        +    methods = [methods] unless methods.respond_to? :each
        +
        +    methods.each do |method|
        +      def_single_delegator(accessor, method)
        +    end
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Singleton.html b/docs/api/v1.8.2/stdlib/Singleton.html new file mode 100644 index 00000000..60bf8c43 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Singleton.html @@ -0,0 +1,419 @@ + + + + + + + Module: Singleton + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Singleton + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/singleton.rb
        +
        + +
        + +

        Defined Under Namespace

        +

        + + + Modules: SingletonClassMethods + + + + +

        + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .__init__(klass) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +
        +
        # File 'opal/stdlib/singleton.rb', line 22
        +
        +def __init__(klass)
        +  klass.instance_eval do
        +    @singleton__instance__ = nil
        +  end
        +  def klass.instance
        +    return @singleton__instance__ if @singleton__instance__
        +    @singleton__instance__ = new
        +  end
        +  klass
        +end
        +
        +
        + +
        +

        + + .included(klass) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +33
        +34
        +35
        +36
        +37
        +
        +
        # File 'opal/stdlib/singleton.rb', line 33
        +
        +def included(klass)
        +  super
        +  klass.extend SingletonClassMethods
        +  Singleton.__init__(klass)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #cloneObject + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +2
        +3
        +4
        +
        +
        # File 'opal/stdlib/singleton.rb', line 2
        +
        +def clone
        +  raise TypeError, "can't clone instance of singleton #{self.class}"
        +end
        +
        +
        + +
        +

        + + #dupObject + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +6
        +7
        +8
        +
        +
        # File 'opal/stdlib/singleton.rb', line 6
        +
        +def dup
        +  raise TypeError, "can't dup instance of singleton #{self.class}"
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Singleton/SingletonClassMethods.html b/docs/api/v1.8.2/stdlib/Singleton/SingletonClassMethods.html new file mode 100644 index 00000000..f135b7df --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Singleton/SingletonClassMethods.html @@ -0,0 +1,230 @@ + + + + + + + Module: Singleton::SingletonClassMethods + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: Singleton::SingletonClassMethods + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/singleton.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #cloneObject + + + + + +

        + + + + +
        +
        +
        +
        +11
        +12
        +13
        +
        +
        # File 'opal/stdlib/singleton.rb', line 11
        +
        +def clone
        +  Singleton.__init__(super)
        +end
        +
        +
        + +
        +

        + + #inherited(sub_klass) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +15
        +16
        +17
        +18
        +
        +
        # File 'opal/stdlib/singleton.rb', line 15
        +
        +def inherited(sub_klass)
        +  super
        +  Singleton.__init__(sub_klass)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/String.html b/docs/api/v1.8.2/stdlib/String.html new file mode 100644 index 00000000..c1db2c25 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/String.html @@ -0,0 +1,580 @@ + + + + + + + Class: String + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: String + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb,
        + opal/stdlib/json.rb,
        opal/stdlib/native.rb,
        opal/stdlib/shellwords.rb,
        opal/stdlib/bigdecimal/util.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #pretty_print(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +416
        +417
        +418
        +419
        +420
        +421
        +422
        +423
        +424
        +425
        +426
        +427
        +
        +
        # File 'opal/stdlib/pp.rb', line 416
        +
        +def pretty_print(q) # :nodoc:
        +  lines = self.lines
        +  if lines.size > 1
        +    q.group(0, '', '') do
        +      q.seplist(lines, lambda { q.text ' +'; q.breakable }) do |v|
        +        q.pp v
        +      end
        +    end
        +  else
        +    q.text inspect
        +  end
        +end
        +
        +
        + +
        +

        + + #shellescapeObject + + + + + +

        +
        +

        call-seq: + str.shellescape => string

        + +

        Escapes +str+ so that it can be safely used in a Bourne shell +command line.

        + +

        See Shellwords.shellescape for details.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +224
        +225
        +226
        +
        +
        # File 'opal/stdlib/shellwords.rb', line 224
        +
        +def shellescape
        +  Shellwords.escape(self)
        +end
        +
        +
        + +
        +

        + + #shellsplitObject + + + + + +

        +
        +

        call-seq: + str.shellsplit => array

        + +

        Splits +str+ into an array of tokens in the same way the UNIX +Bourne shell does.

        + +

        See Shellwords.shellsplit for details.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +213
        +214
        +215
        +
        +
        # File 'opal/stdlib/shellwords.rb', line 213
        +
        +def shellsplit
        +  Shellwords.split(self)
        +end
        +
        +
        + +
        +

        + + #to_dObject + + + + + +

        +
        +

        call-seq: + str.to_d -> bigdecimal

        + +

        Returns the result of interpreting leading characters in +str+ +as a BigDecimal.

        + +
        require 'bigdecimal'
        +require 'bigdecimal/util'
        +
        +"0.5".to_d             # => 0.5e0
        +"123.45e1".to_d        # => 0.12345e4
        +"45.67 degrees".to_d   # => 0.4567e2
        +
        + +

        See also BigDecimal::new.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +69
        +70
        +71
        +
        +
        # File 'opal/stdlib/bigdecimal/util.rb', line 69
        +
        +def to_d
        +  BigDecimal(`#{self}.replace("_", '').replace(/ .*$/,'')`)
        +end
        +
        +
        + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +183
        +184
        +185
        +
        +
        # File 'opal/stdlib/json.rb', line 183
        +
        +def to_json
        +  `JSON.stringify(self)`
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        Returns the internal JavaScript value (with valueOf).

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          the internal JavaScript value (with valueOf).

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +463
        +464
        +465
        +
        +
        # File 'opal/stdlib/native.rb', line 463
        +
        +def to_n
        +  `self.valueOf()`
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/StringIO.html b/docs/api/v1.8.2/stdlib/StringIO.html new file mode 100644 index 00000000..15eaafc1 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/StringIO.html @@ -0,0 +1,938 @@ + + + + + + + Class: StringIO + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: StringIO + + + +

        +
        + +
        +
        Inherits:
        +
        + IO + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/stringio.rb
        +
        + +
        + + + +

        + Constant Summary + collapse +

        + +
        + +
        VERSION = + +
        +
        "0"
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #string ⇒ Object + + + + + + + + + + + + + + + + +

          Returns the value of attribute string.

          +
          + +
        • + + +
        + + + + + +

        Attributes inherited from IO

        +

        #lineno

        + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

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

        Methods inherited from IO

        +

        binread, #initialize_before_node_io, read, write

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(string = "", mode = 'rw') ⇒ StringIO + + + + + +

        +
        +

        Returns a new instance of StringIO.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +17
        +18
        +19
        +
        +
        # File 'opal/stdlib/stringio.rb', line 14
        +
        +def initialize(string = "", mode = 'rw')
        +  @string   = string
        +  @position = 0
        +
        +  super(nil, mode)
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #stringObject + + + + + +

        +
        +

        Returns the value of attribute string.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +12
        +13
        +14
        +
        +
        # File 'opal/stdlib/stringio.rb', line 12
        +
        +def string
        +  @string
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .open(string = "", mode = nil, &block) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +4
        +5
        +6
        +7
        +8
        +9
        +10
        +
        +
        # File 'opal/stdlib/stringio.rb', line 4
        +
        +def self.open(string = "", mode = nil, &block)
        +  io  = new(string, mode)
        +  res = block.call(io)
        +  io.close
        +
        +  res
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #eof?Boolean + + + + Also known as: + eof + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +21
        +22
        +23
        +24
        +25
        +
        +
        # File 'opal/stdlib/stringio.rb', line 21
        +
        +def eof?
        +  check_readable
        +
        +  @position == @string.length
        +end
        +
        +
        + +
        +

        + + #read(length = nil, outbuf = nil) ⇒ Object + + + + Also known as: + readpartial + + + + +

        + + + + +
        +
        +
        +
        +83
        +84
        +85
        +86
        +87
        +88
        +89
        +90
        +91
        +92
        +93
        +94
        +95
        +96
        +97
        +98
        +99
        +100
        +101
        +102
        +103
        +104
        +
        +
        # File 'opal/stdlib/stringio.rb', line 83
        +
        +def read(length = nil, outbuf = nil)
        +  check_readable
        +
        +  return if eof?
        +
        +  string = if length
        +    str = @string[@position, length]
        +    @position += length
        +    @position = @string.length if @position > @string.length
        +    str
        +  else
        +    str = @string[@position .. -1]
        +    @position = @string.length
        +    str
        +  end
        +
        +  if outbuf
        +    outbuf.write(string)
        +  else
        +    string
        +  end
        +end
        +
        +
        + +
        +

        + + #rewindObject + + + + + +

        + + + + +
        +
        +
        +
        +59
        +60
        +61
        +
        +
        # File 'opal/stdlib/stringio.rb', line 59
        +
        +def rewind
        +  seek 0
        +end
        +
        +
        + +
        +

        + + #seek(pos, whence = IO::SEEK_SET) ⇒ Object + + + + Also known as: + pos= + + + + +

        + + + + +
        +
        +
        +
        +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
        +
        +
        # File 'opal/stdlib/stringio.rb', line 27
        +
        +def seek(pos, whence = IO::SEEK_SET)
        +  # Let's reset the read buffer, because it will be most likely wrong
        +  @read_buffer = ''
        +
        +  case whence
        +  when IO::SEEK_SET
        +    raise Errno::EINVAL unless pos >= 0
        +
        +    @position = pos
        +
        +  when IO::SEEK_CUR
        +    if @position + pos > @string.length
        +      @position = @string.length
        +    else
        +      @position += pos
        +    end
        +
        +  when IO::SEEK_END
        +    if pos > @string.length
        +      @position = 0
        +    else
        +      @position -= pos
        +    end
        +  end
        +
        +  0
        +end
        +
        +
        + +
        +

        + + #sysread(length) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +106
        +107
        +108
        +109
        +110
        +
        +
        # File 'opal/stdlib/stringio.rb', line 106
        +
        +def sysread(length)
        +  check_readable
        +
        +  read(length)
        +end
        +
        +
        + +
        +

        + + #tellObject + + + + Also known as: + pos + + + + +

        + + + + +
        +
        +
        +
        +55
        +56
        +57
        +
        +
        # File 'opal/stdlib/stringio.rb', line 55
        +
        +def tell
        +  @position
        +end
        +
        +
        + +
        +

        + + #write(string) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +63
        +64
        +65
        +66
        +67
        +68
        +69
        +70
        +71
        +72
        +73
        +74
        +75
        +76
        +77
        +78
        +79
        +80
        +81
        +
        +
        # File 'opal/stdlib/stringio.rb', line 63
        +
        +def write(string)
        +  check_writable
        +
        +  # Let's reset the read buffer, because it will be most likely wrong
        +  @read_buffer = ''
        +
        +  string = String(string)
        +
        +  if @string.length == @position
        +    @string   += string
        +    @position += string.length
        +  else
        +    before = @string[0 .. @position - 1]
        +    after  = @string[@position + string.length .. -1]
        +
        +    @string   = before + string + after
        +    @position += string.length
        +  end
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/StringScanner.html b/docs/api/v1.8.2/stdlib/StringScanner.html new file mode 100644 index 00000000..81be1089 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/StringScanner.html @@ -0,0 +1,2073 @@ + + + + + + + Class: StringScanner + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: StringScanner + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/strscan.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

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

        Instance Attribute Summary collapse

        +
          + +
        • + + + #matched ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute matched.

          +
          + +
        • + + +
        • + + + #pos ⇒ Object + + + + + + + + + + + + + + + + +

          Returns the value of attribute pos.

          +
          + +
        • + + +
        • + + + #string ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute string.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(string) ⇒ StringScanner + + + + + +

        +
        +

        Returns a new instance of StringScanner.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +6
        +7
        +8
        +9
        +10
        +11
        +12
        +
        +
        # File 'opal/stdlib/strscan.rb', line 6
        +
        +def initialize(string)
        +  @string  = string
        +  @pos     = 0
        +  @matched = nil
        +  @working = string
        +  @match   = []
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #matchedObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute matched.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +4
        +5
        +6
        +
        +
        # File 'opal/stdlib/strscan.rb', line 4
        +
        +def matched
        +  @matched
        +end
        +
        +
        + + + +
        +

        + + #posObject + + + + + +

        +
        +

        Returns the value of attribute pos.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +4
        +5
        +6
        +
        +
        # File 'opal/stdlib/strscan.rb', line 4
        +
        +def pos
        +  @pos
        +end
        +
        +
        + + + +
        +

        + + #stringObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute string.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +
        +
        # File 'opal/stdlib/strscan.rb', line 14
        +
        +def string
        +  @string
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #[](idx) ⇒ 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
        +
        +
        # File 'opal/stdlib/strscan.rb', line 64
        +
        +def [](idx)
        +  if @match.empty?
        +    return nil
        +  end
        +  case idx
        +  when Symbol
        +    idx = idx.to_s
        +  when String
        +    # noop
        +  else
        +    idx = ::Opal.coerce_to!(idx, Integer, :to_int)
        +  end
        +  %x{
        +    var match = #{@match};
        +
        +    if (idx < 0) {
        +      idx += match.length;
        +    }
        +
        +    if (idx < 0 || idx >= match.length) {
        +      return nil;
        +    }
        +
        +    if (match[idx] == null) {
        +      return nil;
        +    }
        +
        +    return match[idx];
        +  }
        +end
        +
        +
        + +
        +

        + + #beginning_of_line?Boolean + + + + Also known as: + bol? + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +16
        +17
        +18
        +
        +
        # File 'opal/stdlib/strscan.rb', line 16
        +
        +def beginning_of_line?
        +  `#{@pos} === 0 || #{@string}.charAt(#{@pos} - 1) === "\n"`
        +end
        +
        +
        + +
        +

        + + #check(pattern) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +95
        +96
        +97
        +98
        +99
        +100
        +101
        +102
        +103
        +104
        +105
        +106
        +107
        +
        +
        # File 'opal/stdlib/strscan.rb', line 95
        +
        +def check(pattern)
        +  pattern = anchor(pattern)
        +
        +  %x{
        +    var result = pattern.exec(#{@working});
        +
        +    if (result == null) {
        +      return #{@matched} = nil;
        +    }
        +
        +    return #{@matched} = result[0];
        +  }
        +end
        +
        +
        + +
        +

        + + #check_until(pattern) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +109
        +110
        +111
        +112
        +113
        +114
        +115
        +116
        +117
        +118
        +119
        +120
        +121
        +122
        +123
        +
        +
        # File 'opal/stdlib/strscan.rb', line 109
        +
        +def check_until(pattern)
        +  %x{
        +    var old_prev_pos = #{@prev_pos};
        +    var old_pos      = #{@pos};
        +    var old_working  = #{@working};
        +
        +    var result = #{scan_until(pattern)};
        +
        +    #{@prev_pos} = old_prev_pos;
        +    #{@pos}      = old_pos;
        +    #{@working}  = old_working;
        +
        +    return result;
        +  }
        +end
        +
        +
        + +
        +

        + + #eos?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +129
        +130
        +131
        +
        +
        # File 'opal/stdlib/strscan.rb', line 129
        +
        +def eos?
        +  `#{@working}.length === 0`
        +end
        +
        +
        + +
        +

        + + #exist?(pattern) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +133
        +134
        +135
        +136
        +137
        +138
        +139
        +140
        +141
        +142
        +143
        +144
        +145
        +146
        +147
        +
        +
        # File 'opal/stdlib/strscan.rb', line 133
        +
        +def exist?(pattern)
        +  %x{
        +    var result = pattern.exec(#{@working});
        +
        +    if (result == null) {
        +      return nil;
        +    }
        +    else if (result.index == 0) {
        +      return 0;
        +    }
        +    else {
        +      return result.index + 1;
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #get_byteObject + + + + Also known as: + getch + + + + +

        + + + + +
        +
        +
        +
        +189
        +190
        +191
        +192
        +193
        +194
        +195
        +196
        +197
        +198
        +199
        +200
        +201
        +202
        +203
        +204
        +205
        +
        +
        # File 'opal/stdlib/strscan.rb', line 189
        +
        +def get_byte
        +  %x{
        +    var result = nil;
        +
        +    if (#{@pos} < #{@string}.length) {
        +      #{@prev_pos}  = #{@pos};
        +      #{@pos}      += 1;
        +      result      = #{@matched} = #{@working}.substring(0, 1);
        +      #{@working}   = #{@working}.substring(1);
        +    }
        +    else {
        +      #{@matched} = nil;
        +    }
        +
        +    return result;
        +  }
        +end
        +
        +
        + +
        +

        + + #match?(pattern) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +207
        +208
        +209
        +210
        +211
        +212
        +213
        +214
        +215
        +216
        +217
        +218
        +219
        +220
        +221
        +222
        +
        +
        # File 'opal/stdlib/strscan.rb', line 207
        +
        +def match?(pattern)
        +  pattern = anchor(pattern)
        +
        +  %x{
        +    var result = pattern.exec(#{@working});
        +
        +    if (result == null) {
        +      return nil;
        +    }
        +    else {
        +      #{@prev_pos} = #{@pos};
        +
        +      return result[0].length;
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #matched_sizeObject + + + + + +

        + + + + +
        +
        +
        +
        +235
        +236
        +237
        +238
        +239
        +240
        +241
        +242
        +243
        +
        +
        # File 'opal/stdlib/strscan.rb', line 235
        +
        +def matched_size
        +  %x{
        +    if (#{@matched} === nil) {
        +      return nil;
        +    }
        +
        +    return #{@matched}.length
        +  }
        +end
        +
        +
        + +
        +

        + + #peek(length) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +125
        +126
        +127
        +
        +
        # File 'opal/stdlib/strscan.rb', line 125
        +
        +def peek(length)
        +  `#{@working}.substring(0, length)`
        +end
        +
        +
        + +
        +

        + + #post_matchObject + + + + + +

        + + + + +
        +
        +
        +
        +245
        +246
        +247
        +248
        +249
        +250
        +251
        +252
        +253
        +
        +
        # File 'opal/stdlib/strscan.rb', line 245
        +
        +def post_match
        +  %x{
        +    if (#{@matched} === nil) {
        +      return nil;
        +    }
        +
        +    return #{@string}.substr(#{@pos});
        +  }
        +end
        +
        +
        + +
        +

        + + #pre_matchObject + + + + + +

        + + + + +
        +
        +
        +
        +255
        +256
        +257
        +258
        +259
        +260
        +261
        +262
        +263
        +
        +
        # File 'opal/stdlib/strscan.rb', line 255
        +
        +def pre_match
        +  %x{
        +    if (#{@matched} === nil) {
        +      return nil;
        +    }
        +
        +    return #{@string}.substr(0, #{@prev_pos});
        +  }
        +end
        +
        +
        + +
        +

        + + #resetObject + + + + + +

        + + + + +
        +
        +
        +
        +265
        +266
        +267
        +268
        +269
        +
        +
        # File 'opal/stdlib/strscan.rb', line 265
        +
        +def reset
        +  @working = @string
        +  @matched = nil
        +  @pos     = 0
        +end
        +
        +
        + +
        +

        + + #restObject + + + + + +

        + + + + +
        +
        +
        +
        +271
        +272
        +273
        +
        +
        # File 'opal/stdlib/strscan.rb', line 271
        +
        +def rest
        +  @working
        +end
        +
        +
        + +
        +

        + + #rest?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +275
        +276
        +277
        +
        +
        # File 'opal/stdlib/strscan.rb', line 275
        +
        +def rest?
        +  `#{@working}.length !== 0`
        +end
        +
        +
        + +
        +

        + + #rest_sizeObject + + + + + +

        + + + + +
        +
        +
        +
        +279
        +280
        +281
        +
        +
        # File 'opal/stdlib/strscan.rb', line 279
        +
        +def rest_size
        +  rest.size
        +end
        +
        +
        + +
        +

        + + #scan(pattern) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +27
        +28
        +29
        +30
        +31
        +32
        +33
        +34
        +35
        +36
        +37
        +
        +
        # File 'opal/stdlib/strscan.rb', line 20
        +
        +def scan(pattern)
        +  pattern = anchor(pattern)
        +
        +  %x{
        +    var result = pattern.exec(#{@working});
        +
        +    if (result == null) {
        +      return #{@matched} = nil;
        +    }
        +    #{@prev_pos} = #{@pos};
        +    #{@pos}     += result[0].length;
        +    #{@working}  = #{@working}.substring(result[0].length);
        +    #{@matched}  = result[0];
        +    #{@match}    = result;
        +
        +    return result[0];
        +  }
        +end
        +
        +
        + +
        +

        + + #scan_until(pattern) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +39
        +40
        +41
        +42
        +43
        +44
        +45
        +46
        +47
        +48
        +49
        +50
        +51
        +52
        +53
        +54
        +55
        +56
        +57
        +58
        +59
        +60
        +61
        +62
        +
        +
        # File 'opal/stdlib/strscan.rb', line 39
        +
        +def scan_until(pattern)
        +  pattern = anchor(pattern)
        +
        +  %x{
        +    var working = #{@working}
        +
        +    for(var i = 0; working.length != i; ++i) {
        +      var result  = pattern.exec(working.substr(i));
        +      if (result !== null) {
        +        var matched_size = i + result[0].length
        +        var matched = working.substr(0, matched_size)
        +
        +        #{@matched}  = result[0]
        +        #{@match}  = result
        +        #{@prev_pos} = #{@pos} + i; // Position of first character of matched
        +        #{@pos} += matched_size // Position one after last character of matched
        +        #{@working} = working.substr(matched_size)
        +
        +        return matched
        +      }
        +    }
        +    return #{@matched} = nil;
        +  }
        +end
        +
        +
        + +
        +

        + + #skip(pattern) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +149
        +150
        +151
        +152
        +153
        +154
        +155
        +156
        +157
        +158
        +159
        +160
        +161
        +162
        +163
        +164
        +165
        +166
        +167
        +168
        +169
        +170
        +171
        +172
        +
        +
        # File 'opal/stdlib/strscan.rb', line 149
        +
        +def skip(pattern)
        +  pattern = anchor(pattern)
        +
        +  %x{
        +    var result = pattern.exec(#{@working});
        +
        +    if (result == null) {
        +      #{@match} = [];
        +      return #{@matched} = nil;
        +    }
        +    else {
        +      var match_str = result[0];
        +      var match_len = match_str.length;
        +
        +      #{@matched}   = match_str;
        +      #{@match}     = result;
        +      #{@prev_pos}  = #{@pos};
        +      #{@pos}      += match_len;
        +      #{@working}   = #{@working}.substring(match_len);
        +
        +      return match_len;
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #skip_until(pattern) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +174
        +175
        +176
        +177
        +178
        +179
        +180
        +181
        +182
        +183
        +184
        +185
        +186
        +187
        +
        +
        # File 'opal/stdlib/strscan.rb', line 174
        +
        +def skip_until(pattern)
        +  %x{
        +    var result = #{scan_until(pattern)};
        +
        +    if (result === nil) {
        +      return nil;
        +    }
        +    else {
        +      #{@matched} = result.substr(-1);
        +
        +      return result.length;
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #terminateObject + + + + + +

        + + + + +
        +
        +
        +
        +283
        +284
        +285
        +286
        +
        +
        # File 'opal/stdlib/strscan.rb', line 283
        +
        +def terminate
        +  @match = nil
        +  self.pos = @string.length
        +end
        +
        +
        + +
        +

        + + #unscanObject + + + + + +

        + + + + +
        +
        +
        +
        +288
        +289
        +290
        +291
        +292
        +293
        +294
        +
        +
        # File 'opal/stdlib/strscan.rb', line 288
        +
        +def unscan
        +  @pos      = @prev_pos
        +  @prev_pos = nil
        +  @match    = nil
        +
        +  self
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Struct.html b/docs/api/v1.8.2/stdlib/Struct.html new file mode 100644 index 00000000..519ed080 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Struct.html @@ -0,0 +1,390 @@ + + + + + + + Class: Struct + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Struct + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/pp.rb,
        + opal/stdlib/native.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        :nodoc:

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

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Instance Method Details

        + + +
        +

        + + #pretty_print(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +386
        +387
        +388
        +389
        +390
        +391
        +392
        +393
        +394
        +395
        +396
        +397
        +398
        +
        +
        # File 'opal/stdlib/pp.rb', line 386
        +
        +def pretty_print(q) # :nodoc:
        +  q.group(1, sprintf("#<struct %s", PP.mcall(self, Kernel, :class).name), '>') {
        +    q.seplist(PP.mcall(self, Struct, :members), lambda { q.text "," }) {|member|
        +      q.breakable
        +      q.text member.to_s
        +      q.text '='
        +      q.group(1) {
        +        q.breakable ''
        +        q.pp self[member]
        +      }
        +    }
        +  }
        +end
        +
        +
        + +
        +

        + + #pretty_print_cycle(q) ⇒ Object + + + + + +

        +
        +

        :nodoc:

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +400
        +401
        +402
        +
        +
        # File 'opal/stdlib/pp.rb', line 400
        +
        +def pretty_print_cycle(q) # :nodoc:
        +  q.text sprintf("#<struct %s:...>", PP.mcall(self, Kernel, :class).name)
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        +
        +

        values as values.

        + + +
        +
        +
        + +

        Returns:

        +
          + +
        • + + + + + + + +

          a JavaScript object with the members as keys and their

          +
          + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +485
        +486
        +487
        +488
        +489
        +490
        +491
        +492
        +493
        +
        +
        # File 'opal/stdlib/native.rb', line 485
        +
        +def to_n
        +  result = `{}`
        +
        +  each_pair do |name, value|
        +    `#{result}[#{name}] = #{Native.try_convert(value, value)}`
        +  end
        +
        +  result
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Template.html b/docs/api/v1.8.2/stdlib/Template.html new file mode 100644 index 00000000..508974e1 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Template.html @@ -0,0 +1,576 @@ + + + + + + + Class: Template + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Template + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/template.rb
        +
        + +
        + +

        Defined Under Namespace

        +

        + + + + + Classes: OutputBuffer + + +

        + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #body ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute body.

          +
          + +
        • + + +
        + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(name, &body) ⇒ Template + + + + + +

        +
        +

        Returns a new instance of Template.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +17
        +18
        +19
        +20
        +
        +
        # File 'opal/stdlib/template.rb', line 17
        +
        +def initialize(name, &body)
        +  @name, @body = name, body
        +  Template[name] = self
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #bodyObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute body.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +15
        +16
        +17
        +
        +
        # File 'opal/stdlib/template.rb', line 15
        +
        +def body
        +  @body
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .[](name) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +3
        +4
        +5
        +
        +
        # File 'opal/stdlib/template.rb', line 3
        +
        +def self.[](name)
        +  @_cache[name] || @_cache["templates/#{name}"]
        +end
        +
        +
        + +
        +

        + + .[]=(name, instance) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +7
        +8
        +9
        +
        +
        # File 'opal/stdlib/template.rb', line 7
        +
        +def self.[]=(name, instance)
        +  @_cache[name] = instance
        +end
        +
        +
        + +
        +

        + + .pathsObject + + + + + +

        + + + + +
        +
        +
        +
        +11
        +12
        +13
        +
        +
        # File 'opal/stdlib/template.rb', line 11
        +
        +def self.paths
        +  @_cache.keys
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #inspectObject + + + + + +

        + + + + +
        +
        +
        +
        +22
        +23
        +24
        +
        +
        # File 'opal/stdlib/template.rb', line 22
        +
        +def inspect
        +  "#<Template: '#{@name}'>"
        +end
        +
        +
        + +
        +

        + + #render(ctx = self) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +26
        +27
        +28
        +
        +
        # File 'opal/stdlib/template.rb', line 26
        +
        +def render(ctx = self)
        +  ctx.instance_exec(OutputBuffer.new, &@body)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Template/OutputBuffer.html b/docs/api/v1.8.2/stdlib/Template/OutputBuffer.html new file mode 100644 index 00000000..ca67017a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Template/OutputBuffer.html @@ -0,0 +1,319 @@ + + + + + + + Class: Template::OutputBuffer + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Template::OutputBuffer + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/template.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initializeOutputBuffer + + + + + +

        +
        +

        Returns a new instance of OutputBuffer.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +31
        +32
        +33
        +
        +
        # File 'opal/stdlib/template.rb', line 31
        +
        +def initialize
        +  @buffer = []
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #append(str) ⇒ Object + + + + Also known as: + append= + + + + +

        + + + + +
        +
        +
        +
        +35
        +36
        +37
        +
        +
        # File 'opal/stdlib/template.rb', line 35
        +
        +def append(str)
        +  @buffer << str
        +end
        +
        +
        + +
        +

        + + #joinObject + + + + + +

        + + + + +
        +
        +
        +
        +39
        +40
        +41
        +
        +
        # File 'opal/stdlib/template.rb', line 39
        +
        +def join
        +  @buffer.join
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Thread.html b/docs/api/v1.8.2/stdlib/Thread.html new file mode 100644 index 00000000..39c8de8c --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Thread.html @@ -0,0 +1,843 @@ + + + + + + + Class: Thread + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Thread + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/thread.rb
        +
        + +
        + +

        Defined Under Namespace

        +

        + + + + + Classes: Backtrace, Queue + + +

        + + + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

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

        +
        +

        Do not allow creation of new instances.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (NotImplementedError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +23
        +24
        +25
        +
        +
        # File 'opal/stdlib/thread.rb', line 23
        +
        +def initialize(*args)
        +  raise NotImplementedError, 'Thread creation not available'
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .currentObject + + + + + +

        + + + + +
        +
        +
        +
        +9
        +10
        +11
        +12
        +13
        +14
        +15
        +16
        +
        +
        # File 'opal/stdlib/thread.rb', line 9
        +
        +def self.current
        +  unless @current
        +    @current = allocate
        +    @current.core_initialize!
        +  end
        +
        +  @current
        +end
        +
        +
        + +
        +

        + + .listObject + + + + + +

        + + + + +
        +
        +
        +
        +18
        +19
        +20
        +
        +
        # File 'opal/stdlib/thread.rb', line 18
        +
        +def self.list
        +  [current]
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #[](key) ⇒ Object + + + + + +

        +
        +

        fiber-local attribute access.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +28
        +29
        +30
        +
        +
        # File 'opal/stdlib/thread.rb', line 28
        +
        +def [](key)
        +  @fiber_locals[coerce_key_name(key)]
        +end
        +
        +
        + +
        +

        + + #[]=(key, value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +32
        +33
        +34
        +
        +
        # File 'opal/stdlib/thread.rb', line 32
        +
        +def []=(key, value)
        +  @fiber_locals[coerce_key_name(key)] = value
        +end
        +
        +
        + +
        +

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

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +36
        +37
        +38
        +
        +
        # File 'opal/stdlib/thread.rb', line 36
        +
        +def key?(key)
        +  @fiber_locals.key?(coerce_key_name(key))
        +end
        +
        +
        + +
        +

        + + #keysObject + + + + + +

        + + + + +
        +
        +
        +
        +40
        +41
        +42
        +
        +
        # File 'opal/stdlib/thread.rb', line 40
        +
        +def keys
        +  @fiber_locals.keys
        +end
        +
        +
        + +
        +

        + + #thread_variable?(key) ⇒ Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +53
        +54
        +55
        +
        +
        # File 'opal/stdlib/thread.rb', line 53
        +
        +def thread_variable?(key)
        +  @thread_locals.key?(coerce_key_name(key))
        +end
        +
        +
        + +
        +

        + + #thread_variable_get(key) ⇒ Object + + + + + +

        +
        +

        thread-local attribute access.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +45
        +46
        +47
        +
        +
        # File 'opal/stdlib/thread.rb', line 45
        +
        +def thread_variable_get(key)
        +  @thread_locals[coerce_key_name(key)]
        +end
        +
        +
        + +
        +

        + + #thread_variable_set(key, value) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +49
        +50
        +51
        +
        +
        # File 'opal/stdlib/thread.rb', line 49
        +
        +def thread_variable_set(key, value)
        +  @thread_locals[coerce_key_name(key)] = value
        +end
        +
        +
        + +
        +

        + + #thread_variablesObject + + + + + +

        + + + + +
        +
        +
        +
        +57
        +58
        +59
        +
        +
        # File 'opal/stdlib/thread.rb', line 57
        +
        +def thread_variables
        +  @thread_locals.keys
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Thread/Backtrace.html b/docs/api/v1.8.2/stdlib/Thread/Backtrace.html new file mode 100644 index 00000000..ac3029bb --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Thread/Backtrace.html @@ -0,0 +1,133 @@ + + + + + + + Class: Thread::Backtrace + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Thread::Backtrace + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/thread.rb
        +
        + +
        + +

        Defined Under Namespace

        +

        + + + + + Classes: Location + + +

        + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Thread/Backtrace/Location.html b/docs/api/v1.8.2/stdlib/Thread/Backtrace/Location.html new file mode 100644 index 00000000..201b27fe --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Thread/Backtrace/Location.html @@ -0,0 +1,625 @@ + + + + + + + Class: Thread::Backtrace::Location + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Thread::Backtrace::Location + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/thread.rb
        +
        + +
        + + + + + +

        Instance Attribute Summary collapse

        +
          + +
        • + + + #base_label ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute base_label.

          +
          + +
        • + + +
        • + + + #label ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute label.

          +
          + +
        • + + +
        • + + + #lineno ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute lineno.

          +
          + +
        • + + +
        • + + + #path ⇒ Object + + + + (also: #absolute_path) + + + + + + + readonly + + + + + + + + + +

          Returns the value of attribute path.

          +
          + +
        • + + +
        + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initialize(str) ⇒ Location + + + + + +

        +
        +

        Returns a new instance of Location.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +115
        +116
        +117
        +118
        +119
        +120
        +121
        +122
        +123
        +124
        +125
        +
        +
        # File 'opal/stdlib/thread.rb', line 115
        +
        +def initialize(str)
        +  @str = str
        +
        +  str =~ /^(.*?):(\d+):(\d+):in `(.*?)'$/
        +  @path = Regexp.last_match(1)
        +  @label = Regexp.last_match(4)
        +  @lineno = Regexp.last_match(2).to_i
        +
        +  @label =~ /(\w+)$/
        +  @base_label = Regexp.last_match(1) || @label
        +end
        +
        +
        + +
        + +
        +

        Instance Attribute Details

        + + + +
        +

        + + #base_labelObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute base_label.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +135
        +136
        +137
        +
        +
        # File 'opal/stdlib/thread.rb', line 135
        +
        +def base_label
        +  @base_label
        +end
        +
        +
        + + + +
        +

        + + #labelObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute label.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +135
        +136
        +137
        +
        +
        # File 'opal/stdlib/thread.rb', line 135
        +
        +def label
        +  @label
        +end
        +
        +
        + + + +
        +

        + + #linenoObject (readonly) + + + + + +

        +
        +

        Returns the value of attribute lineno.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +135
        +136
        +137
        +
        +
        # File 'opal/stdlib/thread.rb', line 135
        +
        +def lineno
        +  @lineno
        +end
        +
        +
        + + + +
        +

        + + #pathObject (readonly) + + + + Also known as: + absolute_path + + + + +

        +
        +

        Returns the value of attribute path.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +135
        +136
        +137
        +
        +
        # File 'opal/stdlib/thread.rb', line 135
        +
        +def path
        +  @path
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #inspectObject + + + + + +

        + + + + +
        +
        +
        +
        +131
        +132
        +133
        +
        +
        # File 'opal/stdlib/thread.rb', line 131
        +
        +def inspect
        +  @str.inspect
        +end
        +
        +
        + +
        +

        + + #to_sObject + + + + + +

        + + + + +
        +
        +
        +
        +127
        +128
        +129
        +
        +
        # File 'opal/stdlib/thread.rb', line 127
        +
        +def to_s
        +  @str
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Thread/Queue.html b/docs/api/v1.8.2/stdlib/Thread/Queue.html new file mode 100644 index 00000000..0b9acf64 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Thread/Queue.html @@ -0,0 +1,571 @@ + + + + + + + Class: Thread::Queue + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Thread::Queue + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + +
          +
        • Object
        • + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/thread.rb
        +
        + +
        + + + + + + + + + +

        + Instance Method Summary + collapse +

        + + + + +
        +

        Constructor Details

        + +
        +

        + + #initializeQueue + + + + + +

        +
        +

        Returns a new instance of Queue.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +73
        +74
        +75
        +
        +
        # File 'opal/stdlib/thread.rb', line 73
        +
        +def initialize
        +  clear
        +end
        +
        +
        + +
        + + +
        +

        Instance Method Details

        + + +
        +

        + + #clearObject + + + + + +

        + + + + +
        +
        +
        +
        +77
        +78
        +79
        +
        +
        # File 'opal/stdlib/thread.rb', line 77
        +
        +def clear
        +  @storage = []
        +end
        +
        +
        + +
        +

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

        + + + + +
        +
        +
        +
        +102
        +103
        +104
        +
        +
        # File 'opal/stdlib/thread.rb', line 102
        +
        +def each(&block)
        +  @storage.each(&block)
        +end
        +
        +
        + +
        +

        + + #empty?Boolean + + + + + +

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +81
        +82
        +83
        +
        +
        # File 'opal/stdlib/thread.rb', line 81
        +
        +def empty?
        +  @storage.empty?
        +end
        +
        +
        + +
        +

        + + #pop(non_block = false) ⇒ Object + + + + Also known as: + deq, shift + + + + +

        + + + + +
        +
        +
        +
        +89
        +90
        +91
        +92
        +93
        +94
        +95
        +96
        +
        +
        # File 'opal/stdlib/thread.rb', line 89
        +
        +def pop(non_block = false)
        +  if empty?
        +    raise ThreadError, 'Queue empty' if non_block
        +    raise ThreadError, 'Deadlock'
        +  end
        +
        +  @storage.shift
        +end
        +
        +
        + +
        +

        + + #push(value) ⇒ Object + + + + Also known as: + <<, enq + + + + +

        + + + + +
        +
        +
        +
        +98
        +99
        +100
        +
        +
        # File 'opal/stdlib/thread.rb', line 98
        +
        +def push(value)
        +  @storage.push(value)
        +end
        +
        +
        + +
        +

        + + #sizeObject + + + + Also known as: + length + + + + +

        + + + + +
        +
        +
        +
        +85
        +86
        +87
        +
        +
        # File 'opal/stdlib/thread.rb', line 85
        +
        +def size
        +  @storage.size
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/ThreadError.html b/docs/api/v1.8.2/stdlib/ThreadError.html new file mode 100644 index 00000000..1717aaf7 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/ThreadError.html @@ -0,0 +1,138 @@ + + + + + + + Exception: ThreadError + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: ThreadError + + + +

        +
        + +
        +
        Inherits:
        +
        + StandardError + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/thread.rb
        +
        + +
        + +

        Overview

        +
        +

        This shim implementation of Thread is meant to only appease code that tries +to be safe in the presence of threads, but does not actually utilize them, +e.g., uses thread- or fiber-local variables.

        + + +
        +
        +
        + + +
        + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Time.html b/docs/api/v1.8.2/stdlib/Time.html new file mode 100644 index 00000000..090f624d --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Time.html @@ -0,0 +1,605 @@ + + + + + + + Class: Time + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Time + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/time.rb,
        + opal/stdlib/json.rb,
        opal/stdlib/native.rb
        +
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true

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

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .def_formatter(name, format, on_utc: false, utc_tz: nil, tz_format: nil, fractions: false, on: self) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +28
        +29
        +30
        +31
        +32
        +33
        +34
        +35
        +36
        +37
        +38
        +39
        +40
        +41
        +42
        +43
        +44
        +45
        +46
        +47
        +
        +
        # File 'opal/stdlib/time.rb', line 28
        +
        +def self.def_formatter(name, format, on_utc: false, utc_tz: nil, tz_format: nil, fractions: false, on: self)
        +  on.define_method name do |fdigits = 0|
        +    case self
        +    when defined?(::DateTime) && ::DateTime
        +      date = on_utc ? new_offset(0) : self
        +    when defined?(::Date) && ::Date
        +      date = ::Time.utc(year, month, day)
        +    when ::Time
        +      date = on_utc ? getutc : self
        +    end
        +    str = date.strftime(format)
        +    str += date.strftime(".%#{fdigits}N") if fractions && fdigits > 0
        +    if utc_tz
        +      str += utc ? utc_tz : date.strftime(tz_format)
        +    elsif tz_format
        +      str += date.strftime(tz_format)
        +    end
        +    str
        +  end
        +end
        +
        +
        + +
        +

        + + .parse(str) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +4
        +5
        +6
        +7
        +8
        +9
        +10
        +11
        +12
        +13
        +14
        +15
        +16
        +17
        +18
        +19
        +20
        +21
        +22
        +23
        +24
        +25
        +26
        +
        +
        # File 'opal/stdlib/time.rb', line 4
        +
        +def self.parse(str)
        +  %x{
        +    var d = Date.parse(str);
        +    if (d !== d) {
        +      // parsing failed, d is a NaN
        +      // probably str is not in ISO 8601 format, which is the only format, required to be supported by Javascript
        +      // try to make the format more like ISO or more like Chrome and parse again
        +      str = str.replace(/^(\d+)([\./])(\d+)([\./])?(\d+)?/, function(matched_sub, c1, c2, c3, c4, c5, offset, orig_string) {
        +        if ((c2 === c4) && c5) {
        +          // 2007.10.1 or 2007/10/1 are ok, but 2007/10.1 is not, convert to 2007-10-1
        +          return c1 + '-' + c3 + '-' + c5;
        +        } else if (c3 && !c4) {
        +          // 2007.10 or 2007/10
        +          // Chrome and Ruby can parse "2007/10", assuming its "2007-10-01", do the same
        +          return c1 + '-' + c3 + '-01';
        +        };
        +        return matched_sub;
        +      });
        +      d = Date.parse(str);
        +    }
        +    return new Date(d);
        +  }
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #to_dateObject + + + + + +

        + + + + +
        +
        +
        +
        +55
        +56
        +57
        +
        +
        # File 'opal/stdlib/time.rb', line 55
        +
        +def to_date
        +  Date.wrap(self)
        +end
        +
        +
        + +
        +

        + + #to_datetimeObject + + + + + +

        + + + + +
        +
        +
        +
        +59
        +60
        +61
        +
        +
        # File 'opal/stdlib/time.rb', line 59
        +
        +def to_datetime
        +  DateTime.wrap(self)
        +end
        +
        +
        + +
        +

        + + #to_jsonObject + + + + + +

        + + + + +
        +
        +
        +
        +189
        +190
        +191
        +
        +
        # File 'opal/stdlib/json.rb', line 189
        +
        +def to_json
        +  strftime('%FT%T%z').to_json
        +end
        +
        +
        + +
        +

        + + #to_nObject + + + + + +

        + + + + +
        +
        +
        +
        +522
        +523
        +524
        +
        +
        # File 'opal/stdlib/native.rb', line 522
        +
        +def to_n
        +  self
        +end
        +
        +
        + +
        +

        + + #to_timeObject + + + + + +

        + + + + +
        +
        +
        +
        +63
        +64
        +65
        +
        +
        # File 'opal/stdlib/time.rb', line 63
        +
        +def to_time
        +  self
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/URI.html b/docs/api/v1.8.2/stdlib/URI.html new file mode 100644 index 00000000..2bd686fc --- /dev/null +++ b/docs/api/v1.8.2/stdlib/URI.html @@ -0,0 +1,301 @@ + + + + + + + Module: URI + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: URI + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/uri.rb
        +
        + +
        + +

        Overview

        +
        +

        backtick_javascript: true +frozen_string_literal: true

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

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .decode_www_form(str, enc = undefined, separator: '&', use__charset_: false, isindex: false) ⇒ Object + + + + + +

        +
        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +5
        +6
        +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
        +
        +
        # File 'opal/stdlib/uri.rb', line 5
        +
        +def self.decode_www_form(str, enc = undefined, separator: '&', use__charset_: false, isindex: false)
        +  raise ArgumentError, "the input of #{name}.#{__method__} must be ASCII only string" unless str.ascii_only?
        +
        +  %x{
        +    var ary = [], key, val;
        +    if (str.length == 0)
        +      return ary;
        +    if (enc)
        +      #{enc = Encoding.find(enc)};
        +
        +    var parts = str.split(#{separator});
        +    for (var i = 0; i < parts.length; i++) {
        +      var string = parts[i];
        +      var splitIndex = string.indexOf('=')
        +
        +      if (splitIndex >= 0) {
        +        key = string.substr(0, splitIndex);
        +        val = string.substr(splitIndex + 1);
        +      } else {
        +        key = string;
        +        val = '';
        +      }
        +
        +      if (isindex) {
        +        if (splitIndex < 0) {
        +          key = '';
        +          val = string;
        +        }
        +        isindex = false;
        +      }
        +
        +      key = decodeURIComponent(key.replace(/\+/g, ' '));
        +      if (val) {
        +        val = decodeURIComponent(val.replace(/\+/g, ' '));
        +      } else {
        +        val = '';
        +      }
        +
        +      if (enc) {
        +        key = #{`key`.force_encoding(enc)}
        +        val = #{`val`.force_encoding(enc)}
        +      }
        +
        +      ary.push([key, val]);
        +    }
        +
        +    return ary;
        +  }
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Vector.html b/docs/api/v1.8.2/stdlib/Vector.html new file mode 100644 index 00000000..0c738955 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Vector.html @@ -0,0 +1,3270 @@ + + + + + + + Class: Vector + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Class: Vector + + + +

        +
        + +
        +
        Inherits:
        +
        + Object + + + show all + +
        +
        + + + + +
        +
        Extended by:
        +
        Matrix::ConversionHelper
        +
        + + + +
        +
        Includes:
        +
        Enumerable, ExceptionForMatrix, Matrix::CoercionHelper
        +
        + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix.rb
        +
        + +
        + +

        Overview

        +
        +

        The +Vector+ class represents a mathematical vector, which is useful in its own right, and +also constitutes a row or column of a Matrix.

        + +

        == Method Catalogue

        + +

        To create a Vector:

        + +
          +
        • Vector.
        • +
        • Vector.elements(array, copy = true)
        • +
        • Vector.basis(size: n, index: k)
        • +
        • Vector.zero(n)
        • +
        + +

        To access elements:

        + +
          +
        • #
        • +
        + +

        To enumerate the elements:

        + +
          +
        • #each2(v)
        • +
        • #collect2(v)
        • +
        + +

        Properties of vectors:

        + +
          +
        • #angle_with(v)
        • +
        • Vector.independent?(*vs)
        • +
        • #independent?(*vs)
        • +
        • #zero?
        • +
        + +

        Vector arithmetic:

        + +
          +
        • #*(x) "is matrix or number"
        • +
        • #+(v)
        • +
        • #-(v)
        • +
        • #/(v)
        • +
        • #+@
        • +
        • #-@
        • +
        + +

        Vector functions:

        + +
          +
        • #inner_product(v), dot(v)
        • +
        • #cross_product(v), cross(v)
        • +
        • #collect
        • +
        • #magnitude
        • +
        • #map
        • +
        • #map2(v)
        • +
        • #norm
        • +
        • #normalize
        • +
        • #r
        • +
        • #round
        • +
        • #size
        • +
        + +

        Conversion to other data types:

        + +
          +
        • #covector
        • +
        • #to_a
        • +
        • #coerce(other)
        • +
        + +

        String representations:

        + +
          +
        • #to_s
        • +
        • #inspect
        • +
        + + +
        +
        +
        + + +

        Defined Under Namespace

        +

        + + + + + Classes: ZeroVectorError + + +

        + + + +

        Constant Summary

        + +

        Constants included + from Exception2MessageMapper

        +

        Exception2MessageMapper::E2MM

        + + + + + + +

        + Class Method Summary + collapse +

        + + + +

        + Instance Method Summary + collapse +

        + +
          + +
        • + + + #*(x) ⇒ Object + + + + + + + + + + + + + +

          Multiplies the vector by +x+, where +x+ is a number or a matrix.

          +
          + +
        • + + +
        • + + + #+(v) ⇒ Object + + + + + + + + + + + + + +

          Vector addition.

          +
          + +
        • + + +
        • + + + #+@ ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #-(v) ⇒ Object + + + + + + + + + + + + + +

          Vector subtraction.

          +
          + +
        • + + +
        • + + + #-@ ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #/(x) ⇒ Object + + + + + + + + + + + + + +

          Vector division.

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

          Returns +true+ iff the two vectors have the same elements in the same order.

          +
          + +
        • + + +
        • + + + #[](i) ⇒ Object + + + + (also: #element, #component) + + + + + + + + + + + +

          Returns element number +i+ (starting at zero) of the vector.

          +
          + +
        • + + +
        • + + + #[]=(i, v) ⇒ Object + + + + (also: #set_element, #set_component) + + + + + + + + + + + +
          + +
        • + + +
        • + + + #angle_with(v) ⇒ Object + + + + + + + + + + + + + +

          Returns an angle with another vector.

          +
          + +
        • + + +
        • + + + #clone ⇒ Object + + + + + + + + + + + + + +

          Returns a copy of the vector.

          +
          + +
        • + + +
        • + + + #coerce(other) ⇒ Object + + + + + + + + + + + + + +

          The coerce method provides support for Ruby type coercion.

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

          Like Array#collect.

          +
          + +
        • + + +
        • + + + #collect2(v) ⇒ Object + + + + + + + + + + + + + +

          Collects (as in Enumerable#collect) over the elements of this vector and +v+ in conjunction.

          +
          + +
        • + + +
        • + + + #covector ⇒ Object + + + + + + + + + + + + + +

          Creates a single-row matrix from this vector.

          +
          + +
        • + + +
        • + + + #cross_product(*vs) ⇒ Object + + + + (also: #cross) + + + + + + + + + + + +

          Returns the cross product of this vector with the others.

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

          Iterate over the elements of this vector.

          +
          + +
        • + + +
        • + + + #each2(v) ⇒ Object + + + + + + + + + + + + + +

          Iterate over the elements of this vector and +v+ in conjunction.

          +
          + +
        • + + +
        • + + + #elements_to_f ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #elements_to_i ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #elements_to_r ⇒ Object + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #eql?(other) ⇒ Boolean + + + + + + + + + + + + + +
          + +
        • + + +
        • + + + #hash ⇒ Object + + + + + + + + + + + + + +

          Returns a hash-code for the vector.

          +
          + +
        • + + +
        • + + + #independent?(*vs) ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ iff all of vectors are linearly independent.

          +
          + +
        • + + +
        • + + + #initialize(array) ⇒ Vector + + + + + + + constructor + + + + + + + + +

          Vector.new is private; use Vector[] or Vector.elements to create.

          +
          + +
        • + + +
        • + + + #inner_product(v) ⇒ Object + + + + (also: #dot) + + + + + + + + + + + +

          Returns the inner product of this vector with the other.

          +
          + +
        • + + +
        • + + + #inspect ⇒ Object + + + + + + + + + + + + + +

          Overrides Object#inspect.

          +
          + +
        • + + +
        • + + + #magnitude ⇒ Object + + + + (also: #r, #norm) + + + + + + + + + + + +

          Returns the modulus (Pythagorean distance) of the vector.

          +
          + +
        • + + +
        • + + + #map2(v, &block) ⇒ Object + + + + + + + + + + + + + +

          Like Vector#collect2, but returns a Vector instead of an Array.

          +
          + +
        • + + +
        • + + + #normalize ⇒ Object + + + + + + + + + + + + + +

          Returns a new vector with the same direction but with norm 1.

          +
          + +
        • + + +
        • + + + #round(ndigits = 0) ⇒ Object + + + + + + + + + + + + + +

          Returns a vector with entries rounded to the given precision (see Float#round).

          +
          + +
        • + + +
        • + + + #size ⇒ Object + + + + + + + + + + + + + +

          Returns the number of elements in the vector.

          +
          + +
        • + + +
        • + + + #to_a ⇒ Object + + + + + + + + + + + + + +

          Returns the elements of the vector in an array.

          +
          + +
        • + + +
        • + + + #to_matrix ⇒ Object + + + + + + + + + + + + + +

          Return a single-column matrix from this vector.

          +
          + +
        • + + +
        • + + + #to_s ⇒ Object + + + + + + + + + + + + + +

          Overrides Object#to_s.

          +
          + +
        • + + +
        • + + + #zero? ⇒ Boolean + + + + + + + + + + + + + +

          Returns +true+ iff all elements are zero.

          +
          + +
        • + + +
        + + + + + + + + + + + + + + + + + +

        Methods included from Matrix::CoercionHelper

        +

        coerce_to, coerce_to_int, coerce_to_matrix

        + + + + + + + + + +

        Methods included from Enumerable

        +

        #each_async, #to_json

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

        Methods included from Exception2MessageMapper

        +

        #Fail, Raise, #Raise, #bind, def_e2message, #def_e2message, #def_exception, def_exception, e2mm_message, extend_object, #fail

        +
        +

        Constructor Details

        + +
        +

        + + #initialize(array) ⇒ Vector + + + + + +

        +
        +

        Vector.new is private; use Vector[] or Vector.elements to create.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1757
        +1758
        +1759
        +1760
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1757
        +
        +def initialize(array)
        +  # No checking is done at this point.
        +  @elements = array
        +end
        +
        +
        + +
        + + +
        +

        Class Method Details

        + + +
        +

        + + .[](*array) ⇒ Object + + + + + +

        +
        +

        Creates a Vector from a list of elements. + Vector[7, 4, ...]

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1718
        +1719
        +1720
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1718
        +
        +def Vector.[](*array)
        +  new convert_to_array(array, false)
        +end
        +
        +
        + +
        +

        + + .basis(size:, index:) ⇒ Object + + + + + +

        +
        +

        Returns a standard basis +n+-vector, where k is the index.

        + +

        Vector.basis(size:, index:) # => Vector[0, 1, 0]

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +1735
        +1736
        +1737
        +1738
        +1739
        +1740
        +1741
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1735
        +
        +def Vector.basis(size:, index:)
        +  raise ArgumentError, "invalid size (#{size} for 1..)" if size < 1
        +  raise ArgumentError, "invalid index (#{index} for 0...#{size})" unless 0 <= index && index < size
        +  array = Array.new(size, 0)
        +  array[index] = 1
        +  new convert_to_array(array, false)
        +end
        +
        +
        + +
        +

        + + .elements(array, copy = true) ⇒ Object + + + + + +

        +
        +

        Creates a vector from an Array. The optional second argument specifies +whether the array itself or a copy is used internally.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1726
        +1727
        +1728
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1726
        +
        +def Vector.elements(array, copy = true)
        +  new convert_to_array(array, copy)
        +end
        +
        +
        + +
        +

        + + .independent?(*vs) ⇒ Boolean + + + + + +

        +
        +

        Returns +true+ iff all of vectors are linearly independent.

        + +

        Vector.independent?(Vector[1,0], Vector[0,1]) + => true

        + +

        Vector.independent?(Vector[1,2], Vector[2,4]) + => false

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +1846
        +1847
        +1848
        +1849
        +1850
        +1851
        +1852
        +1853
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1846
        +
        +def Vector.independent?(*vs)
        +  vs.each do |v|
        +    raise TypeError, "expected Vector, got #{v.class}" unless v.is_a?(Vector)
        +    Vector.Raise ErrDimensionMismatch unless v.size == vs.first.size
        +  end
        +  return false if vs.count > vs.first.size
        +  Matrix[*vs].rank.eql?(vs.count)
        +end
        +
        +
        + +
        +

        + + .zero(size) ⇒ Object + + + + + +

        +
        +

        Return a zero vector.

        + +

        Vector.zero(3) => Vector[0, 0, 0]

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ArgumentError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +1748
        +1749
        +1750
        +1751
        +1752
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1748
        +
        +def Vector.zero(size)
        +  raise ArgumentError, "invalid size (#{size} for 0..)" if size < 0
        +  array = Array.new(size, 0)
        +  new convert_to_array(array, false)
        +end
        +
        +
        + +
        + +
        +

        Instance Method Details

        + + +
        +

        + + #*(x) ⇒ Object + + + + + +

        +
        +

        Multiplies the vector by +x+, where +x+ is a number or a matrix.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1913
        +1914
        +1915
        +1916
        +1917
        +1918
        +1919
        +1920
        +1921
        +1922
        +1923
        +1924
        +1925
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1913
        +
        +def *(x)
        +  case x
        +  when Numeric
        +    els = @elements.collect{|e| e * x}
        +    self.class.elements(els, false)
        +  when Matrix
        +    Matrix.column_vector(self) * x
        +  when Vector
        +    Vector.Raise ErrOperationNotDefined, "*", self.class, x.class
        +  else
        +    apply_through_coercion(x, __method__)
        +  end
        +end
        +
        +
        + +
        +

        + + #+(v) ⇒ Object + + + + + +

        +
        +

        Vector addition.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1930
        +1931
        +1932
        +1933
        +1934
        +1935
        +1936
        +1937
        +1938
        +1939
        +1940
        +1941
        +1942
        +1943
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1930
        +
        +def +(v)
        +  case v
        +  when Vector
        +    Vector.Raise ErrDimensionMismatch if size != v.size
        +    els = collect2(v) {|v1, v2|
        +      v1 + v2
        +    }
        +    self.class.elements(els, false)
        +  when Matrix
        +    Matrix.column_vector(self) + v
        +  else
        +    apply_through_coercion(v, __method__)
        +  end
        +end
        +
        +
        + +
        +

        + + #+@Object + + + + + +

        + + + + +
        +
        +
        +
        +1978
        +1979
        +1980
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1978
        +
        +def +@
        +  self
        +end
        +
        +
        + +
        +

        + + #-(v) ⇒ Object + + + + + +

        +
        +

        Vector subtraction.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1948
        +1949
        +1950
        +1951
        +1952
        +1953
        +1954
        +1955
        +1956
        +1957
        +1958
        +1959
        +1960
        +1961
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1948
        +
        +def -(v)
        +  case v
        +  when Vector
        +    Vector.Raise ErrDimensionMismatch if size != v.size
        +    els = collect2(v) {|v1, v2|
        +      v1 - v2
        +    }
        +    self.class.elements(els, false)
        +  when Matrix
        +    Matrix.column_vector(self) - v
        +  else
        +    apply_through_coercion(v, __method__)
        +  end
        +end
        +
        +
        + +
        +

        + + #-@Object + + + + + +

        + + + + +
        +
        +
        +
        +1982
        +1983
        +1984
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1982
        +
        +def -@
        +  collect {|e| -e }
        +end
        +
        +
        + +
        +

        + + #/(x) ⇒ Object + + + + + +

        +
        +

        Vector division.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1966
        +1967
        +1968
        +1969
        +1970
        +1971
        +1972
        +1973
        +1974
        +1975
        +1976
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1966
        +
        +def /(x)
        +  case x
        +  when Numeric
        +    els = @elements.collect{|e| e / x}
        +    self.class.elements(els, false)
        +  when Matrix, Vector
        +    Vector.Raise ErrOperationNotDefined, "/", self.class, x.class
        +  else
        +    apply_through_coercion(x, __method__)
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        Returns +true+ iff the two vectors have the same elements in the same order.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1882
        +1883
        +1884
        +1885
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1882
        +
        +def ==(other)
        +  return false unless Vector === other
        +  @elements == other.elements
        +end
        +
        +
        + +
        +

        + + #[](i) ⇒ Object + + + + Also known as: + element, component + + + + +

        +
        +

        Returns element number +i+ (starting at zero) of the vector.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1767
        +1768
        +1769
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1767
        +
        +def [](i)
        +  @elements[i]
        +end
        +
        +
        + +
        +

        + + #[]=(i, v) ⇒ Object + + + + Also known as: + set_element, set_component + + + + +

        + + + + +
        +
        +
        +
        +1773
        +1774
        +1775
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1773
        +
        +def []=(i, v)
        +  @elements[i]= v
        +end
        +
        +
        + +
        +

        + + #angle_with(v) ⇒ Object + + + + + +

        +
        +

        Returns an angle with another vector. Result is within the [0...Math::PI]. + Vector[1,0].angle_with(Vector[0,1]) + # => Math::PI / 2

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +2087
        +2088
        +2089
        +2090
        +2091
        +2092
        +2093
        +2094
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2087
        +
        +def angle_with(v)
        +  raise TypeError, "Expected a Vector, got a #{v.class}" unless v.is_a?(Vector)
        +  Vector.Raise ErrDimensionMismatch if size != v.size
        +  prod = magnitude * v.magnitude
        +  raise ZeroVectorError, "Can't get angle of zero vector" if prod == 0
        +
        +  Math.acos( inner_product(v) / prod )
        +end
        +
        +
        + +
        +

        + + #cloneObject + + + + + +

        +
        +

        Returns a copy of the vector.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1895
        +1896
        +1897
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1895
        +
        +def clone
        +  self.class.elements(@elements)
        +end
        +
        +
        + +
        +

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

        +
        +

        The coerce method provides support for Ruby type coercion. +This coercion mechanism is used by Ruby to handle mixed-type +numeric operations: it is intended to find a compatible common +type between the two operands of the operator. +See also Numeric#coerce.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2143
        +2144
        +2145
        +2146
        +2147
        +2148
        +2149
        +2150
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2143
        +
        +def coerce(other)
        +  case other
        +  when Numeric
        +    return Matrix::Scalar.new(other), self
        +  else
        +    raise TypeError, "#{self.class} can't be coerced into #{other.class}"
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        Like Array#collect.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2042
        +2043
        +2044
        +2045
        +2046
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2042
        +
        +def collect(&block) # :yield: e
        +  return to_enum(:collect) unless block_given?
        +  els = @elements.collect(&block)
        +  self.class.elements(els, false)
        +end
        +
        +
        + +
        +

        + + #collect2(v) ⇒ Object + + + + + +

        +
        +

        Collects (as in Enumerable#collect) over the elements of this vector and +v+ +in conjunction.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +1824
        +1825
        +1826
        +1827
        +1828
        +1829
        +1830
        +1831
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1824
        +
        +def collect2(v) # :yield: e1, e2
        +  raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
        +  Vector.Raise ErrDimensionMismatch if size != v.size
        +  return to_enum(:collect2, v) unless block_given?
        +  Array.new(size) do |i|
        +    yield @elements[i], v[i]
        +  end
        +end
        +
        +
        + +
        +

        + + #covectorObject + + + + + +

        +
        +

        Creates a single-row matrix from this vector.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2103
        +2104
        +2105
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2103
        +
        +def covector
        +  Matrix.row_vector(self)
        +end
        +
        +
        + +
        +

        + + #cross_product(*vs) ⇒ Object + + + + Also known as: + cross + + + + +

        +
        +

        Returns the cross product of this vector with the others. + Vector[1, 0, 0].cross_product Vector[0, 1, 0] => Vector[0, 0, 1]

        + +

        It is generalized to other dimensions to return a vector perpendicular +to the arguments. + Vector[1, 2].cross_product # => Vector[-2, 1] + Vector[1, 0, 0, 0].cross_product( + Vector[0, 1, 0, 0], + Vector[0, 0, 1, 0] + ) #=> Vector[0, 0, 0, 1]

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (ErrOperationNotDefined) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +2017
        +2018
        +2019
        +2020
        +2021
        +2022
        +2023
        +2024
        +2025
        +2026
        +2027
        +2028
        +2029
        +2030
        +2031
        +2032
        +2033
        +2034
        +2035
        +2036
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2017
        +
        +def cross_product(*vs)
        +  raise ErrOperationNotDefined, "cross product is not defined on vectors of dimension #{size}" unless size >= 2
        +  raise ArgumentError, "wrong number of arguments (#{vs.size} for #{size - 2})" unless vs.size == size - 2
        +  vs.each do |v|
        +    raise TypeError, "expected Vector, got #{v.class}" unless v.is_a? Vector
        +    Vector.Raise ErrDimensionMismatch unless v.size == size
        +  end
        +  case size
        +  when 2
        +    Vector[-@elements[1], @elements[0]]
        +  when 3
        +    v = vs[0]
        +    Vector[ v[2]*@elements[1] - v[1]*@elements[2],
        +      v[0]*@elements[2] - v[2]*@elements[0],
        +      v[1]*@elements[0] - v[0]*@elements[1] ]
        +  else
        +    rows = self, *vs, Array.new(size) {|i| Vector.basis(size: size, index: i) }
        +    Matrix.rows(rows).laplace_expansion(row: size - 1)
        +  end
        +end
        +
        +
        + +
        +

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

        +
        +

        Iterate over the elements of this vector

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1801
        +1802
        +1803
        +1804
        +1805
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1801
        +
        +def each(&block)
        +  return to_enum(:each) unless block_given?
        +  @elements.each(&block)
        +  self
        +end
        +
        +
        + +
        +

        + + #each2(v) ⇒ Object + + + + + +

        +
        +

        Iterate over the elements of this vector and +v+ in conjunction.

        + + +
        +
        +
        + +

        Raises:

        +
          + +
        • + + + (TypeError) + + + +
        • + +
        + +
        + + + + +
        +
        +
        +
        +1810
        +1811
        +1812
        +1813
        +1814
        +1815
        +1816
        +1817
        +1818
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1810
        +
        +def each2(v) # :yield: e1, e2
        +  raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
        +  Vector.Raise ErrDimensionMismatch if size != v.size
        +  return to_enum(:each2, v) unless block_given?
        +  size.times do |i|
        +    yield @elements[i], v[i]
        +  end
        +  self
        +end
        +
        +
        + +
        +

        + + #elements_to_fObject + + + + + +

        + + + + +
        +
        +
        +
        +2121
        +2122
        +2123
        +2124
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2121
        +
        +def elements_to_f
        +  warn "Vector#elements_to_f is deprecated", uplevel: 1
        +  map(&:to_f)
        +end
        +
        +
        + +
        +

        + + #elements_to_iObject + + + + + +

        + + + + +
        +
        +
        +
        +2126
        +2127
        +2128
        +2129
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2126
        +
        +def elements_to_i
        +  warn "Vector#elements_to_i is deprecated", uplevel: 1
        +  map(&:to_i)
        +end
        +
        +
        + +
        +

        + + #elements_to_rObject + + + + + +

        + + + + +
        +
        +
        +
        +2131
        +2132
        +2133
        +2134
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2131
        +
        +def elements_to_r
        +  warn "Vector#elements_to_r is deprecated", uplevel: 1
        +  map(&:to_r)
        +end
        +
        +
        + +
        +

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

        +
        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +1887
        +1888
        +1889
        +1890
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1887
        +
        +def eql?(other)
        +  return false unless Vector === other
        +  @elements.eql? other.elements
        +end
        +
        +
        + +
        +

        + + #hashObject + + + + + +

        +
        +

        Returns a hash-code for the vector.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1902
        +1903
        +1904
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1902
        +
        +def hash
        +  @elements.hash
        +end
        +
        +
        + +
        +

        + + #independent?(*vs) ⇒ Boolean + + + + + +

        +
        +

        Returns +true+ iff all of vectors are linearly independent.

        + +

        Vector[1,0].independent?(Vector[0,1]) + => true

        + +

        Vector[1,2].independent?(Vector[2,4]) + => false

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +1864
        +1865
        +1866
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1864
        +
        +def independent?(*vs)
        +  self.class.independent?(self, *vs)
        +end
        +
        +
        + +
        +

        + + #inner_product(v) ⇒ Object + + + + Also known as: + dot + + + + +

        +
        +

        Returns the inner product of this vector with the other. + Vector[4,7].inner_product Vector[10,1] => 47

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1994
        +1995
        +1996
        +1997
        +1998
        +1999
        +2000
        +2001
        +2002
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1994
        +
        +def inner_product(v)
        +  Vector.Raise ErrDimensionMismatch if size != v.size
        +
        +  p = 0
        +  each2(v) {|v1, v2|
        +    p += v1 * v2.conj
        +  }
        +  p
        +end
        +
        +
        + +
        +

        + + #inspectObject + + + + + +

        +
        +

        Overrides Object#inspect

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2166
        +2167
        +2168
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2166
        +
        +def inspect
        +  "Vector" + @elements.inspect
        +end
        +
        +
        + +
        +

        + + #magnitudeObject + + + + Also known as: + r, norm + + + + +

        +
        +

        Returns the modulus (Pythagorean distance) of the vector. + Vector[5,8,2].r => 9.643650761

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2053
        +2054
        +2055
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2053
        +
        +def magnitude
        +  Math.sqrt(@elements.inject(0) {|v, e| v + e.abs2})
        +end
        +
        +
        + +
        +

        + + #map2(v, &block) ⇒ Object + + + + + +

        +
        +

        Like Vector#collect2, but returns a Vector instead of an Array.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2062
        +2063
        +2064
        +2065
        +2066
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2062
        +
        +def map2(v, &block) # :yield: e1, e2
        +  return to_enum(:map2, v) unless block_given?
        +  els = collect2(v, &block)
        +  self.class.elements(els, false)
        +end
        +
        +
        + +
        +

        + + #normalizeObject + + + + + +

        +
        +

        Returns a new vector with the same direction but with norm 1. + v = Vector[5,8,2].normalize + # => Vector[0.5184758473652127, 0.8295613557843402, 0.20739033894608505] + v.norm => 1.0

        + + +
        +
        +
        + +

        Raises:

        + + +
        + + + + +
        +
        +
        +
        +2076
        +2077
        +2078
        +2079
        +2080
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2076
        +
        +def normalize
        +  n = magnitude
        +  raise ZeroVectorError, "Zero vectors can not be normalized" if n == 0
        +  self / n
        +end
        +
        +
        + +
        +

        + + #round(ndigits = 0) ⇒ Object + + + + + +

        +
        +

        Returns a vector with entries rounded to the given precision +(see Float#round)

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1783
        +1784
        +1785
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1783
        +
        +def round(ndigits=0)
        +  map{|e| e.round(ndigits)}
        +end
        +
        +
        + +
        +

        + + #sizeObject + + + + + +

        +
        +

        Returns the number of elements in the vector.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +1790
        +1791
        +1792
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1790
        +
        +def size
        +  @elements.size
        +end
        +
        +
        + +
        +

        + + #to_aObject + + + + + +

        +
        +

        Returns the elements of the vector in an array.

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2110
        +2111
        +2112
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2110
        +
        +def to_a
        +  @elements.dup
        +end
        +
        +
        + +
        +

        + + #to_matrixObject + + + + + +

        +
        +

        Return a single-column matrix from this vector

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2117
        +2118
        +2119
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2117
        +
        +def to_matrix
        +  Matrix.column_vector(self)
        +end
        +
        +
        + +
        +

        + + #to_sObject + + + + + +

        +
        +

        Overrides Object#to_s

        + + +
        +
        +
        + + +
        + + + + +
        +
        +
        +
        +2159
        +2160
        +2161
        +
        +
        # File 'opal/stdlib/matrix.rb', line 2159
        +
        +def to_s
        +  "Vector[" + @elements.join(", ") + "]"
        +end
        +
        +
        + +
        +

        + + #zero?Boolean + + + + + +

        +
        +

        Returns +true+ iff all elements are zero.

        + + +
        +
        +
        + +

        Returns:

        + + +
        + + + + +
        +
        +
        +
        +1871
        +1872
        +1873
        +
        +
        # File 'opal/stdlib/matrix.rb', line 1871
        +
        +def zero?
        +  all?(&:zero?)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/Vector/ZeroVectorError.html b/docs/api/v1.8.2/stdlib/Vector/ZeroVectorError.html new file mode 100644 index 00000000..a3c586c2 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/Vector/ZeroVectorError.html @@ -0,0 +1,126 @@ + + + + + + + Exception: Vector::ZeroVectorError + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Exception: Vector::ZeroVectorError + + + +

        +
        + +
        +
        Inherits:
        +
        + StandardError + +
          +
        • Object
        • + + + + + +
        + show all + +
        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/matrix.rb
        +
        + +
        + + + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/YAML.html b/docs/api/v1.8.2/stdlib/YAML.html new file mode 100644 index 00000000..4645480a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/YAML.html @@ -0,0 +1,232 @@ + + + + + + + Module: YAML + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        Module: YAML + + + +

        +
        + + + + + + + + + + + +
        +
        Defined in:
        +
        opal/stdlib/nodejs/yaml.rb
        +
        + +
        + + + + + + + + + +

        + Class Method Summary + collapse +

        + + + + + + +
        +

        Class Method Details

        + + +
        +

        + + .load(data) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +14
        +15
        +16
        +17
        +18
        +
        +
        # File 'opal/stdlib/nodejs/yaml.rb', line 14
        +
        +def self.load(data)
        +  loaded = `__yaml__.safeLoad(data)`
        +  loaded = Hash.new(loaded) if native?(loaded)
        +  loaded
        +end
        +
        +
        + +
        +

        + + .load_path(path) ⇒ Object + + + + + +

        + + + + +
        +
        +
        +
        +10
        +11
        +12
        +
        +
        # File 'opal/stdlib/nodejs/yaml.rb', line 10
        +
        +def self.load_path(path)
        +  load(`#{File}.__fs__.readFileSync(#{path}, 'utf8')`)
        +end
        +
        +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/_index.html b/docs/api/v1.8.2/stdlib/_index.html new file mode 100644 index 00000000..1e9d2f11 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/_index.html @@ -0,0 +1,1163 @@ + + + + + + + stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
        + + +

        stdlib (Opal v1.8.2)

        +
        +

        Alphabetic Index

        + +

        File Listing

        + + +
        +

        Namespace Listing A-Z

        + + + + + + + + + + +
        + + + + + + + + + + + + + + + + + + + + +
          +
        • G
        • +
            + +
          • + Group + + (PrettyPrint) + +
          • + +
          • + GroupQueue + + (PrettyPrint) + +
          • + +
          +
        + + +
        + + + + + + + + +
          +
        • J
        • +
            + +
          • + JS + +
          • + +
          • + JSON + +
          • + +
          • + JSONError + + (JSON) + +
          • + +
          • + Job + + (Benchmark) + +
          • + +
          +
        + + +
          +
        • K
        • + +
        + + + + + + + + + + + + + + +
        + + + + + +
          +
        • Q
        • +
            + +
          • + Queue + + (Thread) + +
          • + +
          +
        + + + + + + + + + + + +
          +
        • U
        • +
            + +
          • + URI + +
          • + +
          • + Util + + (ERB) + +
          • + +
          • + Util + + (CGI) + +
          • + +
          +
        + + +
          +
        • V
        • +
            + +
          • + Vector + +
          • + +
          • + View + + (Buffer) + +
          • + +
          +
        + + +
          +
        • W
        • +
            + +
          • + When + + (Promise) + +
          • + +
          • + Wrapper + + (Native) + +
          • + +
          +
        + + +
        + + +
          +
        • Y
        • +
            + +
          • + YAML + +
          • + +
          +
        + + + + +
        + +
        + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/class_list.html b/docs/api/v1.8.2/stdlib/class_list.html new file mode 100644 index 00000000..34563531 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
        +
        +

        Class List

        + + + +
        + + +
        + + diff --git a/docs/api/v1.8.2/stdlib/css/common.css b/docs/api/v1.8.2/stdlib/css/common.css new file mode 100644 index 00000000..cf25c452 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/css/full_list.css b/docs/api/v1.8.2/stdlib/css/full_list.css new file mode 100644 index 00000000..fa359824 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/css/full_list.css @@ -0,0 +1,58 @@ +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/v1.8.2/stdlib/css/style.css b/docs/api/v1.8.2/stdlib/css/style.css new file mode 100644 index 00000000..eb0dbc86 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/css/style.css @@ -0,0 +1,497 @@ +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; + box-sizing: border-box; +} + +@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 > li > ol { font-size: 0.9em; } +#toc ol ol > li > 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/v1.8.2/stdlib/file.LICENSE.html b/docs/api/v1.8.2/stdlib/file.LICENSE.html new file mode 100644 index 00000000..d9c41b8e --- /dev/null +++ b/docs/api/v1.8.2/stdlib/file.LICENSE.html @@ -0,0 +1,93 @@ + + + + + + + File: LICENSE + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
          + + +

          (MIT)

          + +

          Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>

          + +

          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/v1.8.2/stdlib/file.README.html b/docs/api/v1.8.2/stdlib/file.README.html new file mode 100644 index 00000000..9823d539 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/file.README.html @@ -0,0 +1,108 @@ + + + + + + + File: README + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
          + + +

          inflight

          + +

          Add callbacks to requests in flight to avoid async duplication

          + +

          USAGE

          + +
          var inflight = require('inflight')
          +
          +// some request that does some stuff
          +function req(key, callback) {
          +  // key is any random string.  like a url or filename or whatever.
          +  //
          +  // will return either a falsey value, indicating that the
          +  // request for this key is already in flight, or a new callback
          +  // which when called will call all callbacks passed to inflightk
          +  // with the same key
          +  callback = inflight(key, callback)
          +
          +  // If we got a falsey value back, then there's already a req going
          +  if (!callback) return
          +
          +  // this is where you'd fetch the url or whatever
          +  // callback is also once()-ified, so it can safely be assigned
          +  // to multiple events etc.  First call wins.
          +  setTimeout(function() {
          +    callback(null, key)
          +  }, 100)
          +}
          +
          +// only assigns a single setTimeout
          +// when it dings, all cbs get called
          +req('foo', cb1)
          +req('foo', cb2)
          +req('foo', cb3)
          +req('foo', cb4)
          +
          +
          + + + +
          + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/file.changelog.html b/docs/api/v1.8.2/stdlib/file.changelog.html new file mode 100644 index 00000000..0c21f49a --- /dev/null +++ b/docs/api/v1.8.2/stdlib/file.changelog.html @@ -0,0 +1,163 @@ + + + + + + + File: changelog + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
          + + +

          7.0

          + +
            +
          • Raise error if options.cwd is specified, and not a directory
          • +
          + +

          6.0

          + +
            +
          • Remove comment and negation pattern support
          • +
          • Ignore patterns are always in dot:true mode
          • +
          + +

          5.0

          + +
            +
          • Deprecate comment and negation patterns
          • +
          • Fix regression in mark and nodir options from making all cache +keys absolute path.
          • +
          • Abort if fs.readdir returns an error that's unexpected
          • +
          • Don't emit match events for ignored items
          • +
          • Treat ENOTSUP like ENOTDIR in readdir
          • +
          + +

          4.5

          + +
            +
          • Add options.follow to always follow directory symlinks in globstar
          • +
          • Add options.realpath to call fs.realpath on all results
          • +
          • Always cache based on absolute path
          • +
          + +

          4.4

          + +
            +
          • Add options.ignore
          • +
          • Fix handling of broken symlinks
          • +
          + +

          4.3

          + +
            +
          • Bump minimatch to 2.x
          • +
          • Pass all tests on Windows
          • +
          + +

          4.2

          + +
            +
          • Add glob.hasMagic function
          • +
          • Add options.nodir flag
          • +
          + +

          4.1

          + +
            +
          • Refactor sync and async implementations for performance
          • +
          • Throw if callback provided to sync glob function
          • +
          • Treat symbolic links in globstar results the same as Bash 4.3
          • +
          + +

          4.0

          + +
            +
          • Use ^ for dependency versions (bumped major because this breaks +older npm versions)
          • +
          • Ensure callbacks are only ever called once
          • +
          • switch to ISC license
          • +
          + +

          3.x

          + +
            +
          • Rewrite in JavaScript
          • +
          • Add support for setting root, cwd, and windows support
          • +
          • Cache many fs calls
          • +
          • Add globstar support
          • +
          • emit match events
          • +
          + +

          2.x

          + +
            +
          • Use glob.h and fnmatch.h from NetBSD
          • +
          + +

          1.x

          + +
            +
          • glob.h static binding.
          • +
          +
          + + + +
          + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/file_list.html b/docs/api/v1.8.2/stdlib/file_list.html new file mode 100644 index 00000000..e074a35b --- /dev/null +++ b/docs/api/v1.8.2/stdlib/file_list.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + File List + + + +
          +
          +

          File List

          + + + +
          + + +
          + + diff --git a/docs/api/v1.8.2/stdlib/frames.html b/docs/api/v1.8.2/stdlib/frames.html new file mode 100644 index 00000000..8dc41185 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/frames.html @@ -0,0 +1,17 @@ + + + + + stdlib (Opal v1.8.2) + + + + diff --git a/docs/api/v1.8.2/stdlib/index.html b/docs/api/v1.8.2/stdlib/index.html new file mode 100644 index 00000000..a73a25c0 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/index.html @@ -0,0 +1,75 @@ + + + + + + + File: README + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
          + + +

          Opal stdlib

          + +

          This is the Opal stdlib implementation API documentation.

          +
          + + + +
          + + \ No newline at end of file diff --git a/docs/api/v1.8.2/stdlib/js/app.js b/docs/api/v1.8.2/stdlib/js/app.js new file mode 100644 index 00000000..8d067fe3 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/js/app.js @@ -0,0 +1,314 @@ +(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; + var curli; + 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++) { + if ( typeof(curli) == "undefined" ) { + curli = $('
            1. '); + toc.append(curli); + } + toc = $('
                '); + curli.append(toc); + curli = undefined; + } + } + if (thisTag < lastTag) { + for (i = 0; i < lastTag - thisTag; i++) { + toc = toc.parent(); + toc = toc.parent(); + } + } + var title = $(this).attr('toc-title'); + if (typeof(title) == "undefined") title = $(this).text(); + curli =$('
              1. ' + title + '
              2. '); + toc.append(curli); + 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/v1.8.2/stdlib/js/full_list.js b/docs/api/v1.8.2/stdlib/js/full_list.js new file mode 100644 index 00000000..59069c5e --- /dev/null +++ b/docs/api/v1.8.2/stdlib/js/full_list.js @@ -0,0 +1,216 @@ +(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/v1.8.2/stdlib/js/jquery.js b/docs/api/v1.8.2/stdlib/js/jquery.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/js/jquery.js @@ -0,0 +1,4 @@ +/*! 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/v1.8.2/stdlib/method_list.html b/docs/api/v1.8.2/stdlib/method_list.html new file mode 100644 index 00000000..44805933 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/method_list.html @@ -0,0 +1,8371 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
          +
          +

          Method List

          + + + +
          + + +
          + + diff --git a/docs/api/v1.8.2/stdlib/top-level-namespace.html b/docs/api/v1.8.2/stdlib/top-level-namespace.html new file mode 100644 index 00000000..0785ae14 --- /dev/null +++ b/docs/api/v1.8.2/stdlib/top-level-namespace.html @@ -0,0 +1,525 @@ + + + + + + + Top Level Namespace + + — stdlib (Opal v1.8.2) + + + + + + + + + + + + + + + + + + + +
          + + +

          Top Level Namespace + + + +

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

          Defined Under Namespace

          +

          + + + Modules: Base64, Benchmark, Deno, Enumerable, Exception2MessageMapper, ExceptionForMatrix, FileUtils, Forwardable, JS, JSON, Kernel, Nashorn, Native, NodeJS, Observable, OpenURI, REPLUtils, Racc, RbConfig, SecureRandom, Shellwords, SingleForwardable, Singleton, URI, YAML + + + + Classes: Array, BasicObject, BigDecimal, Boolean, Buffer, CGI, Class, Console, Date, DateTime, Delegator, Dir, ENV, ERB, File, Float, Hash, IO, Integer, Logger, MatchData, Matrix, Method, Module, Mutex, NilClass, Numeric, Object, OpenStruct, OptionParser, PP, Pathname, PrettyPrint, Proc, Promise, PromiseV2, Range, Rational, Regexp, SimpleDelegator, String, StringIO, StringScanner, Struct, Template, Thread, ThreadError, Time, Vector + + +

          + + +

          + Constant Summary + collapse +

          + +
          + +
          Queue = + +
          +
          Thread::Queue
          + +
          PromiseV1 = + +
          +
          Promise
          + +
          RUBY_EXE = +
          +
          +

          required for mspec it would appear

          + + +
          +
          +
          + + +
          +
          +
          'bundle exec exe/opal'
          + +
          ARGV = +
          +
          +

          backtick_javascript: true

          + + +
          +
          +
          + + +
          +
          +
          `scriptArgs`
          + +
          ARGF = + +
          +
          Object.new
          + +
          ParseError = + +
          +
          Racc::ParseError
          + +
          OPAL_PLATFORM = + +
          +
          if nashorn
          +  'nashorn'
          +elsif deno
          +  'deno'
          +elsif node
          +  'nodejs'
          +elsif headless_chrome
          +  'headless-chrome'
          +elsif headless_firefox
          +  'headless-firefox'
          +elsif safari
          +  'safari'
          +elsif gjs
          +  'gjs'
          +elsif quickjs
          +  'quickjs'
          +elsif opal_miniracer
          +  'opal-miniracer'
          +else # possibly browser, which is the primary target
          +end
          + +
          OptParse = +
          +
          +

          An alias for OptionParser.

          + + +
          +
          +
          + + +
          +
          +
          OptionParser
          + +
          + + + + + + + + + +

          + Instance Method Summary + collapse +

          + + + + + + +
          +

          Instance Method Details

          + + +
          +

          + + #DelegateClass(superclass, &block) ⇒ Object + + + + + +

          +
          +

          The primary interface to this library. Use to setup delegation when defining +your class.

          + +

          class MyClass < DelegateClass(ClassToDelegateTo) # Step 1 + def initialize + super(obj_of_ClassToDelegateTo) # Step 2 + end + end

          + +

          or:

          + +

          MyClass = DelegateClass(ClassToDelegateTo) do # Step 1 + def initialize + super(obj_of_ClassToDelegateTo) # Step 2 + end + end

          + +

          Here's a sample of use from Tempfile which is really a File object with a +few special rules about storage location and when the File should be +deleted. That makes for an almost textbook perfect example of how to use +delegation.

          + +

          class Tempfile < DelegateClass(File) + # constant and class member data initialization...

          + +
          def initialize(basename, tmpdir=Dir::tmpdir)
          +  # build up file path/name in var tmpname...
          +
          +  @tmpfile = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL, 0600)
          +
          +  # ...
          +
          +  super(@tmpfile)
          +
          +  # below this point, all methods of File are supported...
          +end
          +
          +# ...
          +
          + +

          end

          + + +
          +
          +
          + + +
          + + + + +
          +
          +
          +
          +408
          +409
          +410
          +411
          +412
          +413
          +414
          +415
          +416
          +417
          +418
          +419
          +420
          +421
          +422
          +423
          +424
          +425
          +426
          +427
          +428
          +429
          +430
          +431
          +432
          +433
          +434
          +435
          +436
          +437
          +438
          +439
          +440
          +441
          +442
          +443
          +444
          +445
          +446
          +447
          +448
          +449
          +450
          +451
          +452
          +453
          +454
          +455
          +456
          +457
          +458
          +459
          +
          +
          # File 'opal/stdlib/delegate.rb', line 408
          +
          +def DelegateClass(superclass, &block)
          +  klass = Class.new(Delegator)
          +  ignores = [*::Delegator.public_api, :to_s, :inspect, :=~, :!~, :===]
          +  protected_instance_methods = superclass.protected_instance_methods
          +  protected_instance_methods -= ignores
          +  public_instance_methods = superclass.public_instance_methods
          +  public_instance_methods -= ignores
          +  klass.module_eval do
          +    def __getobj__ # :nodoc:
          +      unless defined?(@delegate_dc_obj)
          +        return yield if block_given?
          +        __raise__ ::ArgumentError, 'not delegated'
          +      end
          +      @delegate_dc_obj
          +    end
          +
          +    def __setobj__(obj) # :nodoc:
          +      __raise__ ::ArgumentError, 'cannot delegate to self' if equal?(obj)
          +      @delegate_dc_obj = obj
          +    end
          +    protected_instance_methods.each do |method|
          +      define_method(method, Delegator.delegating_block(method))
          +      protected method
          +    end
          +    public_instance_methods.each do |method|
          +      define_method(method, Delegator.delegating_block(method))
          +    end
          +  end
          +  klass.define_singleton_method :public_instance_methods do |all = true|
          +    super(all) | superclass.public_instance_methods
          +  end
          +  klass.define_singleton_method :protected_instance_methods do |all = true|
          +    super(all) | superclass.protected_instance_methods
          +  end
          +  klass.define_singleton_method :instance_methods do |all = true|
          +    super(all) | superclass.instance_methods
          +  end
          +  klass.define_singleton_method :public_instance_method do |name|
          +    super(name)
          +  rescue NameError
          +    raise unless self.public_instance_methods.include?(name)
          +    superclass.public_instance_method(name)
          +  end
          +  klass.define_singleton_method :instance_method do |name|
          +    super(name)
          +  rescue NameError
          +    raise unless instance_methods.include?(name)
          +    superclass.instance_method(name)
          +  end
          +  klass.module_eval(&block) if block
          +  klass
          +end
          +
          + + +
          +

          + + #ruby2_keywordsObject + + + + + +

          +
          +

          This library provides three different ways to delegate method calls to an +object. The easiest to use is SimpleDelegator. Pass an object to the +constructor and all methods supported by the object will be delegated. This +object can be changed later.

          + +

          Going a step further, the top level DelegateClass method allows you to easily +setup delegation through class inheritance. This is considerably more +flexible and thus probably the most common use for this library.

          + +

          Finally, if you need full control over the delegation scheme, you can inherit +from the abstract class Delegator and customize as needed. (If you find +yourself needing this control, have a look at Forwardable which is also in +the standard library. It may suit your needs better.)

          + +

          SimpleDelegator's implementation serves as a nice example of the use of +Delegator:

          + +

          require 'delegate'

          + +

          class SimpleDelegator < Delegator + def getobj + @delegate_sd_obj # return object we are delegating to, required + end

          + +
          def __setobj__(obj)
          +  @delegate_sd_obj = obj # change delegation object,
          +                         # a feature we're providing
          +end
          +
          + +

          end

          + +

          == Notes

          + +

          Be advised, RDoc will not detect delegated methods.

          + + +
          +
          +
          + + +
          + + + + +
          +
          +
          +
          +47
          +
          +
          # File 'opal/stdlib/delegate.rb', line 47
          +
          +require 'ruby2_keywords'
          +
          +
          + + + + + + + + + + \ No newline at end of file diff --git a/docs/guides/v1.8.2/async.html b/docs/guides/v1.8.2/async.html new file mode 100644 index 00000000..03d8a97f --- /dev/null +++ b/docs/guides/v1.8.2/async.html @@ -0,0 +1,235 @@ + + + + + + Opal v1.8.2 · Asynchronous code (PromiseV2 / async / await) + + + + + + + + + +
          +
          +

          Asynchronous code (PromiseV2 / async / await)

          + +

          PromiseV2

          +

          In Opal 1.2 we introduced PromiseV2 which is to replace the default Promise in Opal 2.0 +(which will become PromiseV1). Right now it's experimental, but the interface of PromiseV1 +stay unchanged and will continue to be supported.

          It is imperative that during the transition period you either require 'promise/v1' or +require 'promise/v2' and then use either PromiseV1 or PromiseV2.

          If you write library code it's imperative that you don't require the promise itself, but +detect if PromiseV2 is defined and use the newer implementation, for instance using the +following code:

          module MyLibrary
          +  Promise = defined?(PromiseV2) ? PromiseV2 : ::Promise
          +end
          +

          The difference between PromiseV1 and PromiseV2 is that PromiseV1 is a pure-Ruby +implementation of a Promise, while PromiseV2 is reusing the JavaScript Promise. Both are +incompatible with each other, but PromiseV2 can be awaited (see below) and they translate +1 to 1 to the JavaScript native Promise (they are bridged; you can directly return a +Promise from JavaScript API without a need to translate it). The other difference is that +PromiseV2 always runs a #then block a tick later, while PromiseV1 would could run it +instantaneously.

          +

          Async/await

          +

          In Opal 1.3 we implemented the CoffeeScript pattern of async/await. As of now, it's hidden +behind a magic comment, but this behavior may change in the future.

          Example:

          # await: true
          +
          +require "await"
          +
          +def wait_5_seconds
          +  puts "Let's wait 5 seconds..."
          +  sleep(5).__await__
          +  puts "Done!"
          +end
          +
          +wait_5_seconds.__await__
          +

          It's important to understand what happens under the hood: every scope in which #__await__ is +encountered will become async, which means that it will return a PromiseV2 that will resolve +to a value. This includes methods, blocks and the top scope. This means, that #__await__ is +infectious and you need to remember to #__await__ everything along the way, otherwise +a program will finish too early and the values may be incorrect.

          It is certainly correct to #__await__ any value, including non-Promises, for instance +5.__await__ will correctly resolve to 5 (except that it will make the scope an async +function, with all the limitations described above).

          The await stdlib module includes a few useful functions, like async-aware each_await +function and sleep that doesn't block the thread. It also includes a method #await +which is an alias of #itself - it makes sense to auto-await that method.

          You can take a look at how we ported Minitest to support asynchronous tests..

          This approach is certainly incompatible with what Ruby does, but due to a dynamic nature +of Ruby and a different model of JavaScript this was the least invasive way to catch up +with the latest JavaScript trends and support Promise heavy APIs and asynchronous code.

          +

          Auto-await

          +

          The magic comment also accepts a comma-separated list of methods to be automatically +awaited. An individual value can contain a wildcard character *. For instance, +those two blocks of code are equivalent:

          # await: true
          +
          +require "await"
          +
          +[1,2,3].each_await do |i|
          +  p i
          +  sleep(i).__await__
          +end.__await__
          +
          # await: sleep, *await*
          +
          +require "await"
          +
          +[1,2,3].each_await do |i|
          +  p i
          +  sleep i
          +end
          +
          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/bridging.html b/docs/guides/v1.8.2/bridging.html new file mode 100644 index 00000000..0ba64dc9 --- /dev/null +++ b/docs/guides/v1.8.2/bridging.html @@ -0,0 +1,243 @@ + + + + + + Opal v1.8.2 · Opal Bridging + + + + + + + + + +
          +
          +

          Opal Bridging

          + +

          Intro

          +

          Opal's "bridging" makes JavaScript objects become Ruby object in Opal, boosting language interoperability and performance by using native JavaScript versions of certain Ruby classes.

          +

          Bridging Basics

          +

          Opal modifies the prototype chain of a JavaScript constructor function by injecting a Ruby class and its superclasses, enabling bridged JavaScript classes to inherit Ruby behaviors.

          Prototype chain pre-bridging:

          +
            +
          • constructor (window.String) + +
              +
            • JavaScript prototype chain (window.Object)
            • +
            • null
            • +
          • +
          +

          After bridging with ::Object:

          +
            +
          • constructor (window.String) + +
              +
            • Ruby superclass chain (Opal.Object, Opal.Kernel, Opal.BasicObject)
            • +
            • JavaScript prototype chain (window.Object) + +
                +
              • null
              • +
            • +
          • +
          +

          The Opal.bridge function is used for this, allowing the JavaScript class to become a Ruby class. You can also use a syntax like: class MyCar < `Car` which counterintuitively doesn't mean inheritance - MyCar's superclass will be Object, but MyCar will be bridged into native JavaScript Car class.

          The bridged JavaScript classes are usable in Ruby, but with an adapted interface: JavaScript methods accessed from Ruby use x-strings and Ruby methods accessed from JavaScript use $-prefixed method names (e.g., reduce->$reduce).

          This strategy avoids type casting for bridged objects and boosts performance by utilizing native JavaScript objects.

          Example:

          JavaScript Car class:

          class Car {
          +  constructor(make, model) {
          +    this.make = make;
          +    this.model = model;
          +  }
          +
          +  getCarInfo() {
          +    return `${this.make} ${this.model}`;
          +  }
          +}
          +

          Bridged Ruby MyCar class:

          class MyCar < `Car`
          +  def self.new(make, model)
          +    `new Car(make, model)`
          +  end
          +
          +  def car_info
          +    `self.getCarInfo()`
          +  end
          +end
          +
          +car = MyCar.new('Toyota', 'Corolla')
          +puts car.car_info  # Outputs: "Toyota Corolla"
          +

          This bridges Car to MyCar, creating a Car instance with new Car(make, model). We call getCarInfo() via self, referencing the same JavaScript and Ruby object due to bridging. Thus, creating a MyCar instance makes a Car instance, and car_info on the car object outputs "Toyota Corolla". This shows seamless Ruby-JavaScript interaction via bridging.

          +

          Inheritance & Bridging

          +

          Creating a subclass of a native JavaScript class is possible. Bridging doesn't affect JavaScript's behavior or inheritance hierarchy.

          +

          Bridging Considerations

          + +

          Bridged Class Methods

          +

          Access JavaScript class methods as properties on the constructor with class.$$constructor, where class is a Ruby class. You can access it using self.

          +

          Performance

          +

          Bridging is quicker than wrapping as no wrapper object is used, but altering the prototype chain could affect JavaScript engine performance.

          +

          Exception Handling

          +

          JavaScript Error is bridged to Ruby Exception for unified error handling.

          +

          Native JavaScript Interactions

          +

          Use x-strings for interacting with native JavaScript. The Native class wraps JavaScript objects and offers a Ruby-like API.

          +

          Type Conversions

          +

          With bridging creating equivalent Ruby and JavaScript objects, no explicit type conversion is needed. The Native library's #to_n is how you convert non-bridged objects.

          +

          Bridged Classes in Corelib

          +

          Opal's core library bridges several commonly used JavaScript classes, including Array, Boolean, Number (think: Float which also may act as an Integer), Proc, Time, RegExp, and String, allowing interaction with these JavaScript instances as their Ruby equivalents. Also Hash bridges the Javascript Map class and works very well between Javascript and Opal if primitives of the Javascript types "string", "number" and "symbol" (which must be global, generated with Symbol.for()) are used as keys. When other types or objects are used as keys, there may be issues retrieving the Map entries from each language, because the original references of the objects that have been used as keys are required for retrieval. When using a Map with object keys passed from Javascript as Hash in Opal, calling Hash#rehash may resolve issues and make entries accessible.

          However, Opal doesn't bridge common JavaScript classes like Set due to significant differences in behavior and interfaces between Ruby and JavaScript.

          +

          Drawbacks

          +

          Bridging effectively utilizes JavaScript objects within Ruby, but it does have its downsides.

          The main drawback of Opal bridging is that it modifies the prototypes of JavaScript classes, potentially leading to prototype pollution. This can cause conflicts with other JavaScript code expecting the prototype in its original state, potentially causing hard-to-trace bugs or slower code execution due to changes impacting the JavaScript engine's performance.

          Additionally, bridging requires comprehensive knowledge of both Ruby and JavaScript, and understanding how Opal implements the bridge. Incorrect usage can lead to complex, hard-to-debug issues.

          An alternative to bridging is using Native::Wrapper. This module in Opal's standard library allows interaction with JavaScript objects without modifying their prototypes. It offers a Ruby-friendly API for accessing and calling JavaScript methods, as well as handling JavaScript properties, thus avoiding the prototype pollution issue.

          In conclusion, bridging provides powerful functionality for Ruby-JavaScript code interaction, but it should be used cautiously and with a deep understanding of its implications. Depending on your needs, Native::Wrapper may be a safer and more intuitive alternative.

          +

          Conclusion

          +

          Opal's bridging mechanism offers an enticing method for combining Ruby and JavaScript's strengths into a single environment. Despite requiring caution due to potential drawbacks, bridging enables developers to create Ruby idiomatic APIs for accessing JavaScript code. By leveraging this mechanism, we can redefine conventional web programming paradigms and create more vibrant, dynamic applications.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/cdp_common.html b/docs/guides/v1.8.2/cdp_common.html new file mode 100644 index 00000000..3e55e588 --- /dev/null +++ b/docs/guides/v1.8.2/cdp_common.html @@ -0,0 +1,182 @@ + + + + + + Opal v1.8.2 · Common CDP of Chrome, Firefox, Node and Deno + + + + + + + + + +
          +
          +

          Common CDP of Chrome, Firefox, Node and Deno

          +

          cdp_common.json documents a subset of the common CDP as reported by Chrome, version 107 and Firefox, version 106. +All entries that where marked as "experimental" or "deprecated" have been removed. +Only entries, that where included in both browsers with equal state have been kept.

          The CDP as implemented by Chrome or Firefox can be retrieved directly from the browsers by starting them with the --remote-debugging-port option +and visiting the (http://localhost:9222/json/protocol)[http://localhost:9222/json/protocol] endpoint.

          Unfortunately, Firefox advertising this protocol support doesn't mean it actually is available or even works! +Various domains and methods, advertised as available from Firefox, present a "UnknownMethodError" or other errors.

          The Node and Deno CDP protocol can be inspected by starting them with the --inspect option and visiting the +(http://localhost:9229/json/protocol)[http://localhost:9229/json/protocol] endpoint.

          The actual websocket endpoint uri can be retrieved at (http://localhost:9222/json/version)[http://localhost:9222/json/version] +or as list of targets at (http://localhost:9222/json/list)[http://localhost:9222/json/list], +likewise in Node or Deno with the adjusted port number.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/compiled_ruby.html b/docs/guides/v1.8.2/compiled_ruby.html new file mode 100644 index 00000000..6822a3ae --- /dev/null +++ b/docs/guides/v1.8.2/compiled_ruby.html @@ -0,0 +1,544 @@ + + + + + + Opal v1.8.2 · Compiled Ruby Code + + + + + + + + + +
          +
          +

          Compiled Ruby Code

          + +

          Generated JavaScript

          +

          Opal is a source-to-source compiler, so there is no VM as such and the +compiled code aims to be as fast and efficient as possible, mapping +directly to underlying javascript features and objects where possible.

          +

          Literals

          +
          nil         # => nil
          +true        # => true
          +false       # => false
          +self        # => self
          +

          self is mostly compiled to this. Methods and blocks are implemented +as javascript functions, so their this value will be the right +self value. Class bodies and the top level scope use a self variable +to improve readability.

          nil is compiled to a nil javascript variable. nil is a real object +which allows methods to be called on it. Opal cannot send methods to null +or undefined, and they are considered bad values to be inside ruby code.

          true and false are compiled directly into their native boolean +equivalents. This makes interaction a lot easier as there is no need +to convert values to opal specific values.

          Because true and false compile to their native +javascript equivalents, they must share the same class: Boolean. +Thru some level of hackery, we make them pseudo-members of the appropriate +TrueClass and FalseClass.

          +

          Strings & Symbols

          +
          "hello world!"    # => "hello world!"
          +:foo              # => "foo"
          +<<-EOS            # => "Hello there.\n"
          +Hello there.
          +EOS
          +

          Ruby strings are compiled directly into JavaScript strings for +performance as well as readability. This has the side effect that Opal +does not support mutable strings - i.e. all strings are immutable.

          Strings in Opal are immutable because they are compiled into regular JavaScript strings. This is done for performance reasons.

          For performance reasons, symbols are also compiled directly into strings. +Opal supports all the symbol syntaxes, but does not have a real Symbol +class. Symbols and Strings can therefore be used interchangeably.

          +

          Numbers

          +

          In Opal there is a single class for numbers; Number. To keep Opal +as performant as possible, Ruby numbers are mapped to native numbers. +This has the side effect that all numbers must be of the same class. +Most relevant methods from Integer and Float are implemented on +this class.

          42        # => 42
          +3.142     # => 3.142
          +
          +

          Arrays

          +

          Ruby arrays are compiled directly into JavaScript arrays. Special +Ruby syntaxes for word arrays etc are also supported.

          [1, 2, 3, 4]        # => [1, 2, 3, 4]
          +%w[foo bar baz]     # => ["foo", "bar", "baz"]
          +
          +

          Hash

          +

          Inside Javascript new Map() can be used, which +creates simply a new instance of the Hash class.

          { :foo => 100, :baz => 700 }    # => new Map([["foo", 100], ["baz", 700]])
          +{ foo: 42, bar: [1, 2, 3] }     # => new Map([["foo", 42], ["bar", [1, 2, 3]]])
          +
          +

          Range

          +

          There is a function Opal.range available to create +range instances.

          1..4        # => Opal.range(1, 4, true)
          +3...7       # => Opal.range(3, 7, false)
          +
          +

          Logic and conditionals

          +

          As per Ruby, Opal treats only false and nil as falsy, everything +else is a truthy value including "", 0 and []. This differs from +JavaScript as these values are also treated as false.

          For this reason, most truthy tests must check if values are false or +nil (we also check for null and undefined).

          Taking the following test:

          val = 42
          +
          +if val
          +  return 3.142;
          +end
          +

          This would be compiled into:

          val = 42;
          +if (val !== false && val !== nil && val != null) {
          +  return 3.142
          +} else {
          +  return nil
          +};
          +

          This makes the generated truthy tests (if statements, and checks and +or statements) a little more verbose in the generated code.

          +

          Instance variables

          +

          Instance variables in Opal work just as expected. When ivars are set or +retrieved on an object, they are set natively without the @ prefix. +This allows real JavaScript identifiers to be used which is more +efficient then accessing variables by string name.

          @foo = 200
          +@foo  # => 200
          +
          +@bar  # => nil
          +

          This gets compiled into:

          this.foo = 200;
          +this.foo;   // => 200
          +
          +this.bar;   // => nil
          +

          If an instance variable uses the same name as a reserved JavaScript keyword, +then the instance variable is wrapped using the object-key notation: this['class'].

          +

          Compiled Files

          +

          As described above, a compiled Ruby source gets generated into a string +of JavaScript code that is wrapped inside an anonymous function. This +looks similar to the following:

          (function(Opal) {
          +  // some setup code code
          +  return self.$puts("foo")
          +})(Opal);
          +

          As a complete example, assuming the following code:

          puts "foo"
          +

          This would compile directly into:

          Opal.queue(function(Opal) {
          +  var self = Opal.top, nil = Opal.nil;
          +
          +  Opal.add_stubs('puts');
          +  return self.$puts("foo")
          +});
          +

          TIP:

          you can see the compiled code with this command: opal --compile --no-exit --no-opal --eval 'puts "foo"' +or, more briefly: opal -cEO -e 'puts "foo"'

          +

          Using compiled sources

          +

          If you write the generated code as above into a file app.js and add +that to your HTML page, then it is obvious that "foo" would be +written to the browser's console.

          +

          Debugging and finding errors

          +

          Because Opal does not aim to be fully compatible with Ruby, there are +some instances where things can break and it may not be entirely +obvious what went wrong.

          +

          Using JavaScript debuggers

          +

          As Opal just generates JavaScript, it is useful to use a native +debugger to work through JavaScript code. To use a debugger, simply +add a debugger statement:

          # .. code
          +debugger
          +# .. more code
          +

          The debugger statement is compiled to become a JavaScript debugger +statement. This statement breaks the code if you have your Inspector open.

          All local variables and method/block arguments also keep their Ruby +names except in the rare cases when the name is reserved in JavaScript. +In these cases, a $ suffix is added to the name +(e.g. trytry$).

          +

          JavaScript from Ruby

          +

          Opal tries to interact as cleanly with JavaScript and its api as much +as possible. Ruby arrays, strings, numbers, regexps, blocks and booleans +are just JavaScript native equivalents. The only boxed core features are +hashes.

          +

          Inline JavaScript

          +

          As most of the corelib deals with these low level details, Opal provides +a special syntax for inlining JavaScript code. This is done with +x-strings or "backticks", as their Ruby use has no useful translation +in the browser.

          `window.title`
          +# => "Opal: Ruby to JavaScript compiler"
          +
          +%x{
          +  console.log("opal version is:");
          +  console.log(#{ RUBY_ENGINE_VERSION });
          +}
          +
          +# => opal version is:
          +# => 1.3.1
          +

          Even interpolations are supported, as seen here.

          This feature of inlining code is used extensively, for example in +Array#length:

          class Array
          +  def length
          +    `this.length`
          +  end
          +end
          +

          X-Strings also have the ability to automatically return their value, +as used by this example.

          +

          Native Module

          +

          Reposted from: Mikamayhem

          Opal standard lib (stdlib) includes a Native module. To use it, you need to download and reference native.js. You can find the latest minified one from the CDN here.

          Let's see how it works and wrap window:

          require 'native'
          +
          +win = Native(`window`) # equivalent to Native::Object.new(`window`)
          +

          To access a Native-wrapped global JavaScript object, we can also use $$, after +we have the native module required.

          Now what if we want to access one of its properties?

          win[:location][:href]                         # => "http://dev.mikamai.com/"
          +win[:location][:href] = "http://mikamai.com/" # will bring you to mikamai.com
          +

          And what about methods?

          win.alert('hey there!')
          +

          So let’s do something more interesting:

          class << win
          +  # A cross-browser window close method (works in IE!)
          +  def close!
          +    %x{
          +      return (#@native.open('', '_self', '') && #@native.close()) ||
          +             (#@native.opener = null && #@native.close()) ||
          +             (#@native.opener = '' && #@native.close());
          +    }
          +  end
          +
          +  # let's assign href directly
          +  def href= url
          +    self[:location][:href] = url
          +  end
          +end
          +

          That’s all for now, bye!

          win.close!
          +
          +

          Calling JavaScript Methods

          +

          You can make direct JavaScript method calls on using the recv.JS.method +syntax. For example, if you have a JavaScript object named foo and want to call the +bar method on it with no arguments, with or without parentheses:

          # javascript: foo.bar()
          +foo.JS.bar
          +foo.JS.bar()
          +

          You can call the JavaScript methods with arguments, with or without parentheses, just +like Ruby methods:

          # JavaScript: foo.bar(1, "a")
          +foo.JS.bar(1, :a)
          +foo.JS.bar 1, :a
          +

          You can call the JavaScript methods with argument splats:

          # JavaScript: ($a = foo).bar.apply($a, [1].concat([2, 3]))
          +foo.JS.bar(1, *[2, 3])
          +foo.JS.bar 1, *[2, 3]
          +

          You can provide a block when making a JavaScript method call, and it will be +converted to a JavaScript function added as the last argument to the method:

          # JavaScript:
          +# ($a = (TMP_1 = function(arg){
          +#     var self = TMP_1.$$s || this;
          +#     if (arg == null) arg = nil;
          +#     return "" + (arg.method()) + " " + (self.$baz(3))
          +#    },
          +#    TMP_1.$$s = self, TMP_1),
          +# foo.bar)(1, 2, $a);
          +foo.JS.bar(1, 2){|arg| arg.JS.method + baz(3)}
          +

          Note how self is set for the JavaScript function passed as an argument. This +allows normal Ruby block behavior to work when passing blocks to JavaScript +methods.

          The .JS. syntax is recognized as a special token by the lexer, so if you have +a Ruby method named JS that you want to call, you can add a space to call it:

          # call Ruby JS method on foo, call Ruby bar method on result
          +foo. JS.bar
          +
          +

          Getting/Setting JavaScript Properties

          +

          You can get JavaScript properties using the recv.JS[:property] syntax:

          # JavaScript: foo["bar"]
          +foo.JS[:bar]
          +

          This also works for JavaScript array access:

          # JavaScript: foo[2]
          +foo.JS[2]
          +

          You can set JavaScript properties using this as the left hand side in an +assignment:

          # JavaScript: foo["bar"] = 1
          +foo.JS[:bar] = 1
          +

          This also works for setting values in a JavaScript array:

          # JavaScript: foo[2] = "a"
          +foo.JS[2] = :a
          +

          Like the recv.JS.method syntax, .JS[ is recognized as a special token by +the lexer, so if you want to call the Ruby JS method on a object and then +call the Ruby [] method on the result, you can add a space:

          # call Ruby JS method on foo, call Ruby [] method on result with :a argument
          +foo. JS[:a]
          +
          +

          Calling JavaScript Operators

          +

          Opal has a js library in the stdlib that provides a JS module which can +be used to call JavaScript operators such as new. Example:

          require 'js'
          +
          +# new foo(bar)
          +JS.new(foo, bar)
          +
          +# delete foo["bar"]
          +JS.delete(foo, :bar)
          +
          +# "bar" in foo
          +JS.in(:bar, foo)
          +
          +# foo instanceof bar
          +JS.instanceof(foo, bar)
          +
          +# typeof foo
          +JS.typeof(foo)
          +
          +

          Calling JavaScript Global Functions

          +

          You can also use the js library to call JavaScript global functions via +JS.call:

          require 'js'
          +
          +# parseFloat("1.1")
          +JS.call(:parseFloat, "1.1")
          +

          For convenience, method_missing is aliased to call, allowing you to call +global JavaScript methods directly on the JS module:

          require 'js'
          +
          +# parseFloat("1.1")
          +JS.parseFloat("1.1")
          +
          +

          Wrapping JavaScript Libraries

          +

          If you want to integrate a JavaScript library with Opal, so that you can make Ruby calls, you can choose one of the following options:

          +
            +
          • Use backticks: This is the quickest, simplest approach to integrating: call the native JavaScript code directly; it may provide a slight performance benefit, but also produces "ugly" Ruby code riddled with JavaScript. It's ideal for occasional calls to a JavaScript library.

          • +
          • Use .JS: You can make direct JavaScript method calls on using the recv.JS.method syntax. It is very similar to using backticks but looks more like ruby.

          • +
          • Use Native: Native provides a reasonable Ruby-like wrapper around JavaScript objects. This provides a quick in-term solution if no dedicated Ruby wrapper library exists.

          • +
          • Create your own Wrapper Library: If you use the library a lot, you can create your own Ruby library that wraps the JavaScript calls (which call Native or use backticks under the hood). This provides the best abstraction (eg. you can provide high-level calls that provide functionality, regardless of if the underlying JavaScript call flows change).

          • +
          + +

          Ruby from JavaScript

          +

          Accessing classes and methods defined in Opal from the JavaScript runtime is +possible via the Opal JS object. Consider following code:

          module Bar
          +  BAR = 123
          +end
          +
          +class Foo
          +  include Bar
          +  FOO = 456
          +
          +  def foo
          +    puts "called #foo on class ::Foo defined in Ruby code"
          +  end
          +end
          +
          +BAZ = 789
          +
          +

          Navigating constants

          +

          Top level constants can be accessed as properties of Opal:

          Opal.Object;       // => Object
          +Opal.Kernel;       // => Kernel
          +Opal.Array;        // => Array
          +Opal.RUBY_VERSION; // => "2.3"
          +Opal.Foo;          // => Foo
          +Opal.BAZ;          // => 789
          +

          To reach nested constants the safest way is to call #const_get on Object:

          Opal.Object.$const_get('Bar::BAR'); // => 123
          +Opal.Object.$const_get('Foo::BAR'); // => 123
          +Opal.Object.$const_get('Foo::FOO'); // => 456
          +Opal.Object.$const_get('BAZ');      // => 789
          +

          Constants can also be navigated using the $$ property, although this is limited to constants defined directly under the current object:

          Opal.Bar.$$.BAR // => 123
          +Opal.Foo.$$.FOO // => 456
          +Opal.Foo.$$.BAR // => undefined
          +

          A later feature also allows you to skip the $$ property:

          Opal.Bar.BAR // => 123
          +Opal.Foo.FOO // => 456
          +Opal.Foo.BAR // => undefined
          +
          +

          Calling methods

          +

          Methods are always prefixed by a single $:

          // Equivalent to:
          +//   Foo.new.foo
          +Opal.Foo.$new().$foo(); // => "called #foo on class ::Foo defined in Ruby code"
          +
          +// Equivalent to:
          +//   "hello there".sub('there', 'world')
          +("hello there").$sub('there', 'world'); // => "hello world"
          +

          Methods names unsupported in JS should be called using the JS bracket notation:

          // Equivalent to:
          +//   hash = Hash.new["key"] = "value"
          +//   hash["key"] = "value"
          +var hash = Opal.Hash.$new();  // => {}
          +hash["$[]="]("key", "value"); // => "value"
          +
          +// Equivalent to:
          +//   [1,2,3].reverse!
          +[1,2,3]['$reverse!'](); // => [3,2,1]
          +
          +// Equivalent to:
          +//   1 == 2
          +(1)['$=='](2); // => false
          +

          Passing blocks from JS is a bit more tricky, so the suggested solution is to use Opal.send(…):

          // Equivalent to:
          +//   [1,2,3].map {|n| n * 2}
          +Opal.send([1,2,3], 'map', [], function(n) {return n * 2}); // => [2,4,6]
          +

          Alternatively blocks can also be called the hard way by assigning the block-function to the property $$p of the method:

          // Equivalent to:
          +//   [1,2,3].map {|n| n * 2}
          +array = [1,2,3]
          +array.$map.$$p = function(n) {return n * 2}; // "$$p" stands for "proc"
          +array.$map(); // => [2,4,6]
          +
          +

          Hash

          +

          Since Ruby hashes are bridged to Map. It's quite possible to interact with hashes from JavaScript:

          var myHash = new Map([['a', 1], ['b', 2]]);
          +// output of $inspect: {"a"=>1, "b"=>2}
          +myHash.$store('a', 10);
          +// output of $inspect: {"a"=>10, "b"=>2}
          +myHash.$fetch('b','');
          +// 2
          +myHash.$fetch('z','');
          +// ""
          +myHash.$update(new Map([['b', 20], ['c', 30]]));
          +// output of $inspect: {"a"=>10, "b"=>20, "c"=>30}
          +myHash.$to_n(); // provided by the Native module
          +// output: Map(2) {'b' => 20, 'c' => 30}
          +// aka a standard JavaScript Map
          +

          Be aware Hash#to_n produces a duplicate copy of the hash.

          +

          Freezing Objects

          +

          Starting with Opal 1.6.0 freezing objects is supported in general but a few differences to Ruby apply. +Contrary to Ruby, where #freeze is often used to optimize performance, there is no performance benefit when freezing objects in Opal, instead its main use case is to prevent modification of objects. +There are a few edge cases, where accessing frozen objects in Opal behaves different from Ruby. In those cases a modification attempt will fail silently, with no "FrozenError" exception thrown.

          +

          Advanced Compilation

          + +

          Method Missing

          +

          Opal supports method_missing. This is a key feature of Ruby, and Opal wouldn't be much use without it! This page details the implementation of method_missing for Opal.

          +

          Method dispatches

          +

          Firstly, a Ruby call foo.bar 1, 2, 3 is compiled into the following JavaScript:

          foo.$bar(1, 2, 3)
          +

          This should be pretty easy to read. The bar method has a $ prefix just to distinguish it from underlying JavaScript properties, as well as Ruby ivars. Methods are compiled like this to make the generated code really readable.

          +

          Handling method_missing

          +

          JavaScript does not have an equivalent of method_missing, so how do we handle it? If a function is missing in JavaScript, then a language level exception will be raised.

          To get around this, we make use of our compiler. During parsing, we collect a list of all method calls made inside a Ruby file, and this gives us a list of all possible method calls. We then add stub methods to the root object prototype (an Opal object, not the global JavaScript Object) which will proxy our method missing calls for us.

          For example, assume the following Ruby script:

          first 1, 2, 3
          +second "wow".to_sym
          +

          After parsing, we know we only ever call 3 methods: [:first, :second, :to_sym]. So, imagine we could just add these 3 methods to BasicObject in Ruby, we would get something like this:

          class BasicObject
          +  def first(*args, &block)
          +    method_missing(:first, *args, &block)
          +  end
          +
          +  def second(*args, &block)
          +    method_missing(:second, *args, &block)
          +  end
          +
          +  def to_sym(*args, &block)
          +    method_missing(:to_sym, *args, &block)
          +  end
          +end
          +

          It is obvious from here, that unless an object defines any given method, it will always resort in a dispatch to method_missing from one of our defined stub methods. This is how we get method_missing in Opal.

          +

          Optimising generated code

          +

          To optimise the generated code slightly, we reduce the code output from the compiler into the following JavaScript:

          Opal.add_stubs("first,second,to_sym"]);
          +

          You will see this at the top of all your generated JavaScript files. This will add a stub method for all methods used in your file.

          +

          Alternative approaches

          +

          The old approach was to inline method_missing calls by checking for a method on every method dispatch. This is still supported via a parser option, but not recommended.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/compiler.html b/docs/guides/v1.8.2/compiler.html new file mode 100644 index 00000000..3ebfdd14 --- /dev/null +++ b/docs/guides/v1.8.2/compiler.html @@ -0,0 +1,195 @@ + + + + + + Opal v1.8.2 · Opal Compiler + + + + + + + + + +
          +
          +

          Opal Compiler

          +

          Opal is a source to source compiler. It accepts ruby code as a string and +generates javascript code which can be run in any environment. Generated +code relies on the opal runtime which provides the class system and some +other runtime helpers.

          +

          Compiler stages

          +

          The compiler can be broken down into 3 separate stages:

          +
            +
          • lexing + parsing
          • +
          • code generation
          • +
          + +

          Lexer/Parser

          +

          The opal parser relies on the parser gem, see debug/development documentation there to know more about its internals: https://whitequark.github.io/parser/.

          +

          Code generation

          +

          The opal compiler takes these sexps from the parser +and generates ruby code from them. Each type of sexp has its own node type +used to generate javascript. Each node creates an array of one or more +fragments which are the concatenated together to +form the final javascript. Fragments are used as they contain the generated +code as well as a reference back to the original sexp which is useful for +generating source maps afterwards.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/compiler_directives.html b/docs/guides/v1.8.2/compiler_directives.html new file mode 100644 index 00000000..cd2432e7 --- /dev/null +++ b/docs/guides/v1.8.2/compiler_directives.html @@ -0,0 +1,253 @@ + + + + + + Opal v1.8.2 · Compiler File Loading Directives + + + + + + + + + +
          +
          +

          Compiler File Loading Directives

          +

          The Opal compiler supports some special directives that can optimize or +enhance the output of compiled Ruby code to suit the Ruby environment.

          +

          Require Directive

          +

          All calls to require are captured so that the compiler and build tools +can determine which dependencies a file has. In the case of Builder, +these are collated and then added to a list of files to be processed.

          +

          require

          +

          Assuming we have a file foo.rb:

          # foo.rb
          +require 'bar'
          +require 'baz'
          +

          The compiler will collect these two dependencies, and then Builder +will attempt to discover them within the Opal load path to also compile +them into the target output. If these dependencies cannot be resolved, +then a compile time error will be thrown.

          +

          Dynamic Requires

          +

          Opal only supports hard-coded requires. This means that any dynamically +generated require statements cannot be discovered. Opal may raise an +error or just produce a warning if a dynamic require is used. A dynamic +require is any require that cannot be resolved using static analysis. A +common use case of dynamic requires is to include a directory of Ruby +files. In this case, see require_tree below.

          +

          require_relative

          +

          require_relative is also supported by Opal's compiler for ahead-of-time +inclusion.

          # foo.rb
          +require_relative 'bar'
          +

          This example will try to resolve bar.rb in the same directory.

          +

          autoload

          +

          autoload is used to load a modules and classes within a modules +namespace. As long as the string argument given to autoload can be +resolved in Opal's load paths, in the same way as require, then these +referenced dependencies will also be compiled.

          # foo.rb
          +module Foo
          +  autoload :Bar, 'bar'
          +end
          +

          In this example, bar.rb will also be required.

          +

          require_tree

          +

          require_tree can be used as an Opal-friendly alternative to globbing +over a directory to require a list of dependencies.

          # foo.rb
          +require_tree './models'
          +

          This will, at compile time, resolve all files inside the models/ +directory and also compile them to the output. At runtime this method +will then loop over all modules defined, and require them if they match +that given module path.

          Note: The given directory must be inside Opal's load path, otherwise +no files will be compiled.

          +

          Handling non-Ruby requirements

          +

          Opal's require method is also special as it allows non-Ruby source +files to be required and generated in the output. The obvious example of +this is requiring JavaScript source files. JavaScript sources are +treated as first class citizens in Opal. The Opal gem also supports +compiling .erb files using the same process.

          +

          Opal Specific Code Compilation

          +

          A special case if and unless statements can hide or show blocks of +code from the Opal compiler. These check against RUBY_ENGINE or +RUBY_PLATFORM. As these are valid Ruby statements against constants +that exist in all Ruby runtimes, they will not affect any running code:

          if RUBY_ENGINE == 'opal'
          +  # this code compiles
          +else
          +  # this code never compiles
          +end
          +

          Unless statements are also supported:

          unless RUBY_ENGINE == 'opal'
          +  # this code will not run
          +end
          +

          Also != statements work:

          if RUBY_ENGINE != 'opal'
          +  puts 'do not run this code'
          +end
          +

          These blocks of code don't run at all at runtime, but they also never +compile so will never be in the output JavaScript code. This is +particularly useful for using code in both MRI and Opal.

          Some uses are:

          +
            +
          • Avoid require statements being picked up by Opal compile time +require handling.

          • +
          • To stop certain requires taking place for Opal (and vice-versa for +shared libraries).

          • +
          • To wrap x-strings which might break in compiled JavaScript output.

          • +
          • To simply avoid compiling large blocks of code that are not needed +in the JavaScript/Opal version of an app.

          • +
          +

          In all these examples RUBY_PLATFORM can be used instead of +RUBY_ENGINE.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/configuring_gems.html b/docs/guides/v1.8.2/configuring_gems.html new file mode 100644 index 00000000..1ad9decd --- /dev/null +++ b/docs/guides/v1.8.2/configuring_gems.html @@ -0,0 +1,261 @@ + + + + + + Opal v1.8.2 · Configuring Gems For Opal + + + + + + + + + +
          +
          +

          Configuring Gems For Opal

          +

          To configure a gem to run in Opal the gem will need a couple of things:

          +
            +
          1. The opal gem running on a server (so the ruby code can get compiled to JavaScript).
          2. +
          3. The Opal search path has to know to look for your gem when it is required.
          4. +
          +

          This is done by having the following 2 lines in your outermost .rb file:

          require 'opal'
          +Opal.append_path File.expand_path('..', __FILE__).untaint
          +

          However it only makes sense to execute these lines outside of Opal, since what they do is set things up for Opal to find and compile the files to .js. So how these lines get added to your gem depends on whether the gem can usefully run in the normal server environment as well as in Opal, or just strictly in Opal.

          For example, you have a gem that parses, validates, and gives details on email addresses. This gem would be just as useful on the server, as running +in the browser.

          On the other hand you have a gem that does something with the DOM. There would be no point in making this gem available to the server.

          Each case is detailed below, assuming you have a Gem file structure like this:

          /lib
          +  /your_gem_directory
          +    /your_gem_file1.rb
          +    /your_gem_file2.rb
          +    /...
          +    /version.rb
          +  /your_gem.rb
          +
          +

          Configuring Gems To Run Everywhere

          +

          If your gem will work both in Opal and in a classic ruby environment +your outer .rb file (your_gem.rb) needs to look like this

          # require all the files, regardless of whether this code is running
          +# to run on the server, or inside of Opal.
          +require_relative 'your_gem_directory/your_gem_file1.rb'
          +require_relative 'your_gem_directory/your_gem_file2.rb'
          +# etc
          +require_relative 'your_gem_directory/version'
          +unless RUBY_ENGINE == 'opal'
          +  # Now if we are NOT running inside of opal, set things up so opal can find
          +  # the files. The whole thing is rescued in case the opal gem is not available.
          +  # This would happen if the gem is being used server side ONLY.
          +  begin
          +    require 'opal'
          +    Opal.append_path File.expand_path('..', __FILE__).untaint
          +  rescue LoadError
          +  end
          +end
          +

          So lets see what happens here.

          +
            +
          1. Somebody is going to require this file, perhaps implicitly (for example you are running in rails.)
          2. +
          3. Standard ruby is going to execute the requires, which will load your gem sources, then
          4. +
          5. because the RUBY_ENGINE is not opal, Opal will be required, and your directory of sources added to Opal's search path.
          6. +
          7. Someplace else in some Opal code, the gem will again be required, and so opal searches and finds the gem,
          8. +
          9. and runs this file again, but now inside of the Opal environment. This time the RUBY_ENGINE is Opal so the require 'opal' etc will not be executed.
          10. +
          +

          The result is that you have two versions of the code, one in standard ruby, and a second compiled to .js and ready to be served.

          +

          Configuring Gems To Run In Opal Only

          +

          If it makes no sense to run the code in standard Ruby (i.e. on the server) then the above code can look like this:

          # require all the files, only if Opal is executing
          +if RUBY_ENGINE == 'opal'
          +  require_relative 'your_gem_directory/your_gem_file1.rb'
          +  require_relative 'your_gem_directory/your_gem_file2.rb'
          +  # etc
          +  require_relative 'your_gem_directory/version'
          +else
          +  # NOT running inside of opal, set things up
          +  # so opal can find the files.
          +  require 'opal'
          +  Opal.append_path File.expand_path('..', __FILE__).untaint
          +end
          +
          +

          Testing

          +

          Regardless of which case your gem is designed for, you will want to make sure you test inside the Opal environment. If nothing else you will want to make sure you have all the above configuration setup correctly.

          To do this add the following to your gemspec:

          spec.add_development_dependency "opal-rspec"
          +spec.add_development_dependency "opal"
          +

          Then setup the following in config.ru (assuming your specs are in the /spec directory.)

          require 'bundler'
          +Bundler.require
          +
          +require 'opal-rspec'
          +Opal.append_path File.expand_path('../spec', __FILE__)
          +
          +run Opal::Server.new { |s|
          +  s.main = 'opal/rspec/sprockets_runner'
          +  s.append_path 'spec'
          +  s.debug = false
          +  s.index_path = 'spec/index.html.erb'
          +}
          +

          Finally create a index.html.erb file in the spec directory with the following contents:

          <!DOCTYPE html>
          +<html>
          +<head>
          +</head>
          +<body>
          +  <%= javascript_include_tag @server.main %>
          +</body>
          +</html>
          +

          With all this setup, you can run specs normally to test standard ruby execution, and then do

          bundle exec rackup
          +

          and point your browser to localhost, and you will see your spec results running in the Opal environment.

          Don't forget to checkout the added features of the opal-rspec gem such as async specs.

          +

          Conditional Execution

          +

          In some cases you might have to check whether you are in Opal or not, just wrap the code in:

          if RUBY_ENGINE == 'opal'
          +  # …
          +end
          +

          This might happen in your specs or in the actual gem code.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/encoding.html b/docs/guides/v1.8.2/encoding.html new file mode 100644 index 00000000..da26403e --- /dev/null +++ b/docs/guides/v1.8.2/encoding.html @@ -0,0 +1,181 @@ + + + + + + Opal v1.8.2 · Encoding + + + + + + + + + +
          +
          +

          Encoding

          +

          Encoding support is partial and mostly given by the encoding set by the HTML page. +We suggest to always set encoding to UTF-8 explicitly:

          <!doctype html>
          +<html>
          +  <head>
          +    <meta charset="UTF-8" />
          +    <!-- ... -->
          +
          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/getting_started.html b/docs/guides/v1.8.2/getting_started.html new file mode 100644 index 00000000..c576f25c --- /dev/null +++ b/docs/guides/v1.8.2/getting_started.html @@ -0,0 +1,196 @@ + + + + + + Opal v1.8.2 · Getting Started + + + + + + + + + +
          +
          +

          Getting Started

          +

          Opal is a Ruby to JavaScript compiler, an implementation of the Ruby corelib and stdlib, and associated gems for building fast client-side web applications in Ruby.

          +

          Installation

          +

          Opal is available as a gem and can be installed via:

          $ gem install opal
          +

          Or added to your Gemfile as:

          gem 'opal'
          +
          +

          Getting Started with Opal

          +

          At its core, Opal provides a simple method of compiling a string of Ruby into JavaScript that can run on top of the Opal runtime:

          Opal.compile("[1, 2, 3].each { |a| puts a }")
          +# => "(function() { ... })()"
          +

          Opal allows for Ruby (and ERB) assets to be compiled and treated as first-class JavaScript citizens. Ruby sources can require JavaScript and other Ruby files, working similar to CoffeeScript.

          This relies on the Opal load path. Any gem containing Opal code registers that directory to the Opal load path. Opal will then use all Opal load paths when running instances.

          +

          Adding Lookup Paths

          +

          Opal uses a load path to create a set of locations from which Opal can require files. If you want to add a directory to this load path, you can add it to the global environment.

          In the Opal module, a property paths is used to hold the load paths which Opal uses to require files from. You can add a directory to this:

          Opal.append_path '../my_lib'
          +

          Now, any Ruby files in this directory can be discovered.

          +

          FAQ

          + +

          Why Does Opal Exist?

          +

          Opal aims to keep Ruby relevant in a world where client-side applications are making JavaScript the primary development platform.

          +

          How Compatible is Opal?

          +

          Opal is tested against the Ruby spec as our primary testing setup. The goal is to make Opal as compatible as possible while also considering the restrictions of JavaScript when applicable. Opal supports the majority of Ruby syntax features, as well as a very large part of the corelib implementation. Opal can compile and run RSpec unmodified, as well as self-host the compiler at runtime.

          +

          What Version of Ruby Does Opal Target?

          +

          Opal's tests are run under Ruby 3.2.0 conditions, but it remains mostly compatible with 2.6 level features.

          +

          Why Doesn't Opal Support Mutable Strings?

          +

          All strings in Opal are immutable because Ruby strings are compiled directly into JavaScript strings, which are immutable. Wrapping Ruby strings as a custom JavaScript object would add a lot of overhead and complicate interaction between Ruby and JavaScript libraries.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/headless_browsers.html b/docs/guides/v1.8.2/headless_browsers.html new file mode 100644 index 00000000..f2677ffb --- /dev/null +++ b/docs/guides/v1.8.2/headless_browsers.html @@ -0,0 +1,249 @@ + + + + + + Opal v1.8.2 · Running code in a Headless Browsers + + + + + + + + + +
          +
          +

          Running code in a Headless Browsers

          + +

          Requirements

          +

          First of all, make sure that you have Chrome, at least version 59.0, installed or Firefox, at least version 106.

          +

          Using the runners

          +

          To run your code using headless Chrome, use -R chrome (--runner chrome) option:

          $ opal -Rchrome -e "puts 'Hello, Opal'"
          +Hello, Opal
          +

          To run your code using headless Firefox, use -R firefox (--runner firefox) option:

          $ opal -Rfirefox -e "puts 'Hello, Opal'"
          +Hello, Opal
          +

          The runner also listens for any exceptions and prints formatted stracktraces back to your console:

          $ opal -Rchrome -e "
          +def raising_method
          +  raise 'test error'
          +end
          +
          +raising_method
          +"
          +
          +RuntimeError: test error
          +  from <internal:corelib/…>:2693:7:in `<main>'
          +  from -e:1:1:in `undefined'
          +
          +

          Using exit codes

          +

          By default headless browser runner explicitly sets exit code to 1 when there was any error in the code.

          $ opal -Rchrome -e "42"; echo $?
          +0
          +
          +$ opal -Rchrome -e "raise 'error'"; echo $?
          +RuntimeError: error
          +  from <internal:corelib/kerne…>:2693:7:in `<main>'
          +  from -e:1:1:in `undefined'
          +1
          +

          You can change final exit code by using Kernel#exit, but make sure to require opal/platform in your code.

          $ opal -Rchrome -ropal/platform -e "exit(0)"; echo $?
          +0
          +
          +$ opal -Rchrome -ropal/platform -e "exit(1)"; echo $?
          +1
          +
          +

          Known limitations

          + +
            +
          1. When you call console.log(one, two, three) from your code headless chrome prints only the first passed object. +The reason behind it is the format of the message that chrome sends to the runner. +Opal intentionally uses a simplified method from Chrome API (Console.messageAdded) to catch console.log invocations. +(Check lib/opal/cli_runners/chrome.js do get more information)
          2. +
          + +

          Internals

          + +

          Chrome

          +

          Under the hood when you call opal -Rchrome -e 'your code' Opal uses chrome runner that is defined in +lib/opal/cli_runners/chrome.rb. This runner tries to connect to localhost:9222 (9222 is a default port for a headless chrome server) +or runs the server on its own. It detects your platform and uses a default path to the Chrome executable +(Opal::CliRunners::Chrome#chrome_executable), but you can override it by specifying GOOGLE_CHROME_BINARY environment +variable.

          When the server is up and running it passes compiled js code to lib/opal/cli_runners/chrome_cdp_interface.rb +as a plain input using stdin (basically, it's a second part of the runner). +chrome_cdp_interface.rb is a node js + Opal script that does the main job. It runs any provided code on the running chrome server, +catches errors and forwards console messages.

          +

          Firefox

          +

          This runner tries to connect to localhost:9333 (9333 is the default port for a headless firefox server used by Opal to prevent accidental +connection to a lingering Chrome at port 9222) +or runs the server on its own. It detects your platform and uses a default path to the Firefox executable +(Opal::CliRunners::Firefox#firefox_executable), but you can override it by specifying MOZILLA_FIREFOX_BINARY environment +variable.

          When the server is up and running it passes compiled js code to lib/opal/cli_runners/firefox_cdp_interface.rb +as a plain input using stdin (basically, it's a second part of the runner). +firefox_cdp_interface.rb is a node js + Opal script that does the main job. It runs any provided code on the running chrome server, +catches errors and forwards console messages.

          +

          Using a remote chrome server

          +

          If you want to change a default chrome port or your chrome server is running on a different host:port +you can override default values by specifying CHROME_HOST and CHROME_PORT environment variables:

            $ CHROME_HOST=10.10.10.10 CHROME_PORT=8080 opal -Rchrome -e "puts 42"
          +  Connecting to 10.10.10.10:8080...
          +  42
          +

          CHROME_HOST requires a chrome server to be started. You can't start remotely a server on a different host.

          The CHROME_HOST and CHROME_PORT environment variables are also used by the Firefox runner, the underlying 'chrome-remote-interface' +node module depends on them.

          +

          Additional options

          +

          If you need to pass additional CLI options to the Chrome executable you can do so by setting the CHROME_OPTS environment variable:

            $ CHROME_OPTS="--window-size=412,732" opal -Rchrome -e "puts 42"
          +  42
          +

          Docker users may need CHROME_OPTS="--no-sandbox" due to the user namespaces limitations.

          For a list of additional options see https://developers.google.com/web/updates/2017/04/headless-chrome

          For the Firefox runner use the FIREFOX_OPTS environment variable instead.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/index.html b/docs/guides/v1.8.2/index.html new file mode 100644 index 00000000..5a4417e4 --- /dev/null +++ b/docs/guides/v1.8.2/index.html @@ -0,0 +1,248 @@ + + + + + + Opal v1.8.2 · Opal Guides for v1.6.dev + + + + + + + + + +
          + +

          Opal Guides for v1.6.dev

          +

          These guides are designed to make you immediately productive with Opal, and to help you understand how all of the pieces fit together.

          The guides for earlier releases are available here.

          +
          + +

          Start here

          + +

          Getting Started with Opal

          +

          Everything you need to know to install Opal and create your first application.

          +
          + +

          Using JavaScript Features from Ruby

          + +

          Async

          +

          Learn more about JavaScript async/await support in Opal and how you can use it to avoid explicit callbacks and promises.

          +

          Promises

          +

          How to interact and leverage the power of JavaScript promises from Ruby.

          +

          Source Maps

          +

          How to enable and consume source-maps for your Opal application and be able to debug your Ruby scripts right inside the browser.

          +
          + +

          Using Ruby Features

          + +

          Working with ERB and Haml Templates

          +

          How to work with template libraries in Opal, be it to share the templates with the server or to write your own.

          +
          + +

          Working with Frameworks

          + +

          Rails

          +

          How to use opal-rails to use Opal as the JavaScript compiler.

          +

          Static Applications

          +

          The most basic setup for a static Opal powered website that can be hosted anywhere.

          +

          Sinatra

          +

          Serve Opal applications through Sinatra and opal-sprockets.

          +

          Roda + Sprockets

          +

          Setup Roda + Sprockets to start serving Opal applications from Roda.

          +
          + +

          Interacting with Other Libraries

          + +

          jQuery

          +

          This guide covers the opal-jquery wrapper around the popular library.

          +

          RSpec

          +

          Write specs for your Opal code RSpec and run them on Node.js or in a browser.

          +

          Using Sprockets

          +

          Configure the long-lasting asset handler to work with Opal.

          +
          + +

          Digging Deeper

          + +

          Configuring Gems

          +

          How to make your gem work in Opal and differentiate code for the JavaScript environment.

          +

          Compiler

          +

          A very general overview of how the Opal compiler works.

          +

          Compiled Ruby

          +

          This guide documents how each part of Ruby is mapped to JavaScript internally.

          +

          Compiler File Loading Directives

          +

          The Opal compiler supports some special directives that can optimize or +enhance the output of compiled Ruby code to suit the Ruby environment.

          +

          Using the Opal parser inside a JavaScript environment

          +

          This guide documents how to parse and run Ruby scripts within a browser or any supported JavaScript environment

          +

          Encoding

          +

          (WIP) How to handle encoding within Opal in the browser and in the code.

          +

          Running code in a Headless Chrome

          +

          How to run your Opal application in a headless Chrome from the CLI instead of Node.js.

          +

          Unsupported Features

          +

          Some things that are very difficult, impossible, or outright incompatible with a JavaScript environment.

          +
          + +

          Releases

          + +

          Upgrading Opal

          +

          This guide provides steps to be followed when you upgrade your applications to a newer version of Opal.

          +

          Releasing Instructions

          +

          (WIP) A step-by-step guide on who to release a new version of Opal.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/jquery.html b/docs/guides/v1.8.2/jquery.html new file mode 100644 index 00000000..1872685e --- /dev/null +++ b/docs/guides/v1.8.2/jquery.html @@ -0,0 +1,336 @@ + + + + + + Opal v1.8.2 · JQuery + + + + + + + + + +
          +
          +

          JQuery

          +

          opal-jquery offers a nicer ruby-like syntax for JQuery. It is useful for projects which cannot use opal-browser due to a reliance on jquery for plugins or other libraries.

          foos = Element.find('.foo')
          +# => [<div class="foo">, ...]
          +
          +foos.class
          +# => JQuery
          +
          +foos.on(:click) do
          +  alert "element was clicked"
          +end
          +
          +

          Getting Started

          + +

          Installation

          +

          opal-jquery is distributed as a gem, and needs to be added to your Gemfile:

          # Gemfile
          +gem 'opal'
          +gem 'opal-jquery'
          +
          +

          Usage

          +

          opal-jquery can now be easily added to your opal application sources:

          # app/application.rb
          +
          +# Remember to compile opal-jquery with your javascript application.
          +# See "Compiling" below for an example on compiling dependencies.
          +require 'opal/jquery'
          +
          +alert "Hello from jquery + opal"
          +

          The #alert method is provided by opal-jquery. If the message displays, then +jquery support should be working.

          +

          Compiling

          +

          When compiling your application to javascript, you must be sure to include both +Opal and Opal-JQuery so they'll be available to your application:

          require 'opal'
          +require 'opal-jquery'
          +
          +builder = Opal::Builder.new
          +builder.build('opal')
          +builder.build('opal-jquery')
          +builder.build('./app/application.rb')
          +
          +File.binwrite('application.js', builder.to_s) # must use binary mode for writing
          +

          then simply load the compiled file in your html:

          <!DOCTYPE html>
          +<html>
          +  <head>
          +    <script src='https://code.jquery.com/jquery-3.3.1.min.js' integrity='sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=' crossorigin='anonymous'></script>
          +    <script type='text/javascript' src='./application.js'></script>
          +  </head>
          +  <body></body>
          +</html>
          +

          opal-jquery expects a jquery library to be loaded. This example loads it +remotely from jquery.com, but a locally downloaded copy works just as well, or- +if you're using rails- jquery may be included automatically.

          This example builds opal, opal-jquery and the application into a single .js file, +but you may build them separately, if you so choose. Just remember to include +each respective script in your html!

          +

          How does opal-jquery work

          +

          opal-jquery provides an Element class, whose instances are toll-free +bridged instances of jquery objects. Just like ruby arrays are just javascript +arrays, Element instances are just jquery objects. This makes interaction +with jquery plugins much easier.

          +

          Interacting with the DOM

          + +

          Finding Elements

          +

          opal-jquery provides the Element class, which can be used to find elements in +the current document:

          Element.find('#header')
          +

          Element.find is aliased to Element[]:

          Element['.my-class']
          +

          These methods acts just like $('selector'), and can use any jQuery +compatible selector:

          Element.find('#navigation li:last')
          +

          The result is just a jQuery instance, which is toll-free bridged to +instances of the Element class in ruby:

          Element.find('.foo').class
          +# => Element
          +

          Instances of Element also have the #find method available for +finding elements within the scope of each DOM node represented by +the instance:

          el = Element.find('#header')
          +el.find '.foo'
          +# => #<Element .... >
          +
          +

          Running code on document ready

          +

          Just like jQuery, opal-jquery requires the document to be ready to +be able to fully interact with the page. Any top level access should +use the ready? method:

          Document.ready? do
          +  alert "document is ready to go!"
          +end
          +

          The Kernel#alert method is shown above too.

          +

          Event handling

          +

          The Element#on method is used to attach event handlers to elements:

          Element.find('#header').on :click do
          +  puts "The header was clicked!"
          +end
          +

          Selectors can also be passed as a second argument to handle events +on certain children:

          Element.find('#header').on(:click, '.foo') do
          +  puts "An element with a 'foo' class was clicked"
          +end
          +

          An Event instance is optionally passed to block handlers as well, +which is toll-free bridged to jquery events:

          Element.find('#my_link').on(:click) do |evt|
          +  evt.stop_propagation
          +  puts "stopped the event!"
          +end
          +

          You can access the element which triggered the event by #current_target.

          Document.on :click do |evt|
          +  puts "clicked on: #{evt.current_target}"
          +end
          +
          +

          CSS styles and classnames

          +

          The various jQuery methods are available on Element instances:

          foo = Element.find('.foo')
          +
          +foo.add_class 'blue'
          +foo.remove_class 'foo'
          +foo.toggle_class 'selected'
          +

          There are also added convenience methods for opal-jquery:

          foo = Element.find('#header')
          +
          +foo.class_name
          +# => 'red lorry'
          +
          +foo.class_name = 'yellow house'
          +
          +foo.class_name
          +# => 'yellow house'
          +

          Element#css also exists for getting/setting css styles:

          el = Element.find('#container')
          +el.css 'color', 'blue'
          +el.css 'color'
          +# => 'blue'
          +
          +

          HTTP/AJAX requests

          +

          jQuery's Ajax implementation is also wrapped in the top level HTTP +class.

          HTTP.get("/users/1.json") do |response|
          +  puts response.body
          +  # => "{\"name\": \"Adam Beynon\"}"
          +end
          +

          The block passed to this method is used as the handler when the request +succeeds, as well as when it fails. To determine whether the request +was successful, use the ok? method:

          HTTP.get("/users/2.json") do |response|
          +  if response.ok?
          +    alert "successful!"
          +  else
          +    alert "request failed :("
          +  end
          +end
          +

          It is also possible to use a different handler for each case:

          request = HTTP.get("/users/3.json")
          +
          +request.callback {
          +  puts "Request worked!"
          +}
          +
          +request.errback {
          +  puts "Request didn't work :("
          +}
          +

          The request is actually triggered inside the HTTP.get method, but due +to the async nature of the request, the callback and errback handlers can +be added anytime before the request returns.

          +

          Handling responses

          +

          Web apps deal with JSON responses quite frequently, so there is a useful +#json helper method to get the JSON content from a request:

          HTTP.get("/users.json") do |response|
          +  puts response.body
          +  puts response.json
          +end
          +
          +# => "[{\"name\": \"Adam\"},{\"name\": \"Ben\"}]"
          +# => [{"name" => "Adam"}, {"name" => "Ben"}]
          +

          The #body method will always return the raw response string.

          If an error is encountered, then the #status_code method will hold the +specific error code from the underlying request:

          request = HTTP.get("/users/3.json")
          +
          +request.callback { puts "it worked!" }
          +
          +request.errback { |response|
          +  puts "failed with status #{response.status_code}"
          +}
          +
          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/opal_parser.html b/docs/guides/v1.8.2/opal_parser.html new file mode 100644 index 00000000..61f7bd04 --- /dev/null +++ b/docs/guides/v1.8.2/opal_parser.html @@ -0,0 +1,193 @@ + + + + + + Opal v1.8.2 · Parsing Ruby from JavaScript with `opal-parser` + + + + + + + + + +
          +
          +

          Parsing Ruby from JavaScript with opal-parser

          +

          Generally is best to precompile Ruby source files to JavaScript server-side but sometimes may become useful to be able to compile Ruby to JavaScript directly from JS.

          Opal is able to compile its – pure Ruby – compiler to JavaScript (how cool is that!). The whole compiler chain is available in the stdlib as opal-parser.

          require 'opal-parser'
          +

          Note: For the best performance and application load times, it is strongly recommended to design your application so that it won't need the parser. A lot of methods described in this document are more fun hacks than robust solutions. But if you really want or need to use them, for example so that you can implement a Ruby REPL or an interactive Ruby playground - we have you covered, but for all other cases, we strongly discourage you to take an advice from this guide.

          +

          Features

          + +

          Kernel#eval

          +

          opal-parser provides a partial implementation of Kernel#eval.

          Example:

          require 'opal-parser'
          +eval "puts 'hello world!'"
          +
          +

          Kernel#require_remote

          +

          Will fetch a remote URL (by means of a sync XMLHttpRequest) and evaluate its contents as Ruby code.

          Example:

          require 'opal-parser'
          +require_remote 'http://pastie.org/pastes/10444960/text'
          +HelloWorld.new.say_hello!
          +
          +

          Opal.compile() and Opal.eval() (JavaScript)

          +

          After requiring opal-parser both Opal.compile() and Opal.eval() functions are added to the JavaScript API.

          Opal.compile(string, options) (JavaScript) will forward the call to Opal.compile (Ruby) converting options from a plain JS object to a Ruby Hash. +Opal.eval(string) will compile the given code to JavaScript and then pass it to the native eval() function.

          +

          Support for <script type="text/ruby">

          +

          When opal-parser is required it will search the page for any <script> tag with type text/ruby. +If an src attribute is present will fetch and eval the file with Kernel#require_remote otherwise it will get the script tags contents and eval them with Kernel#eval.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/promises.html b/docs/guides/v1.8.2/promises.html new file mode 100644 index 00000000..d5b95e0d --- /dev/null +++ b/docs/guides/v1.8.2/promises.html @@ -0,0 +1,214 @@ + + + + + + Opal v1.8.2 · Promise + + + + + + + + + +
          +
          +

          Promise

          +

          Promise is a class available in the Opal stdlib for helping structure asynchronous code.

          It can be required inside any Opal applicaton:

          require 'promise'
          +

          Please also take a look at the Asynchronous code guide - we are in the process of modernizing the Promises, along with supporting async/await

          +

          Usage

          +

          This example shows how to use a HTTP request from opal-jquery from a callback style, into a promise style handler.

          def get_json(url)
          +  promise = Promise.new
          +
          +  HTTP.get(url) do |response|
          +    if response.ok?
          +      promise.resolve response.json
          +    else
          +      promise.reject response
          +    end
          +  end
          +
          +  promise
          +end
          +
          +get_json('/users/1.json').then do |json|
          +  puts "Got data: #{json}"
          +end.fail do |res|
          +  alert "It didn't work :( #{res}"
          +end
          +

          A promise can only be resolved or rejected once.

          +

          Chaining Promises

          +

          Promises become useful when chained together. The previous example could be extended to get another object from the result of the first request.

          get_json('/users/1.json').then do |json|
          +  get_json("/posts/#{json[:post_id]}.json")
          +end.then do |post|
          +  puts "got post: #{post}"
          +end
          +
          +

          Composing Promises

          +

          Promise.when can be used to wait for more than 1 promise to resolve (or reject). Lets assume we wanted to get 2 different users:

          first = get_json '/users/1.json'
          +second = get_json '/users/2.json'
          +
          +Promise.when(first, second).then do |user1, user2|
          +  puts "got users: #{user1}, #{user2}"
          +end.fail do
          +  alert "Something bad happened"
          +end
          +
          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/rails.html b/docs/guides/v1.8.2/rails.html new file mode 100644 index 00000000..c3e8fbf1 --- /dev/null +++ b/docs/guides/v1.8.2/rails.html @@ -0,0 +1,247 @@ + + + + + + Opal v1.8.2 · Opal in a Rails application + + + + + + + + + +
          +
          +

          Opal in a Rails application

          +

          Add Opal to your Rails app's Gemfile:

          gem 'opal-rails'
          +
          +

          Basic usage through the asset pipeline

          +

          To configure your asset pipeline to use opal-rails, make sure to bundle install, then rename +app/assets/application.js to app/assets/application.js.rb and set its contents to:

          # app/assets/application.js.rb
          +
          +# Require the opal runtime and core library
          +require 'opal'
          +
          +# For Rails 5.1 and above, otherwise use 'opal_ujs'
          +require 'rails_ujs'
          +
          +# Require of JS libraries will be forwarded to sprockets as is
          +require 'turbolinks'
          +
          +# a Ruby equivalent of the require_tree Sprockets directive is available
          +require_tree '.'
          +

          Opal requires are forwarded to the Asset Pipeline at compile time (similarly to what happens for RubyMotion). You can use either the .rb or .opal extension:

          # app/assets/javascripts/greeter.js.rb
          +
          +puts "G'day world!" # check the console!
          +
          +# Dom manipulation
          +require 'opal-jquery'
          +
          +Document.ready? do
          +  Element.find('body > header').html = '<h1>Hi there!</h1>'
          +end
          +
          +

          As a template

          +

          You can use it for your views too, it even inherits instance and local variables from actions:

          # app/controllers/posts_controller.rb
          +
          +def create
          +  @post = Post.create!(params[:post])
          +  render type: :js, locals: {comments_html: render_to_string(@post.comments)}
          +end
          +

          Each assign is filtered through JSON so it's reduced to basic types:

          # app/views/posts/create.js.opal
          +
          +post = Element.find('.post')
          +post.find('.title').html    = @post[:title]
          +post.find('.body').html     = @post[:body]
          +post.find('.comments').html = comments_html
          +
          +

          As a Haml filter (optional)

          +

          Of course you need to require haml-rails separately since its presence is not assumed

          -# app/views/posts/show.html.haml
          +
          +%article.post
          +  %h1.title= post.title
          +  .body= post.body
          +
          +%a#show-comments Display Comments!
          +
          +.comments(style="display:none;")
          +  - post.comments.each do |comment|
          +    .comment= comment.body
          +
          +:opal
          +  Document.ready? do
          +    Element.find('#show-comments').on :click do |click|
          +      click.prevent_default
          +      click.current_target.hide
          +      Element.find('.comments').effect(:fade_in)
          +    end
          +  end
          +
          +

          Spec!

          +

          Add specs into app/assets/javascripts/spec:

          and then a spec folder with you specs!

          # app/assets/javascripts/spec/example_spec.js.rb
          +
          +describe 'a spec' do
          +  it 'has successful examples' do
          +    'I run'.should =~ /run/
          +  end
          +end
          +

          Then visit /opal_spec from your app and reload at will.

          1 examples, 0 failures

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/releasing.html b/docs/guides/v1.8.2/releasing.html new file mode 100644 index 00000000..a4ca0e12 --- /dev/null +++ b/docs/guides/v1.8.2/releasing.html @@ -0,0 +1,242 @@ + + + + + + Opal v1.8.2 · Releasing + + + + + + + + + +
          +
          +

          Releasing

          +

          This guide is a work-in-progress.

          +
          + +

          Before the release

          +

          All of the following is now covered by bin/rake release:prepare VERSION=v1.2.3

          +
            +
          1. Update the version + +
              +
            • Update lib/opal/version.rb
            • +
            • Update opal/corelib/constants.rb with the same version number along with release dates
            • +
          2. +
          3. Update the changelog + +
              +
            • Ensure all the unreleased changes are documented in UNRELEASED.md
            • +
            • [skip for pre-releases] Run bin/rake changelog VERSION=v1.2.3 specifying the version number you're about to release
            • +
            • [skip for pre-releases] Empty UNRELEASED.md
            • +
          4. +
          5. Commit the updated changelog along with the version bump using this commit message: "Release v1.2.3"
          6. +
          + +
          + +

          Release!

          + +
            +
          • Push the commit to master
          • +
          • Run bin/rake release to release the new version to Rubygems
          • +
          • Go to GitHub releases and create a new release from the latest tag pasting the contents from CHANGELOG.md (or UNRELEASED.md for pre-releases)
          • +
          + +
          + +

          After the release

          + +

          Opal docs

          + +
            +
          • Open opal-docs and run bin/build v1.2.3
          • +
          • Then run bin/deploy
          • +
          + +

          [skip for pre-releases] Opal site

          + +
            +
          • Open opal.github.io and update the opal version in the Gemfile
          • +
          • run bin/build
          • +
          • git push the latest changes
          • +
          + +

          Opal CDN

          + +
            +
          • Run bin/release v1.2.3
          • +
          + +

          [skip for minor-releases] Prepare for the next release

          + +
            +
          • Create a new pull request that: + +
              +
            • Updates a version to v1.x.0.dev in both lib/opal/version.rb and opal/corelib/constants.rb
            • +
          • +
          • Remember to merge that PR before merging anything else next once we decide to not release any more point releases from master.
          • +
          + +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/roda-sprockets.html b/docs/guides/v1.8.2/roda-sprockets.html new file mode 100644 index 00000000..ffd5a856 --- /dev/null +++ b/docs/guides/v1.8.2/roda-sprockets.html @@ -0,0 +1,228 @@ + + + + + + Opal v1.8.2 · Using Opal with Roda and Sprockets + + + + + + + + + +
          +
          +

          Using Opal with Roda and Sprockets

          +

          Add Opal-Sprockets and Roda-Sprockets to your Gemfile (or install using gem):

          # Gemfile
          +gem "opal-sprockets"
          +gem "roda-sprockets"
          +gem "puma"
          +

          Roda-Sprockets uses sprockets as its default build system, so the asset-pipeline +from rails can be mimicked here to map all ruby assets in the /assets +path to be compiled using opal.

          +

          Basic Application

          +
          # config.ru
          +require 'roda'
          +
          +class App < Roda
          +   plugin :sprockets, precompile: %w(application.js),
          +                      prefix: %w(app/),
          +                      opal: true,
          +   plugin :public
          +
          +   route do |r|
          +     r.public
          +     r.sprockets
          +
          +     r.root do
          +       <<~END
          +         <!doctype html>
          +         <html>
          +           <head>
          +             #{ javascript_tag 'application' }
          +             #{ opal_require 'application' }
          +           </head>
          +         </html>
          +       END
          +     end
          +   end     
          +end
          +
          +run App.app
          +

          This creates a sprockets instance under the /assets path, serving Opal assets +from app/ with all the custom opal paths added automatically.

          This env object includes all the opal corelib and stdlib paths. To add +any custom application directories, you must add them to the load path using +Opal.append_path or adding them to the prefix parameter. You can now add +an app/application.rb file into this added path with some basic content:

          # app/application.rb
          +require 'opal'
          +
          +puts "wow, running ruby!"
          +

          It is necessary to require the opal corelib (seen in the require call) above. +This just makes the Opal runtime and corelib available. Then it is possible to +use all the corelib methods and classes, e.g. Kernel#puts as seen above.

          +

          Running Application

          +

          As this is just a simple Roda application, you can run it:

          $ bundle exec rackup
          +

          And point your browser towards http://localhost:9292/ and view the browser +debug console. You should see this message printed.

          +

          Extending the integration

          +

          It's possible to extend this integration, for that please look into the +roda-sprockets documentation

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/rspec.html b/docs/guides/v1.8.2/rspec.html new file mode 100644 index 00000000..aa69bb72 --- /dev/null +++ b/docs/guides/v1.8.2/rspec.html @@ -0,0 +1,226 @@ + + + + + + Opal v1.8.2 · RSpec + + + + + + + + + +
          +
          +

          RSpec

          +

          opal-rspec allows opal to use rspec for running specs in javascript +environments. It comes with built-in support for running rspec with +standard web browser formatters. Also, async spec examples +are supported to reflect browser usage of ruby applications.

          describe User do
          +  it "can be created with a name" do
          +    expect(User.new).to_not be_persisted
          +  end
          +end
          +
          +

          Installation

          +

          Add the opal-rspec gem to your Gemfile:

          # Gemfile
          +gem 'opal'
          +gem 'opal-rspec'
          +
          +

          Running specs

          + +

          In a Browser

          +

          opal-rspec can use sprockets to build and serve specs over a simple rack server. Add the following to a config.ru file:

          # config.ru
          +require 'bundler'
          +Bundler.require
          +
          +sprockets_env = Opal::RSpec::SprocketsEnvironment.new
          +run Opal::Server.new(sprockets: sprockets_env) { |s|
          +  s.main = 'opal/rspec/sprockets_runner'
          +  s.append_path 'spec'
          +  s.debug = false
          +}
          +

          Then run the rack server bundle exec rackup and visit http://localhost:9292 in any web browser.

          +

          Async examples

          +

          opal-rspec adds support for async specs to rspec. These specs are defined using +#async instead of #it:

          describe MyClass do
          +  # normal example
          +  it 'does something' do
          +    expect(:foo).to eq(:foo)
          +  end
          +
          +  # async example
          +  async 'does something else, too' do
          +    # ...
          +  end
          +end
          +

          This just marks the example as running async. To actually handle the async result, +you also need to use a run_async call inside some future handler:

          async 'HTTP requests should work' do
          +  HTTP.get('/users/1.json') do |res|
          +    run_async {
          +      expect(res).to be_ok
          +    }
          +  end
          +end
          +

          The block passed to run_async informs the runner that this spec is finished +so it can move on. Any failures/expectations run inside this block will be run +in the context of the example.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/sinatra.html b/docs/guides/v1.8.2/sinatra.html new file mode 100644 index 00000000..ef640605 --- /dev/null +++ b/docs/guides/v1.8.2/sinatra.html @@ -0,0 +1,227 @@ + + + + + + Opal v1.8.2 · Using Opal with Sinatra + + + + + + + + + +
          +
          +

          Using Opal with Sinatra

          +

          Add Opal-Sprockets to your Gemfile (or install using gem):

          # Gemfile
          +source 'https://rubygems.org'
          +
          +gem 'sinatra'
          +gem 'opal-sprockets'
          +gem 'puma'
          +

          Opal-Sprockets uses sprockets as its default build system, so the asset-pipeline +from rails can be mimicked here to map all ruby assets in the /assets +path to be compiled using opal.

          +

          Basic Application

          +
          # config.ru
          +require 'opal-sprockets'
          +require 'sinatra'
          +
          +opal = Opal::Sprockets::Server.new {|s|
          +  s.append_path 'app'
          +  s.main = 'application'
          +  s.debug = ENV['RACK_ENV'] != 'production'
          +}
          +
          +map '/assets' do
          +  run opal.sprockets
          +end
          +
          +get '/' do
          +  <<-HTML
          +    <!doctype html>
          +    <html>
          +      <head>
          +        #{ Opal::Sprockets.javascript_include_tag('application', debug: opal.debug, sprockets: opal.sprockets, prefix: 'assets/' ) }
          +      </head>
          +    </html>
          +  HTML
          +end
          +
          +run Sinatra::Application
          +

          This creates a simple sprockets instance under the /assets path. Opal +uses a set of load paths to compile assets using sprockets. The +Opal::Environment instance is a simple subclass of Sprockets::Environment +with all the custom opal paths added automatically.

          This env object includes all the opal corelib and stdlib paths. To add +any custom application directories, you must add them to the load path using +env.append_path. You can now add an app/application.rb file into this +added path with some basic content:

          # app/application.rb
          +require 'opal'
          +
          +puts "wow, running ruby!"
          +

          It is necessary to require the opal corelib (seen in the require call) above. +This just makes the Opal runtime and corelib available. Then it is possible to +use all the corelib methods and classes, e.g. Kernel#puts as seen above.

          +

          Running Application

          +

          As this is just a simple sinatra application, you can run it:

          $ bundle exec rackup
          +

          And point your browser towards http://localhost:9292/ and view the browser +debug console. You should see this message printed.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/source_maps.html b/docs/guides/v1.8.2/source_maps.html new file mode 100644 index 00000000..63445325 --- /dev/null +++ b/docs/guides/v1.8.2/source_maps.html @@ -0,0 +1,196 @@ + + + + + + Opal v1.8.2 · Source maps + + + + + + + + + +
          +
          +

          Source maps

          +

          Source maps are available on most environments we support.

          +

          Processor source_map_enabled flag

          +

          To enable sourcemaps in the Sprockets processor you need to turn on the relative flag:

          Opal::Config.source_map_enabled = true # default
          +
          +

          Sprockets debug mode

          +

          The source maps only work with Sprockets in debug mode - this is a limitation of Sprockets.

          +

          Enable source maps

          + +

          Rails

          +

          Rails has debug mode already enabled in development environment with the following line from config/environments/development.rb:

          # Debug mode disables concatenation and preprocessing of assets.
          +# This option may cause significant delays in view rendering with a large
          +# number of complex assets.
          +config.assets.debug = true
          +

          opal-rails also enables sourcemaps in development so with the standard setup you ready to go.

          +

          Sinatra

          +

          You can add Opal::Server as in the official example: sinatra/config.ru.

          +

          Opal::Server

          +

          Opal::Server (which is based on Sprockets) implements sourcemaps and can be used alone or with Rack::Cascade in conjunction with other apps.

          +

          Opal::SimpleServer

          +

          Like Opal::Server, Opal::SimpleServer (which isn't based on Sprockets) implements sourcemaps properly.

          +

          Opal::Builder

          +

          Opal::Builder is a bit lower level and doesn't support source maps by itself. It requires you to call in a specific method to generate them yourself.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/static_applications.html b/docs/guides/v1.8.2/static_applications.html new file mode 100644 index 00000000..1f9d9429 --- /dev/null +++ b/docs/guides/v1.8.2/static_applications.html @@ -0,0 +1,209 @@ + + + + + + Opal v1.8.2 · Static Building + + + + + + + + + +
          +
          +

          Static Building

          +

          opal makes it easy to build static opal applications. Opal uses internal load +paths to make it easy to handle resolving requirements during building. opal +forms the basis of Rails support, so anything you can do there, you can do +standalone as well.

          +

          Overview

          +

          First, install opal adding them to a Gemfile:

          # Gemfile
          +gem "opal"
          +

          Next, we want to add our main app code. Keep all opal code inside app/ +directory, and edit app/application.rb:

          # app/application.rb
          +require "opal"
          +
          +puts "Wow, running opal!"
          +

          You will notice the require "opal" line which will automatically include the +opal runtime and corelib into our output, giving us access to the puts() +method.

          To build this, we need the rake task to add our +app/ directory to the load path, and then to build our target file +application.rb which will be found because it is inside our added load path.

          # Rakefile
          +require 'opal'
          +
          +desc "Build our app to build.js"
          +task :build do
          +  Opal.append_path "app"
          +  File.binwrite "build.js", Opal::Builder.build("application").to_s
          +end
          +

          Now, if you run rake build you will get the build.js output file with our +application compiled, with the opal runtime included as well.

          To run the application, lets create a very simple html file:

          <!DOCTYPE html>
          +<html>
          +  <head>
          +    <script src="build.js"></script>
          +  </head>
          +  <body>
          +  </body>
          +</html>
          +

          Now, open this html file and check the browsers console. You should see our +message printed in the console.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/templates.html b/docs/guides/v1.8.2/templates.html new file mode 100644 index 00000000..1e9a7859 --- /dev/null +++ b/docs/guides/v1.8.2/templates.html @@ -0,0 +1,257 @@ + + + + + + Opal v1.8.2 · Templates with Opal + + + + + + + + + +
          +
          +

          Templates with Opal

          +

          Opal includes support for running erb templates on the client. Haml templates +can also be used via the opal-haml gem.

          +

          Basic Templates

          +

          If you require template.rb from the stdlib, then all compiled templates will +be available on the Template object. Each compiled template will be an +instance of Template, which provides a basic standard rendering api to make +rendering a uniform method on the client.

          For example, to access a template named user:

          require 'template'
          +
          +template = Template['user']
          +context  = User.new('Ford Prefect')
          +
          +puts template.render(context)
          +# => "<div>...</div>"
          +

          #render() will run the template in the given context, and return the result +as a string. This is usually a html string, but it can be used for any dynamic +content.

          +

          Registered Templates

          +

          You can get a quick list of all registered templates using .paths:

          Template.paths
          +# => [#<Template: 'views/user'>, #<Template: 'login'>]
          +

          These names are the keys used to access a template:

          Template['login']
          +# => #<Template: 'login'>
          +
          +

          ERB Templates

          +

          Support for erb templates is built in directly to the opal gem and stdlib. +There is one caveat though when working with sprockets - it must have the +.opalerb file extension, instead of .erb. This is because sprockets has a +built in handler for .erb files.

          If we have the same user class as above, create an app/views/user.opalerb +file:

          <!-- app/views/user.opalerb -->
          +<div class="row">
          +  <div class="col-md-3"><%= self.name %></div>
          +</div>
          +

          Again, you must then require the template (without the .opalerb extension):

          # app/application.rb
          +require 'opal'
          +require 'views/user'
          +

          And then you can access and render the template:

          # app/application.rb
          +
          +template = Template['views/user']
          +user = User.new('Ford Prefect')
          +
          +puts template.render(user)
          +# => "<div class="row">...</div>"
          +
          +

          Haml templates

          +

          opal-haml allows .haml templates to be compiled, just like opal compiles +ruby code, ready to run on the client.

          To get started, add to your Gemfile:

          # Gemfile
          +gem 'opal'
          +gem 'opal-haml'
          +

          opal-haml simply registers the .haml template to be handled under sprockets. +This means, that you can simply require() a haml template in your code.

          Lets say you have the following simple opal app:

          # app/application.rb
          +require 'opal'
          +
          +class User < Struct.new(:name, :age)
          +end
          +

          We want to create an instance of the User class and render it using a haml +template. Lets first create that template as app/views/user.haml:

          -# app/views/user.haml
          +.row
          +  .col-md-6
          +    = self.name
          +  .col-md-6
          +    = self.age
          +

          You are nearly ready to go. Lets create a user instance and render the template +in the context of that user:

          # app/application.rb
          +require 'opal'
          +require 'views/user'
          +
          +class User < Struct.new(:name, :age)
          +end
          +
          +ford = User.new('Ford Prefect', 42)
          +template = Template['views/user']
          +
          +puts template.render(ford)
          +

          Note, when requiring haml templates you do not need to specify the .haml +extension. This code will print the rendered html to the console. If you +check it out, you should see it compiled into something like the following:

          <div class="row">
          +  <div class="col-md-6">
          +    Ford Prefect
          +  </div>
          +  <div class="col-md-6">
          +    42
          +  </div>
          +</div>
          +
          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/unsupported_features.html b/docs/guides/v1.8.2/unsupported_features.html new file mode 100644 index 00000000..41a7e006 --- /dev/null +++ b/docs/guides/v1.8.2/unsupported_features.html @@ -0,0 +1,187 @@ + + + + + + Opal v1.8.2 · Unsupported Features + + + + + + + + + +
          +
          +

          Unsupported Features

          +

          Opal does not support some language/runtime features of ruby. These are documented here when possible, as well as the reasons why they are not supported.

          +

          Mutable Strings

          +

          For performance and ease of runtime features, all strings in Opal are immutable, i.e. #<<, #gsub!, etc. do not exist. Also, symbols are just strings. There is no class, runtime or feature difference between Symbols and Strings. Their syntaxes can be used interchangeably.

          +

          Regexp differences

          +

          We are using JavaScript regular expressions. While we do translate a few of Ruby specific instructions like \A or \z, there are a lot of incompatibilities that you should be aware of - for example $ and ^ don't match newlines like they do in Ruby. Support for features like named matches or lookahead/lookbehind is dependent on the JavaScript environment support for those. To support everything, we would need to compile in the entire Ruby's regular expression engine which is unfeasible at the current time.

          +

          Integer / Float difference

          +

          In Opal, both integers and floats belong to same class Number (using JavaScript native numbers). So 1 / 4 is 0.25 (not 0) and 4.0 / 2 is 2 (not 2.0).

          Number is a subclass of Numeric, like Complex and Rational.

          +

          Encodings

          +

          Encodings only have a very small implementation inside Opal.

          +

          Threads

          +

          JavaScript does not have a native Thread implementation, so they are not present inside Opal. There is a placeholder Thread class just to provide some small level of compatibility with libraries that expect it. It does not have any function.

          +

          Private, Public and Protected methods

          +

          All methods in Opal are defined as public to avoid additional runtime overhead. Module#private and Module#protected exist as just placeholder methods and are no-op methods.

          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/upgrading.html b/docs/guides/v1.8.2/upgrading.html new file mode 100644 index 00000000..05dcdeda --- /dev/null +++ b/docs/guides/v1.8.2/upgrading.html @@ -0,0 +1,183 @@ + + + + + + Opal v1.8.2 · Upgrading from v0.8 to v0.9 + + + + + + + + + +
          +
          +

          Upgrading from v0.8 to v0.9

          + +

          Opal::Processor.load_asset_code deprecated

          +

          Opal::Processor.load_asset_code(sprockets, name) has been deprecated in favor of Opal::Sprockets.load_asset(name, sprockets).

          +

          $console.log instead of pp

          +

          Previously pp would have forwarded the object to JS own console.log but now just prints calling .inspect on it similarly to what p does.

          require 'pp'
          +pp a: 1, b: {c: 3}
          +

          Now:

          require 'console'
          +$console.log a: 1, b: {c: 3}
          +
          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/guides/v1.8.2/using_sprockets.html b/docs/guides/v1.8.2/using_sprockets.html new file mode 100644 index 00000000..2435992c --- /dev/null +++ b/docs/guides/v1.8.2/using_sprockets.html @@ -0,0 +1,229 @@ + + + + + + Opal v1.8.2 · Opal & Sprockets + + + + + + + + + +
          +
          +

          Opal & Sprockets

          +

          The opal-sprockets gem adds sprockets support to Opal, providing a simple +Opal::Sprockets::server class to make it easy to get a rack server up and +running for trying out opal. This server will automatically recompile ruby +sources when they change, meaning you just need to refresh your page to autorun.

          +

          Getting setup

          +

          Add rack & opal-sprockets to your Gemfile:

          #Gemfile
          +source 'https://rubygems.org'
          +
          +gem 'rack'
          +gem 'opal-sprockets'
          +

          And install with bundle install.

          We need a directory to hold our opal code, so create app/ and add a simple +demo script to app/application.rb:

          # app/application.rb
          +require 'opal'
          +
          +puts "hello world"
          +

          If we do not provide an HTML index, sprockets will generate one automatically; +however, it is often useful to override the default with a custom erb file:

          <%# index.erb %>
          +<!DOCTYPE html>
          +<html>
          +  <head>
          +    <meta charset="utf-8">
          +    <title>opal server example</title>
          +    <%= javascript_include_tag @server.main %>
          +  </head>
          +  <body>
          +    you've reached the custom index!
          +  </body>
          +</html>
          +
          +

          Using Opal::Server

          +

          Opal::Server can be run like any rack app, so just add a config.ru file:

          # config.ru
          +require 'opal-sprockets'
          +
          +run Opal::Server.new { |s|
          +  s.append_path 'app'
          +
          +  s.main = 'application'
          +
          +  # override the default index with our custom index
          +  s.index_path = 'index.erb'
          +}
          +

          This rack app simply adds our app/ directory to opal load path, and sets our +main file to application, which will be found inside app/.

          +

          Running the app

          +

          Run bundle exec rackup and visit the page http://localhost:9292 in any +browser. Observe the console to see the printed statement.

          You can just change app/application.rb and refresh the page to see any changes.

          +

          Using an existing sprockets instance

          +

          We only need to append Opal paths to the existing sprockets instance.

          require 'sprockets'
          +environment = Sprockets::Environment.new
          +
          +require 'opal'
          +Opal.paths.each do |path|
          +  environment.append_path path
          +end
          +
          +

          + You're encouraged to help improve the quality of this guide. + Please contribute if you see any typos, factual errors, or missing information.
          + To get started, head to the docs folder in the main repo. +
          + +
          + + + + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html index 1e53204d..8ee5e4a2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -47,11 +47,11 @@

          Opal · Documentation Central

          -

          v1.8.1 stable

          +

          v1.8.2 stable

          See the full Changelog to see what's new

          - API Docs - Guides + API Docs + Guides

          @@ -60,14 +60,14 @@

          All versions

          diff --git a/index.html b/index.html index cf540a8f..a219f426 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
        • - -v1.8.1 + +v1.8.2
        • diff --git a/javascripts/application.js b/javascripts/application.js index f51279a5..f9324299 100644 --- a/javascripts/application.js +++ b/javascripts/application.js @@ -1,4 +1,4 @@ -Opal.queue(function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.queue(function(Opal) {/* Generated by Opal 1.8.2 */ var $send = Opal.send, $gvars = Opal.gvars, self = Opal.top, nil = Opal.nil; if ($gvars.$ == null) $gvars.$ = nil; diff --git a/javascripts/load-parser.js b/javascripts/load-parser.js index 78ea8473..553da400 100644 --- a/javascripts/load-parser.js +++ b/javascripts/load-parser.js @@ -1,4 +1,4 @@ -Opal.queue(function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.queue(function(Opal) {/* Generated by Opal 1.8.2 */ var $gvars = Opal.gvars, self = Opal.top, $nesting = [], $$ = Opal.$r($nesting), nil = Opal.nil; if ($gvars.$ == null) $gvars.$ = nil; diff --git a/javascripts/try.js b/javascripts/try.js index d2d093d9..2912b5fb 100644 --- a/javascripts/try.js +++ b/javascripts/try.js @@ -1,4 +1,4 @@ -Opal.queue(function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.queue(function(Opal) {/* Generated by Opal 1.8.2 */ var $klass = Opal.klass, $def = Opal.def, $lambda = Opal.lambda, $slice = Opal.slice, $send = Opal.send, $gvars = Opal.gvars, $truthy = Opal.truthy, $to_a = Opal.to_a, $ensure_kwargs = Opal.ensure_kwargs, $hash_get = Opal.hash_get, $a, $b, self = Opal.top, $nesting = [], $$ = Opal.$r($nesting), nil = Opal.nil; if ($gvars.$ == null) $gvars.$ = nil; if ($gvars["try"] == null) $gvars["try"] = nil; diff --git a/javascripts/try/examples b/javascripts/try/examples index 94594581..de7d01c1 100644 --- a/javascripts/try/examples +++ b/javascripts/try/examples @@ -1,4 +1,4 @@ -Opal.queue(function(Opal) {/* Generated by Opal 1.8.1 */ +Opal.queue(function(Opal) {/* Generated by Opal 1.8.2 */ var $const_set = Opal.const_set, $send = Opal.send, $a, $nesting = [], $$ = Opal.$r($nesting), nil = Opal.nil; Opal.add_stubs('[]='); diff --git a/libraries/index.html b/libraries/index.html index 5228c72f..e616408d 100644 --- a/libraries/index.html +++ b/libraries/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
        • - -v1.8.1 + +v1.8.2
        • diff --git a/license/index.html b/license/index.html index e6b871c5..dafa9795 100644 --- a/license/index.html +++ b/license/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
        • - -v1.8.1 + +v1.8.2
        • diff --git a/try/index.html b/try/index.html index fa505e47..60caf46c 100644 --- a/try/index.html +++ b/try/index.html @@ -9,7 +9,7 @@ - @@ -62,8 +62,8 @@
        • - -v1.8.1 + +v1.8.2
        • @@ -83,9 +83,9 @@
          - -