Class: PDK::Template::Fetcher::Local

Inherits:
AbstractFetcher show all
Defined in:
lib/pdk/template/fetcher/local.rb

Instance Attribute Summary

Attributes inherited from AbstractFetcher

#fetched, #metadata, #path, #temporary, #uri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractFetcher

#initialize

Constructor Details

This class inherits a constructor from PDK::Template::Fetcher::AbstractFetcher

Class Method Details

.fetchable?(_uri, _options = {}) ⇒ Boolean

Whether the passed uri is fetchable. This is a catch-all and all URIs are considered on-disk already.

Returns:

  • (Boolean)

See Also:



12
13
14
# File 'lib/pdk/template/fetcher/local.rb', line 12

def self.fetchable?(_uri, _options = {})
  true
end

Instance Method Details

#fetch!Object

See Also:

  • AbstractTemplateFetcher.fetch!


17
18
19
20
21
22
23
24
# File 'lib/pdk/template/fetcher/local.rb', line 17

def fetch!
  return if fetched
  super

  @path = uri.shell_path
  @temporary = false
  @metadata['template-url'] = uri.bare_uri
end