Class: Stevenson::Dotfile
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Stevenson::Dotfile
- 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
-
#initialize ⇒ Dotfile
constructor
A new instance of Dotfile.
Constructor Details
#initialize ⇒ Dotfile
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
.install ⇒ Object
12 13 14 |
# File 'lib/stevenson/dotfile.rb', line 12 def install FileUtils.copy TEMPLATE_PATH, path end |
.path ⇒ Object
16 17 18 |
# File 'lib/stevenson/dotfile.rb', line 16 def path File.join(user_path, DOTFILE_FILENAME) end |