scanr 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/scanr.rb +24 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b87794f1c7b88eb2da69e3f5e8592f3f2d6a5edd
4
+ data.tar.gz: 51ee70b3394b94ada4f2381e316353ec54d0286d
5
+ SHA512:
6
+ metadata.gz: 01a47a2258651e491435bdda4b65f845b3ebdc04438af7059e98a2ac12892d44543f972e62d8f89679ab87576464708091acf863db19435fdd47a84c3c0f3e0e
7
+ data.tar.gz: bd0005db6f81f54506eb5810e0d8e110fd00a90f71e8747fd71c68a46e681cc7c72b93d84a792fd1e7ad5512e56908d978eb6d636d2b7a7a97747bd3bd47638d
@@ -0,0 +1,24 @@
1
+ require 'rest-client'
2
+
3
+ class Scanr
4
+
5
+ def initialize(token, lang = 'eng')
6
+ @token = token
7
+ @lang = lang
8
+ end
9
+
10
+ def ocr(path)
11
+ params = {}
12
+ if path.start_with?('http')
13
+ params[:url] = path
14
+ else
15
+ params[:file] = File.new(path, 'rb')
16
+ end
17
+ JSON.parse RestClient.post(url, params)
18
+ end
19
+ end
20
+
21
+ def url
22
+ "https://api.scanr.xyz/ocr?token=#{@token}&lang=#{@lang}"
23
+ end
24
+
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scanr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Sagiv Ofek
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: scanR ruby client
14
+ email: info@scanr.xyz
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/scanr.rb
20
+ homepage: https://www.scanr.xyz
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.5.0
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: scanR ruby client
44
+ test_files: []