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

pulibrary / allsearch_api / e43dfb02-d031-4d11-b014-78d284122bdb

08 May 2025 02:52PM UTC coverage: 99.49%. Remained the same
e43dfb02-d031-4d11-b014-78d284122bdb

Pull #363

circleci

web-flow
Bump rack from 3.1.12 to 3.1.14

Bumps [rack](https://github.com/rack/rack) from 3.1.12 to 3.1.14.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v3.1.12...v3.1.14)

---
updated-dependencies:
- dependency-name: rack
  dependency-version: 3.1.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #363: Bump rack from 3.1.12 to 3.1.14

976 of 981 relevant lines covered (99.49%)

101.15 hits per line

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

95.45
/app/models/article.rb
1
# frozen_string_literal: true
2

3
# This class is responsible for querying the Summon API, aka "Articles+"
4
class Article
3✔
5
  include ActiveModel::API
3✔
6
  include Parsed
3✔
7
  attr_reader :query_terms, :service
3✔
8

9
  delegate :documents, to: :service_response
3✔
10

11
  def initialize(query_terms:)
3✔
12
    @query_terms = query_terms
21✔
13
    summon_config = Rails.application.config_for(:allsearch)[:summon]
21✔
14
    @service = Summon::Service.new(access_id: summon_config[:access_id],
21✔
15
                                   secret_key: summon_config[:secret_key])
16
  end
17

18
  # For documentation on query parameters, see https://developers.exlibrisgroup.com/summon/apis/SearchAPI/Query/Parameters/
19
  def service_response
3✔
20
    service.search(
61✔
21
      's.q': query_terms, # Lucene-style queries
22
      's.fvf': 'ContentType,Newspaper Article,true', # Excludes newspaper articles
23
      's.ho': 't', # Princeton holdings only
24
      's.dym': 't', # Enables Did You Mean functionality
25
      's.ps': 3 # Limits to three documents in response
26
    )
27
  rescue Summon::Transport::TransportError => error
28
    handle_summon_error(error)
1✔
29
  end
30

31
  def number
3✔
32
    service_response.record_count
15✔
33
  end
34

35
  def more_link
3✔
36
    URI::HTTPS.build(host: 'princeton.summon.serialssolutions.com', path: '/search',
26✔
37
                     query: service_response.query.query_string)
38
  end
39

40
  private
3✔
41

42
  # :reek:FeatureEnvy
43
  def handle_summon_error(error)
3✔
44
    message = if error.is_a? Summon::Transport::AuthorizationError
1✔
45
                'Could not authenticate to the upstream Summon service'
1✔
46
              else
47
                error.message
×
48
              end
49
    raise AllsearchError.new(problem: 'UPSTREAM_ERROR',
1✔
50
                             msg: message)
51
  end
52
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