Class: Pronto::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/pronto/cli.rb

Instance Method Summary collapse

Instance Method Details

#execObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/pronto/cli.rb', line 29

def exec
  gem_names = options[:runner].any? ? options[:runner] : ::Pronto.gem_names
  gem_names.each do |gem_name|
    require "pronto/#{gem_name}"
  end

  formatter = ::Pronto::Formatter.get(options[:formatter])
  puts ::Pronto.run(options[:commit], '.', formatter)
rescue Rugged::RepositoryError
  puts '"pronto" should be run from a git repository'
end

#listObject



43
44
45
# File 'lib/pronto/cli.rb', line 43

def list
  puts ::Pronto.gem_names
end

#versionObject



50
51
52
# File 'lib/pronto/cli.rb', line 50

def version
  puts "Pronto version #{::Pronto::VERSION}"
end