Sha256: 844eb14e8c77a13e16e10e546091a69a89bd59db33dfa227017f3fea4a9ecad5

Contents?: true

Size: 435 Bytes

Versions: 4

Compression:

Stored size: 435 Bytes

Contents

module Git
  class Path

    attr_accessor :path

    def initialize(path, check_path = true)
      if !check_path || File.exists?(path)
        @path = File.expand_path(path)
      else
        raise ArgumentError, "path does not exist", File.expand_path(path)
      end
    end

    def readable?
      File.readable?(@path)
    end

    def writable?
      File.writable?(@path)
    end

    def to_s
      @path
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
minad-git-1.1.1 lib/git/path.rb
minad-git-1.1.2 lib/git/path.rb
minad-git-1.1.3 lib/git/path.rb
minad-git-1.1.5 lib/git/path.rb