Module: JekyllPush::Utils

Defined in:
lib/jekyll_push/utils.rb

Class Method Summary collapse

Class Method Details

.slugify(str) ⇒ Object



9
10
11
12
13
# 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