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 +4 -4
- data/lib/merriam/client.rb +4 -4
- data/lib/merriam/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54b73cd2aff871d75ec03b678e5dcb3c7337d672
|
4
|
+
data.tar.gz: 276060eb1540c64f52b9a2280cf51ec74ba356d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8c5c28f3e2c0571826d07f2b101fc0b23b7b21a76fc60afcef52b310eb07cea16d20b8e4f853d946bf0392242509e0e508f824d43d0c291a9f1321c250544b0
|
7
|
+
data.tar.gz: 276593ec7b98261883d7bba36972bc24e5bd772b340027df3633ef9281151db1dcf152a886057828c2bbf5f611fecc20992684742deb4e6fe5dbd5ab3db13012
|
data/lib/merriam/client.rb
CHANGED
@@ -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' =>
|
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 >
|
62
|
+
puts 'Character limit is 31250' if str.size > 312_50
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/lib/merriam/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|