lib/pronto.rb in pronto-0.11.0 vs lib/pronto.rb in pronto-0.11.1
- old
+ new
@@ -53,13 +53,13 @@
require 'pronto/formatter/checkstyle_formatter'
require 'pronto/formatter/null_formatter'
require 'pronto/formatter/formatter'
module Pronto
- def self.run(commit = 'master', repo_path = '.',
+ def self.run(commit = nil, repo_path = '.',
formatters = [Formatter::TextFormatter.new], file = nil)
- commit ||= 'master'
+ commit ||= default_commit
repo = Git::Repository.new(repo_path)
options = { paths: [file] } if file
patches = repo.diff(commit, options)
@@ -69,7 +69,11 @@
formatted = formatter.format(result, repo, patches)
puts formatted if formatted
end
result
+ end
+
+ def self.default_commit
+ Config.new.default_commit
end
end