Sha256: b9709b615591992818ad22951508e967d2b6ae1c636eeacd8ae814844e4db4c2

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require 'r10k/source'
require 'r10k/util/symbolize_keys'

module R10K
class Deployment
# :nocov:
class Source
  # Create a new source from a hash representation
  #
  # @param name [String] The name of the source
  # @param opts [Hash] The properties to use for the source
  #
  # @option opts [String] :remote The git remote for the given source
  # @option opts [String] :basedir The directory to create environments in
  # @option opts [true, false] :prefix Whether the environment names should
  #   be prefixed by the source name. Defaults to false.
  #
  # @deprecated
  # @return [R10K::Source::Base]
  def self.vivify(name, attrs)
    R10K::Util::SymbolizeKeys.symbolize_keys!(attrs)

    remote  = attrs.delete(:remote)
    basedir = attrs.delete(:basedir)
    prefix  = attrs.delete(:prefix)

    raise ArgumentError, "Unrecognized attributes for #{self.name}: #{attrs.inspect}" unless attrs.empty?
    new(name, remote, basedir, prefix)
  end

  def self.new(name, remote, basedir, prefix)
    R10K::Source::Git.new(name, basedir, {:prefix => prefix, :remote => remote})
  end
end
end
# :nocov:
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
r10k-1.5.1 lib/r10k/deployment/source.rb