Sha256: 5bbc2dfb8192e14779034cb2f9580c2b133a8ec1764fbe8a6d0247d588789f17
Contents?: true
Size: 435 Bytes
Versions: 2
Compression:
Stored size: 435 Bytes
Contents
module ViewsHelpers def strip_message(text, length) text.length > length ? text[0, length] + '...' : text end def summ_line(line) line.match(/@@\s+-([^\s]+)\s+\+([^\s]+)\s+@@/) [Regexp.last_match(1), Regexp.last_match(2)].map{|item| parts = item.split(',') if parts.count == 2 parts[0] + '-' + (parts[0].to_i + parts[1].to_i).to_s else item end }.join(' -> ') end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
zitgit-0.1.1 | lib/zitgit/helpers/views.rb |
zitgit-0.1.0 | lib/zitgit/helpers/views.rb |