Class: ManifestDestiny::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/manifest-destiny.rb

Instance Method Summary collapse

Constructor Details

#initialize(root, &block) ⇒ Config

Returns a new instance of Config.



17
18
19
20
21
22
23
24
# File 'lib/manifest-destiny.rb', line 17

def initialize(root, &block)
  @cache = []
  @watch = []
  @network = []
  @fallback = {}
  @root = root
  instance_eval(&block) if block_given?
end

Instance Method Details

#cache(*names) ⇒ Object



30
31
32
# File 'lib/manifest-destiny.rb', line 30

def cache(*names)
  add(@cache, names)
end

#cache_path(*patterns) ⇒ Object



26
27
28
# File 'lib/manifest-destiny.rb', line 26

def cache_path(*patterns)
  add_path(@cache, patterns)
end

#fallback(hash = {}) ⇒ Object



46
47
48
# File 'lib/manifest-destiny.rb', line 46

def fallback(hash = {})
  @fallback.merge!(hash)
end

#network(*names) ⇒ Object



42
43
44
# File 'lib/manifest-destiny.rb', line 42

def network(*names)
  @network.concat(names)
end

#rootObject



50
51
52
# File 'lib/manifest-destiny.rb', line 50

def root
  @root
end

#watch(*names) ⇒ Object



38
39
40
# File 'lib/manifest-destiny.rb', line 38

def watch(*names)
  add(@watch, names)
end

#watch_path(*patterns) ⇒ Object



34
35
36
# File 'lib/manifest-destiny.rb', line 34

def watch_path(*patterns)
  add_path(@watch, patterns)
end