Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Standard File Naming Conventions

5 views
Skip to first unread message

pachl

unread,
Oct 18, 2008, 9:29:36 PM10/18/08
to
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.

Henrik Nyh

unread,
Oct 19, 2008, 3:30:11 AM10/19/08
to

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.

0 new messages