yandex-dictionary 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/lib/.yandex_dictionary.rb.swp +0 -0
- data/lib/yandex_dictionary.rb +4 -4
- data/lib/yandex_dictionary/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c392d3b9c2caa2a456e24749a7766247b23eb71
|
|
4
|
+
data.tar.gz: 91746fc7ca97a0c7919d201a5e60d19d7ca269fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2281aa71ab5371e0012d863d0b9a1d4a16f7674b96cc0c54792884a3101d184d005e67a3ba4ebfcf5d0c8352f5b4dfbdbb2916b2febee212d25c832b19644e4
|
|
7
|
+
data.tar.gz: 101fb555eb0ad537840461598e64a6f05ad411444c030bd393449c912ad40c3b7b92bb0b4c7f8e285dd3c67f609b3c3edf9b7cdb6d8811fa0090676886e8d980
|
|
Binary file
|
data/lib/yandex_dictionary.rb
CHANGED
|
@@ -12,17 +12,17 @@ module Yandex::Dictionary
|
|
|
12
12
|
|
|
13
13
|
# List of translation directions.
|
|
14
14
|
def get_langs
|
|
15
|
-
visit
|
|
15
|
+
visit('/getLangs').to_a
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
# Search word or phrase. Return dictionary entry.
|
|
19
19
|
def lookup(text, *lang)
|
|
20
|
-
options = {
|
|
21
|
-
visit('/lookup', options)
|
|
20
|
+
options = { text: text, lang: lang.join('-') }
|
|
21
|
+
visit('/lookup', options)['def']
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def visit(address, options = {})
|
|
25
|
-
responce = get
|
|
25
|
+
responce = get address, query: options.merge(key: api_key)
|
|
26
26
|
check_errors(responce) unless responce.code == 200
|
|
27
27
|
responce
|
|
28
28
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yandex-dictionary
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergey Smagin
|
|
@@ -30,6 +30,7 @@ executables: []
|
|
|
30
30
|
extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
|
32
32
|
files:
|
|
33
|
+
- lib/.yandex_dictionary.rb.swp
|
|
33
34
|
- lib/yandex_dictionary.rb
|
|
34
35
|
- lib/yandex_dictionary/version.rb
|
|
35
36
|
homepage: https://github.com/s-mage/yandex-dictionary
|