for example, i can choose
t e [0,8]
z = -1+i(1-t) [0,2]
z = (t-3)-i [2,4]
z = 1+i(t-5) [4,6]
z = (7-t)+i [6,8]
then
∮1/z dz = ∫ -i/(-1+i(1-t)) dt [0,2] + ∫ 1/((t-3)-i) dt [2,4] + ∫ i/(1+i(t-5)) dt [4,6] + ∫ -1/((7-t)+i) dt [6,8]
= {ln(-1-i) - ln(-1+i)} + {ln(1-i) - ln(-1-i)} + {ln(1+i) - ln(1-i)} + {ln(-1+i) - ln(1+i)}
= iπ{5/4 - 3/4} + iπ{7/4-5/4} + iπ{1/4-7/4} + iπ{3/4-1/4} = 0
now then... it's 0. what? well yes. why? branch cut. we crossed it. that's gonna bugger you. up to now, i haven't even declared where my branch cut is. branch cut makes things single valued, and you can't cross it with your integral's path. hence, in method 1, you might see it in a textbook as [0,2π
). usually you make a branch cut as convenient as possible. physics people might use [-π,π

sometimes, math people kinda don't care as long as you mention it. taking the interval [0,2π

implies taking the branch cut along the positive real axis. with our square geometry, it's convenient to cut from 0 to a corner of the square. pick any one. i'll choose the -1,i corner, since that's where t starts. cutting there allows us to define a domain for e^iθ, in this case it's [-π5/4, π3/4). so now take a look at that last line again:
= iπ{5/4 - 3/4} + iπ{7/4-5/4} + iπ{1/4-7/4} + iπ{3/4-1/4}
now that we have taken our branch cut, anything outside of the domain can't be right. so iπ7/4 -> -iπ1/4 and iπ5/4 -> -iπ3/4. (these won't actually matter, but it's good practice to remember they don't really exist with this branch cut). so if changing those doesn't matter, what are we forgetting? we're forgetting we can't cross the branch cut. we START just "below" the branch cut and end just "above" it. that means our starting value of iπ3/4 is wrong and we need to swap it for the clockwise moving way of labeling it: -iπ5/4.
= iπ{
-3/4 + 5/4} + iπ{
-1/4 + 3/4} + iπ{1/4+1/4} + iπ{3/4-1/4}
=i2π
one more thing... like i said, iπ3/4 is outside of our domain, why did i still use it once? use the fundamental theorem of calculus to evaluate the last integral at its endpoints, since it's just a riemann integral we can do that, but iπ3/4 is outside of our domain, so call that endpoint "a" instead and take the limit as a->iπ3/4 and it converges nicely and all that (just to be sure i don't try to slip one past you, it's the typical justification)
hope this helps