# Standard File Naming Conventions

**URL:** <https://www.ruby-forum.com/t/standard-file-naming-conventions/151267>\
**Category:** Ruby\
**Created:** [October 19, 2008, 3:31am UTC](https://www.ruby-forum.com/t/standard-file-naming-conventions/151267 "2008-10-19T03:31:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [October 19, 2008, 3:31am UTC](https://www.ruby-forum.com/t/standard-file-naming-conventions/151267/1 "2008-10-19T03:31:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pachl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5f9b8f/32.png) [@pachl](https://www.ruby-forum.com/u/pachl)\
**Post date:** [October 19, 2008, 9:31am UTC](https://www.ruby-forum.com/t/standard-file-naming-conventions/151267/2 "2008-10-19T09:31:56Z")

</div>

On Sun, Oct 19, 2008 at 3:29 AM, pachl [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.
