lib/gruff/base.rb
# Space around text elements. Mostly used for vertical spacing.
Space around text elements. Mostly used for vertical spacing.
Space around text elements . Mostly used for vertical spacing .
def truncate_label_text(text)
      text = text.to_s
      return text if text.size <= @label_max_size
      if @label_truncation_style == :trailing_dots
        text = "#{text[0..(@label_max_size - 4)]}..." if @label_max_size > 3
      else
        text = text[0..(@label_max_size - 1)]
      end
      text
    end
def truncate_label_text ( text ) text = text . to_s return text if text . size <= @label_max_size if @label_truncation_style == :trailing_dots text = "#{text[0..(@label_max_size - 4)]}..." if @label_max_size > 3 else text = text [ 0 .. ( @label_max_size - 1 ) ] end text end
Space around text elements.
Space around text elements .
# 4 because '...' takes up 3 chars
text
<not_specific>