Sha256: caa51e3bbf430219001704163f7f0358b6b4b96306620f96ea6c374d3a839290
Contents?: true
Size: 1.02 KB
Versions: 4
Compression:
Stored size: 1.02 KB
Contents
module Mercurial # # The class represents Mercurial blame output. Obtained by running an +hg blame+ command. # # This is for the Blame object itself, {Mercurial::BlameFactory BlameFactory} is responsible # for assembling instances of the Blame. For the list of all possible blame-related operations please # look documentation for {Mercurial::BlameFactory BlameFactory}. # class Blame attr_reader :repository attr_reader :contents def initialize(repository, data) @repository = repository @contents = data end # # Returns an array of {Mercurial::BlameLine BlameLine} instances. # def lines [].tap do |result| contents.each do |line| author, revision, linenum, text = line.scan(/^(.+) (\w{12}): *(\d+): (.*)$/).first result << BlameLine.new( :author => author, :revision => revision, :num => linenum, :contents => text ) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems