Sha256: 908d5f47721143d3d0f7cef555b590581f3ad420f3a1d67eda07b95901419e45

Contents?: true

Size: 822 Bytes

Versions: 13

Compression:

Stored size: 822 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.new("#include? not implemented")
  end

  def refresh!
    raise Rfix::Error.new("#refresh! not implemented")
  end

  def inspect
    raise Rfix::Error.new("#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

13 entries across 13 versions & 1 rubygems

Version Path
rfix-1.2.2.pre.174 lib/rfix/file.rb
rfix-1.2.5 lib/rfix/file.rb
rfix-1.2.4 lib/rfix/file.rb
rfix-1.2.3.pre lib/rfix/file.rb
rfix-1.2.2.pre lib/rfix/file.rb
rfix-1.2.2.pre.172 lib/rfix/file.rb
rfix-1.2.2 lib/rfix/file.rb
rfix-1.1.0.pre.150 lib/rfix/file.rb
rfix-1.2.0 lib/rfix/file.rb
rfix-1.1.4.pre lib/rfix/file.rb
rfix-1.1.1.pre lib/rfix/file.rb
rfix-1.1.0.pre.149 lib/rfix/file.rb
rfix-1.1.0.pre.147 lib/rfix/file.rb