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

pulibrary / tigerdata-app / 8d70f2ab-acc5-4aab-b64b-743d66ddd2eb

29 Aug 2025 06:22PM UTC coverage: 87.983% (-0.1%) from 88.118%
8d70f2ab-acc5-4aab-b64b-743d66ddd2eb

Pull #1801

circleci

JaymeeH
Merge branch '1586-request-mailer' of https://github.com/pulibrary/tiger-data-app into 1586-request-mailer
Pull Request #1801: 1586 request mailer

10 of 10 new or added lines in 2 files covered. (100.0%)

1173 existing lines in 56 files now uncovered.

2482 of 2821 relevant lines covered (87.98%)

317.98 hits per line

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

100.0
/app/models/mediaflux/namespace_destroy_request.rb
1
# frozen_string_literal: true
UNCOV
2
module Mediaflux
1✔
3
  # Destroy a MediaFlux namespace and everything in it
4
  # @example
5
  #   Mediaflux::NamespaceDestroyRequest.new(session_token: session_id, namespace: "/td-test-001/tigerdataNS/Banana1NS").destroy
6
  #   => true
UNCOV
7
  class NamespaceDestroyRequest < Request
1✔
UNCOV
8
    attr_reader :description, :namespace, :store
1✔
9

10
    # Constructor
11
    # @param session_token [String] the API token for the authenticated session
12
    # @param namespace [String] name of namespace to be destroyed
13
    # @param ignore_missing [Bool] ignore error if the namespace to delete is missing
UNCOV
14
    def initialize(session_token:, namespace:, ignore_missing: false)
1✔
UNCOV
15
      super(session_token: session_token)
3✔
UNCOV
16
      @namespace = namespace
3✔
UNCOV
17
      @ignore_missing = ignore_missing
3✔
UNCOV
18
    end
19

UNCOV
20
    def destroy
1✔
UNCOV
21
      resolve
3✔
UNCOV
22
      if error?
3✔
UNCOV
23
        if response_error.fetch(:message, "").include?("does not exist or is not accessible") && @ignore_missing
2✔
24
          # nothing to do
UNCOV
25
        else
UNCOV
26
          raise(StandardError, "call to service 'asset.namespace.hard.destroy' failed: The namespace #{namespace} does not exist or is not accessible")
1✔
UNCOV
27
        end
UNCOV
28
      end
UNCOV
29
    end
30

31
    # Specifies the Mediaflux service to use when destroying namespaces
32
    # @return [String]
UNCOV
33
    def self.service
1✔
UNCOV
34
      "asset.namespace.hard.destroy"
6✔
UNCOV
35
    end
36

UNCOV
37
    private
1✔
38

UNCOV
39
      def build_http_request_body(name:)
1✔
UNCOV
40
        super do |xml|
6✔
UNCOV
41
          xml.args do
6✔
UNCOV
42
            xml.namespace @namespace
6✔
UNCOV
43
            xml.atomic true
6✔
UNCOV
44
          end
UNCOV
45
        end
UNCOV
46
      end
UNCOV
47
  end
UNCOV
48
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