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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 574c2a940a7e6eef0b41d06566b19d4110b103b8
4
- data.tar.gz: ac4c47d19dfcec4cb6ed8d953cee289b719a1d15
3
+ metadata.gz: b9ea166e1e6fb8abffc7ae33720e4dbc87218ab4
4
+ data.tar.gz: 85623fa3d8e6aca79ebb9a15bf6fb621ed898cc7
5
5
  SHA512:
6
- metadata.gz: 91c48e710d2ed2d5a930b83f52b80f78ee601e7b18c2830a0043ad2c65a741ce0a5a6afa45fa1b2bbda87699579266611907b6472624ce048d6b6bbf171259ae
7
- data.tar.gz: 05039bafb804b5a79c2a0ef123ab346c1aa47a9be75b0a794e665aeb0c110ae4adc53fa2e48d7131c69c579473cd316533f1a06adcc210eee699177b73e0a565
6
+ metadata.gz: 2b2290653a314ee36e5f720afe64d283403f1517d6f1274a393036a50d3ec7fe70052df5442cc5b4dc54ffbc6d9f216c5d31323878c1ae68ad07ca7c991c8dcc
7
+ data.tar.gz: f69887bf0b650e1ed6246f835300bdec4cbff9787160a3d90c3acfabcf3973eeebcd4c20c889782f1256896d68a23be42537f8021e6e0753168c26f3000dd3a7
data/lib/opener/outlet.rb CHANGED
@@ -2,6 +2,7 @@ require_relative 'outlet/output'
2
2
  require_relative 'outlet/version'
3
3
  require_relative 'outlet/server'
4
4
  require 'opener/kaf_to_json'
5
+ require 'opener/scorer/output_processor'
5
6
 
6
7
  module Opener
7
8
  class Outlet
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module Opener
2
2
  class Outlet
3
- VERSION = "1.0.7"
3
+ VERSION = "1.0.8"
4
4
  end
5
5
  end
@@ -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.7
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-23 00:00:00.000000000 Z
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