module Haml::Shared
def human_indentation(indentation, was = false)
-
(String)
- The name of the indentation (e.g. `"12 spaces"`, `"1 tab"`)
Parameters:
-
was
(Boolean
) -- Whether or not to add `"was"` or `"were"` -
indentation
(String
) -- The string used for indentation
def human_indentation(indentation, was = false) if !indentation.include?(?\t) noun = 'space' elsif !indentation.include?(?\s) noun = 'tab' else return indentation.inspect + (was ? ' was' : '') end singular = indentation.length == 1 if was was = singular ? ' was' : ' were' else was = '' end "#{indentation.length} #{noun}#{'s' unless singular}#{was}" end