Sha256: 46ade45eea3b0ea11718f738a14a265d32edbadfd4466dfdbe7b44274b19ba49

Contents?: true

Size: 695 Bytes

Versions: 3

Compression:

Stored size: 695 Bytes

Contents

require 'pdk'

module PDK
  module Template
    module Fetcher
      class Local < PDK::Template::Fetcher::AbstractFetcher
        # Whether the passed uri is fetchable. This is a catch-all and all URIs
        # are considered on-disk already.
        #
        # @see PDK::Template::Fetcher.instance
        # @return [Boolean]
        def self.fetchable?(_uri, _options = {})
          true
        end

        # @see PDK::Template::Fetcher::AbstractTemplateFetcher.fetch!
        def fetch!
          return if fetched

          super

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pdk-3.3.0 lib/pdk/template/fetcher/local.rb
pdk-3.0.1 lib/pdk/template/fetcher/local.rb
pdk-3.0.0 lib/pdk/template/fetcher/local.rb