class Artifactory::Resource::Layout

Public Class Methods

all(options = {}) click to toggle source

Get a list of all repository layouts in the system.

@param [Hash] options

the list of options

@option options [Artifactory::Client] :client

the client object to make the request with

@return [Array<Resource::Layout>]

the list of layouts
# File lib/artifactory/resources/layout.rb, line 34
def all(options = {})
  config = Resource::System.configuration(options)
  list_from_config("config/repoLayouts/repoLayout", config, options)
end
find(name, options = {}) click to toggle source

Find (fetch) a layout by its name.

@example Find a layout by its name

Layout.find('maven-2-default') #=> #<Layout name: 'maven-2-default' ...>

@param [String] name

the name of the layout to find

@param [Hash] options

the list of options

@option options [Artifactory::Client] :client

the client object to make the request with

@return [Resource::Layout, nil]

an instance of the layout that matches the given name, or +nil+
if one does not exist
# File lib/artifactory/resources/layout.rb, line 57
def find(name, options = {})
  config = Resource::System.configuration(options)
  find_from_config("config/repoLayouts/repoLayout/name[text()='#{name}']", config, options)
rescue Error::HTTPError => e
  raise unless e.code == 404

  nil
end