Forum: Ruby Standard File Naming Conventions

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C5243f4a24d1524077d3c03714e87ae4?d=identicon&s=25 Clint Pachl (pachl)
on 2008-10-19 03:31
(Received via mailing list)
For a file containing the given class, SomeCoolClass, what would be
the proper filename?

1) somecoolclass.rb
2) some_cool_class.rb
3) some-cool-class.rb
4) SomeCoolClass.rb

or some other variation?

I noticed in the Ruby stdlib, versions 1, 2 and 3 are used.
4a551074ddba4460f95d011c47190d0e?d=identicon&s=25 Henrik --- (malesca)
on 2008-10-19 09:31
(Received via mailing list)
On Sun, Oct 19, 2008 at 3:29 AM, pachl <> wrote:
> I noticed in the Ruby stdlib, versions 1, 2 and 3 are used.
I'm not sure about the Ruby convention here, but I know Ruby on Rails
uses #2 (some_cool_class.rb).

In Rails, this convention is necessary for some of the magic: if you
reference MyConstant::MyClass and it's not known, Rails uses
const_missing to translate that to my_constant/my_class and tries to
find that in the load path.
This topic is locked and can not be replied to.