atlas_rb 0.0.58 → 0.0.61
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/Gemfile.lock +2 -2
- data/lib/atlas_rb/blob.rb +30 -0
- data/lib/atlas_rb/file_set.rb +16 -16
- data/lib/atlas_rb.rb +1 -1
- metadata +3 -3
- data/lib/atlas_rb/file.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fc8248dce62919e557dcea44a7cbc492f4ec35cd27cb55913c2de1ec480c6d9
|
4
|
+
data.tar.gz: 85246ff7f2a6584a0811d44301ec9456501dae766678a516ba983f8852eae9f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d21922ec797058ceb83b4c780940af0473ab3367c216882295c904781debcf6667d1fc58c910232cdec8abacb0d773a5a1dcd4e1749a4d1961a96c08f1b66dd
|
7
|
+
data.tar.gz: fcbb8e9690552079436ad47a2a1a35903d083436a30e352bf4ec95c7bd71250d9a5294bf4b8b342ba5bca15f285aff9ba87f6d83e93ecce4b861e62619f3b382
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.61
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
atlas_rb (0.0.
|
4
|
+
atlas_rb (0.0.61)
|
5
5
|
faraday (~> 2.7)
|
6
6
|
faraday-follow_redirects (~> 0.3.0)
|
7
7
|
faraday-multipart (~> 1)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
38
|
rspec-support (~> 3.12.0)
|
39
39
|
rspec-support (3.12.1)
|
40
|
-
uri (0.13.
|
40
|
+
uri (0.13.1)
|
41
41
|
|
42
42
|
PLATFORMS
|
43
43
|
x86_64-linux
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AtlasRb
|
4
|
+
class Blob < Resource
|
5
|
+
ROUTE = "/files/"
|
6
|
+
|
7
|
+
def self.find(id)
|
8
|
+
connection({}).get(ROUTE + id)&.body
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.create(id, blob_path)
|
12
|
+
payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path),
|
13
|
+
"application/octet-stream",
|
14
|
+
File.basename(blob_path)) }
|
15
|
+
|
16
|
+
multipart({ work_id: id }).post(ROUTE, payload)&.body
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.destroy(id)
|
20
|
+
connection({}).delete(ROUTE + id)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.update(id, blob_path)
|
24
|
+
payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path),
|
25
|
+
"application/octet-stream",
|
26
|
+
File.basename(blob_path)) }
|
27
|
+
multipart({}).patch(ROUTE + id, payload)&.body
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/atlas_rb/file_set.rb
CHANGED
@@ -3,25 +3,25 @@
|
|
3
3
|
module AtlasRb
|
4
4
|
class FileSet < Resource
|
5
5
|
ROUTE = "/file_sets/"
|
6
|
-
end
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
def self.find(id)
|
8
|
+
connection({}).get(ROUTE + id)&.body
|
9
|
+
end
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
def self.create(id, classification)
|
12
|
+
connection({ work_id: id, classification: classification }).post(ROUTE)&.body
|
13
|
+
end
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
def self.destroy(id)
|
16
|
+
connection({}).delete(ROUTE + id)
|
17
|
+
end
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
def self.update(id, blob_path)
|
20
|
+
# Need to figure out blob vs XML
|
21
|
+
payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path),
|
22
|
+
"application/octet-stream",
|
23
|
+
File.basename(blob_path)) }
|
24
|
+
multipart({}).patch(ROUTE + id, payload)&.body
|
25
|
+
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/atlas_rb.rb
CHANGED
@@ -10,7 +10,7 @@ require_relative "atlas_rb/community"
|
|
10
10
|
require_relative "atlas_rb/collection"
|
11
11
|
require_relative "atlas_rb/work"
|
12
12
|
require_relative "atlas_rb/file_set"
|
13
|
-
require_relative "atlas_rb/
|
13
|
+
require_relative "atlas_rb/blob"
|
14
14
|
|
15
15
|
module AtlasRb
|
16
16
|
class Error < StandardError; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlas_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cliff
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -85,10 +85,10 @@ files:
|
|
85
85
|
- bin/console
|
86
86
|
- bin/setup
|
87
87
|
- lib/atlas_rb.rb
|
88
|
+
- lib/atlas_rb/blob.rb
|
88
89
|
- lib/atlas_rb/collection.rb
|
89
90
|
- lib/atlas_rb/community.rb
|
90
91
|
- lib/atlas_rb/faraday_helper.rb
|
91
|
-
- lib/atlas_rb/file.rb
|
92
92
|
- lib/atlas_rb/file_set.rb
|
93
93
|
- lib/atlas_rb/resource.rb
|
94
94
|
- lib/atlas_rb/version.rb
|
data/lib/atlas_rb/file.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module AtlasRb
|
4
|
-
class File < Resource
|
5
|
-
ROUTE = "/files/"
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.find(id)
|
9
|
-
connection({}).get(ROUTE + id)&.body
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.create(id, blob_path)
|
13
|
-
payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path),
|
14
|
-
"application/octet-stream",
|
15
|
-
File.basename(blob_path)) }
|
16
|
-
|
17
|
-
multipart({ work_id: id }).post(ROUTE, payload)&.body
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.destroy(id)
|
21
|
-
connection({}).delete(ROUTE + id)
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.update(id, blob_path)
|
25
|
-
payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path),
|
26
|
-
"application/octet-stream",
|
27
|
-
File.basename(blob_path)) }
|
28
|
-
multipart({}).patch(ROUTE + id, payload)&.body
|
29
|
-
end
|
30
|
-
end
|