Method: Confgit::Repo#initialize

Defined in:
lib/confgit/repo.rb

#initialize(path = '~/.etc/confgit') ⇒ Repo

Returns a new instance of Repo.



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/confgit/repo.rb', line 22

def initialize(path = '~/.etc/confgit')
	@base_path = File.expand_path(path)
	@repos_path = File.join(@base_path, 'repos')

	FileUtils.mkpath(@repos_path)

	@config = read_config(File.join(@base_path, 'confgit.conf'))
	@repo_path = File.expand_path('current', @repos_path)

	valid_repo unless File.symlink?(@repo_path)
end