Standard File Naming Conventions

P

pachl

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.
 
H

Henrik Nyh

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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top