Module: Copier

Defined in:
lib/copier.rb

Defined Under Namespace

Classes: Config, NotSupported

Class Method Summary collapse

Class Method Details

.config_loadedObject



44
45
46
# File 'lib/copier.rb', line 44

def config_loaded
  @config_loaded
end

.config_prepareObject



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

def config_prepare
  @config = Config.new()
end

.disable_config_fileObject



40
41
42
# File 'lib/copier.rb', line 40

def disable_config_file
  @disable_config_file
end

.disable_config_file=(a) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/copier.rb', line 32

def disable_config_file=(a)
  @disable_config_file = a
  if a
    self.config_prepare
    @config_loaded = false
  end
end

.load_config(f = '~/.copier') ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/copier.rb', line 19

def load_config(f = '~/.copier')
  fn = File.expand_path(f)
  self.config_prepare
  config = @config
  eval(File.read(fn)) rescue nil
  @config = config.dup
  @config_loaded = true
end

.method_missing(name, *args) ⇒ Object



28
29
30
# File 'lib/copier.rb', line 28

def method_missing(name, *args)
  @config.__send__(name, *args)
end