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

pulibrary / pdc_describe / 4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

07 Apr 2025 06:36PM UTC coverage: 1.283% (-94.6%) from 95.862%
4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

Pull #1994

circleci

hectorcorrea
Switched to use the autocomplete that we aleady use for ROR. Integrated it with the existing logic for creators
Pull Request #1994: Started adding auto complete to contributors

0 of 46 new or added lines in 2 files covered. (0.0%)

4806 existing lines in 74 files now uncovered.

65 of 5065 relevant lines covered (1.28%)

0.01 hits per line

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

0.0
/app/models/pdc_metadata/name_identifier.rb
1
# frozen_string_literal: true
2
# Class for storing a named identifier for the creator in our local representation.  This identifier can be a person or organization.
3
# **Please Note:**
4
# The class name NameIdentifier is being utilized becuase it matches with the DataCite Schema: https://support.datacite.org/docs/datacite-metadata-schema-v44-mandatory-properties#24-nameidentifier
5
# It also matches with the DataCite xml mapping gem that we are utilizing: https://github.com/CDLUC3/datacite-mapping/blob/master/lib/datacite/mapping/name_identifier.rb
UNCOV
6
module PDCMetadata
×
7
  # value:      "0000-0001-5000-0007"
8
  # scheme:     "ORCID"
9
  # scheme_uri: "https://orcid.org/""
UNCOV
10
  class NameIdentifier
×
UNCOV
11
    attr_accessor :value, :scheme, :scheme_uri
×
UNCOV
12
    def initialize(value: nil, scheme: nil, scheme_uri: nil)
×
UNCOV
13
      @value = value
×
UNCOV
14
      @scheme = scheme
×
UNCOV
15
      @scheme_uri = scheme_uri
×
UNCOV
16
    end
×
17

UNCOV
18
    ORCID = "ORCID"
×
UNCOV
19
    ROR = "ROR"
×
20

UNCOV
21
    def orcid_url
×
UNCOV
22
      return nil unless scheme == ORCID
×
UNCOV
23
      "#{scheme_uri}/#{value}"
×
UNCOV
24
    end
×
25

UNCOV
26
    def orcid
×
UNCOV
27
      return nil unless scheme == ORCID
×
UNCOV
28
      value
×
UNCOV
29
    end
×
30

UNCOV
31
    def ror
×
UNCOV
32
      ror_url
×
UNCOV
33
    end
×
34

35
    # Allow override of where to look up ROR values.
36
    # This lets us test ROR behavior without making network calls.
37
    # See spec/support/orcid_specs.rb for more info
UNCOV
38
    def ror_url
×
UNCOV
39
      return nil unless scheme == ROR
×
40

UNCOV
41
      value
×
UNCOV
42
    end
×
43

UNCOV
44
    def ror_id
×
UNCOV
45
      return nil unless scheme == ROR
×
UNCOV
46
      value.split("/").last
×
UNCOV
47
    end
×
48

UNCOV
49
    def self.new_orcid(value)
×
UNCOV
50
      NameIdentifier.new(value:, scheme: ORCID, scheme_uri: "https://orcid.org")
×
UNCOV
51
    end
×
52

UNCOV
53
    def self.new_ror(value)
×
UNCOV
54
      NameIdentifier.new(value:, scheme: ROR, scheme_uri: "https://ror.org")
×
UNCOV
55
    end
×
UNCOV
56
  end
×
UNCOV
57
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