#require_relative('./commandarray.rb') require_relative('./environment.rb') require 'time' class Pull < Array#< CommandArray def update if(Environment.scm=='git' && Environment.scm_origin.length > 0 && `git config --list`.include?('user.name=')) if(Timer.elapsed_exceeds?("last_pull",60*60*2)) #if(Timer.get_elapsed("last_pull").nil? || Timer.get_elapsed("last_pull") > 60*60*2) add "<%`git pull 2>&1`%>" add "<%Timer.set_timestamp('last_pull')%>" end end end end