abbyy 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Guardfile +1 -1
- data/README.md +2 -6
- data/Rakefile +10 -1
- data/lib/abbyy/client.rb +13 -2
- data/lib/abbyy/task.rb +2 -0
- data/lib/abbyy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 334edb58265582d7dcb1ded99972284ce6d82932
|
4
|
+
data.tar.gz: b53be5b91c81193c3ba53a0cbcc7fdb13f9f2d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bea78c7cebeb031c421db2a1fd757b368b68e69bd9ca6f9457141b891c58d10166354030578820225fbed62249efef7a0b3402a0c49d57daa9b48fc235485b89
|
7
|
+
data.tar.gz: dca89277bf174cad5651f594ee8ba13866f89d9cf9042e99e5a1f6033d7ca87bc64d533be90174cdd9c8309c93258869142e701420908e4ac05d863566382537
|
data/Guardfile
CHANGED
data/README.md
CHANGED
@@ -32,9 +32,7 @@ client.get
|
|
32
32
|
|
33
33
|
### Example with Ruby on Rails
|
34
34
|
|
35
|
-
|
36
|
-
touch config/initializers/abbyy.rb
|
37
|
-
```
|
35
|
+
$ touch config/initializers/abbyy.rb
|
38
36
|
|
39
37
|
```ruby
|
40
38
|
require 'abbyy'
|
@@ -56,9 +54,7 @@ client.process_image "image.png"
|
|
56
54
|
|
57
55
|
Create new worker ImageScanner:
|
58
56
|
|
59
|
-
|
60
|
-
touch app/workers/image_scanner.rb
|
61
|
-
```
|
57
|
+
$ touch app/workers/image_scanner.rb
|
62
58
|
|
63
59
|
```ruby
|
64
60
|
class ImageScanner
|
data/Rakefile
CHANGED
@@ -1 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require 'rspec/core/rake_task'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
# Default directory to look in is `/specs`
|
5
|
+
# Run with `rake spec`
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |task|
|
7
|
+
task.rspec_opts = ['--color', '--format', 'progress']
|
8
|
+
end
|
9
|
+
|
10
|
+
task :default => :spec
|
data/lib/abbyy/client.rb
CHANGED
@@ -7,15 +7,26 @@ module Abbyy
|
|
7
7
|
include Abbyy::XML
|
8
8
|
include Abbyy::Task
|
9
9
|
|
10
|
-
|
10
|
+
API_ENDPOINT = "cloud.ocrsdk.com"
|
11
|
+
|
12
|
+
attr_reader :task
|
11
13
|
|
12
14
|
def initialize(application_id = Abbyy.application_id, password = Abbyy.password)
|
13
15
|
@appliction_id = application_id
|
14
16
|
@password = password
|
15
|
-
@url = "http://#{CGI.escape(@appliction_id)}:#{CGI.escape(@password)}@cloud.ocrsdk.com"
|
16
17
|
@task = {}
|
17
18
|
end
|
18
19
|
|
20
|
+
# @return [String] the api url with credentials
|
21
|
+
def url
|
22
|
+
@url ||= begin
|
23
|
+
uri = URI::HTTP.build host: API_ENDPOINT
|
24
|
+
uri.user = CGI.escape @appliction_id.to_s
|
25
|
+
uri.password = CGI.escape @password.to_s if uri.user
|
26
|
+
uri.to_s
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
19
30
|
alias_method :current_task, :task
|
20
31
|
|
21
32
|
# Retrieve the result of processing task
|
data/lib/abbyy/task.rb
CHANGED
data/lib/abbyy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abbyy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|