preservation 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +1 -1
- data/lib/preservation/report/transfer.rb +23 -35
- data/lib/preservation/version.rb +1 -1
- data/preservation.gemspec +1 -1
- 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: a6efcc684837cbf6bac7115145709ee5b566a235
|
4
|
+
data.tar.gz: 7fd819b11289942989c00eb6575479551565a01c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc61f57e033bc225bf111e726011a422a29a46a3c0078e3cb6e0c66043abd4c0873e3dcd50fa4e37ffa73e272bafad5dd1d4943b5ee0bc0161d4b1a6fa731f72
|
7
|
+
data.tar.gz: c053938ddc860d3cec69eeb4d509428938c803c8c806b0b80294623158af82074fc10a170ff19fbca9c2c1cbed5c79a8f1b99de98e3f000d8a88f04fb7a83547
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
5
5
|
## Unreleased
|
6
6
|
|
7
|
-
## 0.2.
|
7
|
+
## 0.2.1 - 2016-09-26
|
8
|
+
### Fixed
|
9
|
+
- Reporting - handling nulls in database.
|
10
|
+
- Reporting - namespace for hex/bin conversion.
|
11
|
+
|
12
|
+
## 0.2.0 - 2016-09-18
|
8
13
|
### Changed
|
9
14
|
- Singular uuid rather than an array of uuids as parameter for transfer preparation.
|
10
15
|
- Modules, classes and API.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Preservation [![Gem Version](https://badge.fury.io/rb/preservation.svg)](https://badge.fury.io/rb/preservation) [![GitPitch](https://gitpitch.com/assets/badge.svg)](https://gitpitch.com/lulibrary/preservation
|
1
|
+
# Preservation [![Gem Version](https://badge.fury.io/rb/preservation.svg)](https://badge.fury.io/rb/preservation) [![GitPitch](https://gitpitch.com/assets/badge.svg)](https://gitpitch.com/lulibrary/preservation)
|
2
2
|
|
3
3
|
Extraction and Transformation for Loading by Archivematica's Automation Tools.
|
4
4
|
|
@@ -19,28 +19,10 @@ module Preservation
|
|
19
19
|
|
20
20
|
query = "SELECT id, uuid, hex(path) as hex_path, unit_type, status, microservice, current FROM unit WHERE status #{status_presence} ?"
|
21
21
|
|
22
|
-
# Archivematica stores path as BLOB, so need to convert path to Hex, to search for it
|
23
|
-
# and use hex function in DB query
|
24
22
|
records = []
|
25
23
|
db.results_as_hash = true
|
26
24
|
db.execute( query, [ status_to_find ] ) do |row|
|
27
|
-
|
28
|
-
uuid = row['uuid']
|
29
|
-
bin_path = Preservation::Conversion.hex_to_bin row['hex_path']
|
30
|
-
unit_type = row['unit_type']
|
31
|
-
status = row['status']
|
32
|
-
microservice = row['microservice']
|
33
|
-
current = row['current']
|
34
|
-
o = {}
|
35
|
-
o['path'] = bin_path if !bin_path.empty?
|
36
|
-
o['unit_type'] = unit_type if !unit_type.empty?
|
37
|
-
o['status'] = status if !status.empty?
|
38
|
-
o['microservice'] = microservice if !microservice.empty?
|
39
|
-
o['current'] = current if current
|
40
|
-
o['id'] = id if id
|
41
|
-
o['uuid'] = uuid if !uuid.empty?
|
42
|
-
|
43
|
-
records << o
|
25
|
+
records << row_to_hash(row)
|
44
26
|
end
|
45
27
|
|
46
28
|
records
|
@@ -52,25 +34,10 @@ module Preservation
|
|
52
34
|
def self.current
|
53
35
|
query = "SELECT id, uuid, hex(path) as hex_path, unit_type, status, microservice, current FROM unit WHERE current = 1"
|
54
36
|
|
55
|
-
# Archivematica stores path as BLOB, so need to convert path to Hex, to search for it
|
56
|
-
# and use hex function in DB query
|
57
37
|
o = {}
|
58
38
|
db.results_as_hash = true
|
59
39
|
db.execute( query ) do |row|
|
60
|
-
|
61
|
-
uuid = row['uuid']
|
62
|
-
bin_path = hex_to_bin row['hex_path']
|
63
|
-
unit_type = row['unit_type']
|
64
|
-
status = row['status']
|
65
|
-
microservice = row['microservice']
|
66
|
-
current = row['current']
|
67
|
-
o['path'] = bin_path if !bin_path.empty?
|
68
|
-
o['unit_type'] = unit_type if !unit_type.empty?
|
69
|
-
o['status'] = status if !status.empty?
|
70
|
-
o['microservice'] = microservice if !microservice.empty?
|
71
|
-
o['current'] = current if current
|
72
|
-
o['id'] = id if id
|
73
|
-
o['uuid'] = uuid if !uuid.empty?
|
40
|
+
o = row_to_hash(row)
|
74
41
|
end
|
75
42
|
o
|
76
43
|
end
|
@@ -159,6 +126,27 @@ module Preservation
|
|
159
126
|
Preservation::Report::Database.db_connection Preservation.db_path
|
160
127
|
end
|
161
128
|
|
129
|
+
def self.row_to_hash(row)
|
130
|
+
id = row['id']
|
131
|
+
uuid = row['uuid']
|
132
|
+
# Archivematica stores path as BLOB, so need to convert path to Hex, to search for it
|
133
|
+
# and use hex function in DB query
|
134
|
+
bin_path = Preservation::Conversion.hex_to_bin row['hex_path']
|
135
|
+
unit_type = row['unit_type']
|
136
|
+
status = row['status']
|
137
|
+
microservice = row['microservice']
|
138
|
+
current = row['current']
|
139
|
+
o = {}
|
140
|
+
o['path'] = bin_path if !bin_path.nil? && !bin_path.empty?
|
141
|
+
o['unit_type'] = unit_type if !unit_type.nil? && !unit_type.empty?
|
142
|
+
o['status'] = status if !status.nil? && !status.empty?
|
143
|
+
o['microservice'] = microservice if !microservice.nil? && !microservice.empty?
|
144
|
+
o['current'] = current if current
|
145
|
+
o['id'] = id if id
|
146
|
+
o['uuid'] = uuid if !uuid.nil? && !uuid.empty?
|
147
|
+
o
|
148
|
+
end
|
149
|
+
|
162
150
|
end
|
163
151
|
|
164
152
|
end
|
data/lib/preservation/version.rb
CHANGED
data/preservation.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: preservation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Albin-Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: free_disk_space
|