class PimpMyChangelog::CLI

Public Class Methods

new() click to toggle source
# File lib/pimpmychangelog/cli.rb, line 7
def initialize
  @git_remote = GitRemote.new
end
run!() click to toggle source
# File lib/pimpmychangelog/cli.rb, line 3
def self.run!
  new.run
end

Public Instance Methods

run() click to toggle source
# File lib/pimpmychangelog/cli.rb, line 11
def run
  changelog = read_changelog
  puts changelog
  puts ""
  puts "In case something goes wrong we printed out your current #{changelog_path} above"

  write_changelog(Pimper.new(user, project, changelog).better_changelog)
  puts "Your changelog is now pimped!"
end

Private Instance Methods

changelog_path() click to toggle source
# File lib/pimpmychangelog/cli.rb, line 31
def changelog_path
  "CHANGELOG.md"
end
project() click to toggle source
# File lib/pimpmychangelog/cli.rb, line 27
def project
  @git_remote.project
end
read_changelog() click to toggle source
# File lib/pimpmychangelog/cli.rb, line 35
def read_changelog
  File.read(changelog_path)
end
user() click to toggle source
# File lib/pimpmychangelog/cli.rb, line 23
def user
  @git_remote.user
end
write_changelog(content) click to toggle source
# File lib/pimpmychangelog/cli.rb, line 39
def write_changelog(content)
  File.open(changelog_path, 'w') { |f| f.write content }
end