For the sake of ease even though there are better translations I will quote an online translation
of Iyov {Job} chapter 31 verses 1 and 2
http://www.chabad.org/library/bible_cdo/aid/16433#showrashi=true1 I made a covenant with my eyes, and why should I gaze upon a virgin?
2 Now what is the portion of G-d from above and the heritage of the Almighty from on high?
This is the commentary of Avot De Rabbi Natan, Nuscha B, chapter 2 as translated by me:
From where do we know that Iyov {Job} made a fence to his matters, for it was stated “an unblemished man, upright, fearful of the L-rd and departs from evil" (Iyov 1:1) And thus would Iyov say “distance yourself from the ugly and what is similar to it”. And so he would say, “a covenant I made with my eyes, and why should I gaze upon (alt. translation, think deeply about) a virgin” (Iyov 31:1). And if this is so for a virgin, that she is permitted to be married to him or his son, or grandson and she is permitted to the son of his sister and she is permitted to be married to any man that desires, I would not gaze at her, all the more so I wouldn’t do so for a married woman. Rabbi Yehuda ben Betaira says, that Iyov would expound in his own mind, and what is the portion from the L-rd above and the heritage of the Almighty from on high, if it had been worthy for the first man to be given ten wives, he would have given them to him, but it was only fitting to give to him, one wife, so too, my wife is sufficient, my portion is sufficient. Another interpretation, “ a covenant I have made with my eyes”. What if a virgin that she is permitted to marry any one she wants, if I would gaze at her, it would turn out as if I would be gazing at a married woman.