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

pulibrary / allsearch_api / 93455990-ca6b-4aa4-bb7b-c77568bb5653

01 Aug 2025 03:42PM UTC coverage: 86.395% (-13.1%) from 99.514%
93455990-ca6b-4aa4-bb7b-c77568bb5653

push

circleci

sandbergja
Explicitly include Rake in Gemfile

When we deployed, it gave various errors:
* can't find executable rake for gem rake.
* cannot load such file -- net/ssh/proxy/command (LoadError)

This commit explicitly includes rake and net-ssh in the Gemfile
to see if it resolves the issue.

889 of 1029 relevant lines covered (86.39%)

33.24 hits per line

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

42.86
/app/models/library_website.rb
1
# frozen_string_literal: true
2

3
class LibraryWebsite
1✔
4
  include Parsed
1✔
5

6
  attr_reader :query_terms
1✔
7

8
  def initialize(query_terms:)
1✔
9
    @query_terms = query_terms
×
10
    @website_config = Rails.application.config_for(:allsearch)[:library_website]
×
11
  end
12

13
  def self.library_website_host
1✔
14
    config = LibraryWebsite.website_config
×
15
    if Flipper.enabled?(:permanent_host?)
×
16
      config[:host]
×
17
    else
18
      config[:temporary_host]
×
19
    end
20
  end
21

22
  def self.website_config
1✔
23
    @website_config ||= Rails.application.config_for(:allsearch)[:library_website]
×
24
  end
25

26
  def documents
1✔
27
    service_response['content'][0..2]
×
28
  end
29

30
  def number
1✔
31
    service_response['content'].count
×
32
  end
33

34
  def service_response
1✔
35
    response = Net::HTTP.post_form(uri, 'search' => query_terms)
×
36
    response_code = response.code
×
37
    if response_code.start_with? '5'
×
38
      raise AllsearchError.new(msg: "The library website API returned a #{response_code} HTTP status code.")
×
39
    end
40

41
    @service_response ||= JSON.parse(response.body)
×
42
  end
43

44
  private
1✔
45

46
  def more_link
1✔
47
    URI::HTTPS.build(host: LibraryWebsite.library_website_host,
×
48
                     path: '/search',
49
                     query: "keys=#{query_terms}")
50
  end
51

52
  def uri
1✔
53
    URI::HTTPS.build(host: LibraryWebsite.library_website_host,
×
54
                     path: @website_config[:path])
55
  end
56
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