Class: DevSnap::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton, TR::CondUtils
Defined in:
lib/dev_snap/config.rb

Instance Method Summary collapse

Instance Method Details

#add_to_monitor(path) ⇒ Object



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

def add_to_monitor(path)
  if not_empty?(path)
    _config[:path] = [] if is_empty?(_config[:path])
    _config[:path] << path 
    write
  end
end

#monitor_pathsObject



34
35
36
# File 'lib/dev_snap/config.rb', line 34

def monitor_paths
  _config[:path].nil? ? [] : _config[:path].clone.freeze
end

#remove_path(path) ⇒ Object



27
28
29
30
31
32
# File 'lib/dev_snap/config.rb', line 27

def remove_path(path)
  if not_empty?(path) and not_empty?(_config[:path])
    _config[:path].delete(path)
    write
  end
end

#set_snap_root(root) ⇒ Object



10
11
12
13
# File 'lib/dev_snap/config.rb', line 10

def set_snap_root(root)
  _config[:snap_root] = root 
  write
end

#snap_rootObject



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

def snap_root
  _config[:snap_root]
end