opener-coreference 1.1.0 → 1.1.1

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: 97eefd07dde025888ddd445eaa65d3c8bb7192b7
4
- data.tar.gz: c8486ea3f2791c021c8ce4b573ecde5555a51d63
3
+ metadata.gz: 75b674db39fc6526194b40c85b934880cbbf0a57
4
+ data.tar.gz: 73e72b709fc2c20ab8928dc406fcb4dadd97cfcf
5
5
  SHA512:
6
- metadata.gz: 3088f5141b323c2479119a2defa3e9186203d1fae4a26714e09950a101ee7a6ff2fbcfcde4c69ec13be1d7945a8c41ccbe10ff727979743fae1e7afee9a565f4
7
- data.tar.gz: 26a3692f9a7d3c47ecaa33fafa915f6698ce763ad41c9539db04e678a21503ce9826d487167e404ed0eb230d98b74e7831f78744e8b9d8c44adb9bd2fe56a4db
6
+ metadata.gz: fe4f25138b31ed7223f636a9929418b408d2744e98189f3eed5c010dffa614b93728d2029930154a3a80717fbd27c026847e6c787c3d318e33aad84f0e7a13af
7
+ data.tar.gz: d89a035434f1a1e59cd8bdc48ca1f81f885a1c4ddc069f7a542a08b4487aab1de840ec563d4d1c7a730264a0b411cc7055107a03ae6dfe59eac8f33f1a02e1ec
@@ -4,7 +4,6 @@ require 'nokogiri'
4
4
 
5
5
  require_relative 'coreference/version'
6
6
  require_relative 'coreference/cli'
7
- require_relative 'coreference/error_layer'
8
7
 
9
8
  module Opener
10
9
  class Coreference
@@ -52,7 +51,7 @@ module Opener
52
51
  return stdout
53
52
 
54
53
  rescue Exception => error
55
- return ErrorLayer.new(input, error.message, self.class).add
54
+ return Opener::Core::ErrorLayer.new(input, error.message, self.class).add
56
55
  end
57
56
  end
58
57
 
@@ -1,5 +1,5 @@
1
1
  module Opener
2
2
  class Coreference
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@
16
16
  ** When entering a value no response will be displayed in the browser.
17
17
  </p>
18
18
 
19
- <form action="<%=url("/")%>" method="POST">
19
+ <form action="" method="POST">
20
20
  <div>
21
21
  <label for="input">KAF input *</label>
22
22
  <br />
@@ -27,7 +27,7 @@ Gem::Specification.new do |gem|
27
27
  gem.add_dependency 'opener-webservice'
28
28
  gem.add_dependency 'puma'
29
29
  gem.add_dependency 'opener-daemons'
30
- gem.add_dependency 'opener-core', '~> 1.0'
30
+ gem.add_dependency 'opener-core', '~> 1.0.2'
31
31
 
32
32
  gem.add_development_dependency "rake"
33
33
  end
metadata CHANGED
@@ -1,147 +1,147 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-coreference
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - development@olery.com
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-16 00:00:00.000000000 Z
11
+ date: 2014-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
15
- requirement: !ruby/object:Gem::Requirement
15
+ version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.4'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
20
+ requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
- - - "~>"
22
+ - - ~>
25
23
  - !ruby/object:Gem::Version
26
24
  version: '1.4'
25
+ prerelease: false
26
+ type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httpclient
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
29
34
  requirement: !ruby/object:Gem::Requirement
30
35
  requirements:
31
- - - ">="
36
+ - - '>='
32
37
  - !ruby/object:Gem::Version
33
38
  version: '0'
34
- type: :runtime
35
39
  prerelease: false
40
+ type: :runtime
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
36
43
  version_requirements: !ruby/object:Gem::Requirement
37
44
  requirements:
38
- - - ">="
45
+ - - '>='
39
46
  - !ruby/object:Gem::Version
40
47
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: nokogiri
43
48
  requirement: !ruby/object:Gem::Requirement
44
49
  requirements:
45
- - - ">="
50
+ - - '>='
46
51
  - !ruby/object:Gem::Version
47
52
  version: '0'
48
- type: :runtime
49
53
  prerelease: false
54
+ type: :runtime
55
+ - !ruby/object:Gem::Dependency
56
+ name: opener-coreference-base
50
57
  version_requirements: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ">="
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: opener-coreference-base
57
62
  requirement: !ruby/object:Gem::Requirement
58
63
  requirements:
59
- - - ">="
64
+ - - '>='
60
65
  - !ruby/object:Gem::Version
61
66
  version: '0'
62
- type: :runtime
63
67
  prerelease: false
68
+ type: :runtime
69
+ - !ruby/object:Gem::Dependency
70
+ name: opener-webservice
64
71
  version_requirements: !ruby/object:Gem::Requirement
65
72
  requirements:
66
- - - ">="
73
+ - - '>='
67
74
  - !ruby/object:Gem::Version
68
75
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: opener-webservice
71
76
  requirement: !ruby/object:Gem::Requirement
72
77
  requirements:
73
- - - ">="
78
+ - - '>='
74
79
  - !ruby/object:Gem::Version
75
80
  version: '0'
76
- type: :runtime
77
81
  prerelease: false
82
+ type: :runtime
83
+ - !ruby/object:Gem::Dependency
84
+ name: puma
78
85
  version_requirements: !ruby/object:Gem::Requirement
79
86
  requirements:
80
- - - ">="
87
+ - - '>='
81
88
  - !ruby/object:Gem::Version
82
89
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: puma
85
90
  requirement: !ruby/object:Gem::Requirement
86
91
  requirements:
87
- - - ">="
92
+ - - '>='
88
93
  - !ruby/object:Gem::Version
89
94
  version: '0'
90
- type: :runtime
91
95
  prerelease: false
96
+ type: :runtime
97
+ - !ruby/object:Gem::Dependency
98
+ name: opener-daemons
92
99
  version_requirements: !ruby/object:Gem::Requirement
93
100
  requirements:
94
- - - ">="
101
+ - - '>='
95
102
  - !ruby/object:Gem::Version
96
103
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: opener-daemons
99
104
  requirement: !ruby/object:Gem::Requirement
100
105
  requirements:
101
- - - ">="
106
+ - - '>='
102
107
  - !ruby/object:Gem::Version
103
108
  version: '0'
104
- type: :runtime
105
109
  prerelease: false
110
+ type: :runtime
111
+ - !ruby/object:Gem::Dependency
112
+ name: opener-core
106
113
  version_requirements: !ruby/object:Gem::Requirement
107
114
  requirements:
108
- - - ">="
115
+ - - ~>
109
116
  - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: opener-core
117
+ version: 1.0.2
113
118
  requirement: !ruby/object:Gem::Requirement
114
119
  requirements:
115
- - - "~>"
120
+ - - ~>
116
121
  - !ruby/object:Gem::Version
117
- version: '1.0'
118
- type: :runtime
122
+ version: 1.0.2
119
123
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.0'
124
+ type: :runtime
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rake
127
- requirement: !ruby/object:Gem::Requirement
127
+ version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
132
+ requirement: !ruby/object:Gem::Requirement
135
133
  requirements:
136
- - - ">="
134
+ - - '>='
137
135
  - !ruby/object:Gem::Version
138
136
  version: '0'
137
+ prerelease: false
138
+ type: :development
139
139
  description: Gem that wraps the coreference code
140
- email:
140
+ email:
141
141
  executables:
142
142
  - coreference
143
- - coreference-server
144
143
  - coreference-daemon
144
+ - coreference-server
145
145
  extensions: []
146
146
  extra_rdoc_files: []
147
147
  files:
@@ -153,34 +153,32 @@ files:
153
153
  - exec/coreference.rb
154
154
  - lib/opener/coreference.rb
155
155
  - lib/opener/coreference/cli.rb
156
- - lib/opener/coreference/error_layer.rb
157
156
  - lib/opener/coreference/public/markdown.css
158
157
  - lib/opener/coreference/server.rb
159
158
  - lib/opener/coreference/version.rb
160
159
  - lib/opener/coreference/views/index.erb
161
160
  - opener-coreference.gemspec
162
- homepage:
161
+ homepage:
163
162
  licenses: []
164
163
  metadata: {}
165
- post_install_message:
164
+ post_install_message:
166
165
  rdoc_options: []
167
166
  require_paths:
168
167
  - lib
169
168
  required_ruby_version: !ruby/object:Gem::Requirement
170
169
  requirements:
171
- - - ">="
170
+ - - '>='
172
171
  - !ruby/object:Gem::Version
173
172
  version: 1.9.2
174
173
  required_rubygems_version: !ruby/object:Gem::Requirement
175
174
  requirements:
176
- - - ">="
175
+ - - '>='
177
176
  - !ruby/object:Gem::Version
178
177
  version: '0'
179
178
  requirements: []
180
- rubyforge_project:
179
+ rubyforge_project:
181
180
  rubygems_version: 2.2.2
182
- signing_key:
181
+ signing_key:
183
182
  specification_version: 4
184
183
  summary: Gem that wraps the coreference code
185
184
  test_files: []
186
- has_rdoc: yard
@@ -1,89 +0,0 @@
1
- module Opener
2
- class Coreference
3
- ##
4
- # Add Error Layer to KAF file instead of throwing an error.
5
- #
6
- class ErrorLayer
7
- attr_accessor :input, :document, :error, :klass
8
-
9
- def initialize(input, error, klass)
10
- @input = input.to_s
11
- # Make sure there is always a document, even if it is empty.
12
- @document = Nokogiri::XML(input) rescue Nokogiri::XML(nil)
13
- @error = error
14
- @klass = klass
15
- end
16
-
17
- def add
18
- if is_xml?
19
- unless has_errors_layer?
20
- add_errors_layer
21
- end
22
- else
23
- add_root
24
- add_text
25
- add_errors_layer
26
- end
27
- add_error
28
-
29
- xml = !!document.encoding ? document.to_xml : document.to_xml(:encoding => "UTF-8")
30
-
31
- return xml
32
- end
33
-
34
- ##
35
- # Check if the document is a valid XML file.
36
- #
37
- def is_xml?
38
- !!document.root
39
- end
40
-
41
- ##
42
- # Add root element to the XML file.
43
- #
44
- def add_root
45
- root = Nokogiri::XML::Node.new "KAF", document
46
- document.add_child(root)
47
- end
48
-
49
- ##
50
- # Check if the document already has an errors layer.
51
- #
52
- def has_errors_layer?
53
- !!document.at('errors')
54
- end
55
-
56
- ##
57
- # Add errors element to the XML file.
58
- #
59
- def add_errors_layer
60
- node = Nokogiri::XML::Node.new "errors", document
61
- document.root.add_child(node)
62
- end
63
-
64
- ##
65
- # Add the text file incase it is not a valid XML document. More
66
- # info for debugging.
67
- #
68
- def add_text
69
- node = Nokogiri::XML::Node.new "raw", document
70
- node.inner_html = input
71
- document.root.add_child(node)
72
-
73
- end
74
-
75
- ##
76
- # Add the actual error to the errors layer.
77
- #
78
- def add_error
79
- node = document.at('errors')
80
- error_node = Nokogiri::XML::Node.new "error", node
81
- error_node['class'] = klass.to_s
82
- error_node['version'] = klass::VERSION
83
- error_node.inner_html = error
84
- node.add_child(error_node)
85
- end
86
-
87
- end # ErrorLayer
88
- end # Coreference
89
- end # Opener