/
ruby.coffee
38 lines (33 loc) · 996 Bytes
/
ruby.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# The same as the classical convention, except that directories in the module hierarchy are defined
# with `under_scores`. This helps to differentiate them as namespaces.
# ## An Example
#
# Given this project hierarchy:
#
# lib/
# things-and-baubles/
# stuff/
# moo.js
# gizmo.js
# many-doohickey.js
# fizz.js
# fizz_bam.js
#
# The exported module hierarchy will be as follows (assuming that lib/ is autorequired):
#
# {
# things_and_baubles: {
# stuff: {
# Moo: <Moo from moo.js>
# },
# Gizmo: <Gizmo from gizmo.js>
# ManyDoohickey: <ManyDoohickey from many-doohickey.js>
# },
# Fizz: <Fizz from fizz.js>
# FizzBam: <FizzBam from fizz_bam.js>
# }
Classical = require './classical'
class Ruby extends Classical
directoryToProperty: (directoryName, parentPath) ->
@specialCaseModuleNames[directoryName] or @underscore directoryName
module.exports = Ruby