dict 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,13 +57,18 @@ Search WORD in dict, an open source dictionary aggregator.
57
57
  def clean_translation(opts, word)
58
58
  translation = get_translations(opts, word)
59
59
  string = String.new
60
- string = string + word + " : "
60
+ string += word + " : "
61
61
  if opts.dict?
62
62
  translation[word].each { |x| string << x << ", " }
63
63
  else
64
- Dict.available_dictionaries.each do |x|
65
- translation[x][word].each { |x| string << x << ", " }
64
+ begin
65
+ Dict.available_dictionaries.each do |x|
66
+ translation[x][word].each { |y| string << y << ", " }
67
+ end
68
+ rescue NoMethodError
69
+ return "No translation found."
66
70
  end
71
+
67
72
  end
68
73
  2.times { string.chop! }
69
74
  string
data/lib/dict/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dict
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -186,4 +186,12 @@ rubygems_version: 1.8.24
186
186
  signing_key:
187
187
  specification_version: 3
188
188
  summary: Gem made for dictionary application
189
- test_files: []
189
+ test_files:
190
+ - spec/dict/lib_dict_cli_runner_spec.rb
191
+ - spec/dict/lib_dict_spec.rb
192
+ - spec/dict/lib_wiktionary_spec.rb
193
+ - spec/dict/spec_helper.rb
194
+ - spec/dict/vcr_cassettes/translations_slownik_cassette.yml
195
+ - spec/dict/vcr_cassettes/wiktionary_translations_field_cassette.yml
196
+ - spec/dict/vcr_cassettes/wiktionary_translations_samochod_cassette.yml
197
+ - spec/dict/vcr_setup.rb