lib/opener/constituent_parsers/de.rb in opener-constituent-parser-de-1.0.2 vs lib/opener/constituent_parsers/de.rb in opener-constituent-parser-de-1.1.0
- old
+ new
@@ -50,35 +50,21 @@
##
# Runs the command and returns the output of STDOUT, STDERR and the
# process information.
#
# @param [String] input The input to process.
- # @return [Array]
+ # @return [String]
#
def run(input)
unless File.file?(kernel)
raise "The Python kernel (#{kernel}) does not exist"
end
- return Open3.capture3(command, :stdin_data => input)
- end
+ stdout, stderr, process = Open3.capture3(command, :stdin_data => input)
- ##
- # Runs the command and takes care of error handling/aborting based on the
- # output.
- #
- # @see #run
- #
- def run!(input)
- stdout, stderr, process = run(input)
+ raise stderr unless process.success?
- if process.success?
- puts stdout
-
- STDERR.puts(stderr) unless stderr.empty?
- else
- abort stderr
- end
+ return stdout
end
protected
##