Class: PuppetForgeServer::Backends::ProxyV3
- Defined in:
- lib/puppet_forge_server/backends/proxy_v3.rb
Constant Summary collapse
- @@PRIORITY =
10
Instance Attribute Summary collapse
-
#PRIORITY ⇒ Object
readonly
Returns the value of attribute PRIORITY.
Instance Method Summary collapse
- #get_metadata(author, name, options = {}) ⇒ Object
-
#initialize(url, cache_dir, http_client = PuppetForgeServer::Http::HttpClient.new) ⇒ ProxyV3
constructor
A new instance of ProxyV3.
- #query_metadata(query, options = {}) ⇒ Object
Methods inherited from Proxy
Constructor Details
#initialize(url, cache_dir, http_client = PuppetForgeServer::Http::HttpClient.new) ⇒ ProxyV3
Returns a new instance of ProxyV3.
25 26 27 |
# File 'lib/puppet_forge_server/backends/proxy_v3.rb', line 25 def initialize(url, cache_dir, http_client = PuppetForgeServer::Http::HttpClient.new) super(url, cache_dir, http_client) end |
Instance Attribute Details
#PRIORITY ⇒ Object (readonly)
Returns the value of attribute PRIORITY.
23 24 25 |
# File 'lib/puppet_forge_server/backends/proxy_v3.rb', line 23 def PRIORITY @PRIORITY end |
Instance Method Details
#get_metadata(author, name, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/puppet_forge_server/backends/proxy_v3.rb', line 29 def (, name, = {}) = ({:with_checksum => true}).merge() query ="#{}-#{name}" begin releases = [:version] ? [JSON.parse(get("/v3/releases/#{query}-#{[:version]}"))] : get_all_release_pages("/v3/releases?module=#{query}") (releases) rescue OpenURI::HTTPError #ignore end end |
#query_metadata(query, options = {}) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/puppet_forge_server/backends/proxy_v3.rb', line 40 def (query, = {}) , name = query.split('-') begin (, name, ) if && name rescue OpenURI::HTTPError #ignore end end |