Sha256: 57f5f4e82ff7c39d745026a69b2325c1d4dcf39e8ee4716ac0c1afa86f1c4992

Contents?: true

Size: 918 Bytes

Versions: 6

Compression:

Stored size: 918 Bytes

Contents

# frozen_string_literal: true

# See bottom of file for specific origin requires...

module Bridgetown
  module Model
    # Abstract Superclass
    class Origin
      extend ActiveSupport::DescendantsTracker

      # @return [String]
      attr_accessor :id

      # Override in subclass
      def self.handle_scheme?(_scheme)
        false
      end

      def initialize(id)
        self.id = id
      end

      def read
        raise "Implement #read in a subclass of Bridgetown::Model::Origin"
      end

      # @return [Pathname]
      def relative_path
        raise "Implement #relative_path in a subclass of Bridgetown::Model::Origin"
      end

      def exists?
        raise "Implement #exists? in a subclass of Bridgetown::Model::Origin"
      end
    end
  end
end

require "bridgetown-core/model/builder_origin"
require "bridgetown-core/model/repo_origin"
require "bridgetown-core/model/plugin_origin"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bridgetown-core-1.0.0.alpha6 lib/bridgetown-core/model/origin.rb
bridgetown-core-1.0.0.alpha5 lib/bridgetown-core/model/origin.rb
bridgetown-core-1.0.0.alpha4 lib/bridgetown-core/model/origin.rb
bridgetown-core-1.0.0.alpha3 lib/bridgetown-core/model/origin.rb
bridgetown-core-1.0.0.alpha2 lib/bridgetown-core/model/origin.rb
bridgetown-core-1.0.0.alpha1 lib/bridgetown-core/model/origin.rb