class Keepachangelog::CLI
Public Class Methods
shell()
click to toggle source
# File lib/keepachangelog/cli.rb, line 8 def self.shell Thor::Base.shell.new end
Public Instance Methods
parse()
click to toggle source
# File lib/keepachangelog/cli.rb, line 37 def parse case options[:from].to_sym when :md then parse_markdown when :yaml then parse_yaml else shell.error "Unknown input format #{options[:from]}" exit 1 end end
version()
click to toggle source
# File lib/keepachangelog/cli.rb, line 16 def version shell.say Keepachangelog.version end
Private Instance Methods
parse_markdown()
click to toggle source
# File lib/keepachangelog/cli.rb, line 51 def parse_markdown parser = MarkdownParser.load(options[:in]) print parser end
parse_yaml()
click to toggle source
# File lib/keepachangelog/cli.rb, line 56 def parse_yaml parser = YamlParser.load(options[:in]) print parser end
print(parser)
click to toggle source
rubocop:disable Metrics/AbcSize
# File lib/keepachangelog/cli.rb, line 62 def print(parser) case options[:to].to_sym when :json shell.say parser.to_json when :s, :string shell.say parser.to_s when :md, :markdown shell.say parser.to_md when :yaml, :yml out = options[:out] || 'changelog' parser.to_yaml(out) shell.say "Finished writing changelog to '#{out}'" else shell.error "Unknown output format #{options[:to]}" exit 2 end end