Class: Add
- Inherits:
-
Object
- Object
- Add
- Defined in:
- lib/add.rb
Overview
require_relative ‘./commandarray.rb’
Instance Method Summary collapse
-
#update ⇒ Object
updates the commands in the Add CommandArray.
Instance Method Details
#update ⇒ Object
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[:source] files that are not tracked by subversion will have the appropriate svn add command appended to the Add Commands
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/add.rb', line 10 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 |