Class: KPM::NexusFacade::GithubApiCalls

Inherits:
NexusApiCallsV2 show all
Defined in:
lib/kpm/nexus_helper/github_api_calls.rb

Constant Summary

Constants inherited from NexusApiCallsV2

NexusApiCallsV2::ERROR_MESSAGE_404, NexusApiCallsV2::OPEN_TIMEOUT_DEFAULT, NexusApiCallsV2::READ_TIMEOUT_DEFAULT

Instance Attribute Summary

Attributes inherited from NexusApiCallsV2

#configuration, #logger, #ssl_verify, #version

Instance Method Summary collapse

Methods inherited from NexusApiCallsV2

#initialize, #pull_artifact, #search_for_artifacts

Constructor Details

This class inherits a constructor from KPM::NexusFacade::NexusApiCallsV2

Instance Method Details

#build_query_params(_coordinates, _what_parameters = nil) ⇒ Object



44
45
46
# File 'lib/kpm/nexus_helper/github_api_calls.rb', line 44

def build_query_params(_coordinates, _what_parameters = nil)
  ''
end

#get_artifact_info(coordinates) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/kpm/nexus_helper/github_api_calls.rb', line 16

def get_artifact_info(coordinates)
  super

  _, versioned_artifact, coords = build_base_path_and_coords(coordinates)
  sha1 = get_sha1(coordinates)
  "<artifact-resolution>
  <data>
    <presentLocally>true</presentLocally>
    <groupId>#{coords[:group_id]}</groupId>
    <artifactId>#{coords[:artifact_id]}</artifactId>
    <version>#{coords[:version]}</version>
    <extension>#{coords[:packaging]}</extension>
    <snapshot>#{!(coords[:version] =~ /-SNAPSHOT$/).nil?}</snapshot>
    <sha1>#{sha1}</sha1>
    <repositoryPath>/#{coords[:group_id].gsub('.', '/')}/#{versioned_artifact}</repositoryPath>
  </data>
</artifact-resolution>"
end

#get_artifact_info_endpoint(coordinates) ⇒ Object



35
36
37
38
# File 'lib/kpm/nexus_helper/github_api_calls.rb', line 35

def get_artifact_info_endpoint(coordinates)
  base_path, = build_base_path_and_coords(coordinates)
  "#{base_path}/maven-metadata.xml"
end

#pull_artifact_endpoint(coordinates) ⇒ Object



11
12
13
14
# File 'lib/kpm/nexus_helper/github_api_calls.rb', line 11

def pull_artifact_endpoint(coordinates)
  base_path, versioned_artifact, = build_base_path_and_coords(coordinates)
  "#{base_path}/#{versioned_artifact}"
end

#search_for_artifact_endpoint(_coordinates) ⇒ Object

Raises:

  • (NoMethodError)


40
41
42
# File 'lib/kpm/nexus_helper/github_api_calls.rb', line 40

def search_for_artifact_endpoint(_coordinates)
  raise NoMethodError, 'GitHub Packages has no search support'
end