Method: Git::Lib#initialize
- Defined in:
- lib/git/lib.rb
#initialize(base = nil, logger = nil) ⇒ Lib
Returns a new instance of Lib.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/git/lib.rb', line 12 def initialize(base = nil, logger = nil) @git_dir = nil @git_index_file = nil @git_work_dir = nil @path = nil if base.is_a?(Git::Base) @git_dir = base.repo.path @git_index_file = base.index.path if base.index @git_work_dir = base.dir.path if base.dir elsif base.is_a?(Hash) @git_dir = base[:repository] @git_index_file = base[:index] @git_work_dir = base[:working_directory] end @logger = logger end |