aspose_ocr_cloud 1.0.0 → 1.0.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/lib/aspose_ocr_cloud/configuration.rb +1 -1
 - data/lib/aspose_ocr_cloud/version.rb +1 -1
 - data/test/ocr_tests.rb +15 -15
 - 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: 091f4d78f55b7635f97f57a74f7ab1b3b0f5875a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e9a0b86d50ef8a0d86917580ede4a620b17747f1
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2cc0508b62d056b4d81853852c81d5ff96e3dc26e53025400cae23e1e4d961f7dac6fd2cedec0d949223cdff19bda0eea99b49701d5a31fc045464f6a5259b03
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c1d46833a4d55d469fea2eec009a9dfbb719cbe13ae6858084b743f6f2f5e3cbea8b7cd4e6a5db5999eae4551c757adf8e805e3545f10204d58f3ee09aa3f8ea
         
     | 
    
        data/test/ocr_tests.rb
    CHANGED
    
    | 
         @@ -9,33 +9,33 @@ class OCRTests < Minitest::Test 
     | 
|
| 
       9 
9 
     | 
    
         
             
            	include AsposeStorageCloud
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            	def setup
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 12 
     | 
    
         
            +
                        #Get App key and App SID from https://cloud.aspose.com
         
     | 
| 
      
 13 
     | 
    
         
            +
                        AsposeApp.app_key_and_sid("", "")
         
     | 
| 
      
 14 
     | 
    
         
            +
            	    @ocr_api = OcrApi.new
         
     | 
| 
       15 
15 
     | 
    
         
             
            	end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
            	def teardown
         
     | 
| 
       18 
18 
     | 
    
         
             
            	end
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
            	def upload_file(file_name)
         
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
      
 21 
     | 
    
         
            +
                        @storage_api = StorageApi.new
         
     | 
| 
      
 22 
     | 
    
         
            +
            	    response = @storage_api.put_create(file_name, File.open("data/" << file_name,"r") { |io| io.read } )
         
     | 
| 
      
 23 
     | 
    
         
            +
            	    assert(response, message="Failed to upload {file_name} file.")
         
     | 
| 
       24 
24 
     | 
    
         
             
            	end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
            	def test_post_ocr_from_url_or_content
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
      
 27 
     | 
    
         
            +
            	    opts = {url: "http://s017.radikal.ru/i406/1202/7b/70183bef7a09.jpg", use_default_dictionaries: true}
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
      
 29 
     | 
    
         
            +
                        response = @ocr_api.post_ocr_from_url_or_content(opts)
         
     | 
| 
      
 30 
     | 
    
         
            +
            	    assert(response, message="Failed to recognize image text from some url if provided or from the request body content.")
         
     | 
| 
       31 
31 
     | 
    
         
             
            	end
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
      
 33 
     | 
    
         
            +
                    def test_get_recognize_document
         
     | 
| 
      
 34 
     | 
    
         
            +
                	    file_name = "Sampleocr.bmp"
         
     | 
| 
      
 35 
     | 
    
         
            +
                	    upload_file(file_name)
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
                	    response = @ocr_api.get_recognize_document(file_name)
         
     | 
| 
      
 38 
     | 
    
         
            +
                	    assert(response, message="Failed to recognize image text.")
         
     | 
| 
      
 39 
     | 
    
         
            +
                    end
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
41 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: aspose_ocr_cloud
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - M. Sohail Ismail
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2016- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-11-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: typhoeus
         
     |