ddr-models 2.4.0.rc3 → 2.4.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ddr/index/fields.rb +14 -10
- data/lib/ddr/models/version.rb +1 -1
- data/spec/index/fields_spec.rb +22 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2406a157a006c5fff980da281a457b140c467e27
|
4
|
+
data.tar.gz: ca9c89caf184aa999333ef3781373fa71137c408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82dfb88bdb1cdb4cde005ce04ad8153ae2742638d8eb4a79f697d68f8fb4a4b7524b1885c105257a0036a2da50dc66741bf0f37dbea64ac447f2f536977dd209
|
7
|
+
data.tar.gz: 1441428287cdcdb26c8a9e8337520e15b5b384974da1acd7ae525a21c8f09da06172ebe37222b18fa99e420c4e31fd7d4e875977ff419da31a6ca28ac7ce4033
|
data/lib/ddr/index/fields.rb
CHANGED
@@ -2,16 +2,6 @@ module Ddr::Index
|
|
2
2
|
module Fields
|
3
3
|
extend Deprecation
|
4
4
|
|
5
|
-
def self.get(name)
|
6
|
-
const_get(name.to_s.upcase, false)
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.techmd
|
10
|
-
constants(false)
|
11
|
-
.select { |c| c =~ /\ATECHMD_/ }
|
12
|
-
.map { |c| const_get(c) }
|
13
|
-
end
|
14
|
-
|
15
5
|
ID = UniqueKeyField.instance
|
16
6
|
|
17
7
|
ACCESS_ROLE = Field.new :access_role, :stored_sortable
|
@@ -85,6 +75,20 @@ module Ddr::Index
|
|
85
75
|
WORKFLOW_STATE = Field.new :workflow_state, :stored_sortable
|
86
76
|
YEAR_FACET = Field.new :year_facet, solr_name: "year_facet_iim"
|
87
77
|
|
78
|
+
def self.get(name)
|
79
|
+
const_get(name.to_s.upcase, false)
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.techmd
|
83
|
+
@techmd ||= constants(false).select { |c| c =~ /\ATECHMD_/ }.map { |c| const_get(c) }
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.descmd
|
87
|
+
@descmd ||= Ddr::Datastreams::DescriptiveMetadataDatastream.properties.map do |base, config|
|
88
|
+
Field.new base, *(config.behaviors)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
88
92
|
def self.const_missing(name)
|
89
93
|
if name == :PID
|
90
94
|
Deprecation.warn(Ddr::Index::Fields,
|
data/lib/ddr/models/version.rb
CHANGED
data/spec/index/fields_spec.rb
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
module Ddr::Index
|
2
2
|
RSpec.describe Fields do
|
3
3
|
|
4
|
+
describe "module methods" do
|
5
|
+
specify {
|
6
|
+
expect(Fields.techmd).to contain_exactly(
|
7
|
+
Fields::TECHMD_COLOR_SPACE,
|
8
|
+
Fields::TECHMD_CREATING_APPLICATION,
|
9
|
+
Fields::TECHMD_CREATION_TIME,
|
10
|
+
Fields::TECHMD_FILE_SIZE,
|
11
|
+
Fields::TECHMD_FITS_VERSION,
|
12
|
+
Fields::TECHMD_FITS_DATETIME,
|
13
|
+
Fields::TECHMD_FORMAT_LABEL,
|
14
|
+
Fields::TECHMD_FORMAT_VERSION,
|
15
|
+
Fields::TECHMD_IMAGE_HEIGHT,
|
16
|
+
Fields::TECHMD_IMAGE_WIDTH,
|
17
|
+
Fields::TECHMD_MEDIA_TYPE,
|
18
|
+
Fields::TECHMD_MODIFICATION_TIME,
|
19
|
+
Fields::TECHMD_PRONOM_IDENTIFIER,
|
20
|
+
Fields::TECHMD_VALID,
|
21
|
+
Fields::TECHMD_WELL_FORMED
|
22
|
+
)
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
4
26
|
describe "constants" do
|
5
27
|
describe "ID" do
|
6
28
|
subject { Fields::ID }
|