method
prepare_trim_mode
prepare_trim_mode(mode)
public
Hide source
# File lib/erb.rb, line 661 def prepare_trim_mode(mode) # :nodoc: case mode when 1 return [false, '>'] when 2 return [false, '<>'] when 0, nil return [false, nil] when String unless mode.match?(/\A(%|-|>|<>){1,2}\z/) warn_invalid_trim_mode(mode, uplevel: 5) end perc = mode.include?('%') if mode.include?('-') return [perc, '-'] elsif mode.include?('<>') return [perc, '<>'] elsif mode.include?('>') return [perc, '>'] else [perc, nil] end else warn_invalid_trim_mode(mode, uplevel: 5) return [false, nil] end end