%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/org/ |
Current File : //usr/local/share/emacs/27.2/lisp/org/ob-ruby.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; 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 "\2040 \306\267\202. \307\"\207\310\311!\307\312\313\235\203 \202 \n\314\315\"#\"\210\316!\207\317\207\320\267\202\221\312\321\"\322!\204F \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\317\344\345p!!b\210`d{\262|\266c\210\346\317\347\"\210@b\210\212\350\351!\317\347#\205\235 \350A\317\347#)\204\252 \352\345p!!\210\202\210 \344\345p!!b\210\211c\210\203\324 \353\354\355\356\351\206\303 \336!#\242\"\203\324 \357\242\327\225\"\240\210\360\242A\"\210)\266,\210\361\362\363\360\361\364\322!\204\363 \323\324\f\"\210\325 \326\327\330\331\332!\365\"\334$\216rq\210\212\366\336C\326\337\340\331\332!\341\"\342\343% B\317\344\345p!!b\210`d{\262|\266\367\370\371\372F\"\210@b\210\212\350\351!\317\347#\205N\350A\317\347#)\204[\352\345p!!\210\2029\344\345p!!b\210\211c\210\f\203\206\353\354\355\356\351\206u\336!#\242\"\203\206\357\242\327\225\"\240\210\360\242A\")\266\202,\262\355#\373\"\342\"\355#\207\310\311!\374\235\206\247\313\235\322!\204\264\323\324\"\210\325 \326\327\330\331\332!\375\"\334$\216rq\210\212\376\336C\326\337\340\331\332!\341\"\342\343% B\317\344\345p!!b\210`d{\262|\266\203\373\377c\210\346\317\347\"\210\367\201D \201E \nC\204\312B\314\315\"\"C\202*\201F \201G \201H \312C\314\315\"\"FC#\"\210\346\317\347\"\210@b\210\212\350\351!\317\347#\205I\350A\317\347#)\204V\352\345p!!\210\2024\344\345p!!b\210\211c\210\203\201\353\354\355\356\351\f\206p\336!#\242\"\203\201\357\242\327\225\"\240\210\360\242A\"\210)\266,\210\316!\207\317\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 #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (output 10 value 15)) org-babel-eval org-babel-temp-file "ruby-" format "pp" org-babel-process-file-name noquote org-babel-eval-read-file nil #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (output 54 value 411)) "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]+" substring 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';" comint-last-input-end comint-prompt-regexp org-babel-ruby-f-write org-babel-ruby-pp-f-write #[257 "\300!c\210\301\302\303\"\207" [org-babel-chomp comint-send-input nil t] 4 "\n\n(fn LINE)"] append "results=_" "require 'pp'" "orig_out = $stdout"] 21 (#$ . 6398)]) (provide 'ob-ruby)