Sha256: 7d517a4e3bd293068a71948a65691dcf63961d19c353cabecae1d0669dfb6493

Contents?: true

Size: 838 Bytes

Versions: 3

Compression:

Stored size: 838 Bytes

Contents

module Rugged
  class Commit

    def self.prettify_message(msg, strip_comments = true)
      Rugged::prettify_message(msg, strip_comments)
    end

    def inspect
      "#<Rugged::Commit:#{object_id} {message: #{message.inspect}, tree: #{tree.inspect}, parents: #{parent_oids}>"
    end

    # The time when this commit was made effective. This is the same value
    # as the +:time+ attribute for +commit.committer+.
    #
    # Returns a Time object
    def time
      @time ||= Time.at(self.epoch_time)
    end

    def to_hash
      {
        :message => message,
        :committer => committer,
        :author => author,
        :tree => tree,
        :parents => parents,
      }
    end

    def modify(new_args, update_ref=nil)
      args = self.to_hash.merge(new_args)
      Commit.create(args, update_ref)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rugged-0.18.0.gh.de28323 lib/rugged/commit.rb
rugged-0.18.0.b1 lib/rugged/commit.rb
rugged-0.17.0.b7 lib/rugged/commit.rb