Sha256: c4d01dcd0c9f6903b7e59ea894c5de105310fbf67367afdd3decf3039b533b40
Contents?: true
Size: 424 Bytes
Versions: 3
Compression:
Stored size: 424 Bytes
Contents
class String def append(s) self + s end def pad_to_col(n) pad_amount = n - self.uncolorize.length return " " + s if pad_amount < 0 return self + (" " * pad_amount) end 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 def _term_width @term_width ||= `tput cols`.to_i end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
git-status-all-1.1.3 | lib/git/status_all/extensions.rb |
git-status-all-1.1.2 | lib/git/status_all/extensions.rb |
git-status-all-1.1.0 | lib/git/status_all/extensions.rb |