Sha256: 1798eab8423447f5522cd88abc29d8e9b2c43b18a668741ab7ab1f38e9f4c7d0
Contents?: true
Size: 933 Bytes
Versions: 12
Compression:
Stored size: 933 Bytes
Contents
module Mercurial # # This class represents a factory for {Mercurial::Blame Blame} instances. # class BlameFactory include Mercurial::Helper # Instance of a {Mercurial::Repository Repository}. attr_reader :repository def initialize(repository) @repository = repository end # Finds a blame for a specified file path at a specified revision. # Returns an instance of {Mercurial::Blame Blame}. # # Omit +revision+ if you want the latest blame. # # === Example: # repository.blames.for_path('some-fancy-directory/all-blame-is-on-me.rb') # def for_path(path, revision=nil, cmd_options={}) revision ||= 'tip' build do hg(["blame ? -ucl -r ?", path, revision], cmd_options) end end private def build(data=nil, &block) data ||= block.call Mercurial::Blame.new(repository, data) end end end
Version data entries
12 entries across 12 versions & 1 rubygems