lib/pronto.rb in pronto-0.4.3 vs lib/pronto.rb in pronto-0.5.0

- old
+ new

@@ -1,18 +1,22 @@ require 'rugged' require 'octokit' require 'gitlab' require 'forwardable' +require 'pronto/config_file' +require 'pronto/config' + require 'pronto/git/repository' require 'pronto/git/patches' require 'pronto/git/patch' require 'pronto/git/line' require 'pronto/plugin' require 'pronto/message' require 'pronto/runner' +require 'pronto/runners' require 'pronto/github' require 'pronto/gitlab' require 'pronto/formatter/text_formatter' require 'pronto/formatter/json_formatter' @@ -30,13 +34,13 @@ repo = Git::Repository.new(repo_path) options = { paths: [file] } if file patches = repo.diff(commit, options) - result = run_all_runners(patches) + result = Runners.new.run(patches) - formatted = formatter.format(result, repo) + formatted = formatter.format(result, repo, patches) puts formatted if formatted result end @@ -48,18 +52,8 @@ runner_path = File.join(gem.full_gem_path, "lib/pronto/#{gem.name}.rb") File.exist?(runner_path) end end - gems.map { |gem| gem.name.sub(/^pronto-/, '') } - .uniq - .sort - end - - private - - def self.run_all_runners(patches) - Runner.runners.map do |runner| - runner.new.run(patches, patches.commit) - end.flatten.compact + gems.map { |gem| gem.name.sub(/^pronto-/, '') }.uniq.sort end end