yandex-translator-api 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +4 -6
- data/lib/yandex/translator.rb +2 -2
- data/lib/yandex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f4b1bdcb3caa7e79e5debce7faf671cbe7f7db
|
4
|
+
data.tar.gz: 05b5cfec72eaa8ccfcb2830bc43a5dee11eab241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a2209a2e80482dffff70bb557d28a488320ac4cff0d05d207400317b39d80526eeafd1916bdafa33132b445ea09dcad75d595d7ed58c6163fc2399e129c0070
|
7
|
+
data.tar.gz: 412c3a1c025e1ea7924bcb032e53f339a460724cb210aed7ea4c561362ccbef47cdcbe83c24dc5ec4344a069866322e31781a7dcf3587b35051e25045a2bf8e7
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
# Yandex
|
1
|
+
# Yandex Translator API
|
2
2
|
|
3
3
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/yandex`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
10
8
|
|
11
9
|
```ruby
|
12
|
-
gem 'yandex'
|
10
|
+
gem 'yandex-translator-api'
|
13
11
|
```
|
14
12
|
|
15
13
|
And then execute:
|
@@ -18,7 +16,7 @@ And then execute:
|
|
18
16
|
|
19
17
|
Or install it yourself as:
|
20
18
|
|
21
|
-
$ gem install yandex
|
19
|
+
$ gem install yandex-translator-api
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
@@ -32,7 +30,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
30
|
|
33
31
|
## Contributing
|
34
32
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kortirso/yandex-translator-api.
|
36
34
|
|
37
35
|
|
38
36
|
## License
|
data/lib/yandex/translator.rb
CHANGED
@@ -14,7 +14,7 @@ module Yandex
|
|
14
14
|
|
15
15
|
attr_reader :api_key, :base_uri
|
16
16
|
|
17
|
-
def initialize(api_key =
|
17
|
+
def initialize(api_key = '')
|
18
18
|
@api_key = api_key
|
19
19
|
@base_uri = 'https://translate.yandex.net/api/v1.5/tr.json'
|
20
20
|
end
|
@@ -28,7 +28,7 @@ module Yandex
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def http_request(address, args)
|
31
|
-
uri = URI("#{base_uri}
|
31
|
+
uri = URI("#{base_uri}#{address}")
|
32
32
|
req = Net::HTTP::Post.new(uri)
|
33
33
|
req.set_form_data(args.merge(key: api_key))
|
34
34
|
Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
|
data/lib/yandex/version.rb
CHANGED