Sha256: 6864e8bb9f94328549e94680c85df3b41a8576a1aad40f386f5c0d8cf8e22b5c

Contents?: true

Size: 507 Bytes

Versions: 23

Compression:

Stored size: 507 Bytes

Contents

require_relative('./commandarray.rb')
require_relative('./environment.rb')
require 'time'

class Pull < 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)
	    self.add "<%`git pull 2>&1`%>"
	    self.add "<%Timer.set_timestamp('last_pull')%>"
	  end
	end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
dev_tasks-1.0.14 lib/pull.rb
dev_tasks-1.0.13 lib/pull.rb
dev_tasks-1.0.12 lib/pull.rb