Method: Artifactory::Resource::BuildComponent.all

Defined in:
lib/artifactory/resources/build_component.rb

.all(options = {}) ⇒ Array<Resource::BuildComponent>

Search for all compoenents for which build data exists.

Parameters:

  • options (Hash) (defaults to: {})

    the list of options

Options Hash (options):

Returns:



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/artifactory/resources/build_component.rb', line 34

def all(options = {})
  client = extract_client!(options)
  client.get("/api/build")["builds"].map do |component|
    from_hash(component, client: client)
  end.compact.flatten
rescue Error::HTTPError => e
  # Artifactory returns a 404 instead of an empty list when there are no
  # builds. Whoever decided that was a good idea clearly doesn't
  # understand the point of REST interfaces...
  raise unless e.code == 404

  []
end