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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f544c04c012e4c0525bcbadfb5d190a52d9e07ee
4
- data.tar.gz: 76beab7394e926599f29ed974c369a346000b372
3
+ metadata.gz: c0f4b1bdcb3caa7e79e5debce7faf671cbe7f7db
4
+ data.tar.gz: 05b5cfec72eaa8ccfcb2830bc43a5dee11eab241
5
5
  SHA512:
6
- metadata.gz: 2f16aa6a388cdc92b692fa6ddde94dcdd3cb0af5f0be8165655d7e07ea7a7accd81047c63f69f94a5e22a386f72e5e857b8587359a24fccaaffb6d29e845bf76
7
- data.tar.gz: f071c16319ef2742291d9c17c60654fd1833af7ddcebeb8aa86ce66bc49f6a6c8e2f7e85b17e661f28e3d0c073a99950643bccd3de93659eb9f0f44c464cbe34
6
+ metadata.gz: 3a2209a2e80482dffff70bb557d28a488320ac4cff0d05d207400317b39d80526eeafd1916bdafa33132b445ea09dcad75d595d7ed58c6163fc2399e129c0070
7
+ data.tar.gz: 412c3a1c025e1ea7924bcb032e53f339a460724cb210aed7ea4c561362ccbef47cdcbe83c24dc5ec4344a069866322e31781a7dcf3587b35051e25045a2bf8e7
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  group :test do
4
4
  gem 'rspec'
5
+ gem 'webmock'
5
6
  end
6
7
 
7
8
  gemspec
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/[USERNAME]/yandex.
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
@@ -14,7 +14,7 @@ module Yandex
14
14
 
15
15
  attr_reader :api_key, :base_uri
16
16
 
17
- def initialize(api_key = nil)
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}/#{address}")
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) }
@@ -1,3 +1,3 @@
1
1
  module Yandex
2
- VERSION = '0.9.1'
2
+ VERSION = '0.9.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yandex-translator-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Bogdanov