doxie 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/doxie.gemspec +1 -1
- data/lib/doxie.rb +4 -0
- data/spec/doxie_spec.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae4e4a69165781ebee343cba581f5a735e68ac08
|
4
|
+
data.tar.gz: 7757f3e1c1a1eeda217bb307e708e9cc4e6e6815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
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)
|