Sha256: 51cd05270930ef8d3f73fd0db7f4525c3475d51c2d8079d9689b4a5e123e19ba

Contents?: true

Size: 859 Bytes

Versions: 38

Compression:

Stored size: 859 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

38 entries across 38 versions & 1 rubygems

Version Path
dev_tasks-1.0.35 lib/add.rb
dev_tasks-1.0.34 lib/add.rb
dev_tasks-1.0.33 lib/add.rb
dev_tasks-1.0.31 lib/add.rb
dev_tasks-1.0.30 lib/add.rb
dev_tasks-1.0.29 lib/add.rb
dev_tasks-1.0.28 lib/add.rb
dev_tasks-1.0.27 lib/add.rb
dev_tasks-1.0.26 lib/add.rb
dev_tasks-1.0.25 lib/add.rb
dev_tasks-1.0.24 lib/add.rb
dev_tasks-1.0.23 lib/add.rb
dev_tasks-1.0.22 lib/add.rb
dev_tasks-1.0.21 lib/add.rb
dev_tasks-1.0.20 lib/add.rb
dev_tasks-1.0.19 lib/add.rb
dev_tasks-1.0.18 lib/add.rb
dev_tasks-1.0.17 lib/add.rb
dev_tasks-1.0.16 lib/add.rb
dev_tasks-1.0.15 lib/add.rb