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

pulibrary / tigerdata-app / 47f8b36e-6cbd-422b-b67d-16bb6ff637e9

29 Oct 2025 11:56AM UTC coverage: 82.265% (-9.1%) from 91.333%
47f8b36e-6cbd-422b-b67d-16bb6ff637e9

Pull #2118

circleci

bess
Update expected version of mediaflux
Pull Request #2118: Upgrade to mediaflux_dev v0.17.0

1 of 1 new or added line in 1 file covered. (100.0%)

568 existing lines in 35 files now uncovered.

2528 of 3073 relevant lines covered (82.26%)

296.63 hits per line

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

100.0
/app/models/mediaflux/project_list_request.rb
1
# frozen_string_literal: true
2
module Mediaflux
2✔
3
  class ProjectListRequest < Request
2✔
4
    attr_reader :aql_query, :collection, :action, :deep_search, :iterator
2✔
5

6
    # Constructor
7
    # @param session_token [String] the API token for the authenticated session
8
    # @param aql_query [String] Optional AQL query string
9
    # @param collection [Integer] Optional collection id
10
    # @param action [String] Optional, by default it uses get-name but it could also be get-meta to get all
11
    #                        the fields for the assets or `get-values` to get a limited list of fields.
12
    # @param deep_search [Bool] Optional, false by default. When true queries the collection and it subcollections.
13
    # @param iterator [Bool] Optional, true by default. When true returns an iterator.  When false returns a list of results
14
    def initialize(session_token:, aql_query: nil, action: "get-meta", deep_search: true)
2✔
15
      super(session_token: session_token)
61✔
16
      @aql_query = aql_query
61✔
17
      @collection = collection
61✔
18
      @action = action
61✔
19
      @deep_search = deep_search
61✔
20
    end
21

22
    # Specifies the Mediaflux service to use when running a query
23
    # @return [String]
24
    def self.service
2✔
25
      "asset.query"
122✔
26
    end
27

28
    # Returns the iterator that could be used to fetch the data
29
    def results
2✔
30
      xml = response_xml
61✔
31
      assets = xml.xpath("/response/reply/result/asset")
61✔
32
      assets.map do |asset|
61✔
33
        metadata = asset.xpath("./meta//tigerdata:project", "tigerdata" => "tigerdata")
1,663✔
34
        {
35
          mediaflux_id: asset.xpath("@id").first.value,
1,663✔
36
          title: metadata.xpath("./Title").text,
37
          description: metadata.xpath("./Description").text,
38
          project_purpose: metadata.xpath("./ProjectPurpose").text,
39
          data_sponsor: metadata.xpath("./DataSponsor").text,
40
          data_manager: metadata.xpath("./DataManager").text,
41
          data_users: data_users_from_string(metadata.xpath("./DataUser").text),
42
          directory: metadata.xpath("./ProjectDirectory").text
43
        }
44
      end
45
    end
46

47
    private
2✔
48

49
      def build_http_request_body(name:)
2✔
50
        super do |xml|
122✔
51
          xml.args do
122✔
52
            xml.where aql_query if aql_query.present?
122✔
53
            xml.action action if action.present?
122✔
54
          end
55
        end
56
      end
57

58
      def data_users_from_string(users)
2✔
59
        return [] if users.blank?
1,663✔
UNCOV
60
        users.split(",")
403✔
61
      end
62
  end
63
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