circleci
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
| 1 |
# frozen_string_literal: true
|
|
|
UNCOV
2
|
require "ezid-client"
|
× |
| 3 |
|
|
|
UNCOV
4
|
class Orcid |
× |
| 5 |
# Notice that we allow for an "X" as the last digit.
|
|
| 6 |
# Source https://gist.github.com/asencis/644f174855899b873131c2cabcebeb87
|
|
|
UNCOV
7
|
ORCID_REGEX = /^(\d{4}-){3}\d{3}(\d|X)$/ |
× |
| 8 |
|
|
|
UNCOV
9
|
def self.valid?(orcid) |
× |
|
UNCOV
10
|
return false if orcid.blank? |
× |
|
UNCOV
11
|
ORCID_REGEX.match(orcid).to_s == orcid
|
× |
|
UNCOV
12
|
end
|
× |
| 13 |
|
|
|
UNCOV
14
|
def self.invalid?(orcid) |
× |
|
UNCOV
15
|
!valid?(orcid) |
× |
|
UNCOV
16
|
end
|
× |
| 17 |
|
|
|
UNCOV
18
|
def self.url(orcid) |
× |
|
UNCOV
19
|
"https://orcid.org/#{orcid}"
|
× |
|
UNCOV
20
|
end
|
× |
|
UNCOV
21
|
end
|
× |