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

pulibrary / orcid_princeton_hanami / 58bf55de-6875-4d28-8490-070da9c0f8dc

02 Dec 2025 09:46PM UTC coverage: 98.761% (-1.2%) from 100.0%
58bf55de-6875-4d28-8490-070da9c0f8dc

Pull #152

circleci

web-flow
Update dependency rack to v3
Pull Request #152: Update dependency rack to v3

558 of 565 relevant lines covered (98.76%)

4.24 hits per line

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

85.0
/app/actions/health/status.rb
1
# frozen_string_literal: true
2

3
module OrcidPrinceton
1✔
4
  module Actions
1✔
5
    module Health
1✔
6
      # handles the /health route
7
      class Status < OrcidPrinceton::Action
1✔
8
        include Deps['operations.orcid_api_status']
1✔
9

10
        format :html, :json
1✔
11

12
        before :set_format_for_json_extension
1✔
13

14
        def handle(_request, response)
1✔
15
          current_status = retrieve_orcid_id_status
1✔
16

17
          if response.format == :json
1✔
18
            response.body = current_status.to_json
×
19
          else
20
            response[:current_status] = current_status
1✔
21
          end
22
        end
23

24
        private
1✔
25

26
        def set_format_for_json_extension(request, response)
1✔
27
          if request.path.end_with?('.json')
1✔
28
            response.format = :json
×
29
          end
30
        end
31

32
        def retrieve_orcid_id_status
1✔
33
          case orcid_api_status.call
1✔
34
          in Dry::Monads::Result::Success(_orcid_status)
35
            { status: 'ok', results: [{ name: 'ORCID', message: '', status: 'OK' }] }
1✔
36
          in Dry::Monads::Result::Failure(error)
37
            { status: 'error', results: [{ name: 'ORCID', message: error, status: 'ERROR' }] }
×
38
          end
39
        end
40
      end
41
    end
42
  end
43
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