Sha256: bb46a50f1d2df34a72514d0fd2f0aad8d67c11be2e97dcad5fece0606420e981

Contents?: true

Size: 235 Bytes

Versions: 6

Compression:

Stored size: 235 Bytes

Contents

# ~*~ encoding: utf-8 ~*~
module Gollum
  module Helpers

    def trim_leading_slash url
      return url if url.nil?
      url.gsub!('%2F', '/')
      return '/' + url.gsub(/^\/+/, '') if url[0, 1] == '/'
      url
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gollum-lib-4.0.3-java lib/gollum-lib/helpers.rb
gollum-lib-4.0.3 lib/gollum-lib/helpers.rb
gollum-lib-4.0.2 lib/gollum-lib/helpers.rb
gollum-lib-4.0.1 lib/gollum-lib/helpers.rb
gollum-lib-4.0.0 lib/gollum-lib/helpers.rb
gollum-lib-3.0.0 lib/gollum-lib/helpers.rb