class Flickxtractr::Dotfile
Constants
- DOTFILE_FILENAME
- TEMPLATE_PATH
Public Class Methods
exists?()
click to toggle source
# File lib/flickxtractr/dotfile.rb, line 20 def exists? File.exist? path end
install()
click to toggle source
# File lib/flickxtractr/dotfile.rb, line 12 def install FileUtils.copy TEMPLATE_PATH, path end
new()
click to toggle source
Calls superclass method
# File lib/flickxtractr/dotfile.rb, line 31 def initialize dotfile_path = File.exist?(self.class.path) ? self.class.path : TEMPLATE_PATH super Hashie::Mash.new YAML.load_file(dotfile_path) end
path()
click to toggle source
# File lib/flickxtractr/dotfile.rb, line 16 def path File.join(user_path, DOTFILE_FILENAME) end
Private Class Methods
user_path()
click to toggle source
# File lib/flickxtractr/dotfile.rb, line 26 def user_path Dir.home rescue ENV.fetch('HOME', "/") end