Where is the scripture about being lukewarm and how it is like returning to a dog's vomit?

In the book of Revelation, John prefaces the prophecy of the end times with letters to each of the seven churches of that day. To the church at Laodicea, he writes:

I know your deeds, that you are neither cold nor hot. I wish you were either one or the other! So, because you are lukewarm—neither hot nor cold—I am about to spit you out of my mouth (Rev. 3:15-16 NIV).

The Message expands on this:

"I know you inside and out, and find little to my liking. You're not cold, you're not hot—far better to be either cold or hot! You're stale. You're stagnant. You make me want to vomit. You brag, 'I'm rich, I've got it made, I need nothing from anyone,' oblivious that in fact you're a pitiful, blind beggar, threadbare and homeless (Rev. 3:15-17).

The essence of this passage is that God desires for us to be completely commited to him. God despises those who pay him lip service, but who in their hearts, they are not fully trusting in God.