Sha256: 1f2e4519bf29a0d2e0f28173abfe44046611530b3dadbfe9d54a6f4646888d85

Contents?: true

Size: 506 Bytes

Versions: 11

Compression:

Stored size: 506 Bytes

Contents

module Precious
  module Helpers
    # Extract the path string that Gollum::Wiki expects
    def extract_path(file_path)
      return nil if file_path.nil?
      last_slash = file_path.rindex("/")
      if last_slash
        file_path[0, last_slash]
      end
    end

    # Extract the 'page' name from the file_path
    def extract_name(file_path)
      ::File.basename(file_path)
    end

    def sanitize_empty_params(param)
      [nil,''].include?(param) ? nil : CGI.unescape(param)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gollum-2.2.1 lib/gollum/frontend/helpers.rb
gollum-2.2.0 lib/gollum/frontend/helpers.rb
gollum-2.1.10 lib/gollum/frontend/helpers.rb
gollum-2.1.9 lib/gollum/frontend/helpers.rb
gollum-2.1.8 lib/gollum/frontend/helpers.rb
gollum-2.1.7 lib/gollum/frontend/helpers.rb
gollum-2.1.6 lib/gollum/frontend/helpers.rb
gollum-2.1.4 lib/gollum/frontend/helpers.rb
gollum-2.1.3 lib/gollum/frontend/helpers.rb
gollum-2.1.2 lib/gollum/frontend/helpers.rb
gollum-2.1.0 lib/gollum/frontend/helpers.rb