Class: Add

Inherits:
Array show all
Defined in:
lib/dev_commands.rb

Instance Method Summary collapse

Methods inherited from Array

#add, #execute, #to_html

Instance Method Details

#updateObject



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/dev_commands.rb', line 218

def update
	if(File.exists?('.git') && File.exists?('.gitignore'))
		add 'git add --all' 
	else
		if(defined?(SOURCE))
			if(File.exists?('.svn'))
				SOURCE.each{|f|

					add "svn add #{f} --parents" if Command.output("svn status #{f}").include?('?')
					add "svn add #{f} --parents" if Command.exit_code("svn status #{f}") != 0
				}
			end
			if(File.exists?('.git'))
				SOURCE.each{|f|
					add "git add #{f} -v" if `git status #{f}`.include?('untracked')
				}
			end
		end
	end
end