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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 380aa885e4796684c9684adab6d25c6f21de09e6
4
- data.tar.gz: 701d426655bc61b0fe008ad8ef715492fbb22295
3
+ metadata.gz: ca98c08af8db2e27c420fe04ef2118fd9e2f1e18
4
+ data.tar.gz: c8ef3ca5e8c3eb887739d8823898e3e8f2cf5920
5
5
  SHA512:
6
- metadata.gz: 1c0fc1f81f2a772da5a466fd78eb87c20a3e84b44f29880b927ca36a2d2cf13b7f36fa05b8fb402c5cfcd942da2a08e009205d7c9e9b85a1e1611a15a7252235
7
- data.tar.gz: 5624098164e62cf5d922188cf2377503fab361d6f592224ae1659b31a9a83e9721756d56ce3375338c26f7c54a04cff107aa8f8abb553fb448646cd411845373
6
+ metadata.gz: 55ac2c4abaff15fcabf57ff1a370740c54ff19b294078be2f2638577c3a68bd4db0b60870e832856a1f30ae922f19f6425ea862661a34a641e7aca8afd1c83d7
7
+ data.tar.gz: ecc5959ed23946cbb5cfa8ce98e1badfbeb69a89a366da060aeed0d679805701231787f01d8ba5cf6bfcfda340a359d66ee0dadac6d34bf2afbabe91c35ba8a4
data/.travis.yml CHANGED
@@ -1,10 +1,8 @@
1
1
  rvm:
2
- - 1.8.7
3
2
  - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
6
5
  - 2.1.1
7
- - jruby-18mode # JRuby in 1.8 mode
8
6
  - jruby-19mode # JRuby in 1.9 mode
9
7
  - rbx-2
10
8
  script: "bundle exec rake spec"
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Detect Language API Client [![Build Status](https://secure.travis-ci.org/detectlanguage/detect_language.png)](http://travis-ci.org/detectlanguage/detect_language)
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.
@@ -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/detect_language"
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
- when Net::HTTPSuccess, Net::HTTPUnauthorized then
42
- parse_response(response.body)
43
- else
44
- raise "Failure: #{response.class}"
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
 
@@ -1,3 +1,3 @@
1
1
  module DetectLanguage
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
@@ -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.6
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-07-08 00:00:00.000000000 Z
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/detect_language
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.2.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.