detect_language 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/README.md +9 -1
- data/detect_language.gemspec +1 -1
- data/lib/detect_language/client.rb +4 -4
- data/lib/detect_language/version.rb +1 -1
- data/spec/detect_language_spec.rb +11 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca98c08af8db2e27c420fe04ef2118fd9e2f1e18
|
4
|
+
data.tar.gz: c8ef3ca5e8c3eb887739d8823898e3e8f2cf5920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ac2c4abaff15fcabf57ff1a370740c54ff19b294078be2f2638577c3a68bd4db0b60870e832856a1f30ae922f19f6425ea862661a34a641e7aca8afd1c83d7
|
7
|
+
data.tar.gz: ecc5959ed23946cbb5cfa8ce98e1badfbeb69a89a366da060aeed0d679805701231787f01d8ba5cf6bfcfda340a359d66ee0dadac6d34bf2afbabe91c35ba8a4
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Detect Language API Client [![Build Status](https://secure.travis-ci.org/detectlanguage/
|
1
|
+
Detect Language API Client [![Build Status](https://secure.travis-ci.org/detectlanguage/detectlanguage-ruby.png)](http://travis-ci.org/detectlanguage/detectlanguage-ruby)
|
2
2
|
========
|
3
3
|
|
4
4
|
Detects language of given text. Returns detected language codes and scores.
|
@@ -81,6 +81,14 @@ Result is array of detections in the same order as the texts were passed.
|
|
81
81
|
|
82
82
|
Array of language codes and names.
|
83
83
|
|
84
|
+
### Secure Mode
|
85
|
+
|
86
|
+
If you are passing sensitive information to the Detect Language API you can enable SSL.
|
87
|
+
|
88
|
+
SSL usage adds data and processing overhead. Please use only if encryption is really necessary.
|
89
|
+
|
90
|
+
DetectLanguage.configuration.secure = true
|
91
|
+
|
84
92
|
## License
|
85
93
|
|
86
94
|
Detect Language API Client is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/detect_language.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["laurynas.butkus@gmail.com"]
|
7
7
|
gem.description = %q{Language Detection API Client}
|
8
8
|
gem.summary = %q{Detects language of given text. Returns detected language codes and scores.}
|
9
|
-
gem.homepage = "https://github.com/detectlanguage/
|
9
|
+
gem.homepage = "https://github.com/detectlanguage/detectlanguage-ruby"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -38,10 +38,10 @@ module DetectLanguage
|
|
38
38
|
response = http.request(request)
|
39
39
|
|
40
40
|
case response
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
when Net::HTTPSuccess, Net::HTTPUnauthorized then
|
42
|
+
parse_response(response.body)
|
43
|
+
else
|
44
|
+
raise(Error, "Failure: #{response.class}")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -55,6 +55,17 @@ describe DetectLanguage do
|
|
55
55
|
result[0][0]['language'].should == "en"
|
56
56
|
result[1][0]['language'].should == "lt"
|
57
57
|
end
|
58
|
+
|
59
|
+
|
60
|
+
context 'secure mode' do
|
61
|
+
before { DetectLanguage.configuration.secure = true }
|
62
|
+
after { DetectLanguage.configuration.secure = false }
|
63
|
+
|
64
|
+
it "detects language" do
|
65
|
+
result = subject.detect("Hello world")
|
66
|
+
result[0]['language'].should == "en"
|
67
|
+
end
|
68
|
+
end
|
58
69
|
end
|
59
70
|
|
60
71
|
describe '.user_status' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: detect_language
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurynas Butkus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Language Detection API Client
|
14
14
|
email:
|
@@ -32,7 +32,7 @@ files:
|
|
32
32
|
- lib/detect_language/version.rb
|
33
33
|
- spec/detect_language_spec.rb
|
34
34
|
- spec/spec_helper.rb
|
35
|
-
homepage: https://github.com/detectlanguage/
|
35
|
+
homepage: https://github.com/detectlanguage/detectlanguage-ruby
|
36
36
|
licenses:
|
37
37
|
- MIT
|
38
38
|
metadata: {}
|
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
version: '0'
|
53
53
|
requirements: []
|
54
54
|
rubyforge_project:
|
55
|
-
rubygems_version: 2.
|
55
|
+
rubygems_version: 2.0.14
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: Detects language of given text. Returns detected language codes and scores.
|