What is the best practice for working with a project as nested modules? I come from the world of Python, so I'm used to every file representing their own enclosed module, never polluting the global environment. Up until now (I've worked with Ruby for a week) I've created one file per class in a nested structure such as this:

lib
`- project_name
   |- sub_module
   |  `- foo_bar.rb
   `- some_class.rb

Where some_class.rb contains:

module ProjectName
    class SomeClass
        # ...
    end
end


And foo_bar.rb contains:

module ProjectName::SubModule
    class FooBar
        # ...
    end
end


This has incidentally worked fine up until now, but I realized that if I require foo_bar.rb before I require some_class.rb I would get a NameError: uninitialized constant ProjectName. So now I'm exploring workarounds for foo_bar.rb, all pretty ugly in my opinion:

module ProjectName
    module SubModule
        # Double indent for all the code in the file!?
    end
end

module ProjectName end
module ProjectName::SubModule
    # Fair enough, I suppose...
end

module ProjectName module SubModule
    # Ugly
end end


I suppose any of these would work and the choice would be a matter of taste, but I'd rather use the option that most developers in this situation uses. The question is in the title, please comment.
I use the version with double indent and I think it is the common usage:

module ProjectName
    module SubModule
        # Double indent for all the code in the file!?
    end
end


If you don't like the double indention, just don't do it. 

It is best practice to indent each code level (module, class, def, loops...), but no must.
In Python it is part of the syntax, but not in Ruby.

See also https://stackoverflow.com/questions/3833641/is-there-an-acceptable-way-of-putting-multiple-module-declarations-on-the-same-l