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

pulibrary / bibdata / 3165b919-56f4-4faa-baf4-b5a08621230c

18 Sep 2025 03:08PM UTC coverage: 90.866% (+0.2%) from 90.675%
3165b919-56f4-4faa-baf4-b5a08621230c

Pull #2927

circleci

Ryan Laddusaw
Add QA DSpace config
Pull Request #2927: Index theses from dspace 7+

1411 of 1519 new or added lines in 16 files covered. (92.89%)

41 existing lines in 7 files now uncovered.

8874 of 9766 relevant lines covered (90.87%)

338.18 hits per line

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

43.33
/lib/bibdata_rs/theses/fetcher.rb
1
# frozen_string_literal: true
2

3
module BibdataRs
1✔
4
  module Theses
1✔
5
    class Fetcher
1✔
6
      def self.env_config
1✔
7
        Rails.application.config_for Rails.root.join('config/dspace.yml')
×
8
      end
9

10
      def self.default_server
1✔
11
        env_config['server']
×
12
      end
13

14
      def self.default_community
1✔
15
        env_config['community']
×
16
      end
17

18
      def self.default_legacy_server
1✔
NEW
19
        env_config['legacy_server']
×
20
      end
21

22
      def self.default_rest_limit
1✔
23
        env_config['rest_limit']
×
24
      end
25

26
      def self.theses_cache_path
1✔
NEW
27
        env_config['filepath'] || '/tmp/theses.json'
×
28
      end
29

30
      def self.temp_theses_cache_path
1✔
NEW
31
        env_config['temp_filepath'] || '/tmp/temp_theses.json'
×
32
      end
33

34
      def self.temp_legacy_theses_cache_path
1✔
NEW
35
        env_config['temp_legacy_filepath'] || '/tmp/temp_legacy_theses.json'
×
36
      end
37

38
      def self.merge_theses_json
1✔
NEW
39
        theses_json = File.read(temp_theses_cache_path)
×
NEW
40
        legacy_theses_json = File.read(temp_legacy_theses_cache_path)
×
41

NEW
42
        parsed_theses = JSON.parse(theses_json)
×
NEW
43
        parsed_legacy_theses = JSON.parse(legacy_theses_json)
×
44

NEW
45
        merged_theses = parsed_theses + parsed_legacy_theses
×
NEW
46
        File.write(theses_cache_path, JSON.pretty_generate(merged_theses))
×
47
      end
48

49
      ##
50
      # Get a json representation of all thesis collections and write it as JSON to
51
      # a cache file.
52
      def self.write_all_collections_to_cache
1✔
NEW
53
        BibdataRs::Theses.all_legacy_documents_as_solr(default_legacy_server, default_community, default_rest_limit)
×
UNCOV
54
        BibdataRs::Theses.all_documents_as_solr(default_server, default_community, default_rest_limit)
×
NEW
55
        merge_theses_json
×
56
      end
57
    end
58
  end
59
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