Sha256: 8966712a9fc567e77fcbf96f35334f2f0ede1e410cdf4eede076cff2dc56c127

Contents?: true

Size: 530 Bytes

Versions: 2

Compression:

Stored size: 530 Bytes

Contents

module Amiba
  module Repo

    def init(dir)
      Grit::Repo.init(dir)
    end

    def repo
      Grit::Repo.new(Dir.pwd)
    rescue
      raise "No repo exists at #{Dir.pwd}"
    end

    def add_and_commit(filename, msg=nil)
      repo.add(filename)
      repo.commit_index(msg || "Added a new entry at #{filename}")
    end

    def last_commit_date(filename)
      repo.log(filename).first.committed_date
    end

    def last_commit_dates(*filenames)
      filenames.map {|fn| last_commit_date(fn)}
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
amiba-0.0.3 lib/amiba/repo.rb
amiba-0.0.2 lib/amiba/repo.rb