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

pulibrary / pdc_describe / b1776731-62d7-41a7-882d-6a5b4760db75

14 May 2024 12:28PM UTC coverage: 79.223% (-16.7%) from 95.9%
b1776731-62d7-41a7-882d-6a5b4760db75

push

circleci

carolyncole
Adding a submission completion page

fixes #1791

9 of 9 new or added lines in 2 files covered. (100.0%)

567 existing lines in 42 files now uncovered.

2692 of 3398 relevant lines covered (79.22%)

60.03 hits per line

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

91.3
/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
33✔
9
  end
10

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

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

22
  # relation_type, identifier, link
23
  def format_related_object_links(related_object)
1✔
24
    rol = RelatedObjectLink.new
11✔
25
    rol.identifier = related_object.related_identifier
11✔
26
    rol.relation_type = related_object.relation_type
11✔
27
    rol.link = format_link(related_object.related_identifier, related_object.related_identifier_type)
11✔
28
    rol
11✔
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")
11✔
36
    return "https://doi.org/#{id}" if id_type == "DOI"
1✔
UNCOV
37
    return "https://arxiv.org/abs/#{id}" if id_type == "arXiv"
×
UNCOV
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