Sha256: d6fca2785e57510ec1793e7e93bb722ba44767c6511d5d0074e004885b921ff4

Contents?: true

Size: 786 Bytes

Versions: 4

Compression:

Stored size: 786 Bytes

Contents

module Madrox
  class Repo
    # Gets the Grit object for this Madrox::Repo.
    #
    # Returns a Grit::Repo instance.
    attr_reader :grit

    def initialize(path)
      @grit = Grit::Repo.new(path)
    rescue Grit::NoSuchPathError, Grit::InvalidGitRepositoryError
    end

    # Public: Determines whether this Madrox repo has an available Git
    # repo.
    #
    # Returns true if the Git repo exists, or false.
    def exist?
      @grit && @grit.git.exists?
    end

    # Gets a Madrox::Timeline for the given user.
    #
    # user  - String user name for the timeline.
    # email - Optional string email address for commit messages.
    #
    # Returns a Madrox::Timeline.
    def timeline(user, email = nil)
      Madrox::Timeline.new(self, user, email)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
madrox-0.3.0 lib/madrox/repo.rb
madrox-0.2.0 lib/madrox/repo.rb
madrox-0.1.1 lib/madrox/repo.rb
madrox-0.1.0 lib/madrox/repo.rb