For most bikes, the gas flow from the tank is controlled by a petcock located on the underside of the gas tank. Just turn it to the "OFF" position and you should be able to remove it without spilling any gas. Always, check your manual though, because some tanks have cross-overs that run under the frame down-tube or coils mounted to it.
"I think my coworkers are probably getting grossed out by me walking around barefoot all day. It grosses me out to walk on the company carpet barefoot. But I have the ice pack tied around the ankle and can't put socks or shoes on over it."