Sha256: 32e892d693054da1805a61176e7eceb4283a83d66fa9a4c20c340f32e3341ee8

Contents?: true

Size: 776 Bytes

Versions: 2

Compression:

Stored size: 776 Bytes

Contents

#          Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

module Ramaze

  # Shortcuts to some CGI methods

  module CgiHelper
    private

    # shortcut for CGI.escape

    def url_encode(*args)
      CGI.escape(*args)
    end

    # shortcut for CGI.unescape

    def url_decode(*args)
      CGI.unescape(*args)
    end

    # shortcut for CGI.escapeHTML

    def html_escape(string)
      CGI.escapeHTML(string)
    end

    # shortcut for CGI.unescapeHTML

    def html_unescape(string)
      CGI.unescapeHTML(string)
    end

    # one-letter versions help in case like #{h foo.inspect}
    # ERb/ERuby/Rails compatible
    alias h html_escape
    alias u url_encode

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-0.3.0 lib/ramaze/helper/cgi.rb
ramaze-0.3.5 lib/ramaze/helper/cgi.rb