Class: Pronto::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.is_thor_reserved_word?(word, type) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/pronto/cli.rb', line 9

def is_thor_reserved_word?(word, type)
  return false if word == 'run'
  super
end

Instance Method Details

#listObject



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

def list
  puts ::Pronto.gem_names
end

#runObject



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/pronto/cli.rb', line 35

def run
  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

#versionObject



56
57
58
# File 'lib/pronto/cli.rb', line 56

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