Sha256: 7c0ec1839f33a362b114dd399a5fa272f8a69467362f06c32e8366221832d630

Contents?: true

Size: 955 Bytes

Versions: 2

Compression:

Stored size: 955 Bytes

Contents

require 'pathname'
require_relative '../execution_error'

module LintTrap
  module 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

2 entries across 2 versions & 1 rubygems

Version Path
lint_trap-0.0.15 lib/lint_trap/container/base.rb
lint_trap-0.0.14 lib/lint_trap/container/base.rb