Sha256: 19f5b9b83ad4a87e4430c049ebef839590d49162b0fdc820f66ef9265b181e73

Contents?: true

Size: 810 Bytes

Versions: 6

Compression:

Stored size: 810 Bytes

Contents

require "rugged"
require "shellwords"
require "digest"
require "listen"

class Rfix::File < Struct.new(:path, :repo, :ref)
  include Rfix::Log

  def initialize(path, repo, ref)
    # check_absolute!(path)
    super(path, repo, ref)
  end

  def check_absolute!(path)
    if Pathname.new(path).absolute?
      say_abort "Path must be relative #{path}"
    end
  end

  def include?(_)
    raise Rfix::Error, "#include? not implemented"
  end

  def refresh!
    raise Rfix::Error, "#refresh! not implemented"
  end

  def inspect
    raise Rfix::Error, "#inspect not implemented"
  end

  def git_path
    @git_path ||= Pathname.new(repo.workdir)
  end

  def absolute_path
    path
    # @absolute_path ||= to_abs(path)
  end

  def to_abs(path)
    File.join(repo.workdir, path)
  end

  alias to_s path
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rfix-1.4.1 lib/rfix/file.rb
rfix-1.4.0.pre.201 lib/rfix/file.rb
rfix-1.4.0 lib/rfix/file.rb
rfix-1.3.0.pre.199 lib/rfix/file.rb
rfix-1.2.6.pre.198 lib/rfix/file.rb
rfix-1.2.6 lib/rfix/file.rb