Sha256: f18959a4c90afb1f7877eabe07c9321498bdfcd4ad5e23017588f61e90c38374

Contents?: true

Size: 694 Bytes

Versions: 12

Compression:

Stored size: 694 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

12 entries across 12 versions & 1 rubygems

Version Path
pdk-2.7.1 lib/pdk/template/fetcher/local.rb
pdk-2.7.0 lib/pdk/template/fetcher/local.rb
pdk-2.6.1 lib/pdk/template/fetcher/local.rb
pdk-2.6.0 lib/pdk/template/fetcher/local.rb
pdk-2.5.0 lib/pdk/template/fetcher/local.rb
pdk-2.3.0 lib/pdk/template/fetcher/local.rb
pdk-2.2.0 lib/pdk/template/fetcher/local.rb
pdk-2.1.1 lib/pdk/template/fetcher/local.rb
pdk-2.1.0 lib/pdk/template/fetcher/local.rb
pdk-2.0.0 lib/pdk/template/fetcher/local.rb
pdk-1.18.1 lib/pdk/template/fetcher/local.rb
pdk-1.18.0 lib/pdk/template/fetcher/local.rb