that_language-service 0.1.0.pre1 → 0.1.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/that_language/service/application.rb +31 -17
- data/lib/that_language/service/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c051c7168c6c236c0ebfa9b0390b18904128b98
|
4
|
+
data.tar.gz: c19cbbdf07358de028c55b5d01c6bba34bfe7b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8395584f51cf76ef12b8d7f7101ae89a89ddc8812a3441116c2e02c388949131120a2b9d5e17ac615f478350d694cb7a691d94771ed1f73ade7aa79470fd8e2d
|
7
|
+
data.tar.gz: e6d4f3f2383a05b8b1abe908972f92b5c7ad9c4d51e4386f76fbe44c65f2e06e99d7a3461f10f72fda027d2f266e8afcbf1c71b355cfc06abb1174c6358b8e44
|
@@ -4,36 +4,50 @@ require "that_language"
|
|
4
4
|
module ThatLanguage
|
5
5
|
module Service
|
6
6
|
class Application < Sinatra::Application
|
7
|
-
get '/' do
|
8
|
-
|
7
|
+
get '/language_code' do
|
8
|
+
render_json language_code: language_code
|
9
9
|
end
|
10
10
|
|
11
|
-
post '/' do
|
12
|
-
|
11
|
+
post '/language_code' do
|
12
|
+
render_json language_code: language_code
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
get '/detect' do
|
16
|
+
render_json(detect)
|
17
|
+
end
|
18
|
+
|
19
|
+
post '/detect' do
|
20
|
+
render_json(detect)
|
21
|
+
end
|
22
22
|
|
23
23
|
get '/details' do
|
24
|
-
|
24
|
+
render_json details: details
|
25
25
|
end
|
26
26
|
|
27
27
|
post '/details' do
|
28
|
-
|
28
|
+
render_json details: details
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
private
|
32
|
+
|
33
|
+
def render_json(hash)
|
34
|
+
hash.to_json
|
33
35
|
end
|
34
36
|
|
35
|
-
|
36
|
-
ThatLanguage.language_code(
|
37
|
+
def language_code
|
38
|
+
ThatLanguage.language_code(text)
|
39
|
+
end
|
40
|
+
|
41
|
+
def detect
|
42
|
+
ThatLanguage.detect(text)
|
43
|
+
end
|
44
|
+
|
45
|
+
def details
|
46
|
+
ThatLanguage.details(text)
|
47
|
+
end
|
48
|
+
|
49
|
+
def text
|
50
|
+
params['text']
|
37
51
|
end
|
38
52
|
end
|
39
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: that_language-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Helm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: that_language
|