Class: CodeSage::GitAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/code_sage/git_analyzer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ GitAnalyzer

Returns a new instance of GitAnalyzer.



7
8
9
10
11
# File 'lib/code_sage/git_analyzer.rb', line 7

def initialize(options = {})
  @options = options
  @repo_path = Dir.pwd
  @repo = Rugged::Repository.new(@repo_path)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/code_sage/git_analyzer.rb', line 5

def options
  @options
end

#repo_pathObject (readonly)

Returns the value of attribute repo_path.



5
6
7
# File 'lib/code_sage/git_analyzer.rb', line 5

def repo_path
  @repo_path
end

Instance Method Details

#get_changesObject



13
14
15
16
17
18
19
# File 'lib/code_sage/git_analyzer.rb', line 13

def get_changes
  if @options[:files]
    analyze_specific_files(@options[:files])
  else
    analyze_branch_changes(@options[:branch])
  end
end