merriam 1.0.2 → 1.0.3

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: b3d0f6163b601510852a32e3757cac87cd68ca90
4
- data.tar.gz: c5437f9d343a80507c74ff8ba7d45a4c0044106b
3
+ metadata.gz: 54b73cd2aff871d75ec03b678e5dcb3c7337d672
4
+ data.tar.gz: 276060eb1540c64f52b9a2280cf51ec74ba356d2
5
5
  SHA512:
6
- metadata.gz: 1a0ae9cb8a61a23a5c9c367ea831752a3155f012f7c61f79abb675b01cc398b06408f939eb8547e553123be8c84bd04ac941e6d317e120f0978b9a45bc5a3bc7
7
- data.tar.gz: edbf194ee8947d24528a4b73424facbdddf9f4ea7c8f6d683bbb27ffc3946da0b43d566c774a20bcbb0a77296bbe08685d26a948079d6edb89c6e7edb62e563e
6
+ metadata.gz: b8c5c28f3e2c0571826d07f2b101fc0b23b7b21a76fc60afcef52b310eb07cea16d20b8e4f853d946bf0392242509e0e508f824d43d0c291a9f1321c250544b0
7
+ data.tar.gz: 276593ec7b98261883d7bba36972bc24e5bd772b340027df3633ef9281151db1dcf152a886057828c2bbf5f611fecc20992684742deb4e6fe5dbd5ab3db13012
@@ -19,8 +19,8 @@ module Merriam
19
19
  end
20
20
 
21
21
  def detect(t)
22
- char_limit(t.join)
23
- resp = HTTPClient.post("#{BASE_URL}/detect.json", t.to_json, headers)
22
+ char_limit([t].flatten.join)
23
+ resp = HTTPClient.post("#{BASE_URL}/detect.json", { t: [t].flatten }.to_json, headers)
24
24
  body = JSON.parse(resp.body)
25
25
  resp.status_code.eql?(200) ? [body].flatten.map { |b| Response.new(b) } : body
26
26
  end
@@ -44,7 +44,7 @@ module Merriam
44
44
  def translate_url(url, language_code)
45
45
  str = open(url).read
46
46
  char_limit(str)
47
- data = {'t' => html, 'c' => language_code}
47
+ data = {'t' => str, 'c' => language_code}
48
48
  resp = HTTPClient.post("#{BASE_URL}/translate_html.json", data.to_json, headers)
49
49
  body = JSON.parse(resp.body)
50
50
  resp.status_code.eql?(200) ? TranslateText.new(body) : body
@@ -59,7 +59,7 @@ module Merriam
59
59
  end
60
60
 
61
61
  def char_limit(str)
62
- puts 'Character limit is 31250' if str.size > _31250
62
+ puts 'Character limit is 31250' if str.size > 312_50
63
63
  end
64
64
  end
65
65
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Merriam
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merriam
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vajapravin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-02 00:00:00.000000000 Z
12
+ date: 2018-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: http
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 2.6.13
76
+ rubygems_version: 2.6.14
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Language detect and translate library for Rails app