Sha256: 78595bbb76f648ba69f3175d14b1bdbe924113ac11e228923761964e63870a19
Contents?: true
Size: 846 Bytes
Versions: 12
Compression:
Stored size: 846 Bytes
Contents
require 'chicanery/git' include Chicanery::Git git 'chicanery', '.', branches: [:master] poll_period 10 def now Time.now.to_i end def say message `growlnotify -t "some new chicanery ..." --image ~/icons/chicanery.png -m \"#{message}\"` end start = now maximum = ARGV.shift.to_i say "Uncommitted changes will be automatically reverted after #{maximum} seconds" when_run do |state| start = now if `git status`.chomp.split("\n").last == 'nothing to commit, working directory clean' elapsed = now - start if elapsed >= maximum say "no commits detected in #{elapsed} seconds - reverting all uncommitted changes" `afplay ~/build_sounds/ticktock.mp3` `git reset --hard` `git clean -d -x -f` start = now end end when_commit do |branch, commit, previous| say "commit detected - resetting timer" start = now end
Version data entries
12 entries across 12 versions & 1 rubygems