Sha256: 78d83b3405ba1f2b9166dd391861caf775320a649d19c1a9ec0deaf817cee5e4

Contents?: true

Size: 335 Bytes

Versions: 1

Compression:

Stored size: 335 Bytes

Contents

# ~*~ encoding: utf-8 ~*~

module Grit
  class Blob
    def is_symlink
      self.mode == 0120000
    end

    def symlink_target(base_path = nil)
      target   = self.data
      new_path = File.expand_path(File.join('..', target), base_path)

      if File.file? new_path
        return new_path
      end
    end

    nil
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gollum-lib-3.0.0 lib/gollum-lib/grit_ext.rb