sdr-client 0.96.0 → 0.97.0
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/Gemfile.lock +39 -34
- data/README.md +3 -1
- data/lib/sdr_client/deposit/file_metadata_builder.rb +2 -3
- data/lib/sdr_client/deposit/file_set.rb +1 -1
- data/lib/sdr_client/deposit/matching_file_grouping_strategy.rb +1 -1
- data/lib/sdr_client/deposit/model_process.rb +2 -5
- data/lib/sdr_client/deposit/process.rb +1 -2
- data/lib/sdr_client/deposit/upload_files.rb +2 -0
- data/lib/sdr_client/deposit/upload_files_metadata_builder.rb +1 -1
- data/lib/sdr_client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c562c90ba48ff8d6168c1c7488537bde46faab61ec81963de5917776ffa9f079
|
|
4
|
+
data.tar.gz: 1e22559c270a5312f975a382c87daac40af750c24755f62c02873775d07c0855
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5aa3b0ff99dfedf0751c5c0f9782d5c17b0092a5aa98a222e9f15c0011945f6fa67403f82334bcdfc6d405883e49682032dee0b498a1a0f56d7b84a52cf36756
|
|
7
|
+
data.tar.gz: ed9acb2561e273f516804b60b734d3a4c900b79c3648bfa62cde33d3164ab42e27d13d675233ca45f3f1f0d75314cca3702810a0a9ed3a9f7b68359332f12a89
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
sdr-client (0.
|
|
4
|
+
sdr-client (0.97.0)
|
|
5
5
|
activesupport
|
|
6
6
|
cocina-models (~> 0.86.0)
|
|
7
7
|
dry-monads
|
|
@@ -45,33 +45,38 @@ GEM
|
|
|
45
45
|
docile (1.4.0)
|
|
46
46
|
dry-container (0.11.0)
|
|
47
47
|
concurrent-ruby (~> 1.0)
|
|
48
|
-
dry-core (0.
|
|
48
|
+
dry-core (0.9.1)
|
|
49
49
|
concurrent-ruby (~> 1.0)
|
|
50
|
+
zeitwerk (~> 2.6)
|
|
50
51
|
dry-inflector (0.3.0)
|
|
51
|
-
dry-logic (1.
|
|
52
|
+
dry-logic (1.3.0)
|
|
52
53
|
concurrent-ruby (~> 1.0)
|
|
53
|
-
dry-core (~> 0.
|
|
54
|
-
|
|
54
|
+
dry-core (~> 0.9, >= 0.9)
|
|
55
|
+
zeitwerk (~> 2.6)
|
|
56
|
+
dry-monads (1.5.0)
|
|
55
57
|
concurrent-ruby (~> 1.0)
|
|
56
|
-
dry-core (~> 0.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
dry-
|
|
58
|
+
dry-core (~> 0.9, >= 0.9)
|
|
59
|
+
zeitwerk (~> 2.6)
|
|
60
|
+
dry-struct (1.5.2)
|
|
61
|
+
dry-core (~> 0.9, >= 0.9)
|
|
62
|
+
dry-types (~> 1.6)
|
|
60
63
|
ice_nine (~> 0.11)
|
|
61
|
-
|
|
64
|
+
zeitwerk (~> 2.6)
|
|
65
|
+
dry-types (1.6.1)
|
|
62
66
|
concurrent-ruby (~> 1.0)
|
|
63
67
|
dry-container (~> 0.3)
|
|
64
|
-
dry-core (~> 0.
|
|
68
|
+
dry-core (~> 0.9, >= 0.9)
|
|
65
69
|
dry-inflector (~> 0.1, >= 0.1.2)
|
|
66
|
-
dry-logic (~> 1.
|
|
70
|
+
dry-logic (~> 1.3, >= 1.3)
|
|
71
|
+
zeitwerk (~> 2.6)
|
|
67
72
|
edtf (3.1.0)
|
|
68
73
|
activesupport (>= 3.0, < 8.0)
|
|
69
74
|
equivalent-xml (0.6.0)
|
|
70
75
|
nokogiri (>= 1.4.3)
|
|
71
|
-
faraday (2.
|
|
76
|
+
faraday (2.6.0)
|
|
72
77
|
faraday-net_http (>= 2.0, < 3.1)
|
|
73
78
|
ruby2_keywords (>= 0.0.4)
|
|
74
|
-
faraday-net_http (3.0.
|
|
79
|
+
faraday-net_http (3.0.1)
|
|
75
80
|
hashdiff (1.0.1)
|
|
76
81
|
i18n (1.12.0)
|
|
77
82
|
concurrent-ruby (~> 1.0)
|
|
@@ -81,9 +86,9 @@ GEM
|
|
|
81
86
|
multi_json
|
|
82
87
|
minitest (5.16.3)
|
|
83
88
|
multi_json (1.15.0)
|
|
84
|
-
nokogiri (1.13.
|
|
89
|
+
nokogiri (1.13.9-x86_64-darwin)
|
|
85
90
|
racc (~> 1.4)
|
|
86
|
-
nokogiri (1.13.
|
|
91
|
+
nokogiri (1.13.9-x86_64-linux)
|
|
87
92
|
racc (~> 1.4)
|
|
88
93
|
openapi3_parser (0.9.2)
|
|
89
94
|
commonmarker (~> 0.17)
|
|
@@ -98,40 +103,40 @@ GEM
|
|
|
98
103
|
racc (1.6.0)
|
|
99
104
|
rainbow (3.1.1)
|
|
100
105
|
rake (13.0.6)
|
|
101
|
-
regexp_parser (2.
|
|
106
|
+
regexp_parser (2.6.0)
|
|
102
107
|
rexml (3.2.5)
|
|
103
|
-
rspec (3.
|
|
104
|
-
rspec-core (~> 3.
|
|
105
|
-
rspec-expectations (~> 3.
|
|
106
|
-
rspec-mocks (~> 3.
|
|
107
|
-
rspec-core (3.
|
|
108
|
-
rspec-support (~> 3.
|
|
109
|
-
rspec-expectations (3.
|
|
108
|
+
rspec (3.12.0)
|
|
109
|
+
rspec-core (~> 3.12.0)
|
|
110
|
+
rspec-expectations (~> 3.12.0)
|
|
111
|
+
rspec-mocks (~> 3.12.0)
|
|
112
|
+
rspec-core (3.12.0)
|
|
113
|
+
rspec-support (~> 3.12.0)
|
|
114
|
+
rspec-expectations (3.12.0)
|
|
110
115
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
111
|
-
rspec-support (~> 3.
|
|
112
|
-
rspec-mocks (3.
|
|
116
|
+
rspec-support (~> 3.12.0)
|
|
117
|
+
rspec-mocks (3.12.0)
|
|
113
118
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
114
|
-
rspec-support (~> 3.
|
|
115
|
-
rspec-support (3.
|
|
116
|
-
rspec_junit_formatter (0.
|
|
119
|
+
rspec-support (~> 3.12.0)
|
|
120
|
+
rspec-support (3.12.0)
|
|
121
|
+
rspec_junit_formatter (0.6.0)
|
|
117
122
|
rspec-core (>= 2, < 4, != 2.12.0)
|
|
118
123
|
rss (0.2.9)
|
|
119
124
|
rexml
|
|
120
|
-
rubocop (1.
|
|
125
|
+
rubocop (1.37.1)
|
|
121
126
|
json (~> 2.3)
|
|
122
127
|
parallel (~> 1.10)
|
|
123
128
|
parser (>= 3.1.2.1)
|
|
124
129
|
rainbow (>= 2.2.2, < 4.0)
|
|
125
130
|
regexp_parser (>= 1.8, < 3.0)
|
|
126
131
|
rexml (>= 3.2.5, < 4.0)
|
|
127
|
-
rubocop-ast (>= 1.
|
|
132
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
|
128
133
|
ruby-progressbar (~> 1.7)
|
|
129
134
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
130
|
-
rubocop-ast (1.
|
|
135
|
+
rubocop-ast (1.23.0)
|
|
131
136
|
parser (>= 3.1.1.0)
|
|
132
137
|
rubocop-rake (0.6.0)
|
|
133
138
|
rubocop (~> 1.0)
|
|
134
|
-
rubocop-rspec (2.
|
|
139
|
+
rubocop-rspec (2.14.2)
|
|
135
140
|
rubocop (~> 1.33)
|
|
136
141
|
ruby-progressbar (1.11.0)
|
|
137
142
|
ruby2_keywords (0.0.5)
|
|
@@ -153,7 +158,7 @@ GEM
|
|
|
153
158
|
addressable (>= 2.8.0)
|
|
154
159
|
crack (>= 0.3.2)
|
|
155
160
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
156
|
-
zeitwerk (2.6.
|
|
161
|
+
zeitwerk (2.6.4)
|
|
157
162
|
|
|
158
163
|
PLATFORMS
|
|
159
164
|
x86_64-darwin-19
|
data/README.md
CHANGED
|
@@ -11,9 +11,10 @@ This provides a way for consumers to easily and correctly deposit files to the S
|
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Ruby 3 is required. The latest 3.x release is recommended.
|
|
15
15
|
|
|
16
16
|
`gem install sdr-client`
|
|
17
|
+
Note that some commands require the lastest version of the client. Use this command to update the client as necessary.
|
|
17
18
|
|
|
18
19
|
## Usage
|
|
19
20
|
|
|
@@ -35,6 +36,7 @@ Log in:
|
|
|
35
36
|
```
|
|
36
37
|
sdr login --url https://sdr-api-server:3000
|
|
37
38
|
```
|
|
39
|
+
You will be prompted for an email and password. Note that this is for an SDR API account, not SUNET account.
|
|
38
40
|
|
|
39
41
|
Display version of sdr-client:
|
|
40
42
|
```
|
|
@@ -31,13 +31,12 @@ module SdrClient
|
|
|
31
31
|
# @return [Hash<String, Hash<String, String>>]
|
|
32
32
|
def build
|
|
33
33
|
files.each do |file_path|
|
|
34
|
-
file_key = ::File.basename(file_path)
|
|
35
34
|
OPERATIONS.each do |operation|
|
|
36
35
|
result = operation.for(file_path: file_path)
|
|
37
36
|
next if result.nil?
|
|
38
37
|
|
|
39
|
-
files_metadata[
|
|
40
|
-
files_metadata[
|
|
38
|
+
files_metadata[file_path] ||= {}
|
|
39
|
+
files_metadata[file_path][operation::NAME] = result
|
|
41
40
|
end
|
|
42
41
|
end
|
|
43
42
|
files_metadata
|
|
@@ -10,7 +10,7 @@ module SdrClient
|
|
|
10
10
|
# Call `#values` on the result of the grouping operation because 1)
|
|
11
11
|
# `Process#build_filesets` expects an array of arrays, not an array of
|
|
12
12
|
# hashes, and 2) the keys aren't used anywhere
|
|
13
|
-
uploads.group_by { |ul| ::File.basename(ul.filename, '.*') }.values
|
|
13
|
+
uploads.group_by { |ul| ::File.join(::File.dirname(ul.filename), ::File.basename(ul.filename, '.*')) }.values
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
end
|
|
@@ -61,15 +61,12 @@ module SdrClient
|
|
|
61
61
|
def child_files_match
|
|
62
62
|
# Files without request files.
|
|
63
63
|
files.each do |filepath|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
raise "Request file not provided for #{filepath}" if request_files[filename].nil?
|
|
64
|
+
raise "Request file not provided for #{filepath}" if request_files[filepath].nil?
|
|
67
65
|
end
|
|
68
66
|
|
|
69
67
|
# Request files without files
|
|
70
|
-
filenames = files.map { |filepath| ::File.basename(filepath) }
|
|
71
68
|
request_files.each_key do |request_filename|
|
|
72
|
-
raise "File not provided for request file #{request_filename}" unless
|
|
69
|
+
raise "File not provided for request file #{request_filename}" unless files.include?(request_filename)
|
|
73
70
|
end
|
|
74
71
|
end
|
|
75
72
|
|
|
@@ -28,6 +28,8 @@ module SdrClient
|
|
|
28
28
|
def run
|
|
29
29
|
file_metadata.map do |filename, metadata|
|
|
30
30
|
direct_upload(metadata.to_json).tap do |response|
|
|
31
|
+
# ActiveStorage modifies the filename provided in response, so setting here.
|
|
32
|
+
response.filename = filename
|
|
31
33
|
upload_file(filename: filename,
|
|
32
34
|
url: response.direct_upload.fetch('url'),
|
|
33
35
|
content_type: response.content_type,
|
data/lib/sdr_client/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sdr-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.97.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Coyne
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-11-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
274
274
|
- !ruby/object:Gem::Version
|
|
275
275
|
version: '0'
|
|
276
276
|
requirements: []
|
|
277
|
-
rubygems_version: 3.
|
|
277
|
+
rubygems_version: 3.3.7
|
|
278
278
|
signing_key:
|
|
279
279
|
specification_version: 4
|
|
280
280
|
summary: The CLI for https://github.com/sul-dlss/sdr-api
|