module JekyllPush::Utils

Public Class Methods

slugify(str) click to toggle source

@return [String]

# File lib/jekyll_push/utils.rb, line 9
def self.slugify(str)
  safe = str.to_s.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
  warn Rainbow("Warning: '#{str}' is not an acceptable branch name. Using '#{safe}' instead.").orange unless safe.eql?(str)
  safe
end