Sha256: bb9c49d890ab611bfc9b64b625671b05cd8015cd72cc4626a4c66f185bbfa1d9

Contents?: true

Size: 546 Bytes

Versions: 4

Compression:

Stored size: 546 Bytes

Contents

require 'grit'

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

4 entries across 4 versions & 1 rubygems

Version Path
amiba-0.0.7 lib/amiba/repo.rb
amiba-0.0.6 lib/amiba/repo.rb
amiba-0.0.5 lib/amiba/repo.rb
amiba-0.0.4 lib/amiba/repo.rb