module Pronto

def self.default_commit

def self.default_commit
  Config.new.default_commit
end

def self.run(commit = nil, repo_path = '.',

def self.run(commit = nil, repo_path = '.',
             formatters = [Formatter::TextFormatter.new], file = nil)
  commit ||= default_commit
  repo = Git::Repository.new(repo_path)
  options = { paths: [file] } if file
  patches = repo.diff(commit, options)
  result = Runners.new.run(patches)
  Array(formatters).each do |formatter|
    formatted = formatter.format(result, repo, patches)
    puts formatted if formatted
  end
  result
end