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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0f6a55d76a056241228c28d36683eb8cfa64d93
4
- data.tar.gz: 598bce80b23a03b0ef442e1ef139fdbe634e94a0
3
+ metadata.gz: 6c051c7168c6c236c0ebfa9b0390b18904128b98
4
+ data.tar.gz: c19cbbdf07358de028c55b5d01c6bba34bfe7b41
5
5
  SHA512:
6
- metadata.gz: b407cfcec432d2b1c7dfbf83aa62de25cff52c2ce9df2ac821607af0995175099cb45ec84f24cd3fab6bd936ae15e780baafdee3d7fba40e9e0e679acbb3d8b8
7
- data.tar.gz: dbf9def05111c39b10d6d8e8012ef9b36176031b2079338f85c2b1000819f7eae2833a5cd8143f365a6bb0fb9837def4836640cc84b8a134b96ddc4d2f80300e
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
- ThatLanguage.language_code(params['text'])
7
+ get '/language_code' do
8
+ render_json language_code: language_code
9
9
  end
10
10
 
11
- post '/' do
12
- ThatLanguage.language_code(params['text'])
11
+ post '/language_code' do
12
+ render_json language_code: language_code
13
13
  end
14
14
 
15
- # get '/detect' do
16
- # ThatLanguage.detect(params['text']).to_json
17
- # end
18
- #
19
- # post '/detect' do
20
- # ThatLanguage.detect(params['text']).to_json
21
- # end
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
- ThatLanguage.details(params['text']).to_json
24
+ render_json details: details
25
25
  end
26
26
 
27
27
  post '/details' do
28
- ThatLanguage.details(params['text']).to_json
28
+ render_json details: details
29
29
  end
30
30
 
31
- get '/language_code' do
32
- ThatLanguage.language_code(params['text']).to_json
31
+ private
32
+
33
+ def render_json(hash)
34
+ hash.to_json
33
35
  end
34
36
 
35
- post '/language_code' do
36
- ThatLanguage.language_code(params['text']).to_json
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
@@ -2,6 +2,6 @@ require 'sinatra'
2
2
 
3
3
  module ThatLanguage
4
4
  module Service
5
- VERSION = "0.1.0.pre1"
5
+ VERSION = "0.1.0.pre2"
6
6
  end
7
7
  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.pre1
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-09-30 00:00:00.000000000 Z
11
+ date: 2015-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: that_language