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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80b4bf4ac88afd31bc2ec1941a081a7e5002928e
4
- data.tar.gz: 3454977d7ae1e765bebf7454d3957d4e57e7ff79
3
+ metadata.gz: 2406a157a006c5fff980da281a457b140c467e27
4
+ data.tar.gz: ca9c89caf184aa999333ef3781373fa71137c408
5
5
  SHA512:
6
- metadata.gz: 56a5f5fca3277ea75bbba6766b6b14b570b059cb889e6511abd27a085cf56daf7430dac82afb005806a208ae7a11ff6716cebaee543733a6fd6d4969c08e73fd
7
- data.tar.gz: 9b5f82ad467a6b6fdec25048c3a70e01c4a2ccb7ddc6ebbae8652e112d9ee4bdaac48ece550dc6059b45efe0efa7f659d2d0241e880a9dfaf791e1bd2619bdf4
6
+ metadata.gz: 82dfb88bdb1cdb4cde005ce04ad8153ae2742638d8eb4a79f697d68f8fb4a4b7524b1885c105257a0036a2da50dc66741bf0f37dbea64ac447f2f536977dd209
7
+ data.tar.gz: 1441428287cdcdb26c8a9e8337520e15b5b384974da1acd7ae525a21c8f09da06172ebe37222b18fa99e420c4e31fd7d4e875977ff419da31a6ca28ac7ce4033
@@ -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,
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Models
3
- VERSION = "2.4.0.rc3"
3
+ VERSION = "2.4.0.rc4"
4
4
  end
5
5
  end
@@ -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 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddr-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0.rc3
4
+ version: 2.4.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Coble