Class: ChangelogGenerator::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/changelog_generator/cli.rb', line 6

def self.exit_on_failure?
  true
end

Instance Method Details

#generateObject



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/changelog_generator/cli.rb', line 31

def generate()
  generator = Generator.new(options[:user], options[:repo], options[:from_ref], options[:to_ref], options[:label_filter])
  begin
    output = generator.description + "\n\n"
    output << generator.changelog
    puts output
  rescue Exception => e
    puts e.message
    STDERR.puts "#{e}"
    STDERR.puts e.backtrace
    throw e
  end
end

#hello(name) ⇒ Object



15
16
17
18
19
# File 'lib/changelog_generator/cli.rb', line 15

def hello(name)
  greeting = "Hello, #{name}!"
  greeting.upcase! if options[:upcase]
  puts greeting
end