;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\303\304\305\"\207" [require ob org-macs add-to-list org-babel-tangle-lang-exts ("ruby" . "rb")] 3) (defvar org-babel-default-header-args:ruby nil) #@113 Name of command to use for executing ruby code. It's possible to override it by using a header argument `:ruby' (defvar org-babel-ruby-command "ruby" (#$ . 595)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \210\300\316\302\303\317DD\320\306\307\310\311\312\321\314\322& \207" [custom-declare-variable org-babel-ruby-hline-to funcall function #[0 "\300\207" [#1="nil"] 1 #1#] "Replace hlines in incoming tables with this when translating to ruby." :group org-babel :version "24.4" :package-version (Org . "8.0") :type string org-babel-ruby-nil-to #[0 "\300\207" [hline] 1] "Replace nil in ruby tables with this before returning." (Org . "8.0") symbol] 12) #@118 Execute a block of Ruby code with Babel. This function is called by `org-babel-execute-src-block'. (fn BODY PARAMS) (defalias 'org-babel-execute:ruby #[514 "\301\302\236A\"\303\236A\304\236A\305\236A\206\306\307!#\310\235\203P\311\312!r\211q\210\313\314\315\316\317!\320\"\321$\216\322\323!\210c\210\324\325\236A!\210\326 *\262\202W\327$\330\331\235?\205\251\332\235\204\242\333\235\204\242\334\235\204\242\335\235\204\242\336\235\204\242\337\235\204\242\340\235\204\234\341\235\204\234\342\235\204\234\343\235\203\246\344\235\204\246\202\251\345!\262\346\347 \236A\350\n\236A\"\346\351\n\236A\352 \236A\"#)\207" [org-babel-ruby-command org-babel-ruby-initiate-session :session :result-params :result-type :ruby org-babel-expand-body:generic org-babel-variable-assignments:ruby "xmp" generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 require rcodetools xmp :xmp-option buffer-string org-babel-ruby-evaluate org-babel-reassemble-table "none" "scalar" "verbatim" "html" "code" "pp" "file" "output" "raw" "org" "drawer" "table" org-babel-ruby-table-or-string org-babel-pick-name :colname-names :colnames :rowname-names :rownames] 14 (#$ . 1285)]) #@93 Prepare SESSION according to the header arguments specified in PARAMS. (fn SESSION PARAMS) (defalias 'org-babel-prep-session:ruby #[514 "\301!\302!\303!\204\304\305\"\210\306 \307\310\311\312\313!\314\"\315$\216rq\210\212\316\317\320!\210db\210\321\307\322\323\312\313!\324\"\325\326%\"\210,\210\207" [comint-input-filter org-babel-ruby-initiate-session org-babel-variable-assignments:ruby org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] sit-for 0.5 mapc 257 "\211c\210\301\302\303\"\210\304\300!\210\305\306!\210db\207" [comint-send-input nil t org-babel-comint-wait-for-output sit-for 0.1] 4 "\n\n(fn VAR)"] 12 (#$ . 2566)]) #@51 Load BODY into SESSION. (fn SESSION BODY PARAMS) (defalias 'org-babel-load-session:ruby #[771 "\300 \301\302\303\304\305!\306\"\307$\216\310\"r\211q\210\311\312p!!b\210\313!c\210)\211\262)\207" [current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 org-babel-prep-session:ruby process-mark get-buffer-process org-babel-chomp] 10 (#$ . 3382)]) #@78 Return list of ruby statements assigning the block's variables. (fn PARAMS) (defalias 'org-babel-variable-assignments:ruby #[257 "\300\301\302!\"\207" [mapcar #[257 "\300\301@\302A!#\207" [format "%s=%s" org-babel-ruby-var-to-ruby] 6 "\n\n(fn PAIR)"] org-babel--get-vars] 5 (#$ . 3789)]) #@143 Convert VAR into a ruby variable. Convert an elisp value into a string of ruby source code specifying a variable of the same value. (fn VAR) (defalias 'org-babel-ruby-var-to-ruby #[257 "\211<\203\301\302\303\304#\305Q\207\211\306=\203\207\307\310\"\207" [org-babel-ruby-hline-to "[" mapconcat org-babel-ruby-var-to-ruby ", " "]" hline format "%S"] 6 (#$ . 4088)]) #@180 Convert RESULTS into an appropriate elisp value. If RESULTS look like a table, then convert them into an Emacs-lisp table, otherwise return the results as a string. (fn RESULTS) (defalias 'org-babel-ruby-table-or-string #[257 "\300!\211<\203\301\302\"\202\211\207" [org-babel-script-escape mapcar #[257 "\211\204\207\207" [org-babel-ruby-nil-to] 2 "\n\n(fn EL)"]] 5 (#$ . 4467)]) #@168 Initiate a ruby session. If there is not a current inferior-process-buffer in SESSION then create one. Return the initialized session. (fn &optional SESSION PARAMS) (defalias 'org-babel-ruby-initiate-session #[512 "\302\230?\205f\303\304!\210\305\236\206\306 \"A\307\310\311\"!\211\206O\312 \313\314\315\316\317!\320\"\321$\216\322\323!\203: \202;\206A\324?\205I\325 #\210p)\262\326!\203]\327\330!\210\211\202d\327\331!\210\332!\266\203\207" [inf-ruby-default-implementation inf-ruby-implementations "none" require inf-ruby :ruby assoc get-buffer format "*%s*" current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 run-ruby-or-pop-to-buffer functionp "ruby" inf-ruby-buffer org-babel-comint-buffer-livep sit-for 0.25 0.5 org-babel-ruby-initiate-session] 11 (#$ . 4864)]) #@51 String to indicate that evaluation has completed. (defvar org-babel-ruby-eoe-indicator ":org_babel_ruby_eoe" (#$ . 5720)) (defvar org-babel-ruby-f-write "File.open('%s','w'){|f| f.write((_.class == String) ? _ : _.inspect)}") (defvar org-babel-ruby-pp-f-write "File.open('%s','w'){|f| $stdout = f; pp(results); $stdout = orig_out}") (defvar org-babel-ruby-wrapper-method "\ndef main()\n%s\nend\nresults = main()\nFile.open('%s', 'w'){ |f| f.write((results.class == String) ? results : results.inspect) }\n") (defvar org-babel-ruby-pp-wrapper-method "\nrequire 'pp'\ndef main()\n%s\nend\nresults = main()\nFile.open('%s', 'w') do |f|\n $stdout = f\n pp results\nend\n") #@281 Pass BODY to the Ruby process in BUFFER. If RESULT-TYPE equals `output' then return a list of the outputs of the statements in BODY, if RESULT-TYPE equals `value' then return the value of the last statement in BODY, as elisp. (fn BUFFER BODY &optional RESULT-TYPE RESULT-PARAMS) (defalias 'org-babel-ruby-evaluate #[1026 "\2046\306=\203\307\"\207\310=\2034\311\312!\307\313\314\235\203% \202&\n\315\316\"#\"\210\317!\207\320\207\306=\203\241\313\321 \"\322!\204L\323\324\"\210\325 \326\327\330\331\332!\333\"\334$\216rq\210\212\335\336C\326\337\340\331\332!\341\"\342\343% B\320\344\345p!!b\210`d{\262|\266c\210\346\320\347\"\210@b\210\212\350\351 !\320\347#\205\243\350A\320\347#)\204\260\352\345p!!\210\202\216\344\345p!!b\210\211c\210\203\332\353\354\355\356\351\206\311\336!#\242\"\203\332\211\242\327\225\320O\240\210\357\242A\"\210)\266,\210\360\361\362\357\360\363\322 !\204\371\323\324\f\"\210\325 \326\327\330\331\332!\364\"\334$\216r q\210\212\365\336C\326\337\340\331\332!\341\"\342\343% B\320\344\345p!!b\210`d{\262|\266\366\367\370\371F\"\210@b\210\212\350\351 !\320\347#\205T\350A\320\347#)\204a\352\345p!!\210\202?\344\345p!!b\210\211c\210\f\203\214\353\354\355\356\351\206{\336!#\242\"\203\214\211\242\327\225\320O\240\210\357\242A\")\266\202,\262\355#\372\"\342\"\355#\207\310=\203\233\311\312!\373\235\206\263\314\235\322!\204\300\323\324\"\210\325 \326\327\330\331\332!\374\"\334$\216rq\210\212\375\336C\326\337\340\331\332!\341\"\342\343% B\320\344\345p!!b\210`d{\262|\266\203\376c\210\346\320\347\"\210\366\377\201D\nC\204!\313B\315 \316\"\"C\2024\201E\201F\201G\313C\315\316\"\"F C#\"\210\346\320\347\"\210@b\210\212\350\351 !\320\347#\205S\350A\320\347#)\204`\352\345p!!\210\202>\344\345p!!b\210\211c\210\203\213\353\354\355\356\351\f\206z\336!#\242\"\203\213\211\242\327\225\320O\240\210\357\242A\"\210)\266,\210\317!\207\320\207" [org-babel-ruby-command org-babel-ruby-pp-wrapper-method org-babel-ruby-wrapper-method org-babel-ruby-eoe-indicator comint-input-filter comint-output-filter-functions output org-babel-eval value org-babel-temp-file "ruby-" format "pp" org-babel-process-file-name noquote org-babel-eval-read-file nil "puts \"%s\"" org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] "" 257 "\300\211\242P\240\207" [] 4 "\n\n(fn TEXT)" process-mark get-buffer-process comint-send-input t re-search-forward regexp-quote accept-process-output string-match replace-regexp-in-string "\n" "[ \n]+" split-string mapconcat identity butlast org-trim [set-match-data evaporate] #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] mapc #[257 "\300!c\210\301\302\303\"\207" [org-babel-chomp comint-send-input nil t] 4 "\n\n(fn LINE)"] "conf.echo=false;_org_prompt_mode=conf.prompt_mode;conf.prompt_mode=:NULL" "conf.prompt_mode=_org_prompt_mode;conf.echo=true" "[ \n]" "code" [set-match-data evaporate] #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] "require 'pp';" #[257 "\300!c\210\301\302\303\"\207" [org-babel-chomp comint-send-input nil t] 4 "\n\n(fn LINE)"] comint-last-input-end comint-prompt-regexp org-babel-ruby-f-write org-babel-ruby-pp-f-write append "results=_" "require 'pp'" "orig_out = $stdout"] 21 (#$ . 6398)]) (provide 'ob-ruby)