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

pulibrary / allsearch_api / dc764cb3-fc9b-47a1-b010-56b68ecb28a7

01 Aug 2025 03:30PM UTC coverage: 99.514%. Remained the same
dc764cb3-fc9b-47a1-b010-56b68ecb28a7

push

circleci

web-flow
Merge pull request #384 from pulibrary/dependabot/bundler/nokogiri-1.18.9

Bump nokogiri from 1.18.8 to 1.18.9

1024 of 1029 relevant lines covered (99.51%)

92.23 hits per line

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

100.0
/app/services/sample_data_creation_service.rb
1
# frozen_string_literal: true
2

3
class SampleDataCreationService
3✔
4
  def initialize(solr_collection:, filename:, query: 'cats')
3✔
5
    @solr_collection = solr_collection
1✔
6
    @query = query
1✔
7
    @file_path = Rails.root.join('sample-data', filename)
1✔
8
  end
9

10
  def create
3✔
11
    file_path.write(docs.to_json)
1✔
12
  end
13

14
  private
3✔
15

16
  attr_reader :file_path, :query, :solr_collection
3✔
17

18
  def docs
3✔
19
    @docs ||= begin
1✔
20
      response = Net::HTTP.get(uri)
1✔
21
      parsed = JSON.parse(response, symbolize_names: true)[:response][:docs]
1✔
22
      parsed.map do |document|
1✔
23
        document.except(:hashed_id_ssi, :solr_bboxtype, :timestamp, :_version_)
3✔
24
      end
25
    end
26
  end
27

28
  def uri
3✔
29
    URI.parse "http://localhost:7872/solr/#{solr_collection}/select?q=#{query}&rows=5&facet=false&fl=*"
1✔
30
  end
31
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