push
circleci
0 of 33 new or added lines in 1 file covered. (0.0%)
9374 existing lines in 213 files now uncovered.47 of 9753 relevant lines covered (0.48%)
0.01 hits per line
| 1 |
# frozen_string_literal: true
|
|
|
UNCOV
2
|
module Orangelight |
× |
| 3 |
# For reference notes that end with a url convert the note into link
|
|
|
UNCOV
4
|
class ReferenceNoteUrlProcessor < Blacklight::Rendering::AbstractStep |
× |
|
UNCOV
5
|
include ActionView::Helpers::UrlHelper |
× |
|
UNCOV
6
|
def render |
× |
|
UNCOV
7
|
return next_step(values) unless config.references_url |
× |
|
UNCOV
8
|
values.map! do |reference|
|
× |
|
UNCOV
9
|
if (url = reference[/ (http.*)$/]) |
× |
|
UNCOV
10
|
chomped = reference.chomp(url) |
× |
|
UNCOV
11
|
reference = link_to(chomped, url.gsub(/\s/, ''), target: '_blank', rel: 'noopener') |
× |
|
UNCOV
12
|
end
|
× |
|
UNCOV
13
|
reference |
× |
|
UNCOV
14
|
end
|
× |
| 15 |
|
|
|
UNCOV
16
|
next_step(values) |
× |
|
UNCOV
17
|
end
|
× |
|
UNCOV
18
|
end
|
× |
|
UNCOV
19
|
end
|
× |