class Pronto::CLI
Public Class Methods
is_thor_reserved_word?(word, type)
click to toggle source
Calls superclass method
# File lib/pronto/cli.rb, line 9 def is_thor_reserved_word?(word, type) return false if word == 'run' super end
Public Instance Methods
list()
click to toggle source
# File lib/pronto/cli.rb, line 84 def list puts ::Pronto::GemNames.new.to_a end
run(path = '.')
click to toggle source
# File lib/pronto/cli.rb, line 52 def run(path = '.') path = File.expand_path(path) gem_names = options[:runner].any? ? options[:runner] : ::Pronto::GemNames.new.to_a gem_names.each do |gem_name| require "pronto/#{gem_name}" end formatters = ::Pronto::Formatter.get(options[:formatters]) commit_options = %i[workdir staged unstaged index] commit = commit_options.find { |o| options[o] } || options[:commit] repo_workdir = ::Rugged::Repository.discover(path).workdir relative = path.sub(repo_workdir, '') messages = Dir.chdir(repo_workdir) do file = relative.length != path.length ? relative : nil ::Pronto.run(commit, '.', formatters, file) end if options[:'exit-code'] error_messages_count = messages.count { |m| m.level != :info } exit(error_messages_count) end rescue Rugged::RepositoryError puts '"pronto" must be run from within a git repository or must be supplied the path to a git repository' rescue Pronto::Error => e $stderr.puts "Pronto errored: #{e.message}" end
verbose_version()
click to toggle source
# File lib/pronto/cli.rb, line 98 def verbose_version puts Version.verbose end
version()
click to toggle source
# File lib/pronto/cli.rb, line 91 def version puts Version::STRING end