Sha256: fc689680e8262dea1c115ddbe609f8c4dd726cd0aa88e988de5e4abf3a4d2a43
Contents?: true
Size: 474 Bytes
Versions: 6
Compression:
Stored size: 474 Bytes
Contents
module Cp8Cli class PullRequestTitle def initialize(title, prefixes: []) @title = title @prefixes = Array(prefixes) end def run title_with_prefixes.presence end private attr_reader :title, :prefixes def title_with_prefixes "#{prefixes_to_text} #{title}".strip end def prefixes_to_text prefixes.map do |prefix| "[#{prefix.to_s.upcase}]" end.join(" ") end end end
Version data entries
6 entries across 6 versions & 1 rubygems