Sha256: 273753840997574de1644d61ab4b2ffdd4002cec1df7e07563f53607bc6ec86a

Contents?: true

Size: 1018 Bytes

Versions: 13

Compression:

Stored size: 1018 Bytes

Contents

class Add < Array
	def update
		if(File.exists?('.git') && File.exists?('.gitignore'))
			add 'git add --all' 
		else
			if(defined?(SOURCE))
				if(File.exists?('.svn'))
					SOURCE.each{|f|
						if(File.exists?(f))
	                        status=Command.output("svn status #{f}")
	                        if(status.include?('?') || status.include?('was not found'))
								puts "svn add #{f} --parents"
								add "svn add #{f} --parents"
							else
								puts "#{status}" if status.strip.length > 0
								puts "        #{f}" if status.strip.length == 0
							end
						end
					}
				end
				if(File.exists?('.git'))
					SOURCE.each{|f|
						status=`git status #{f} --short`
						#if status.include?('untracked') || status.include?('modified:')
						if status.include?('??') || status.include?(' M ')
							puts "git add #{f} -v"
							add "git add #{f} -v" 
						else
							puts status if status.strip.length > 0
						end
					}
				end
			end
		end
	end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dev-2.0.128 lib/commands/add.rb
dev-2.0.127 lib/commands/add.rb
dev-2.0.126 lib/commands/add.rb
dev-2.0.124 lib/commands/add.rb
dev-2.0.123 lib/commands/add.rb
dev-2.0.122 lib/commands/add.rb
dev-2.0.121 lib/commands/add.rb
dev-2.0.119 lib/commands/add.rb
dev-2.0.118 lib/commands/add.rb
dev-2.0.117 lib/commands/add.rb
dev-2.0.116 lib/commands/add.rb
dev-2.0.115 lib/commands/add.rb
dev-2.0.114 lib/commands/add.rb