• 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/presenters/work_presenter.rb
1
# frozen_string_literal: true
UNCOV
2
class WorkPresenter
×
UNCOV
3
  attr_reader :work
×
4

UNCOV
5
  delegate :resource, to: :work
×
6

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

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

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

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