Class: GemKit::Release::Commands::Changelog

Inherits:
Command
  • Object
show all
Defined in:
lib/gem_kit/release/commands/changelog.rb

Overview

Linting is the default because it is the safe, read-only half. Writing edits a file and costs money, so it asks for the flag.

Constant Summary

Constants inherited from Command

GemKit::Release::Commands::Command::RED, GemKit::Release::Commands::Command::RESET

Instance Attribute Summary

Attributes inherited from Command

#options

Instance Method Summary collapse

Methods inherited from Command

#fail_with, #gate, #initialize, #lines, #project, #refuse, #relative, #render, #say, #version_file

Constructor Details

This class inherits a constructor from GemKit::Release::Commands::Command

Instance Method Details

#call(version = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gem_kit/release/commands/changelog.rb', line 15

def call(version = nil)
  return write_entry if options[:write]

  problems = version ? gate.release_problems(version) : gate.changelog_problems

  if problems.empty?
    say("#{relative(project.changelog_path)} is #{version ? "ready to release #{version}" : "clean"}.")
    return
  end

  refuse("#{problems.size} problem(s) in #{relative(project.changelog_path)}:", problems)
end