How should I protect a gas line in a closet?
You basically would build a bulkhead to contain this.  Any enclosed gas pipe/water/electric should be built with a wall that meets code

This means the bulkhead should be framed out like a mini wall.  Floor plate, top plate, wall plate, joists and studs 16" O/C.  Frame it out affixed firmly to the wall (anchoring the wall plate in the studs) and glue down or preferably anchor down the floor plate.  Angle it to go all the way up the wall to enclose the vertical portion of the pipe.

Once you frame it all in, cover in sheet rock, mud and tape.  And paint.

Then you can finish it out and use the bulkhead (excluding the vertical part) to make a cool shoe shelf.