Method: Git::Base#initialize
- Defined in:
- lib/git/base.rb
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/git/base.rb', line 69 def initialize( = {}) if working_dir = [:working_directory] [:repository] = File.join(working_dir, '.git') if ![:repository] [:index] = File.join(working_dir, '.git', 'index') if ![:index] end if [:log] @logger = [:log] @logger.info("Starting Git") end @working_directory = Git::WorkingDirectory.new([:working_directory]) if [:working_directory] @repository = Git::Repository.new([:repository]) if [:repository] @index = Git::Index.new([:index], false) if [:index] end |