]>
git.r.bdr.sh - rbdr/lyricli.rb/blob - lib/lyricli/configuration.rb
8d26b7f179c8bd48b7539a1b0fae3131aabb81e7
5 @config_path = "~/.lyricli.conf"
6 @defaults_path = "defaults.json"
10 @
@instance = Configuration
.new
17 load_config
unless @config
22 load_config
unless @config
27 private_class_method
:new
31 # TODO: Apart from this, load a default yml that will be used for this.
32 # And just extend everything from the user's config.
34 # path = File.expand_path(@config_path)
35 path_root
= File
.expand_path(File
.dirname(__FILE__
))
36 path
= File
.join(path_root
, @defaults_path)
39 file
= File
.new(path
, "r")
40 @config = MultiJson
.decode(file
.read
)
47 path
= File
.expand_path(@config_path)
48 file
= File
.new(path
, "w")
49 file
.print(MultiJson
.encode(@config))