Sha256: 7995cbeda70334c3f9cc21997572d4840ec312c63b650bffdf7bc0c9ef18e861

Contents?: true

Size: 774 Bytes

Versions: 3

Compression:

Stored size: 774 Bytes

Contents

module Divvy
  module Script
    PACKAGES = {}
    
    def package(name, options = {}, &block)
      package = Package.new(name, options, &block)
      raise "Duplicate package name: #{package.name}" if PACKAGES.key?(package.name)
      PACKAGES[package.name] = package
    end

    def provision(host, package, server_options)
      provision = Provisioner.new(host, package, server_options)
      provision.run
    end
    
    def register_verifier(verifier)
      Divvy::Verification.class_eval { include verifier }
    end

    def register_plugin(plugin)
      Divvy::PackageRunner.class_eval { include plugin }
    end
    
    def get_package(key)
      package = PACKAGES[key]
      raise "Package #{key} not found!" unless package
      package
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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