class Dotrepo::ConfigFile
Constants
- FILE_PATH
Attributes
data[R]
Public Class Methods
new()
click to toggle source
# File lib/dotrepo/config_file.rb, line 7 def initialize if File.exists? FILE_PATH @data = defaults.merge YAML.load_file FILE_PATH else @data = defaults end end
Public Instance Methods
destination()
click to toggle source
# File lib/dotrepo/config_file.rb, line 19 def destination fetch_from_data "destination" end
source()
click to toggle source
# File lib/dotrepo/config_file.rb, line 15 def source fetch_from_data "source" end
Private Instance Methods
defaults()
click to toggle source
# File lib/dotrepo/config_file.rb, line 29 def defaults { "source" => '~/.dotrepo/repo', "destination" => '~/' } end
fetch_from_data(key)
click to toggle source
# File lib/dotrepo/config_file.rb, line 25 def fetch_from_data key data[key] end