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

pulibrary / orangelight / 0e37073d-109c-440c-949f-49d2aa86311b

18 Aug 2025 09:05PM UTC coverage: 0.482% (-94.9%) from 95.343%
0e37073d-109c-440c-949f-49d2aa86311b

push

circleci

web-flow
Replace per_page_options_for_select with custom component to avoid deprecation issue (#5186)

* Start creating new component to address deprecaton warning

* Replace per_page_options_for_select with custom component to avoid deprecation issue

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

---------

Co-authored-by: Ryan Jensen <rj1044@princeton.edu>
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

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

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

0.0
/app/models/concerns/blacklight/document/cite_proc.rb
1
# frozen_string_literal: true
2

3
## Adds the methods needed for CiteProc citations,
4
# Including MLA, APA, and Chicago
UNCOV
5
module Blacklight::Document::CiteProc
×
UNCOV
6
  private
×
7

UNCOV
8
    def properties
×
UNCOV
9
      props = {}
×
UNCOV
10
      props[:id] = id
×
UNCOV
11
      props[:edition] = cite_proc_edition if cite_proc_edition
×
UNCOV
12
      props[:type] = cite_proc_type if cite_proc_type
×
UNCOV
13
      props[:author] = cite_proc_authors if cite_proc_authors
×
UNCOV
14
      props[:title] = cite_proc_title if cite_proc_title
×
UNCOV
15
      props[:publisher] = cite_proc_publisher if cite_proc_publisher
×
UNCOV
16
      props[:'publisher-place'] = cite_proc_publisher_place if cite_proc_publisher_place
×
UNCOV
17
      props[:issued] = cite_proc_issued if cite_proc_issued
×
UNCOV
18
      props
×
UNCOV
19
    end
×
20

UNCOV
21
    def cite_proc_type
×
UNCOV
22
      self[:format]&.first&.downcase
×
UNCOV
23
    end
×
24

UNCOV
25
    def cite_proc_authors
×
UNCOV
26
      @cite_proc_authors ||= cleaned_authors&.map do |author|
×
UNCOV
27
        if author.include?(', ')
×
UNCOV
28
          family, given = author.split(', ')
×
UNCOV
29
          CiteProc::Name.new(family:, given:)
×
UNCOV
30
        else
×
UNCOV
31
          CiteProc::Name.new(literal: author)
×
UNCOV
32
        end
×
UNCOV
33
      end
×
UNCOV
34
    end
×
35

36
    # Can remove after https://github.com/pulibrary/bibdata/issues/2646 is completed & re-indexed
UNCOV
37
    def cleaned_authors
×
UNCOV
38
      self[:author_citation_display]&.map do |author|
×
39
        # remove any parenthetical statements from author, as used for Corporate authors in Marc
UNCOV
40
        author.sub(/ \(.*\)/, '')
×
UNCOV
41
      end
×
UNCOV
42
    end
×
43

UNCOV
44
    def cite_proc_edition
×
UNCOV
45
      @cite_proc_edition ||= begin
×
UNCOV
46
        str = self[:edition_display]&.first
×
UNCOV
47
        str&.dup&.sub!(/[[:punct:]]?$/, '')
×
UNCOV
48
      end
×
UNCOV
49
    end
×
50

UNCOV
51
    def cite_proc_title
×
UNCOV
52
      @cite_proc_title ||= self[:title_citation_display]&.first
×
UNCOV
53
    end
×
54

UNCOV
55
    def cite_proc_publisher
×
UNCOV
56
      @cite_proc_publisher ||= begin
×
UNCOV
57
        publisher = self[:pub_citation_display]&.first&.split(': ').try(:[], 1)
×
UNCOV
58
        publisher&.gsub(/^<(.*)>$/, '\1')
×
UNCOV
59
      end
×
UNCOV
60
    end
×
61

UNCOV
62
    def cite_proc_publisher_place
×
UNCOV
63
      @cite_proc_publisher_place ||= self[:pub_citation_display]&.first&.split(': ').try(:[], 0)
×
UNCOV
64
    end
×
65

UNCOV
66
    def cite_proc_issued
×
UNCOV
67
      @cite_proc_issued ||= self[:pub_date_start_sort]
×
UNCOV
68
    end
×
UNCOV
69
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