branch: elpa/inf-ruby
commit 781d677941855f13d980536cde0367819c80d35d
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>

    Use call-process-shell-command instead of splitting right after concat
    
    Seems more straightforward.
    
    #190
---
 inf-ruby.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 5d7aef2685..b79a18f49d 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -122,7 +122,12 @@ So when used it must include %s.  Set to nil to disable."
 WITH-BUNDLER, the command is wrapped with `bundle exec'."
   (let* ((command (format (or inf-ruby-wrapper-command "%s")
                           (concat (when with-bundler "bundle exec ") "irb 
-v")))
-         (output (car (last (apply #'process-lines (split-string-and-unquote 
command)))))
+         (output
+          (with-output-to-string
+            (let ((status (call-process-shell-command command nil
+                                                      standard-output)))
+              (unless (eql status 0)
+                (error "%s exited with status %s" command status)))))
          (fields (split-string output "[ (]")))
     (if (equal (car fields) "irb")
         (version<= "1.2.0" (nth 1 fields))

Reply via email to