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

pulibrary / pdc_describe / 9091a1ae-29be-458c-984a-339d213919c4

12 Dec 2024 07:41PM UTC coverage: 26.434% (-69.7%) from 96.113%
9091a1ae-29be-458c-984a-339d213919c4

Pull #2000

circleci

jrgriffiniii
Removing integration with ActiveStorage
Pull Request #2000: Bump actionpack from 7.2.1.1 to 7.2.2.1

945 of 3575 relevant lines covered (26.43%)

0.35 hits per line

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

34.78
/app/presenters/work_presenter.rb
1
# frozen_string_literal: true
2
class WorkPresenter
1✔
3
  attr_reader :work
1✔
4

5
  delegate :resource, to: :work
1✔
6

7
  def initialize(work:)
1✔
8
    @work = work
×
9
  end
10

11
  def description
1✔
12
    value = resource.description
×
13
    return if value.nil?
×
14
    Rinku.auto_link(value, :all, 'target="_blank"')
×
15
  end
16

17
  def related_objects_link_list
1✔
18
    ro = resource.related_objects
×
19
    ro.map { |a| format_related_object_links(a) }
×
20
  end
21

22
  # relation_type, identifier, link
23
  def format_related_object_links(related_object)
1✔
24
    rol = RelatedObjectLink.new
×
25
    rol.identifier = related_object.related_identifier
×
26
    rol.relation_type = related_object.relation_type
×
27
    rol.link = format_link(related_object.related_identifier, related_object.related_identifier_type)
×
28
    rol
×
29
  end
30

31
  # Turn an identifier into a link. This will vary for different kinds of related objects.
32
  # A DOI URL is not the same as an arXiv URL, for example.
33
  # For now, only format links for DOI and arXiv identifiers
34
  def format_link(id, id_type)
1✔
35
    return id if id.starts_with?("http")
×
36
    return "https://doi.org/#{id}" if id_type == "DOI"
×
37
    return "https://arxiv.org/abs/#{id}" if id_type == "arXiv"
×
38
    ""
×
39
  end
40
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