module NotTooLate

Constants

VERSION

Public Class Methods

run(time_travel, git_command) click to toggle source
# File lib/not_too_late.rb, line 7
def run(time_travel, git_command)
  set_sys_time_to(Date.today - time_travel)
  puts "running #{git_command}"
  system git_command
  system "sudo ntpdate -u time.apple.com"
end

Private Class Methods

set_sys_time_to(date) click to toggle source
# File lib/not_too_late.rb, line 16
def set_sys_time_to(date)
  command = 'sudo date $(date "+' +
            date.strftime("%m") +
            date.strftime("%d") +
            '%H%M' +
            date.strftime("%y") +
            '.%S")'
  p command
  system command
end