doxie 0.0.7 → 0.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51d0c17e145193ebfec7231b9c9113799c384305
4
- data.tar.gz: 7fae9d4100c33a0eedfd83fe7637ea1b878a1284
3
+ metadata.gz: ae4e4a69165781ebee343cba581f5a735e68ac08
4
+ data.tar.gz: 7757f3e1c1a1eeda217bb307e708e9cc4e6e6815
5
5
  SHA512:
6
- metadata.gz: e8be18b7473ac8eeba04d4d297e0389ce12357ca328639c1113094880c6d560acbc9131bc50e808698f951c3ce4f005baf83164adcd7a1d922f9e40188e0e055
7
- data.tar.gz: 3c3188c4e7d0e2c45b333a6c42d4436baf40aaf4b2ebba6c93bccb46a53bb310d85446e24f495c55988ce87d01098f5f1ba6a83e182ad4f5377c6893d1211466
6
+ metadata.gz: 8e5d37700e28d2c523f92966815c5b491ffac320bf0394aad2a8ee094d9d9cd2f2b5366580c624d20a20e335cbc25b537618027849de0912fa44327d4b228cda
7
+ data.tar.gz: 546710b03cb98194449ab32780456864f1bdbdb9ef33293a997aa5c1a91e858cb6a01fa7a8980f84b6b25c112e4d66fb65b344904e7cc2d08ca11ea0adc6dda8
data/README.md CHANGED
@@ -95,6 +95,22 @@ client.scan "/DOXIE/JPEG/IMG_0001.JPG", 'test.jpg'
95
95
  => true
96
96
  ```
97
97
 
98
+ ### GET /thumbnails/DOXIE/JPEG/IMG_XXXX.JPG
99
+
100
+ There are 2 ways to get a thumbnail off your Doxie. The first is to get the raw binary content and then do something with it yourself.
101
+
102
+ ```rb
103
+ client.thumbnail "/DOXIE/JPEG/IMG_0001.JPG"
104
+ => "...?]?1:Xt?????'A??}:<??13???z*???}?rT???????z!ESj?/?..."
105
+ ```
106
+
107
+ The other is to pass in a filename:
108
+
109
+ ```rb
110
+ client.thumbnail "/DOXIE/JPEG/IMG_0001.JPG", 'test.jpg'
111
+ => true
112
+ ```
113
+
98
114
  ## Contributing
99
115
 
100
116
  1. **Fork** the repo on GitHub
data/doxie.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'doxie'
4
- s.version = '0.0.7'
4
+ s.version = '0.0.8'
5
5
  s.summary = "Doxie API Wrapper for getting scans off your Doxie scanner"
6
6
  s.description = "Doxie API Wrapper for getting scans off your Doxie scanner"
7
7
  s.authors = ["Cristiano Betta"]
data/lib/doxie.rb CHANGED
@@ -41,6 +41,10 @@ module Doxie
41
41
  file "/scans#{scan_name}", file_name
42
42
  end
43
43
 
44
+ def thumbnail scan_name, file_name = nil
45
+ file "/thumbnails#{scan_name}", file_name
46
+ end
47
+
44
48
  private
45
49
 
46
50
  def get path
data/spec/doxie_spec.rb CHANGED
@@ -70,6 +70,20 @@ describe 'Doxie::Client' do
70
70
  end
71
71
  end
72
72
 
73
+ describe 'get /thumbnails/DOXIE/JPEG/IMG_0001.JPG' do
74
+ it 'should return the result' do
75
+ stub_request(:get, "#{@base_url}/thumbnails/DOXIE/JPEG/IMG_0001.JPG")
76
+ .to_return(@json_response_body)
77
+ @client.thumbnail('/DOXIE/JPEG/IMG_0001.JPG').must_equal(@json_response_object)
78
+ end
79
+
80
+ it 'should write to file' do
81
+ stub_request(:get, "#{@base_url}/thumbnails/DOXIE/JPEG/IMG_0001.JPG")
82
+ .to_return(@json_response_body)
83
+ @client.thumbnail('/DOXIE/JPEG/IMG_0001.JPG', 'test.jpg').must_equal(true)
84
+ end
85
+ end
86
+
73
87
  it 'raises an authentication error exception if the response code is 401' do
74
88
  stub_request(:get, "#{@base_url}/hello.json")
75
89
  .to_return(status: 401)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doxie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristiano Betta