Class: Codeowners::Git
- Inherits:
-
Object
- Object
- Codeowners::Git
- Defined in:
- lib/codeowners/git.rb,
lib/codeowners/git/contributor.rb,
lib/codeowners/git/contributors.rb
Defined Under Namespace
Classes: Contributor, Contributors
Instance Method Summary collapse
- #contributors(file, debug = false) ⇒ Object
-
#initialize(base_directory) ⇒ Git
constructor
A new instance of Git.
Constructor Details
#initialize(base_directory) ⇒ Git
Returns a new instance of Git.
8 9 10 |
# File 'lib/codeowners/git.rb', line 8 def initialize(base_directory) @base_directory = Pathname.new(::File.(base_directory)) end |
Instance Method Details
#contributors(file, debug = false) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/codeowners/git.rb', line 12 def contributors(file, debug = false) require "codeowners/git/contributors" output = git(["log", "--numstat", %(--pretty=format:"author:%aN email:%ae"), "--no-color", "--", escape(file)]) print_debug(output, debug) Contributors.call(file, output) end |