Browse Source

fixed bug with exportation of ruby arrays

Eric Schulte 16 years ago
parent
commit
64e01ac324
3 changed files with 11 additions and 3 deletions
  1. 3 1
      litorgy/litorgy-script.el
  2. 2 2
      rorg.org
  3. 6 0
      test-export.org

+ 3 - 1
litorgy/litorgy-script.el

@@ -48,7 +48,7 @@ automatically generated wrapper for `litorgy-script-execute'.")
 def main
 %s
 end
-puts main
+puts main().inspect
 ")
 
 (defvar litorgy-script-python-wrapper-method
@@ -89,7 +89,9 @@ executed through litorgy."
                 (format "\t%s\n" line))
               (butlast body-lines) "\n")
              (format "\treturn %s\n" (car (last body-lines)))))))
+        ;; (message (buffer-substring (point-min) (point-max))) ;; debug script
         (shell-command-on-region (point-min) (point-max) cmd nil 'replace)
+        ;; (message (buffer-string)) ;; debug results
         (litorgy-script-table-or-results (buffer-string))))))
 
 (defun litorgy-script-var-to-ruby/python (var)

+ 2 - 2
rorg.org

@@ -229,14 +229,14 @@ following message =no result returned by source block=.
 
 ** TODO ruby arrays not recognized as such
 
-Something is wrong in [[file:litorgy/ligorgy-script.el]] related to the
+Something is wrong in [[file:litorgy/litorgy-script.el]] related to the
 recognition of ruby arrays as such.
 
 #+begin_src ruby :results replace
 [1, 2, 3, 4]
 #+end_src
 
-: 1
+| 1 | 2 | 3 | 4 |
 
 #+begin_src python :results replace
 [1, 2, 3, 4]

+ 6 - 0
test-export.org

@@ -33,6 +33,12 @@ This is a source block, and lets see the results
 :the_results
 #+end_src
 
+lets see the source, and results for a ruby array
+#+begin_src ruby :results replace
+[1, 2, 3, 4].map{ |n| n * 2 }
+#+end_src
+
+
 ** emacs-lisp
 
 a table