Sha256: a539ed35261ecb307d3b0ee7971030388093efbdbfa9843ae2c325279e7caa87

Contents?: true

Size: 748 Bytes

Versions: 3

Compression:

Stored size: 748 Bytes

Contents

module Mate
  module Git
    class << self
      def excludesfile(workind_dir)
        expand_path IO.popen(%W[git -C #{workind_dir} config --get core.excludesfile], &:read)
      end

      def global_tmignore
        expand_path '~/.tmignore'
      end

      def toplevel(workind_dir)
        expand_path IO.popen(%W[git -C #{workind_dir} rev-parse --show-toplevel], err: '/dev/null', &:read)
      end

      def git_dir(workind_dir)
        expand_path IO.popen(%W[git -C #{workind_dir} rev-parse --absolute-git-dir], err: '/dev/null', &:read)
      end

    private

      def expand_path(path)
        return unless path

        path = path.strip
        return if path == ''

        Pathname(path).expand_path
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mate-3.1.0 lib/mate/git.rb
mate-3.0.0 lib/mate/git.rb
mate-2.2.0 lib/mate/git.rb