<commit_before>require 'chicanery/git'

include Chicanery::Git

git 'chicanery', '.', branches: [:master]

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<commit_msg>added explicit poll period to baby steps example<commit_after>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
{'fraction_non_alphanumeric': 0.12836079791847355, 'fraction_numerical': 0.0017346053772766695, 'mean_word_length': 4.128888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '773835', 'n_tokens_mistral': 392, 'n_tokens_neox': 377, 'n_words': 126}