Class: Mbeditor::GitCombinedDiffService

Inherits:
Object
  • Object
show all
Includes:
GitService
Defined in:
app/services/mbeditor/git_combined_diff_service.rb

Constant Summary

Constants included from GitService

Mbeditor::GitService::SAFE_GIT_REF

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GitService

ahead_behind, current_branch, find_branch_base, parse_git_log, parse_git_log_with_parents, parse_name_status, parse_numstat, parse_porcelain_status, resolve_path, run_git, upstream_branch

Constructor Details

#initialize(repo_path:, scope:) ⇒ GitCombinedDiffService

Returns a new instance of GitCombinedDiffService.



9
10
11
12
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 9

def initialize(repo_path:, scope:)
  @repo_path = repo_path.to_s
  @scope     = scope
end

Instance Attribute Details

#repo_pathObject (readonly)

Returns the value of attribute repo_path.



7
8
9
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 7

def repo_path
  @repo_path
end

#scopeObject (readonly)

Returns the value of attribute scope.



7
8
9
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 7

def scope
  @scope
end

Instance Method Details

#callObject



14
15
16
17
18
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 14

def call
  return local_diff if scope == :local

  branch_diff
end