ocrsdk 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/README.md +80 -1
- data/VERSION +1 -1
- data/lib/ocrsdk/abstract_entity.rb +2 -5
- data/lib/ocrsdk/image.rb +4 -4
- data/lib/ocrsdk/promise.rb +4 -4
- data/lib/ocrsdk/verifiers/format.rb +2 -2
- data/lib/ocrsdk/verifiers/language.rb +1 -1
- data/lib/ocrsdk/verifiers/profile.rb +1 -1
- data/lib/ocrsdk/verifiers/status.rb +1 -1
- data/lib/ocrsdk.rb +7 -0
- data/spec/abstract_entity_spec.rb +19 -0
- data/spec/ocrsdk/image_spec.rb +8 -1
- data/spec/ocrsdk/pdf_spec.rb +7 -0
- data/spec/ocrsdk/promise_spec.rb +7 -1
- data/spec/ocrsdk_spec.rb +10 -0
- metadata +4 -19
- data/coverage/index.css +0 -56
- data/coverage/index.html +0 -244
- data/coverage/jquery.js +0 -154
- data/coverage/jquery.tablesorter.js +0 -2
- data/coverage/lib/ocrsdk/abstract_entity.rb.html +0 -207
- data/coverage/lib/ocrsdk/document.rb.html +0 -159
- data/coverage/lib/ocrsdk/errors.rb.html +0 -199
- data/coverage/lib/ocrsdk/image.rb.html +0 -543
- data/coverage/lib/ocrsdk/pdf.rb.html +0 -311
- data/coverage/lib/ocrsdk/promise.rb.html +0 -791
- data/coverage/lib/ocrsdk/verifiers/format.rb.html +0 -303
- data/coverage/lib/ocrsdk/verifiers/language.rb.html +0 -439
- data/coverage/lib/ocrsdk/verifiers/profile.rb.html +0 -215
- data/coverage/lib/ocrsdk/verifiers/status.rb.html +0 -247
- data/coverage/lib/ocrsdk/verifiers.rb.html +0 -167
- data/coverage/lib/ocrsdk.rb.html +0 -263
- data/coverage/report.css +0 -97
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,2 +1,81 @@
|
|
1
1
|
OCRSDK [![Build Status](https://secure.travis-ci.org/andrusha/ocrsdk.png?branch=master)](http://travis-ci.org/andrusha/ocrsdk) [![Dependency Status](https://gemnasium.com/andrusha/ocrsdk.png)](http://gemnasium.com/andrusha/ocrsdk) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/andrusha/ocrsdk)
|
2
|
-
======
|
2
|
+
======
|
3
|
+
|
4
|
+
An Abbyy's [OCRSDK](http://ocrsdk.com) API wrapper in Ruby.
|
5
|
+
|
6
|
+
Terminology
|
7
|
+
-----------
|
8
|
+
|
9
|
+
Abbyy uses terms "Image" and "Document" in a way that might be confusing at first, so let's get it straight from the beginning:
|
10
|
+
|
11
|
+
* Image - is a single input _file_ which result in a single output, it might be _multi-page_ pdf document as well as jpeg image.
|
12
|
+
* Document - is a collection of files which result in a single output, e.g. a collection of scanned pages in tiff format.
|
13
|
+
|
14
|
+
Installation
|
15
|
+
------------
|
16
|
+
|
17
|
+
```bash
|
18
|
+
gem install ocrsdk
|
19
|
+
```
|
20
|
+
|
21
|
+
Configuration
|
22
|
+
-------------
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
OCRSDK.setup do |config|
|
26
|
+
config.application_id = '99bottlesofbeer'
|
27
|
+
config.password = '98bottlesofbeer'
|
28
|
+
end
|
29
|
+
```
|
30
|
+
|
31
|
+
Usage
|
32
|
+
-----
|
33
|
+
|
34
|
+
There are two basic workflows - synchornous and asynchronous. The first one is simpler, but since recognition may take a significant amount of time and you may want to utilize the same thread (or give response to the user, that processing is started) while document is processed there is also an asynchronous version of each function.
|
35
|
+
|
36
|
+
### Simple
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
image = OCRSDK::Image.new '~/why_cats_paint.pdf'
|
40
|
+
|
41
|
+
# sync
|
42
|
+
image.as_text_sync([:english]) # => "because they can"
|
43
|
+
image.as_pdf_sync([:english], '~/why_cats_paint_ocred.pdf') # # => 31337 (bytes written)
|
44
|
+
|
45
|
+
# async
|
46
|
+
promise = image.as_text([:english])
|
47
|
+
puts "Your document would be ready in #{promise.estimate_completion}"
|
48
|
+
promise.wait.result # byte-string, you might need to .force_encoding("utf-8") => "because they can"
|
49
|
+
```
|
50
|
+
|
51
|
+
### Advanced
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
# have the same methods as Image + a few format-specific
|
55
|
+
pdf = OCRSDK::PDF.new '~/why_cats_paint.pdf'
|
56
|
+
unless pdf.recognizeable?
|
57
|
+
return puts "Your document is already recognized"
|
58
|
+
end
|
59
|
+
|
60
|
+
promise = pdf.as_pdf([:english]) # pdf with images as pdf recognized
|
61
|
+
puts "Your document would be ready in #{promise.estimate_completion}"
|
62
|
+
|
63
|
+
while promise.processing?
|
64
|
+
begin
|
65
|
+
promise.update
|
66
|
+
sleep 5
|
67
|
+
rescue OCRSDK::NotEnoughCredits
|
68
|
+
return puts "You need to purchase more credits for your account"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
if promise.completed?
|
73
|
+
File.open('~/why_cats_paint_ocred.pdf', 'wb+') {|f| f.write promise.result }
|
74
|
+
else
|
75
|
+
puts "Processing failed"
|
76
|
+
end
|
77
|
+
```
|
78
|
+
|
79
|
+
Copyright
|
80
|
+
=========
|
81
|
+
Copytright © 2012 Andrey Korzhuev. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -1,9 +1,6 @@
|
|
1
1
|
class OCRSDK::AbstractEntity
|
2
|
-
def initialize
|
3
|
-
@
|
4
|
-
@password = password || '' # Rails.configuration.ocrsdk.password
|
5
|
-
|
6
|
-
@url = prepare_url @application_id, @password
|
2
|
+
def initialize
|
3
|
+
@url = prepare_url OCRSDK.config.application_id, OCRSDK.config.password
|
7
4
|
end
|
8
5
|
|
9
6
|
private
|
data/lib/ocrsdk/image.rb
CHANGED
@@ -3,15 +3,15 @@ class OCRSDK::Image < OCRSDK::AbstractEntity
|
|
3
3
|
include OCRSDK::Verifiers::Format
|
4
4
|
include OCRSDK::Verifiers::Profile
|
5
5
|
|
6
|
-
def initialize(image_path
|
7
|
-
super(
|
6
|
+
def initialize(image_path)
|
7
|
+
super()
|
8
8
|
@image_path = image_path
|
9
9
|
end
|
10
10
|
|
11
11
|
def as_text(languages)
|
12
12
|
xml_string = api_process_image @image_path, languages, :txt, :text_extraction
|
13
13
|
|
14
|
-
OCRSDK::Promise.from_response xml_string
|
14
|
+
OCRSDK::Promise.from_response xml_string
|
15
15
|
end
|
16
16
|
|
17
17
|
def as_text_sync(languages, wait_interval=OCRSDK::DEFAULT_POLL_TIME)
|
@@ -21,7 +21,7 @@ class OCRSDK::Image < OCRSDK::AbstractEntity
|
|
21
21
|
def as_pdf(languages)
|
22
22
|
xml_string = api_process_image @image_path, languages, :pdf, :document_conversion
|
23
23
|
|
24
|
-
OCRSDK::Promise.from_response xml_string
|
24
|
+
OCRSDK::Promise.from_response xml_string
|
25
25
|
end
|
26
26
|
|
27
27
|
def as_pdf_sync(languages, out_path=nil, wait_interval=OCRSDK::DEFAULT_POLL_TIME)
|
data/lib/ocrsdk/promise.rb
CHANGED
@@ -3,12 +3,12 @@ class OCRSDK::Promise < OCRSDK::AbstractEntity
|
|
3
3
|
|
4
4
|
attr_reader :task_id, :status, :result_url, :estimate_processing_time
|
5
5
|
|
6
|
-
def self.from_response(xml_string
|
7
|
-
OCRSDK::Promise.new(nil
|
6
|
+
def self.from_response(xml_string)
|
7
|
+
OCRSDK::Promise.new(nil).parse_response xml_string
|
8
8
|
end
|
9
9
|
|
10
|
-
def initialize(task_id
|
11
|
-
super(
|
10
|
+
def initialize(task_id)
|
11
|
+
super()
|
12
12
|
@task_id = task_id
|
13
13
|
end
|
14
14
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module OCRSDK::Verifiers::Format
|
2
2
|
# http://ocrsdk.com/documentation/specifications/image-formats/
|
3
3
|
INPUT_FORMATS = [:bmp, :dcx, :pcx, :png, :jp2, :jpc, :jpg, :jpeg, :jfif, :pdf,
|
4
|
-
:tif, :tiff, :gif, :djvu, :djv, :jb2]
|
4
|
+
:tif, :tiff, :gif, :djvu, :djv, :jb2].freeze
|
5
5
|
|
6
6
|
# http://ocrsdk.com/documentation/apireference/processImage/
|
7
7
|
OUTPUT_FORMATS = [:txt, :rtf, :docx, :xlsx, :pptx, :pdf_searchable,
|
8
|
-
:pdf_text_and_images, :xml, :alto]
|
8
|
+
:pdf_text_and_images, :xml, :alto].freeze
|
9
9
|
|
10
10
|
def format_to_s(format)
|
11
11
|
format.to_s.camelize(:lower)
|
@@ -15,7 +15,7 @@ module OCRSDK::Verifiers::Language
|
|
15
15
|
:portuguese_standard, :provencal, :quechua, :romanian, :romanian_moldavia, :romany,
|
16
16
|
:rundi, :russian, :samoan, :selkup, :serbian_cyrillic, :shona, :sioux, :slovenian,
|
17
17
|
:somali, :spanish, :sunda, :tabassaran, :tagalog, :tahitian, :tajik, :tatar, :tinpo,
|
18
|
-
:tun, :turkish, :uighur_cyrillic, :ukrainian, :uzbek_cyrillic, :visayan]
|
18
|
+
:tun, :turkish, :uighur_cyrillic, :ukrainian, :uzbek_cyrillic, :visayan].freeze
|
19
19
|
|
20
20
|
def language_to_s(language)
|
21
21
|
language.to_s.camelize
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module OCRSDK::Verifiers::Profile
|
2
2
|
# http://ocrsdk.com/documentation/specifications/processing-profiles/
|
3
3
|
PROFILES = [:document_conversion, :document_archiving, :text_extraction,
|
4
|
-
:field_level_recognition, :barcode_recognition]
|
4
|
+
:field_level_recognition, :barcode_recognition].freeze
|
5
5
|
|
6
6
|
def profile_to_s(profile)
|
7
7
|
profile.to_s.camelize(:lower)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module OCRSDK::Verifiers::Status
|
2
2
|
# http://ocrsdk.com/documentation/specifications/task-statuses/
|
3
3
|
STATUSES = [:submitted, :queued, :in_progress, :completed,
|
4
|
-
:processing_failed, :deleted, :not_enough_credits]
|
4
|
+
:processing_failed, :deleted, :not_enough_credits].freeze
|
5
5
|
|
6
6
|
def status_to_s(status)
|
7
7
|
status.to_s.camelize
|
data/lib/ocrsdk.rb
CHANGED
@@ -5,11 +5,18 @@ require 'pdf-reader'
|
|
5
5
|
require 'rest-client'
|
6
6
|
require 'active_support/inflector'
|
7
7
|
require 'active_support/time'
|
8
|
+
require 'active_support/configurable'
|
8
9
|
|
9
10
|
# http://ocrsdk.com/documentation/apireference/
|
10
11
|
module OCRSDK
|
12
|
+
include ActiveSupport::Configurable
|
13
|
+
|
11
14
|
DEFAULT_POLL_TIME = 3
|
12
15
|
SERVICE_URL = 'cloud.ocrsdk.com'
|
16
|
+
|
17
|
+
def self.setup
|
18
|
+
yield config
|
19
|
+
end
|
13
20
|
end
|
14
21
|
|
15
22
|
require 'ocrsdk/errors'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe OCRSDK::AbstractEntity do
|
5
|
+
before do
|
6
|
+
OCRSDK.setup do |config|
|
7
|
+
config.application_id = 'meow'
|
8
|
+
config.password = 'purr'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should initialize and prepare url" do
|
13
|
+
OCRSDK::AbstractEntity.new.instance_eval { @url }.to_s.should_not be_empty
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should prepare url correctly" do
|
17
|
+
OCRSDK::AbstractEntity.new.instance_eval { prepare_url 'meow!', "'pew'" }.to_s.should == "http://meow%21:%27pew%27@cloud.ocrsdk.com"
|
18
|
+
end
|
19
|
+
end
|
data/spec/ocrsdk/image_spec.rb
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe OCRSDK::Image do
|
5
|
+
before do
|
6
|
+
OCRSDK.setup do |config|
|
7
|
+
config.application_id = 'app_id'
|
8
|
+
config.password = 'pass'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
5
12
|
describe ".as_text" do
|
6
13
|
subject { OCRSDK::Image.new 'image.jpg' }
|
7
14
|
before { mock_ocrsdk }
|
@@ -46,7 +53,7 @@ describe OCRSDK::Image do
|
|
46
53
|
end
|
47
54
|
|
48
55
|
describe ".api_process_image" do
|
49
|
-
subject { OCRSDK::Image.new 'image.jpg'
|
56
|
+
subject { OCRSDK::Image.new 'image.jpg' }
|
50
57
|
|
51
58
|
it "should raise UnsupportedLanguage on unsupported language" do
|
52
59
|
expect {
|
data/spec/ocrsdk/pdf_spec.rb
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe OCRSDK::PDF do
|
5
|
+
before do
|
6
|
+
OCRSDK.setup do |config|
|
7
|
+
config.application_id = 'meow'
|
8
|
+
config.password = 'purr'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
5
12
|
describe ".recognizeable?" do
|
6
13
|
it "should return false for a document with text only" do
|
7
14
|
OCRSDK::PDF.new(TestFiles.lorem_pdf).recognizeable?.should be_false
|
data/spec/ocrsdk/promise_spec.rb
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe OCRSDK::Promise do
|
5
|
+
before do
|
6
|
+
OCRSDK.setup do |config|
|
7
|
+
config.application_id = 'app_id'
|
8
|
+
config.password = 'pass'
|
9
|
+
end
|
10
|
+
end
|
5
11
|
|
6
12
|
describe ".parse_response" do
|
7
13
|
context "correct response" do
|
@@ -57,7 +63,7 @@ describe OCRSDK::Promise do
|
|
57
63
|
end
|
58
64
|
|
59
65
|
describe ".api_update_status" do
|
60
|
-
subject { OCRSDK::Promise.new 'test'
|
66
|
+
subject { OCRSDK::Promise.new 'test' }
|
61
67
|
|
62
68
|
it "should make an api call with correct url" do
|
63
69
|
RestClient.stub(:get) do |url|
|
data/spec/ocrsdk_spec.rb
CHANGED
@@ -5,4 +5,14 @@ describe OCRSDK do
|
|
5
5
|
it "should have service url" do
|
6
6
|
OCRSDK::SERVICE_URL.length.should > 0
|
7
7
|
end
|
8
|
+
|
9
|
+
it "should be configurable" do
|
10
|
+
OCRSDK.setup do |config|
|
11
|
+
config.application_id = 'meow'
|
12
|
+
config.password = 'purr'
|
13
|
+
end
|
14
|
+
|
15
|
+
OCRSDK.config.application_id.should == 'meow'
|
16
|
+
OCRSDK.config.password.should == 'purr'
|
17
|
+
end
|
8
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocrsdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -154,23 +154,6 @@ files:
|
|
154
154
|
- README.md
|
155
155
|
- Rakefile
|
156
156
|
- VERSION
|
157
|
-
- coverage/index.css
|
158
|
-
- coverage/index.html
|
159
|
-
- coverage/jquery.js
|
160
|
-
- coverage/jquery.tablesorter.js
|
161
|
-
- coverage/lib/ocrsdk.rb.html
|
162
|
-
- coverage/lib/ocrsdk/abstract_entity.rb.html
|
163
|
-
- coverage/lib/ocrsdk/document.rb.html
|
164
|
-
- coverage/lib/ocrsdk/errors.rb.html
|
165
|
-
- coverage/lib/ocrsdk/image.rb.html
|
166
|
-
- coverage/lib/ocrsdk/pdf.rb.html
|
167
|
-
- coverage/lib/ocrsdk/promise.rb.html
|
168
|
-
- coverage/lib/ocrsdk/verifiers.rb.html
|
169
|
-
- coverage/lib/ocrsdk/verifiers/format.rb.html
|
170
|
-
- coverage/lib/ocrsdk/verifiers/language.rb.html
|
171
|
-
- coverage/lib/ocrsdk/verifiers/profile.rb.html
|
172
|
-
- coverage/lib/ocrsdk/verifiers/status.rb.html
|
173
|
-
- coverage/report.css
|
174
157
|
- lib/ocrsdk.rb
|
175
158
|
- lib/ocrsdk/abstract_entity.rb
|
176
159
|
- lib/ocrsdk/document.rb
|
@@ -184,6 +167,7 @@ files:
|
|
184
167
|
- lib/ocrsdk/verifiers/profile.rb
|
185
168
|
- lib/ocrsdk/verifiers/status.rb
|
186
169
|
- ocrsdk.gemspec
|
170
|
+
- spec/abstract_entity_spec.rb
|
187
171
|
- spec/fixtures/files/lorem.complex.pdf
|
188
172
|
- spec/fixtures/files/lorem.pdf
|
189
173
|
- spec/fixtures/files/malformed.pdf
|
@@ -228,6 +212,7 @@ signing_key:
|
|
228
212
|
specification_version: 3
|
229
213
|
summary: Abbyy's OCR (ocrsdk.com) API wrapper in Ruby.
|
230
214
|
test_files:
|
215
|
+
- spec/abstract_entity_spec.rb
|
231
216
|
- spec/fixtures/files/lorem.complex.pdf
|
232
217
|
- spec/fixtures/files/lorem.pdf
|
233
218
|
- spec/fixtures/files/malformed.pdf
|
data/coverage/index.css
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
.near {
|
2
|
-
background-color: #E0DEDB;
|
3
|
-
color: black;
|
4
|
-
}
|
5
|
-
|
6
|
-
.near a {
|
7
|
-
color: black;
|
8
|
-
}
|
9
|
-
|
10
|
-
.near a:visited {
|
11
|
-
color: black;
|
12
|
-
}
|
13
|
-
|
14
|
-
.miss {
|
15
|
-
font-weight: normal;
|
16
|
-
}
|
17
|
-
|
18
|
-
a {
|
19
|
-
color: black;
|
20
|
-
}
|
21
|
-
|
22
|
-
a:visited {
|
23
|
-
color: black;
|
24
|
-
}
|
25
|
-
|
26
|
-
.header {
|
27
|
-
cursor:pointer;
|
28
|
-
}
|
29
|
-
|
30
|
-
th.header:hover {
|
31
|
-
background-color:#666;
|
32
|
-
}
|
33
|
-
|
34
|
-
.headerSortUp:after {
|
35
|
-
content: "\25BC";
|
36
|
-
/* margin-left: 1em;*/
|
37
|
-
}
|
38
|
-
|
39
|
-
.headerSortDown:after {
|
40
|
-
content: "\25B2";
|
41
|
-
|
42
|
-
/* margin-left: 1em;*/
|
43
|
-
}
|
44
|
-
|
45
|
-
#filters {
|
46
|
-
padding-bottom: 20px;
|
47
|
-
font-size: 16px;
|
48
|
-
}
|
49
|
-
|
50
|
-
#big_total {
|
51
|
-
float: right;
|
52
|
-
border: 3px solid #999;
|
53
|
-
padding: 10px;
|
54
|
-
font-size: 24px;
|
55
|
-
font-weight: bold;
|
56
|
-
}
|
data/coverage/index.html
DELETED
@@ -1,244 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>Coverage Report</title>
|
4
|
-
<link href="report.css?0.9295655220139563" media="screen" rel="stylesheet" type="text/css" />
|
5
|
-
<link href="index.css?0.1185955988799996" media="screen" rel="stylesheet" type="text/css" />
|
6
|
-
<script src="jquery.js?0.8317918045278826"></script>
|
7
|
-
<script src="jquery.tablesorter.js?0.4377297609330264"></script>
|
8
|
-
<script>
|
9
|
-
$(function() {
|
10
|
-
|
11
|
-
function filterByPercent() {
|
12
|
-
var p = $('#filter_by_percent').val();
|
13
|
-
if (p == 0 ) {
|
14
|
-
$('#main tbody tr').show();
|
15
|
-
} else if (p == 10) {
|
16
|
-
$('#main tbody tr.row').show();
|
17
|
-
$('#main tbody tr.10').hide();
|
18
|
-
} else if (p == 100) {
|
19
|
-
$('#main tbody tr.row').hide();
|
20
|
-
$('#main tbody tr.10').show();
|
21
|
-
} else {
|
22
|
-
$('#main tbody tr.row').hide();
|
23
|
-
var x = 0;
|
24
|
-
while (x < p) {
|
25
|
-
$('#main tbody tr.' + x).show();
|
26
|
-
x++;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
|
-
function filterByName(name) {
|
32
|
-
$('#main tbody tr:visible').each(function() {
|
33
|
-
if ($(this).attr('id').indexOf(name) != -1) {
|
34
|
-
$(this).show();
|
35
|
-
} else {
|
36
|
-
$(this).hide();
|
37
|
-
}
|
38
|
-
});
|
39
|
-
}
|
40
|
-
|
41
|
-
$('#filter_by_percent').change(function(e) {
|
42
|
-
filterByPercent();
|
43
|
-
filterByName($('#filter_by_name').val());
|
44
|
-
});
|
45
|
-
|
46
|
-
$('#filter_by_name').keyup(function(e) {
|
47
|
-
filterByPercent();
|
48
|
-
filterByName($(this).val());
|
49
|
-
});
|
50
|
-
|
51
|
-
$("#main").tablesorter();
|
52
|
-
});
|
53
|
-
</script>
|
54
|
-
</head>
|
55
|
-
<body>
|
56
|
-
<div id='big_total' class='miss'>99.44%</div>
|
57
|
-
|
58
|
-
<h1>Coverage Report</h1>
|
59
|
-
|
60
|
-
<div id='filters'>
|
61
|
-
Filter:
|
62
|
-
<input type='text' id='filter_by_name'>
|
63
|
-
|
64
|
-
Code Coverage Threshold:
|
65
|
-
<select id='filter_by_percent'>
|
66
|
-
<option value='0'>Show All</option>
|
67
|
-
<option value='1'><= 10% Coverage</option>
|
68
|
-
<option value='2'><= 20% Coverage</option>
|
69
|
-
<option value='3'><= 30% Coverage</option>
|
70
|
-
<option value='4'><= 40% Coverage</option>
|
71
|
-
<option value='5'><= 50% Coverage</option>
|
72
|
-
<option value='6'><= 60% Coverage</option>
|
73
|
-
<option value='7'><= 70% Coverage</option>
|
74
|
-
<option value='8'><= 80% Coverage</option>
|
75
|
-
<option value='9'><= 90% Coverage</option>
|
76
|
-
<option value='10'>< 100% Coverage</option>
|
77
|
-
<option value='100'>= 100% Coverage</option>
|
78
|
-
</select>
|
79
|
-
</div>
|
80
|
-
|
81
|
-
<table cellpadding='0' cellspacing='1'>
|
82
|
-
<tr>
|
83
|
-
<th>Legend</th>
|
84
|
-
</tr>
|
85
|
-
<tr>
|
86
|
-
|
87
|
-
<td class='hit'>This file was tested 100%!</td>
|
88
|
-
</tr>
|
89
|
-
<tr>
|
90
|
-
<td class='near'>This file was tested >90%!</td>
|
91
|
-
</tr>
|
92
|
-
<tr>
|
93
|
-
<td class='miss'>This file was not tested nearly enough!</td>
|
94
|
-
</tr>
|
95
|
-
</table>
|
96
|
-
|
97
|
-
<div> </div>
|
98
|
-
|
99
|
-
<table cellpadding="0" cellspacing='1' id='main'>
|
100
|
-
<thead>
|
101
|
-
<tr class='header'>
|
102
|
-
<th>File</th>
|
103
|
-
<th>Lines</th>
|
104
|
-
<th>Lines Of Code</th>
|
105
|
-
<th>Untested Lines of Code</th>
|
106
|
-
<th>Tested %</th>
|
107
|
-
</tr>
|
108
|
-
</thead>
|
109
|
-
|
110
|
-
<tbody>
|
111
|
-
|
112
|
-
<tr class='row hit 10' id='lib/ocrsdk.rb'>
|
113
|
-
<td>
|
114
|
-
<a href="lib/ocrsdk.rb.html">lib/ocrsdk.rb</a>
|
115
|
-
</td>
|
116
|
-
<td>23</td>
|
117
|
-
<td>23</td>
|
118
|
-
<td>0</td>
|
119
|
-
<td>100.0%</td>
|
120
|
-
</tr>
|
121
|
-
|
122
|
-
<tr class='row hit 10' id='lib/ocrsdk/abstract_entity.rb'>
|
123
|
-
<td>
|
124
|
-
<a href="lib/ocrsdk/abstract_entity.rb.html">lib/ocrsdk/abstract_entity.rb</a>
|
125
|
-
</td>
|
126
|
-
<td>14</td>
|
127
|
-
<td>8</td>
|
128
|
-
<td>0</td>
|
129
|
-
<td>100.0%</td>
|
130
|
-
</tr>
|
131
|
-
|
132
|
-
<tr class='row hit 10' id='lib/ocrsdk/document.rb'>
|
133
|
-
<td>
|
134
|
-
<a href="lib/ocrsdk/document.rb.html">lib/ocrsdk/document.rb</a>
|
135
|
-
</td>
|
136
|
-
<td>8</td>
|
137
|
-
<td>3</td>
|
138
|
-
<td>0</td>
|
139
|
-
<td>100.0%</td>
|
140
|
-
</tr>
|
141
|
-
|
142
|
-
<tr class='row hit 10' id='lib/ocrsdk/errors.rb'>
|
143
|
-
<td>
|
144
|
-
<a href="lib/ocrsdk/errors.rb.html">lib/ocrsdk/errors.rb</a>
|
145
|
-
</td>
|
146
|
-
<td>13</td>
|
147
|
-
<td>10</td>
|
148
|
-
<td>0</td>
|
149
|
-
<td>100.0%</td>
|
150
|
-
</tr>
|
151
|
-
|
152
|
-
<tr class='row hit 10' id='lib/ocrsdk/image.rb'>
|
153
|
-
<td>
|
154
|
-
<a href="lib/ocrsdk/image.rb.html">lib/ocrsdk/image.rb</a>
|
155
|
-
</td>
|
156
|
-
<td>56</td>
|
157
|
-
<td>29</td>
|
158
|
-
<td>0</td>
|
159
|
-
<td>100.0%</td>
|
160
|
-
</tr>
|
161
|
-
|
162
|
-
<tr class='row hit 10' id='lib/ocrsdk/pdf.rb'>
|
163
|
-
<td>
|
164
|
-
<a href="lib/ocrsdk/pdf.rb.html">lib/ocrsdk/pdf.rb</a>
|
165
|
-
</td>
|
166
|
-
<td>27</td>
|
167
|
-
<td>12</td>
|
168
|
-
<td>0</td>
|
169
|
-
<td>100.0%</td>
|
170
|
-
</tr>
|
171
|
-
|
172
|
-
<tr class='row hit 10' id='lib/ocrsdk/promise.rb'>
|
173
|
-
<td>
|
174
|
-
<a href="lib/ocrsdk/promise.rb.html">lib/ocrsdk/promise.rb</a>
|
175
|
-
</td>
|
176
|
-
<td>87</td>
|
177
|
-
<td>47</td>
|
178
|
-
<td>0</td>
|
179
|
-
<td>100.0%</td>
|
180
|
-
</tr>
|
181
|
-
|
182
|
-
<tr class='row miss 8' id='lib/ocrsdk/verifiers.rb'>
|
183
|
-
<td>
|
184
|
-
<a href="lib/ocrsdk/verifiers.rb.html">lib/ocrsdk/verifiers.rb</a>
|
185
|
-
</td>
|
186
|
-
<td>17</td>
|
187
|
-
<td>7</td>
|
188
|
-
<td>1</td>
|
189
|
-
<td>85.7%</td>
|
190
|
-
</tr>
|
191
|
-
|
192
|
-
<tr class='row hit 10' id='lib/ocrsdk/verifiers/format.rb'>
|
193
|
-
<td>
|
194
|
-
<a href="lib/ocrsdk/verifiers/format.rb.html">lib/ocrsdk/verifiers/format.rb</a>
|
195
|
-
</td>
|
196
|
-
<td>26</td>
|
197
|
-
<td>11</td>
|
198
|
-
<td>0</td>
|
199
|
-
<td>100.0%</td>
|
200
|
-
</tr>
|
201
|
-
|
202
|
-
<tr class='row hit 10' id='lib/ocrsdk/verifiers/language.rb'>
|
203
|
-
<td>
|
204
|
-
<a href="lib/ocrsdk/verifiers/language.rb.html">lib/ocrsdk/verifiers/language.rb</a>
|
205
|
-
</td>
|
206
|
-
<td>43</td>
|
207
|
-
<td>14</td>
|
208
|
-
<td>0</td>
|
209
|
-
<td>100.0%</td>
|
210
|
-
</tr>
|
211
|
-
|
212
|
-
<tr class='row hit 10' id='lib/ocrsdk/verifiers/profile.rb'>
|
213
|
-
<td>
|
214
|
-
<a href="lib/ocrsdk/verifiers/profile.rb.html">lib/ocrsdk/verifiers/profile.rb</a>
|
215
|
-
</td>
|
216
|
-
<td>15</td>
|
217
|
-
<td>7</td>
|
218
|
-
<td>0</td>
|
219
|
-
<td>100.0%</td>
|
220
|
-
</tr>
|
221
|
-
|
222
|
-
<tr class='row hit 10' id='lib/ocrsdk/verifiers/status.rb'>
|
223
|
-
<td>
|
224
|
-
<a href="lib/ocrsdk/verifiers/status.rb.html">lib/ocrsdk/verifiers/status.rb</a>
|
225
|
-
</td>
|
226
|
-
<td>19</td>
|
227
|
-
<td>9</td>
|
228
|
-
<td>0</td>
|
229
|
-
<td>100.0%</td>
|
230
|
-
</tr>
|
231
|
-
|
232
|
-
</tbody>
|
233
|
-
|
234
|
-
<tr class='header'>
|
235
|
-
<th>Total</th>
|
236
|
-
<th>348</th>
|
237
|
-
<th>180</th>
|
238
|
-
<th>1</th>
|
239
|
-
<th>99.44%</th>
|
240
|
-
</tr>
|
241
|
-
</table>
|
242
|
-
<p>Generated on: 2012-12-01 01:40:30 +0400</p>
|
243
|
-
</body>
|
244
|
-
</html>
|