dict 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/translate +13 -6
  2. metadata +1 -1
data/bin/translate CHANGED
@@ -10,17 +10,24 @@ opts = Slop.parse do
10
10
  banner "Usage: $translate -w word [Options]"
11
11
  on '-w', :word=, 'after this option is a word to translate'
12
12
  on '-h', :help=, 'help', :argument => :optional
13
- on '-t', :time=, 'time in seconds, default: 300 seconds', :as => :int
14
- on '-d', :dict=, 'dictionaries: all, wiki etc., default is all dictionaries'
15
- on '-s', :status=, 'status of API', :argument => :optional
13
+ on '-s', :services=, 'available services', :argument => :optional
14
+ #on '-t', :time=, 'time in seconds, default: 300 seconds', :as => :int
15
+ on '-d', :dict=, 'dictionaries: wiktionary, dictpl; default is all dictionaries'
16
16
  end
17
17
 
18
18
  # translation
19
- puts Dict::Translation.get_response(opts[:word], opts[:time] || 300, opts[:dict] || "all") if opts.word?
19
+ if opts.word?
20
+ if opts.dict?
21
+ puts Dict.get_single_dictionary_translations(opts[:word],opts[:dict])
22
+ else
23
+ puts Dict.get_all_dictionaries_translations(opts[:word])
24
+ end
25
+ end
20
26
 
21
27
  # help
22
28
  puts opts if opts.help?
23
29
 
24
- # status
25
- puts Dict::Translation.status if opts.status?
30
+ # services
31
+ puts Dict.available_services if opts.services?
32
+
26
33
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: