Sha256: b14ef98cf1b385a552a43e34a846663bc644de1228aa586cd5fd24c720ceeefc

Contents?: true

Size: 333 Bytes

Versions: 16

Compression:

Stored size: 333 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

16 entries across 16 versions & 2 rubygems

Version Path
gollum-lib-2.0.0 lib/gollum-lib/grit_ext.rb
gitlab-gollum-lib-1.1.0 lib/gollum-lib/grit_ext.rb
gitlab-gollum-lib-1.0.2 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.9 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.8 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.7 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.6 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.5 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.4 lib/gollum-lib/grit_ext.rb
gitlab-gollum-lib-1.0.1 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.3 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.2 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.1 lib/gollum-lib/grit_ext.rb
gitlab-gollum-lib-1.0.0 lib/gollum-lib/grit_ext.rb
gollum-lib-1.0.0 lib/gollum-lib/grit_ext.rb
gollum-lib-0.0.1 lib/gollum-lib/grit_ext.rb