Sha256: 536d9c03d8b0c5af1413295bb288d2d6d3de68337f1954f6d1db9c8392a70c65

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

# encoding: UTF-8

module Tetra
  # represents a prebuilt package dependency from a jar file
  # in a kit
  class JarKitItem
    # implement to_spec
    include SpecGenerator
    attr_reader :project
    attr_reader :package_name
    attr_reader :spec_dir
    attr_reader :template_spec_name
    attr_reader :conflicts

    # implement to_archive
    include Archiver
    attr_reader :source_dir
    attr_reader :source_paths
    attr_reader :destination_dir

    # template-specific  attributes
    attr_reader :provides_symbol
    attr_reader :provides_version
    attr_reader :install_dir

    def initialize(project, path)
      _, name = Pathname.new(path).split
      hash = Digest::SHA1.file(path).hexdigest

      @project = project
      @package_name = "kit-item-#{name.to_s.gsub(".", "-")}"
      @spec_dir = "kit"
      @template_spec_name = "kit_item.spec"
      @conflicts = false

      @source_dir = File.join("kit", "jars")
      @source_paths = [path]
      @destination_dir = @package_name

      @provides_symbol = "tetra-jar(#{name})"
      @provides_version = hash
      @install_dir = "jars"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tetra-0.43.0 lib/tetra/jar_kit_item.rb
tetra-0.42.0 lib/tetra/jar_kit_item.rb
tetra-0.41.0 lib/tetra/jar_kit_item.rb