bin/translate in google-translate-0.8.3 vs bin/translate in google-translate-0.8.4
- old
+ new
@@ -23,15 +23,19 @@
def print_languages list, title
puts title
puts list.join(', ')
end
- def display text
+ def display result
+ r1, r2 = *result
+
if RUBY_PLATFORM =~ /mswin32/
- File.open("temp.txt", "w") {|f| f.write text }
- %x[notepad temp.txt]
+ # File.open("temp.txt", "w") {|f| f.write text }
+ # %x[notepad temp.txt]
+
+ puts (r2.empty? ? r1 : r2 )
else
- puts text
+ puts r1
end
end
def run
if(ARGV.size == 0)