Sha256: ce321e44ecc9c5f76281f2308af9312036c8c4586fd04859de8656dee51b3fbf

Contents?: true

Size: 675 Bytes

Versions: 3

Compression:

Stored size: 675 Bytes

Contents

module Divvy
  class Package
    
    def initialize(name, options = {}, &block)
      @name = name
      @options = options
      @dependencies = []
      @verifications = []
      self.instance_eval(&block)
    end

    attr_reader :name, :options, :verifications, :apply_block

    def requires(*packages)
      @dependencies << packages
      @dependencies.flatten!
    end
    
    def dependencies
      @dependencies.map { |key| Divvy::Script.get_package(key) }        
    end

    def apply(&block)
      @apply_block = block
    end
    
    def verify(description = '', &block)
      @verifications << Verification.new(self, description, &block)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mdwan-divvy-0.1.0 lib/divvy/package.rb
mdwan-divvy-0.1.1 lib/divvy/package.rb
mdwan-divvy-0.1.2 lib/divvy/package.rb