ocr_space 0.2.7 → 0.2.7.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: 07c54f34c3ffbac769ca3e06aefeb84f87232a26
4
- data.tar.gz: 0eb9021b0320048e05304753d717eaf05fd8c3d6
3
+ metadata.gz: cf750bb7ed29514efe3c1893e572e6bef6092b15
4
+ data.tar.gz: 1da64cddff8cd276648b7486bf712ca4ccd9c085
5
5
  SHA512:
6
- metadata.gz: 467bb9d9a9273adfcd43faa244ee0a417a22f31af47562a58ab2bd5ffefae6a0e6afdf6c13d64f43c1e5ba8437cdc4dafc368602338d1503460f14d87de760cb
7
- data.tar.gz: 71f87d3e68891d7b63ed9ece7f5fccac63531e37e399aa3cb24d7f1a6ebca3c2bbc3b2c2d3dccc8c4854e650560fd5f9054df74e390b7e6747c7bb6da3a1b255
6
+ metadata.gz: 91cae9df5deca49f245e39c2486d7429232468f22601e664b5565bf62000948817c714ba10022637f1e46f9b9e2b9e3aa1ba0a191b6b762ba96139adb5e7a44d
7
+ data.tar.gz: 4712b8920749d5197f4032329b01f1561870722f37b1ac6eee672e6fe72012d066d5be82fd3e2bb3d1436291b28fbe02d134cb02e3e20baa0068022f3d4d5d69
@@ -1,8 +1,8 @@
1
1
  require 'httmultiparty'
2
2
 
3
3
  module OcrSpace
4
- class FilePost
5
- include HTTMultiParty
6
- base_uri 'https://api.ocr.space'
7
- end
4
+ class FilePost
5
+ include HTTMultiParty
6
+ base_uri 'https://api.ocr.space'
7
+ end
8
8
  end
@@ -2,18 +2,19 @@ require 'ocr_space/file_post'
2
2
  require 'fileutils'
3
3
 
4
4
  module OcrSpace
5
- class FromFile
6
- attr_reader :data
7
- def initialize(apikey: ENV['ocr_api_key'], language: 'eng', isOverlayRequired: false, files: nil, ocr_space: "https://api.ocr.space/parse/image")
8
- @file = File.new(files)
9
- @data = OcrSpace::FilePost.post("/parse/image",
10
- body: { apikey: apikey,
11
- language: language,
12
- isOverlayRequired: isOverlayRequired,
13
- files: @file})
14
- end
15
- def text_data
16
- self.data.parsed_response["ParsedResults"][0]["ParsedText"]
17
- end
18
- end
5
+ class FromFile
6
+ attr_reader :data
7
+ def initialize(apikey: ENV['ocr_api_key'], language: 'eng', isOverlayRequired: false, files: nil, ocr_space: 'https://api.ocr.space/parse/image')
8
+ @file = File.new(files)
9
+ @data = OcrSpace::FilePost.post('/parse/image',
10
+ body: { apikey: apikey,
11
+ language: language,
12
+ isOverlayRequired: isOverlayRequired,
13
+ files: @file })
14
+ end
15
+
16
+ def text_data
17
+ data.parsed_response['ParsedResults'][0]['ParsedText']
18
+ end
19
+ end
19
20
  end
@@ -1,18 +1,18 @@
1
1
  require 'httparty'
2
2
 
3
3
  module OcrSpace
4
- class FromUrl
5
- attr_reader :data
6
- def initialize(apikey: ENV['ocr_api_key'], language: 'eng', isOverlayRequired: false, url: nil, ocr_space: "https://api.ocr.space/parse/image")
7
- @data = HTTParty.post("https://api.ocr.space/parse/image",
8
- body: { apikey: apikey,
9
- language: language,
10
- isOverlayRequired: isOverlayRequired,
11
- url: url})
12
- end
4
+ class FromUrl
5
+ attr_reader :data
6
+ def initialize(apikey: ENV['ocr_api_key'], language: 'eng', isOverlayRequired: false, url: nil, ocr_space: 'https://api.ocr.space/parse/image')
7
+ @data = HTTParty.post('https://api.ocr.space/parse/image',
8
+ body: { apikey: apikey,
9
+ language: language,
10
+ isOverlayRequired: isOverlayRequired,
11
+ url: url })
12
+ end
13
13
 
14
- def text_data
15
- self.data.parsed_response["ParsedResults"][0]["ParsedText"]
14
+ def text_data
15
+ data.parsed_response['ParsedResults'][0]['ParsedText']
16
+ end
16
17
  end
17
- end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module OcrSpace
2
- VERSION = "0.2.7"
2
+ VERSION = '0.2.7.1'.freeze
3
3
  end
data/lib/ocr_space.rb CHANGED
@@ -1,3 +1,3 @@
1
- require "ocr_space/version"
2
- require "ocr_space/from_url"
3
- require "ocr_space/from_file"
1
+ require 'ocr_space/version'
2
+ require 'ocr_space/from_url'
3
+ require 'ocr_space/from_file'
data/ocr_space.gemspec CHANGED
@@ -4,36 +4,36 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'ocr_space/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "ocr_space"
8
- spec.version = OcrSpace::VERSION
9
- spec.authors = ["Suyesh Bhandari"]
10
- spec.email = ["suyeshb@gmail.com"]
7
+ spec.name = 'ocr_space'
8
+ spec.version = OcrSpace::VERSION
9
+ spec.authors = ['Suyesh Bhandari']
10
+ spec.email = ['suyeshb@gmail.com']
11
11
 
12
- spec.summary = "Free Online OCR for Ruby - Convert images to text "
13
- spec.description = "Free Online OCR for Ruby - Convert images to text "
14
- spec.homepage = "https://suyesh.github.io/ocr_space/"
15
- spec.license = "MIT"
12
+ spec.summary = 'Free Online OCR for Ruby - Convert images to text '
13
+ spec.description = 'Free Online OCR for Ruby - Convert images to text '
14
+ spec.homepage = 'https://suyesh.github.io/ocr_space/'
15
+ spec.license = 'MIT'
16
16
 
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
- else
22
- raise "RubyGems 2.0 or newer is required to protect against " \
23
- "public gem pushes."
24
- end
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
+ else
22
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
23
+ 'public gem pushes.'
24
+ end
25
25
 
26
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features)/})
28
- end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
- spec.require_paths = ["lib"]
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = 'exe'
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ['lib']
32
32
 
33
- spec.add_development_dependency "bundler", "~> 1.13"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_dependency "json"
36
- spec.add_dependency "httparty"
37
- spec.add_dependency "httmultiparty"
38
- spec.add_dependency 'colorize'
33
+ spec.add_development_dependency 'bundler', '~> 1.13'
34
+ spec.add_development_dependency 'rake', '~> 10.0'
35
+ spec.add_dependency 'json'
36
+ spec.add_dependency 'httparty'
37
+ spec.add_dependency 'httmultiparty'
38
+ spec.add_dependency 'colorize'
39
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocr_space
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suyesh Bhandari