Class: GitHubChangelogGenerator::ChangelogGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/github_changelog_generator.rb

Overview

Main class and entry point for this script.

Instance Method Summary collapse

Constructor Details

#initializeObject

Class, responsible for whole changelog generation cycle



27
28
29
30
# File 'lib/github_changelog_generator.rb', line 27

def initialize
  @options = Parser.parse_options
  @generator = Generator.new @options
end

Instance Method Details

#runObject

The entry point of this script to generate changelog

Raises:



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

def run
  log = @generator.compound_changelog

  if @options.write_to_file?
    output_filename = @options[:output].to_s
    File.open(output_filename, "wb") { |file| file.write(log) }
    puts "Done!"
    puts "Generated log placed in #{Dir.pwd}/#{output_filename}"
  else
    puts log
  end
end