Sha256: 8467f48b615b91203b7aa36e2c055f7d422979902111314e4209bde625e7b305

Contents?: true

Size: 987 Bytes

Versions: 1

Compression:

Stored size: 987 Bytes

Contents

require 'pathname'
require_relative '../execution_error'

module LintTrap
  module Container
    # Interface for a container
    class Base
      ImagePullError = Class.new(ExecutionError)

      LOCAL_CONFIG_PATH = Pathname.new(File.expand_path('../../../../config', __FILE__))

      def initialize(image, repo_path, options = {})
        @image = image
        @repo_path = Pathname.new(repo_path)
        @options = default_options.merge(options)
      end

      def pull
        raise NotImplementedError, 'Must implement pull.'
      end

      def wrap(_command)
        raise NotImplementedError, 'Must implement wrap.'
      end

      def config_path(_path)
        raise NotImplementedError, 'Must implement config_path.'
      end

      def file_path(_path)
        raise NotImplementedError, 'Must implement file_path.'
      end

    protected

      attr_reader :image, :repo_path, :options

    private

      def default_options
        {}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lint_trap-0.0.16 lib/lint_trap/container/base.rb