Sha256: ef5be269de61dec2ada3ed7c07a296eb3e3fbc1085281739b78e9dbaaca9a9d6

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

require 'dply/jenkins'
module Dply
  class ConfigStruct

    attr_writer :revision, :build_url, :build_url_proc, 
                :revision_proc
    attr_accessor :dir, :name, :repo, :branch, :mirror,
                  :strategy, :target, :verify_checksum, 
                  :config_map, :dir_map, :shared_dirs, 
                  :config_download_url, :config_skip_download 

    def initialize(dir = nil)
      @dir = dir || Dir.pwd
      @target = :default
      @branch = :master
      @verify_checksum = true
      @shared_dirs = []
    end

    def revision
      if @revision == :latest
        @revision = instance_eval(&revision_proc)
      else
        @revision
      end
    end

    def build_url
      @build_url ||= instance_eval(&build_url_proc)
    end

    def build_url_proc
      @build_url_proc ||= Proc.new do
        "#{repo}/artifacts/#{name}/#{revision}/#{name}-#{revision}-#{branch.to_s.tr("/","_")}.tar.gz"
      end
    end

    def dir_map
      @dir_map ||= {
        "tmp" => "tmp",
        "log" => "log"
      }
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dply-0.2.11 lib/dply/config_struct.rb
dply-0.2.10 lib/dply/config_struct.rb
dply-0.2.9 lib/dply/config_struct.rb
dply-0.2.8 lib/dply/config_struct.rb
dply-0.2.7 lib/dply/config_struct.rb
dply-0.2.6 lib/dply/config_struct.rb
dply-0.2.5 lib/dply/config_struct.rb
dply-0.2.4 lib/dply/config_struct.rb