class String

Public Instance Methods

_term_width() click to toggle source
# File lib/git/status_all/extensions.rb, line 20
def _term_width
        @term_width ||= `tput cols`.to_i
end
append(s) click to toggle source
# File lib/git/status_all/extensions.rb, line 4
def append(s)
        self + s
end
pad_to_col(n) click to toggle source
# File lib/git/status_all/extensions.rb, line 8
def pad_to_col(n)
        pad_amount = n - self.uncolorize.length
        return " " + s if pad_amount < 0
        return self + (" " * pad_amount)
end
right_align(s) click to toggle source
# File lib/git/status_all/extensions.rb, line 14
def right_align(s)
        pad_amount = self._term_width - self.uncolorize.length - s.uncolorize.length
        return " " + s if pad_amount < 0
        return self + (" " * pad_amount) + s
end