Module: R10K::Source

Defined in:
lib/r10k/source.rb

Defined Under Namespace

Classes: Base, Exec, Git, Hash, SVN, Yaml, Yamldir

Class Method Summary collapse

Class Method Details

.factoryObject



7
8
9
# File 'lib/r10k/source.rb', line 7

def self.factory
  @factory ||= R10K::KeyedFactory.new
end

.from_hash(name, hash) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/r10k/source.rb', line 23

def self.from_hash(name, hash)
  R10K::Util::SymbolizeKeys.symbolize_keys!(hash)

  basedir = hash.delete(:basedir)

  type = hash.delete(:type)
  type = type.is_a?(String) ? type.to_sym : type

  generate(type, name, basedir, hash)
end

.generate(type, basedir, name, options = {}) ⇒ Object



19
20
21
# File 'lib/r10k/source.rb', line 19

def self.generate(type, basedir, name, options = {})
  factory.generate(type, basedir, name, options)
end

.register(key, klass) ⇒ Object



11
12
13
# File 'lib/r10k/source.rb', line 11

def self.register(key, klass)
  factory.register(key, klass)
end

.retrieve(key) ⇒ Object



15
16
17
# File 'lib/r10k/source.rb', line 15

def self.retrieve(key)
  factory.retrieve(key)
end