• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

samvera / hydra-pcdm / 65136fe3-7459-42d0-8dcf-fad3664e0817

21 Apr 2023 06:52PM UTC coverage: 72.072% (-27.9%) from 100.0%
65136fe3-7459-42d0-8dcf-fad3664e0817

push

circleci

web-flow
Release 1.3.0 (#299)

160 of 222 relevant lines covered (72.07%)

8.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.86
/lib/hydra/pcdm.rb
1
require 'active_support'
12✔
2
require 'mime/types'
12✔
3
require 'active_fedora/aggregation'
12✔
4

5
module Hydra
12✔
6
  module PCDM
12✔
7
    extend ActiveSupport::Autoload
12✔
8

9
    module Vocab
12✔
10
      extend ActiveSupport::Autoload
12✔
11
      eager_autoload do
12✔
12
        autoload :PCDMTerms
12✔
13
      end
14
    end
15

16
    autoload :Config
12✔
17

18
    # models
19
    autoload_under 'models' do
12✔
20
      autoload :Collection
12✔
21
      autoload :Object
12✔
22
      autoload :File
12✔
23
    end
24

25
    # behavior concerns
26
    autoload_under 'models/concerns' do
12✔
27
      autoload :CollectionBehavior
12✔
28
      autoload :ObjectBehavior
12✔
29
      autoload :PcdmBehavior
12✔
30
    end
31

32
    autoload :PCDMIndexer
12✔
33
    autoload :CollectionIndexer
12✔
34
    autoload :ObjectIndexer
12✔
35

36
    # file services
37
    autoload :AddTypeToFile,                     'hydra/pcdm/services/file/add_type'
12✔
38
    autoload :GetMimeTypeForFile,                'hydra/pcdm/services/file/get_mime_type'
12✔
39

40
    # Associations
41
    autoload :AncestorChecker,                   'hydra/pcdm/ancestor_checker'
12✔
42
    autoload :Validators,                        'hydra/pcdm/validators'
12✔
43

44
    # model validations
45
    def self.collection?(collection)
12✔
46
      return false unless collection.respond_to? :type
×
47
      Array(collection.type).include? Vocab::PCDMTerms.Collection
×
48
    end
49

50
    def self.object?(object)
12✔
51
      return false unless object.respond_to? :type
×
52
      Array(object.type).include? Vocab::PCDMTerms.Object
×
53
    end
54

55
    def self.file?(file)
12✔
56
      return false unless file.respond_to? :metadata_node
×
57
      Array(file.metadata_node.type).include? Vocab::PCDMTerms.File
×
58
    end
59
  end
60
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc