Sha256: d85975380c024f79af79de25e920c3bb6f3d98f8e38ace554d1867ff0c6a3be8
Contents?: true
Size: 871 Bytes
Versions: 21
Compression:
Stored size: 871 Bytes
Contents
# By default, command runs only when story is finished class FinishedCommand < Command def run! check_finishes unless override? system cmd end private # Checks to see if the most recent commit finishes the story # We look for 'Finishes' or 'Delivers' and issue a warning if neither is # in the most recent commit. (Also supports 'Finished' and 'Delivered'.) def check_finishes unless finished? warning = "Warning: Unfinished story\n" warning += "Run `git commit --amend` to add 'Finishes' or 'Delivers' " warning += "to the commit message\n" warning += "Use --override to override" $stderr.puts warning exit 1 end end def finished? !!(`git log -1`.match(/Finishe(s|d)|Deliver(s|ed)|Fixe(s|d) #\d+/i)) end def override? options.override end end
Version data entries
21 entries across 21 versions & 1 rubygems