Class: Stevenson::Dotfile

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/stevenson/dotfile.rb

Constant Summary collapse

TEMPLATE_PATH =
File.join(File.dirname(__FILE__), '..', '..', 'assets', 'stevenson_dotfile.yml')
DOTFILE_FILENAME =
".stevenson"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDotfile

Returns a new instance of Dotfile.



27
28
29
30
# 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

Class Method Details

.installObject



12
13
14
# File 'lib/stevenson/dotfile.rb', line 12

def install
  FileUtils.copy TEMPLATE_PATH, path
end

.pathObject



16
17
18
# File 'lib/stevenson/dotfile.rb', line 16

def path
  File.join(user_path, DOTFILE_FILENAME)
end