Sha256: 5ba4f48a07b7a8fd1d3db3e7eec65dddca9f2bc3375631efb704069850277596

Contents?: true

Size: 558 Bytes

Versions: 20

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

require "pathname"
require "rfix/git_helper"

class Rfix::GitFile
  include Rfix::GitHelper
  attr_reader :path, :ref

  def initialize(path, ref, root_dir)
    @path = File.join(root_dir, path)
    @root_dir = Pathname.new(root_dir)
    @ref = ref
    @ranges = []
  end

  def file?
    File.file?(path)
  end

  def ==(other)
    path == other.path
  end

  def eql?(other)
    path == other.path
  end

  def hash
    path.hash
  end

  def relative_path
    Pathname.new(path).relative_path_from(@root_dir).to_s
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rfix-1.0.15.pre.116 lib/rfix/git_file.rb
rfix-1.0.15 lib/rfix/git_file.rb
rfix-1.0.8.pre.109 lib/rfix/git_file.rb
rfix-1.0.8.pre.108 lib/rfix/git_file.rb
rfix-1.0.7.pre.68 lib/rfix/git_file.rb
rfix-1.0.7.pre.67 lib/rfix/git_file.rb
rfix-1.0.7.pre.66 lib/rfix/git_file.rb
rfix-1.0.7.pre.65 lib/rfix/git_file.rb
rfix-1.0.7.pre.61 lib/rfix/git_file.rb
rfix-1.0.6.pre.60 lib/rfix/git_file.rb
rfix-1.0.7 lib/rfix/git_file.rb
rfix-1.0.5.pre.58 lib/rfix/git_file.rb
rfix-1.0.6 lib/rfix/git_file.rb
rfix-1.0.5.pre.pre.57 lib/rfix/git_file.rb
rfix-1.0.5 lib/rfix/git_file.rb
rfix-1.0.4 lib/rfix/git_file.rb
rfix-1.0.3 lib/rfix/git_file.rb
rfix-1.0.2 lib/rfix/git_file.rb
rfix-1.0.1 lib/rfix/git_file.rb
rfix-1.0.0 lib/rfix/git_file.rb