ddr-core 1.6.6 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63206a3cc7fdaf62637f980a49fd6b4c5c6912238ebc028c111246ccf0fec036
4
- data.tar.gz: a05daaf250a9a618ad05e312c267fba162ae0072c85a7eea9941e174d48c2b54
3
+ metadata.gz: 22911e9ad5452855fb5b40ef580f328296e41a1abd7a9ed589a6d2015eb745a1
4
+ data.tar.gz: 8191a791a07c581ede3d65b555bea9f123e218eeaf629f69210f4d7f000b0cc3
5
5
  SHA512:
6
- metadata.gz: 21ecc27d2b66cd0729352b603ebda307321b643b0ae05e09693b2fbdef9a35cedbf0a367e6e6fdfbd4bf68bf6fcae5141a9ac918abe80d1b9c0be3f9cdd42daa
7
- data.tar.gz: e2f16e2a8501c000eef52a17d3b90d967e471aea12a4dbe04fe674417c9bd39962cab3b5763ca792f94bba75bb8f86434b78602b59590c868cfde18d3b3e8ef1
6
+ metadata.gz: a1059b1a44d54aa2a3fa9003e4d1f0733563e606fa53160eaee724f2f9333f1bb21d5313bbaf43318abe354fca4baeca55b8288bf2924b42ed6ba62ee7adcd60
7
+ data.tar.gz: b909f0636e55d0b69e48e9593320c141c66229eaa772656dd064f2e26899a48819d03a4d5099791024b10f167713700fc53baf829b2366d81816df25b16791f0
data/README.md CHANGED
@@ -10,19 +10,11 @@ Change to the `.docker` directory.
10
10
 
11
11
  Start the *development* stack:
12
12
 
13
- $ ./dev.sh up -d --build
13
+ $ ./dev.sh up -d
14
14
 
15
15
  To run a Bash shell on the app server:
16
16
 
17
- $ ./dev.sh run --rm app bash
18
-
19
- To connect to the *development* database:
20
-
21
- $ ./dev.sh run --rm app psql -U postgres -h db -d ddr_core
22
-
23
- To run the *test suite*:
24
-
25
- $ ./run_test_suite.sh
17
+ $ ./dev.sh exec app bash
26
18
 
27
19
  Stop the *development* stack:
28
20
 
@@ -6,55 +6,9 @@ module Ddr
6
6
  attribute :content, Ddr::File.optional
7
7
  attribute :fits_file, Ddr::File.optional
8
8
 
9
- ### DDRevo ################################################
10
- # Extracted text factored out to separate concern -- Ddr::HasExtractedText
11
- ### DDRevo ################################################
12
- # has_file_datastream \
13
- # name: Ddr::Datastreams::EXTRACTED_TEXT,
14
- # type: Ddr::Datastreams::PlainTextDatastream,
15
- # versionable: true,
16
- # label: "Text extracted from the content file",
17
- # control_group: "M"
18
- #
19
-
20
9
  delegate :original_filename, to: :content, allow_nil: true
21
-
22
- #######DDRevo#########
23
- # expect that the FileManagement module will go to staff app
24
- #######DDRevo#########
25
- # include FileManagement
26
- #
27
- #######DDRevo#########
28
- # to staff app
29
- #######DDRevo#########
30
- # delegate :validate_checksum!, to: :content
31
10
  end
32
11
 
33
- #######DDRevo#########
34
- # to staff app
35
- #######DDRevo#########
36
- # # Convenience method wrapping FileManagement#add_file
37
- # def upload file, opts={}
38
- # add_file(file, Ddr::Datastreams::CONTENT, opts)
39
- # end
40
- #
41
- #######DDRevo#########
42
- # to staff app
43
- #######DDRevo#########
44
- # # Set content to file and save
45
- # def upload! file, opts={}
46
- # upload(file, opts)
47
- # save
48
- # end
49
- #
50
- #######DDRevo#########
51
- # DerivativesManager will go to staff app. Need to determine if there is a need for a '#derivatives' method on
52
- # content-bearing objects and, if so, what it should return
53
- #######DDRevo#########
54
- # def derivatives
55
- # @derivatives ||= Ddr::Managers::DerivativesManager.new(self)
56
- # end
57
- #
58
12
  def techmd
59
13
  @techmd ||= Ddr::Managers::TechnicalMetadataManager.new(self)
60
14
  end
@@ -80,10 +34,6 @@ module Ddr
80
34
  content_type&.split("/")&.last
81
35
  end
82
36
 
83
- # def content_type= mime_type
84
- # self.content.mimeType = mime_type
85
- # end
86
- #
87
37
  def image?
88
38
  content_major_type == "image"
89
39
  end
@@ -92,42 +42,5 @@ module Ddr
92
42
  content_type == "application/pdf"
93
43
  end
94
44
 
95
- # def virus_checks
96
- # Ddr::Events::VirusCheckEvent.for_object(self)
97
- # end
98
- #
99
- # def last_virus_check
100
- # virus_checks.last
101
- # end
102
- #
103
- # def last_virus_check_on
104
- # last_virus_check && last_virus_check.event_date_time
105
- # end
106
- #
107
- # def last_virus_check_outcome
108
- # last_virus_check && last_virus_check.outcome
109
- # end
110
- #
111
- # def content_changed?
112
- # content.external? ? content.dsLocation_changed? : content.content_changed?
113
- # end
114
- #
115
- ### DDRevo ###########################################
116
- # Moved to Ddr::Resource where other 'has_<file>?' methods reside
117
- ### DDRevo ###########################################
118
- # def has_extracted_text?
119
- # extractedText.has_content?
120
- # end
121
- #
122
- # def with_content_file(&block)
123
- # WithContentFile.new(self, &block)
124
- # end
125
- #
126
- # protected
127
- #
128
- # def default_content_type
129
- # "application/octet-stream"
130
- # end
131
-
132
45
  end
133
46
  end
@@ -4,5 +4,9 @@ module Ddr
4
4
  attribute :type, Ddr::Files::CHECKSUM_TYPES
5
5
  attribute :value, Valkyrie::Types::Strict::String
6
6
 
7
+ def sha1?
8
+ type == Ddr::Files::CHECKSUM_TYPE_SHA1
9
+ end
10
+
7
11
  end
8
12
  end
@@ -28,6 +28,10 @@ module Ddr
28
28
  file.size
29
29
  end
30
30
 
31
+ def sha1
32
+ digest.detect(&:sha1?)&.value
33
+ end
34
+
31
35
  # Return default file extension for file based on MIME type
32
36
  def default_file_extension
33
37
  mimetypes = MIME::Types[media_type]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddr-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Coble
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-11-01 00:00:00.000000000 Z
14
+ date: 2021-11-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activeresource
@@ -269,16 +269,16 @@ dependencies:
269
269
  name: rspec-rails
270
270
  requirement: !ruby/object:Gem::Requirement
271
271
  requirements:
272
- - - ">="
272
+ - - "~>"
273
273
  - !ruby/object:Gem::Version
274
- version: '0'
274
+ version: '4.1'
275
275
  type: :development
276
276
  prerelease: false
277
277
  version_requirements: !ruby/object:Gem::Requirement
278
278
  requirements:
279
- - - ">="
279
+ - - "~>"
280
280
  - !ruby/object:Gem::Version
281
- version: '0'
281
+ version: '4.1'
282
282
  - !ruby/object:Gem::Dependency
283
283
  name: solr_wrapper
284
284
  requirement: !ruby/object:Gem::Requirement