Permalink
Browse files

add-inns

  • Loading branch information...
1 parent e56022b commit e9bec48c5f6be526414cdf9a3759ba12af685547 prikha committed Sep 28, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 lib/dickens.rb
View
@@ -39,15 +39,20 @@ class StarDict
class << self
def find(word)
word.to_s
- invoke(word)
+ command = [@@executable, prepare_options, word].join(" ")
+ invoke(command).join
+ end
+
+ def list
+ command = [@@executable, "--list-dicts"].join(" ")
+ puts invoke(command)
end
protected
- def invoke(word)
- command = [@@executable, prepare_options, word].join(" ")
+ def invoke(command)
stdin, stdout, stderr = Open3.popen3(command)
- return stdout.readlines.join
+ return stdout.readlines
end
def prepare_options

0 comments on commit e9bec48

Please sign in to comment.