module AwesomeLoader::Utils
Misc utilities.
Constants
- LEADING_SEP
- SNAKE
Regex to match “snake name” paths
- TRAILING_SEP
Public Class Methods
camelize(name)
click to toggle source
Converts a snake_case_name to a CamelCaseName.
@param name [String] the snake_case version @return [String] the CamelCase version
# File lib/awesome_loader/utils.rb, line 17 def self.camelize(name) name.capitalize.gsub(SNAKE) { |match| match[1].capitalize } end
clean_path(path)
click to toggle source
Returns the path with any leading or trailing /'s removed.
@param path [String] @return [String]
# File lib/awesome_loader/utils.rb, line 27 def self.clean_path(path) path.sub(LEADING_SEP, '').sub(TRAILING_SEP, '') end