lib/soloist/util.rb in soloist-0.9.1 vs lib/soloist/util.rb in soloist-0.9.2
- old
+ new
@@ -28,7 +28,14 @@
[nil, nil]
else
raise Errno::ENOENT, "#{filenames.join(" or ")} not found" unless file || opts[:required] == false
end
end
+
+ # stolen from activesupport
+ def camelize(term)
+ string = term.to_s
+ string = string.sub(/^[a-z\d]*/) { $&.capitalize }
+ string.gsub(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{$2.capitalize}" }.gsub('/', '::')
+ end
end
end
\ No newline at end of file