that_language-service 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/lib/that_language/service/application.rb +7 -4
- data/lib/that_language/service/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e077667697565d50f7439e4d4a891c9e1d22d77
|
4
|
+
data.tar.gz: fb32417797fe61940c27503e3a98d2c2d52294aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd25468fceb9cfc51198a89ee360bb088d9654e2db3e08a02fda36477fe53996954fc5771df2845fa0f1d18f31dfdcd810d692d8a2f14fd2b9bb0f77408d9ae4
|
7
|
+
data.tar.gz: 56ea951aae1928f2f53fabb463fcebacf4671fe1d3afff2126d0dc0723db7ad932d7b3a516b3ca5bd9ce737980ac7ae19e943911e6bcd50d8f5544add2a5178f
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
## 0.1.3 [☰](https://github.com/Deradon/that_language-service/compare/v0.1.2...v0.1.3) (2016-05-23)
|
2
|
+
|
3
|
+
### Bug fixes
|
4
|
+
|
5
|
+
* Allow get requests with a referrer from a different domain ([Disable `Rack::Protection::JsonCsrf`](https://github.com/Deradon/that_language-service/pull/2))
|
6
|
+
|
7
|
+
### Enhancements
|
8
|
+
|
9
|
+
* All routes listen to post and get requests
|
10
|
+
|
11
|
+
## 0.1.2 [☰](https://github.com/Deradon/that_language-service/compare/v0.1.0...v0.1.2) (2016-03-13)
|
12
|
+
|
13
|
+
### Enhancements
|
14
|
+
|
15
|
+
* Fail fast when running specs
|
16
|
+
* Update gemspec
|
17
|
+
|
18
|
+
## 0.1.0 (2015-12-07)
|
19
|
+
|
20
|
+
* Initial release
|
@@ -5,6 +5,8 @@ require "that_language"
|
|
5
5
|
module ThatLanguage
|
6
6
|
module Service
|
7
7
|
class Application < Sinatra::Application
|
8
|
+
set :protection, except: [:json_csrf]
|
9
|
+
|
8
10
|
route :get, :post, '/language' do
|
9
11
|
render_json language: ThatLanguage.language(text)
|
10
12
|
end
|
@@ -25,23 +27,23 @@ module ThatLanguage
|
|
25
27
|
render_json ThatLanguage.details(text)
|
26
28
|
end
|
27
29
|
|
28
|
-
get '/available' do
|
30
|
+
route :get, :post, '/available' do
|
29
31
|
render_json available: ThatLanguage.available
|
30
32
|
end
|
31
33
|
|
32
|
-
get '/available_languages' do
|
34
|
+
route :get, :post, '/available_languages' do
|
33
35
|
render_json({
|
34
36
|
available_languages: ThatLanguage.available_languages
|
35
37
|
})
|
36
38
|
end
|
37
39
|
|
38
|
-
get '/available_language_codes' do
|
40
|
+
route :get, :post, '/available_language_codes' do
|
39
41
|
render_json({
|
40
42
|
available_language_codes: ThatLanguage.available_language_codes
|
41
43
|
})
|
42
44
|
end
|
43
45
|
|
44
|
-
get '/version' do
|
46
|
+
route :get, :post, '/version' do
|
45
47
|
render_json version: ThatLanguage::VERSION
|
46
48
|
end
|
47
49
|
|
@@ -49,6 +51,7 @@ module ThatLanguage
|
|
49
51
|
|
50
52
|
def render_json(obj)
|
51
53
|
content_type :json
|
54
|
+
|
52
55
|
obj.to_json
|
53
56
|
end
|
54
57
|
|
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.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Helm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: that_language
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- ".gitignore"
|
161
161
|
- ".rspec"
|
162
162
|
- ".travis.yml"
|
163
|
+
- CHANGELOG.md
|
163
164
|
- CODE_OF_CONDUCT.md
|
164
165
|
- Gemfile
|
165
166
|
- LICENSE.txt
|