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

pulibrary / tigerdata-app / 5761a836-7ce0-47df-9302-d25fe3ceed83

01 Dec 2025 10:02PM UTC coverage: 67.957% (-3.6%) from 71.597%
5761a836-7ce0-47df-9302-d25fe3ceed83

Pull #2250

circleci

JaymeeH
fixing typo
Pull Request #2250: Organize the submission provenance for a project

8 of 31 new or added lines in 2 files covered. (25.81%)

416 existing lines in 25 files now uncovered.

2265 of 3333 relevant lines covered (67.96%)

193.38 hits per line

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

73.33
/app/services/pul_datacite.rb
1
# frozen_string_literal: true
2
class PULDatacite
2✔
3
  class << self
2✔
4
    # Determines whether or not a test DOI should be referenced
5
    # (this avoids requests to the DOI API endpoint for non-production deployments)
6
    # @return [Boolean]
7
    def publish_test_doi?
2✔
8
      (Rails.env.development? || Rails.env.test?) && Rails.configuration.datacite.user.blank?
95✔
9
    end
10
  end
11

12
  attr_reader :datacite_connection
2✔
13

14
  def initialize
2✔
15
    @datacite_connection = Datacite::Client.new(username: Rails.configuration.datacite.user,
95✔
16
                                                password: Rails.configuration.datacite.password,
17
                                                host: Rails.configuration.datacite.host)
18
  end
19

20
  def draft_doi
2✔
21
    if PULDatacite.publish_test_doi?
95✔
22
      Rails.logger.info "Using hard-coded test DOI during development."
95✔
23
      "10.34770/tbd"
95✔
24
    else
UNCOV
25
      result = datacite_connection.autogenerate_doi(prefix: Rails.configuration.datacite.prefix)
×
UNCOV
26
      if result.success?
×
UNCOV
27
        result.success.doi
×
28
      else
UNCOV
29
        raise("Error generating DOI. #{result.failure.status} / #{result.failure.reason_phrase}")
×
30
      end
31
    end
32
  end
33
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