class Stevenson::Dotfile

Constants

DOTFILE_FILENAME
TEMPLATE_PATH

Public Class Methods

install() click to toggle source
# File lib/stevenson/dotfile.rb, line 12
def install
  FileUtils.copy TEMPLATE_PATH, path
end
new() click to toggle source
Calls superclass method
# File lib/stevenson/dotfile.rb, line 27
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/stevenson/dotfile.rb, line 16
def path
  File.join(user_path, DOTFILE_FILENAME)
end

Private Class Methods

user_path() click to toggle source
# File lib/stevenson/dotfile.rb, line 22
def user_path
  Dir.home rescue ENV.fetch('HOME', "/")
end