Sha256: 5ae3cc0f2fafe52d23b6a838adea15696cbcd0c17b0a218d70baa5c7276f7aff

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

module Vx
  module Builder
    class BuildConfiguration
      class Deploy

        class Base

          class << self

            @@loaded = []

            def loaded
              @@loaded
            end

            def provide(val)
              loaded.push self
              @key = val
            end

            def key
              @key
            end

            def detect(params)
              params.key?(key.to_s) if key
            end
          end

          attr_reader :params, :branch

          def initialize(params)
            @params = params.is_a?(Hash) ? params : {}
            self.branch = params["branch"]
          end

          def branch=(value)
            @branch = Array(value).map(&:to_s)
          end

          def branch?(name)
            if branch.empty?
              true
            else
              branch.include?(name)
            end
          end

          def key
            if self.class.key
              Array(params[self.class.key.to_s])
            end
          end

          def to_commands
            nil
          end

        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vx-builder-0.3.0 lib/vx/builder/build_configuration/deploy/base.rb