Class: ArtRest::Folder
- Includes:
- DirEntry
- Defined in:
- lib/artrest/dir_entry.rb
Overview
Represents an Artifactory Folder Info resource.
Example
folder = ArtRest::Folder.new('http://localhost:8081/artifactory/api/storage/libs-release-local/commons-lang/commons-lang', { ... })
Class Method Summary collapse
Instance Method Summary collapse
Methods included from DirEntry
Methods inherited from Resources
Methods inherited from Resource
#base_url, check_options, #content, #content!, #content=, create, inherited, #initialize, mime_type=, resource_attributes, #unparsed_content
Constructor Details
This class inherits a constructor from ArtRest::Resource
Class Method Details
.matches_path(path, options) ⇒ Object
:nodoc:
29 30 31 32 33 |
# File 'lib/artrest/dir_entry.rb', line 29 def matches_path(path, ) # :nodoc: return false unless path =~ %r|^/api/storage/[a-zA-Z0-9_.+-]+/.+$| content_hash = JSON.parse(RestClient::Resource.new([[:base_url], path].join, [:user], [:password]).get) return content_hash['children'] end |
Instance Method Details
#[](suburl, &new_block) ⇒ Object
:nodoc:
54 55 56 57 |
# File 'lib/artrest/dir_entry.rb', line 54 def [](suburl, &new_block) # :nodoc: subresource_content = JSON.parse(RestClient::Resource.new(url, , &new_block)[suburl].get) ArtRest::DirEntry.create_node([url, suburl].join, , subresource_content, &new_block) end |