lib/mercurial-ruby/blame.rb in mercurial-ruby-0.7.0 vs lib/mercurial-ruby/blame.rb in mercurial-ruby-0.7.1

- old
+ new

@@ -1,16 +1,26 @@ 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( \ No newline at end of file