Class: Fog::Storage::Artifactory::Files
- Inherits:
-
Collection
- Object
- Collection
- Fog::Storage::Artifactory::Files
- Defined in:
- lib/fog/artifactory/models/storage/files.rb
Instance Method Summary collapse
- #all(options = {}) ⇒ Object
- #get(key, _options = {}, &_block) ⇒ Object
- #head(key, options = {}) ⇒ Object
- #new(attributes = {}) ⇒ Object
Instance Method Details
#all(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/artifactory/models/storage/files.rb', line 12 def all( = {}) requires :directory = .reject { |_key, value| value.nil? || value.to_s.empty? } merge_attributes() load(service.client.get('/api/search/artifact', name: '.*', repos: directory.key)['results'].map do |artifact| path = URI.parse(artifact['uri']).path endpoint_path = URI.parse(service.client.endpoint).path path.slice!(endpoint_path) service.client.get(path) end) end |
#get(key, _options = {}, &_block) ⇒ Object
24 25 26 27 |
# File 'lib/fog/artifactory/models/storage/files.rb', line 24 def get(key, = {}, &_block) requires :directory new(service.client.get("/api/storage/#{directory.key}#{key}")) end |
#head(key, options = {}) ⇒ Object
29 30 31 |
# File 'lib/fog/artifactory/models/storage/files.rb', line 29 def head(key, = {}) # TODO: implement end |
#new(attributes = {}) ⇒ Object
33 34 35 36 |
# File 'lib/fog/artifactory/models/storage/files.rb', line 33 def new(attributes = {}) requires :directory super({ directory: directory }.merge(attributes)) end |