Class: Cliptic::Config::Custom
Class Method Summary
collapse
Methods inherited from Default
colors, config, make_bool
Class Method Details
.cfg_file_exists? ⇒ Boolean
48
49
50
|
# File 'lib/cliptic/config.rb', line 48
def self.cfg_file_exists?
File.exist?(File_Path)
end
|
.key_map ⇒ Object
42
43
44
45
46
47
|
# File 'lib/cliptic/config.rb', line 42
def self.key_map
{
$colors => {key:"hi"},
$config => {key:"set"}
}
end
|
.read_cfg ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'lib/cliptic/config.rb', line 34
def self.read_cfg
Reader.new.tap do |file|
key_map.each do |dest, key|
dest.merge!(file.read(**key))
end
end
make_bool($config)
end
|
.set ⇒ Object
30
31
32
|
# File 'lib/cliptic/config.rb', line 30
def self.set
cfg_file_exists? ? read_cfg : .choose_opt
end
|