|
@@ -29,6 +29,14 @@ def convert_case(source)
|
|
|
return source.split('_').collect(&:capitalize).join
|
|
|
end
|
|
|
|
|
|
+def origin_case(source)
|
|
|
+ source.gsub(/::/, '/').
|
|
|
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
|
|
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
|
|
|
+ tr("-", "_").
|
|
|
+ downcase
|
|
|
+end
|
|
|
+
|
|
|
def ensure_dir(dir)
|
|
|
return if Dir.exist?(dir)
|
|
|
FileUtils.mkdir_p dir
|