lib/mercurial-ruby/factories/blame_factory.rb in mercurial-ruby-0.7.0 vs lib/mercurial-ruby/factories/blame_factory.rb in mercurial-ruby-0.7.1
- old
+ new
@@ -1,15 +1,27 @@
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
\ No newline at end of file