88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
# File 'lib/scaffolding/class_names_transformer.rb', line 88
def replacement_for(string)
case string
when "Scaffolding::AbsolutelyAbstract::CreativeConcepts"
parent.pluralize
when "Scaffolding::CompletelyConcrete::TangibleThings"
child.pluralize
when "ScaffoldingAbsolutelyAbstractCreativeConcepts"
parent.pluralize.gsub("::", "")
when "ScaffoldingCompletelyConcreteTangibleThings"
child.pluralize.gsub("::", "")
when "Scaffolding Absolutely Abstract Creative Concepts"
parent.pluralize.titlecase.tr("/", " ")
when "Scaffolding Completely Concrete Tangible Things"
child.pluralize.titlecase.tr("/", " ")
when "scaffolding.completely_concrete.tangible_things"
child.underscore.pluralize
when "Scaffolding/Absolutely Abstract/Creative Concepts"
parent.pluralize.titlecase
when "Scaffolding/Completely Concrete/Tangible Things"
child.pluralize.titlecase
when "scaffolding/absolutely_abstract/creative_concepts"
parent.underscore.pluralize
when "scaffolding/completely_concrete/tangible_things"
child.underscore.pluralize
when "scaffolding/completely_concrete/_tangible_things"
parts = child.underscore.split("/")
parts.push "_#{parts.pop}"
parts.join("/").pluralize
when "scaffolding_absolutely_abstract_creative_concepts"
parent.underscore.tr("/", "_").pluralize
when "scaffolding_completely_concrete_tangible_things"
child.underscore.tr("/", "_").pluralize
when "scaffolding-absolutely-abstract-creative-concepts"
parent.underscore.gsub(/[\/_]/, "-").pluralize
when "scaffolding-completely-concrete-tangible-things"
child.underscore.gsub(/[\/_]/, "-").pluralize
when "Scaffolding::AbsolutelyAbstract::CreativeConcept"
parent
when "Scaffolding::CompletelyConcrete::TangibleThing"
child
when "ScaffoldingAbsolutelyAbstractCreativeConcept"
parent.gsub("::", "")
when "ScaffoldingCompletelyConcreteTangibleThing"
child.gsub("::", "")
when "Scaffolding Absolutely Abstract Creative Concept"
parent.titlecase.tr("/", " ")
when "Scaffolding Completely Concrete Tangible Thing"
child.titlecase.tr("/", " ")
when "Scaffolding/Absolutely Abstract/Creative Concept"
parent.titlecase
when "Scaffolding/Completely Concrete/Tangible Thing"
child.titlecase
when "scaffolding/absolutely_abstract/creative_concept"
parent.underscore
when "scaffolding/completely_concrete/tangible_thing"
child.underscore
when "scaffolding_absolutely_abstract_creative_concept"
parent.underscore.tr("/", "_")
when "scaffolding_completely_concrete_tangible_thing"
child.underscore.tr("/", "_")
when "scaffolding-absolutely-abstract-creative-concept"
parent.underscore.gsub(/[\/_]/, "-")
when "scaffolding-completely-concrete-tangible-thing"
child.underscore.gsub(/[\/_]/, "-")
when "absolutely_abstract_creative_concepts"
parent_class_name_in_context.underscore.tr("/", "_").pluralize
when "completely_concrete_tangible_things"
class_name_in_parent_context.underscore.tr("/", "_").pluralize
when "absolutely_abstract/creative_concepts"
parent_class_name_in_context.underscore.pluralize
when "completely_concrete/tangible_things"
class_name_in_parent_context.underscore.pluralize
when "absolutely-abstract-creative-concepts"
parent.underscore.gsub(/[\/_]/, "-").pluralize
when "completely-concrete-tangible-things"
child.underscore.gsub(/[\/_]/, "-").pluralize
when "absolutely_abstract_creative_concept"
parent_class_name_in_context.underscore.tr("/", "_")
when "completely_concrete_tangible_thing"
class_name_in_parent_context.underscore.tr("/", "_")
when "absolutely_abstract/creative_concept"
parent_class_name_in_context.underscore
when "completely_concrete/tangible_thing"
class_name_in_parent_context.underscore
when "absolutely-abstract-creative-concept"
parent.underscore.gsub(/[\/_]/, "-")
when "completely-concrete-tangible-thing"
child.underscore.gsub(/[\/_]/, "-")
when "creative_concepts"
parent_in_namespace_class_name.underscore.pluralize
when "tangible_things"
in_namespace_class_name.underscore.pluralize
when "Creative Concepts"
parent_in_namespace_class_name.titlecase.pluralize
when "Tangible Things"
in_namespace_class_name.titlecase.pluralize
when "Creative concepts"
parent_in_namespace_class_name.titlecase.downcase.capitalize.pluralize
when "Tangible things"
in_namespace_class_name.titlecase.downcase.capitalize.pluralize
when "creative concepts"
parent_in_namespace_class_name.titlecase.downcase.pluralize
when "tangible things"
in_namespace_class_name.titlecase.downcase.pluralize
when "creative-concepts"
parent_in_namespace_class_name.underscore.gsub(/[\/_]/, "-").pluralize
when "tangible-things"
in_namespace_class_name.underscore.gsub(/[\/_]/, "-").pluralize
when "creative_concept"
parent_in_namespace_class_name.underscore
when "tangible_thing"
in_namespace_class_name.underscore
when "Creative Concept"
parent_in_namespace_class_name.titlecase
when "Tangible Thing"
in_namespace_class_name.titlecase
when "Creative concept"
parent_in_namespace_class_name.titlecase.downcase.capitalize
when "Tangible thing"
in_namespace_class_name.titlecase.downcase.capitalize
when "creative concept"
parent_in_namespace_class_name.titlecase.downcase
when "tangible thing"
in_namespace_class_name.titlecase.downcase
when "creative-concept"
parent_in_namespace_class_name.underscore.gsub(/[\/_]/, "-")
when "tangible-thing"
in_namespace_class_name.underscore.gsub(/[\/_]/, "-")
when ":account"
":#{namespace}"
when "/account/"
"/#{namespace}/"
else
"🛑"
end
end
|