Sha256: 3c87160367eb537cda26d5605e9e9274b7aed2443e8183ca5618919fb90c00c7

Contents?: true

Size: 1.37 KB

Versions: 57

Compression:

Stored size: 1.37 KB

Contents

puts __FILE__ if defined?(DEBUG)

desc 'adds source files to git or subversion'
task :add do Tasks.execute_task :add;end

class Add < Array
	def update
		if(File.exists?('.git') && File.exists?('.gitignore'))
			add_quiet 'git add --all' 
		else
			if(defined?(SOURCE))
				if(File.exists?('.svn'))
					SOURCE.each{|f|
						if(File.exists?(f) && File.file?(f))
							if(f.include?(' '))
	                          status=Command.output("svn status \"#{f}\"") 
	                          error=Command.error("svn status \"#{f}\"")
	                        else
	                          status=Command.output("svn status #{f}") 
	                          error=Command.error("svn status #{f}")
	                   	    end
	                        if(status.include?('?') || status.include?('was not found') || error.include?('was not found'))
	                        	if(f.include?(' '))
								  add_quiet "svn add \"#{f}\" --parents"
							    else
								  add_quiet "svn add #{f} --parents"
							    end
							end
						end
					}
				end
				if(File.exists?('.git'))
					SOURCE.each{|f|
						if(File.exists?(f) && File.file?(f))
						  status=Command.output("git status #{f} --short")
						  if status.include?('??') || status.include?(' M ')
							add_quiet "git add #{f} -v" 
						  end
					    end
					}
				end
			end
		end
	end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
dev-2.0.287 lib/tasks/add.rb
dev-2.0.286 lib/tasks/add.rb
dev-2.0.285 lib/tasks/add.rb
dev-2.0.284 lib/tasks/add.rb
dev-2.0.283 lib/tasks/add.rb
dev-2.0.282 lib/tasks/add.rb
dev-2.0.281 lib/tasks/add.rb
dev-2.0.280 lib/tasks/add.rb
dev-2.0.279 lib/tasks/add.rb
dev-2.0.278 lib/tasks/add.rb
dev-2.0.277 lib/tasks/add.rb
dev-2.0.276 lib/tasks/add.rb
dev-2.0.275 lib/tasks/add.rb
dev-2.0.274 lib/tasks/add.rb
dev-2.0.273 lib/tasks/add.rb
dev-2.0.272 lib/tasks/add.rb
dev-2.0.271 lib/tasks/add.rb