opener-outlet 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opener/outlet.rb +1 -0
- data/lib/opener/outlet/server.rb +22 -0
- data/lib/opener/outlet/version.rb +1 -1
- data/opener-outlet.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9ea166e1e6fb8abffc7ae33720e4dbc87218ab4
|
4
|
+
data.tar.gz: 85623fa3d8e6aca79ebb9a15bf6fb621ed898cc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b2290653a314ee36e5f720afe64d283403f1517d6f1274a393036a50d3ec7fe70052df5442cc5b4dc54ffbc6d9f216c5d31323878c1ae68ad07ca7c991c8dcc
|
7
|
+
data.tar.gz: f69887bf0b650e1ed6246f835300bdec4cbff9787160a3d90c3acfabcf3973eeebcd4c20c889782f1256896d68a23be42537f8021e6e0753168c26f3000dd3a7
|
data/lib/opener/outlet.rb
CHANGED
data/lib/opener/outlet/server.rb
CHANGED
@@ -89,6 +89,28 @@ module Opener
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
92
|
+
|
93
|
+
get '/score/:request_id' do
|
94
|
+
unless params[:request_id] == 'favicon.ico'
|
95
|
+
begin
|
96
|
+
output = Output.find_by_uuid(params[:request_id])
|
97
|
+
if output
|
98
|
+
content_type('text/json')
|
99
|
+
processor = Opener::Scorer::OutputProcessor.new(output.text)
|
100
|
+
result = processor.process
|
101
|
+
body(result.to_json)
|
102
|
+
else
|
103
|
+
halt(404, "No record found for ID #{params[:request_id]}")
|
104
|
+
end
|
105
|
+
rescue => error
|
106
|
+
error_callback = params[:error_callback]
|
107
|
+
|
108
|
+
submit_error(error_callback, error.message) if error_callback
|
109
|
+
|
110
|
+
raise(error)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
92
114
|
|
93
115
|
private
|
94
116
|
|
data/opener-outlet.gemspec
CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |gem|
|
|
36
36
|
gem.add_dependency 'activesupport', '~>3.2'
|
37
37
|
gem.add_dependency 'opener-webservice'
|
38
38
|
gem.add_dependency 'opener-kaf2json'
|
39
|
+
gem.add_dependency 'opener-scorer'
|
39
40
|
|
40
41
|
gem.add_development_dependency 'rspec'
|
41
42
|
gem.add_development_dependency 'cucumber'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-outlet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- development@olery.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -206,6 +206,20 @@ dependencies:
|
|
206
206
|
version: '0'
|
207
207
|
prerelease: false
|
208
208
|
type: :runtime
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: opener-scorer
|
211
|
+
version_requirements: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - '>='
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
requirement: !ruby/object:Gem::Requirement
|
217
|
+
requirements:
|
218
|
+
- - '>='
|
219
|
+
- !ruby/object:Gem::Version
|
220
|
+
version: '0'
|
221
|
+
prerelease: false
|
222
|
+
type: :runtime
|
209
223
|
- !ruby/object:Gem::Dependency
|
210
224
|
name: rspec
|
211
225
|
version_requirements: !ruby/object:Gem::Requirement
|