Sha256: 155e7edd73e26d21b928ca3d90e9b954e3e7cb3e53c5f163e26e3c9ce7ef6bcb

Contents?: true

Size: 861 Bytes

Versions: 2

Compression:

Stored size: 861 Bytes

Contents

#require_relative './commandarray.rb'

class Add #< CommandArray

  # updates the commands in the Add CommandArray
  #
  # if a .git directory exists, the command 'git add -A -v' will be appended the Add Commands
  # if a .svn directory exists, all DEV[:files][:source] files that are not tracked by subversion
  # will have the appropriate svn add command appended to the Add Commands
  def update
    if(Dir.exists?(".git"))
    	DEV_TASKS[:files][:source].each{|f|
	    if(`git status #{f}`.include?('untracked'))
		  add "git add #{f} -v"
		end
	  }
	  #if(`git status`.include?('untracked files present'))
	  #  self.add 'git add -A -v'
	  #end
	end
	if(Dir.exists?(".svn") && defined?(DEV_TASKS))
	  DEV_TASKS[:files][:source].each{|f|
	    if(`svn status #{f}`.include?('?'))
		  add "svn add #{f}"
		end
	  }
	end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dev_tasks-1.0.38 lib/add.rb
dev_tasks-1.0.37 lib/add.rb