archivist-client 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YTAyOWNlYTk3OTFlNzBkOTQ3MTBjZjgzZTY0MjY1YTE2M2E1NjgxZg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e7704b95e3bc73ba04777f7c7be9b5b6930f3843
|
4
|
+
data.tar.gz: c3c3dca6cc795170838e5d944fdc1814b125703c
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDFjMjQ5OGE3YThjYjRkZjFjZDIwMzk0NDc5ZGIyZDA1ZDc0YmQ3ZDVmN2Iy
|
11
|
-
ZjRlNjg3ZGQ3NjYwYTIzOTNmNGYzODUxOTczYjc1ZGU3NDRiYzY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OWMzNWZhOWQyYWY4ZGU3NmFmMjVkMTI0MGY3ODVhMjVlZGY0NWJjM2RmNjI1
|
14
|
-
MDFlYzgzMzRhNDY5MmMzNjliYWQyZDAwYzIzMTNlMDNlYmE3YjQwN2JjMDVl
|
15
|
-
MWYxNjJmOTcwOTkxNTc4M2ZhODZhM2VjZjEzMTdmNzlkODljZTA=
|
6
|
+
metadata.gz: 0de6ce9accf8abacbbafc168ca37938c0f91b8dd963e90528d4e965973b16ca6d513979c08800ef40f63b898e111db2d41740db3ceb198b926d0b6fcb70f4daf
|
7
|
+
data.tar.gz: 05011890ed16175915b2091a691f0f9ae937d80bde858e37cedcb81a40f45be076270efa33a3a0af4891c1b509e30abe623a89232bf6d253c7d5965785d4d063
|
@@ -6,6 +6,8 @@ require 'date'
|
|
6
6
|
module Archivist
|
7
7
|
module Model
|
8
8
|
class Document
|
9
|
+
UnsupportedFormat = Class.new(StandardError)
|
10
|
+
|
9
11
|
include Virtus.model
|
10
12
|
|
11
13
|
include Archivist::Client::Constants
|
@@ -33,9 +35,13 @@ module Archivist
|
|
33
35
|
def download(format=:text)
|
34
36
|
# e.g. format_index.text_format
|
35
37
|
file_format = format_index.send(:"#{format}_format")
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
if file_format.nil?
|
39
|
+
raise UnsupportedFormat, "#{identifier} not available in format #{format}"
|
40
|
+
else
|
41
|
+
# e.g. /download/firstbooknapole00gruagoog/firstbooknapole00gruagoog_djvu.txt
|
42
|
+
@conn.get(download_path(file_format.name)).
|
43
|
+
body.force_encoding('UTF-8')
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
def download_path(file)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archivist-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Duane Johnson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|