Sha256: 3a7ddf0703c4d5ea07e9d9000e453884f35aeed245abd66b250fe5ba38fd5d59

Contents?: true

Size: 942 Bytes

Versions: 3

Compression:

Stored size: 942 Bytes

Contents

# frozen_string_literal: true

require 'skippy/lib_source'
require 'skippy/library'
require 'skippy/project'

class Skippy::LibraryInstaller

  attr_reader :project, :source

  # @param [Skippy::Project] project
  # @param [Skippy::LibrarySource] source
  def initialize(project, lib_source)
    @project = project
    @source = lib_source
    @messager = nil
  end

  def on_status(&block)
    @messager = block
  end

  # @return [Skippy::Library]
  def install
    raise NotImplementedError
  end

  private

  # @param [Symbol] type
  # @param [String] message
  def status(type, message)
    @messager&.call(type, message)
  end

  # @param [String] message
  def info(message)
    status(:info, message)
  end

  # @param [String] message
  def warning(message)
    status(:warning, "Warning: #{message}")
  end

  # @return [Pathname]
  def path
    project.libraries.path
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
skippy-0.5.2.a lib/skippy/installer.rb
skippy-0.5.1.a lib/skippy/installer.rb
skippy-0.5.0.a lib/skippy/installer.rb