2023-04-03 15:34:59 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class String
|
2023-04-06 22:25:41 +00:00
|
|
|
def to_kebab
|
|
|
|
self.gsub(/\s+/, '-') # Replace all spaces with dashes.
|
|
|
|
.gsub(/[^a-zA-Z0-9-]/, '') # Remove all non-alphanumerical (and dashes) characters.
|
|
|
|
.gsub(/-+/, '-') # Reduce all dashes into only one.
|
|
|
|
.gsub(/^-|-+$/, '') # Remove all leading and trailing dashes.
|
2023-04-03 15:34:59 +00:00
|
|
|
.downcase
|
|
|
|
end
|
|
|
|
end
|
2023-05-27 11:33:48 +00:00
|
|
|
|
|
|
|
module Asciidoctor
|
|
|
|
module FoodogsquaredCustomExtensions
|
|
|
|
NAME = 'asciidoctor-foodogsquared-custom-extensions'
|
|
|
|
VERSION = '1.0.0'
|
|
|
|
CONTACT_EMAIL = 'foodogsquared@foodogsquared.one'
|
|
|
|
USER_AGENT = "#{NAME}/#{VERSION} ( #{CONTACT_EMAIL} )"
|
|
|
|
end
|
|
|
|
end
|