dina 3.3.8.0 → 3.4.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d087f664b96ac8283cc4cdcc1bb568e49d6a4395e42e106369d94b558175f939
4
- data.tar.gz: 51b7d46f7e7050c85b9d7bc831d8db5acde50eba0092558150f10031ff85a260
3
+ metadata.gz: ad42d2bbf02a3b8ba6274c9eee94395ebc78662e33dd3e37ae30a51ca94f1ad7
4
+ data.tar.gz: 4699b92330b897870325169a484b43f2263f3bc44ad15bd8757e6f058e3ff0d7
5
5
  SHA512:
6
- metadata.gz: 7eac64d8358496f847a0c06644459af343025728145455e5e392353e97d125b6fb7b3f2924dee80fa743e930523d6ddc58cf245dad0149c978d8444f3cb22a9d
7
- data.tar.gz: 9aa2b23d6050c7b2afb2f81fdca840e2ea877ec6c747fa361c99c3c8764573b113445b5b13c05b870ac6a6c18a67a6024c8d0db560a5a168de09b3948a887ea3
6
+ metadata.gz: f6a4d51327f4b877b1f082f9f27aadbfe4edc356084143a5626884448e2c863a532373d58189e22ff62cdfa0ee659031e43aa8ad1c9b3654313f6e66c7e00845
7
+ data.tar.gz: 49736d5bbb411f4b72a238cd7cbb4425a48852fc2760d486e0803f8353e90735747caf9849708c605a659f4e8a4588b56c4e139b4c3781b915ffc7170c6ec3bb
@@ -8,6 +8,9 @@ module Dina
8
8
  belongs_to :collectingEvent, class_name: "CollectingEvent", shallow_path: true
9
9
  belongs_to :project, class_name: "Project", shallow_path: true
10
10
  belongs_to :transaction, class_name: "Transaction", shallow_path: true
11
+ belongs_to :site, class_name: "Site", shallow_path: true
12
+ belongs_to :assemblage, class_name: "Assemblage", shallow_path: true
13
+ belongs_to :protocol, class_name: "Protocol", shallow_path: true
11
14
 
12
15
  def self.endpoint_path
13
16
  "collection-api/"
@@ -16,6 +16,7 @@ module Dina
16
16
  property :fileName, type: :string
17
17
  property :dcFormat, type: :string
18
18
  property :isDerivative, type: :boolean
19
+ property :dateTimeDigitized, type: :time
19
20
 
20
21
  validates_presence_of :group, message: "group is required"
21
22
  validates_presence_of :filePath, message: "filePath is required"
@@ -17,8 +17,16 @@ module Dina
17
17
  end
18
18
 
19
19
  def run(request_method, path, params: nil, headers: {}, body: nil)
20
+ uuid_regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
21
+ slug = path[5..].dup
20
22
 
21
- if request_method == :get && path == "file/download"
23
+ if request_method == :get && uuid_regex.match?(slug.to_s.downcase)
24
+ path = "object-upload/#{slug}"
25
+ headers[:content_type] = "application/json"
26
+ response = @faraday.run_request(request_method, path, body, headers) do |request|
27
+ end
28
+ response
29
+ elsif request_method == :get && path == "file/download"
22
30
  path = "file" + "/#{params[:group].downcase}/#{params[:fileIdentifier]}"
23
31
  if params[:isDerivative]
24
32
  path = "file" + "/#{params[:group].downcase}/derivative/#{params[:fileIdentifier]}"
data/lib/dina/version.rb CHANGED
@@ -2,8 +2,8 @@ module Dina
2
2
  class Version
3
3
 
4
4
  MAJOR = 3
5
- MINOR = 3
6
- PATCH = 8
5
+ MINOR = 4
6
+ PATCH = 0
7
7
  BUILD = 0
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dina
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.8.0
4
+ version: 3.4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse