Sha256: e0df3c44cc310764744460d10a93c345995ccfc5c9c55c379f2a08bd6b0c6a37

Contents?: true

Size: 971 Bytes

Versions: 22

Compression:

Stored size: 971 Bytes

Contents

require 'cgi'
require 'cgi/session'
require 'cgi/session/pstore'
require 'action_controller/cgi_ext/cgi_methods'

# Wrapper around the CGIMethods that have been secluded to allow testing without 
# an instantiated CGI object
class CGI #:nodoc:
  class << self
    alias :escapeHTML_fail_on_nil :escapeHTML

    def escapeHTML(string)
      escapeHTML_fail_on_nil(string) unless string.nil?
    end
  end
  
  # Returns a parameter hash including values from both the request (POST/GET)
  # and the query string with the latter taking precedence.
  def parameters
    request_parameters.update(query_parameters)
  end

  def query_parameters
    CGIMethods.parse_query_parameters(query_string)
  end

  def request_parameters
    CGIMethods.parse_request_parameters(params, env_table)
  end
  
  def session(parameters = nil)
    parameters = {} if parameters.nil?
    parameters['database_manager'] = CGI::Session::PStore
    CGI::Session.new(self, parameters)
  end
end

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
actionpack-1.13.0 lib/action_controller/cgi_ext/cgi_ext.rb
actionpack-1.13.2 lib/action_controller/cgi_ext/cgi_ext.rb
actionpack-1.13.4 lib/action_controller/cgi_ext/cgi_ext.rb
actionpack-1.13.6 lib/action_controller/cgi_ext/cgi_ext.rb
actionpack-1.13.1 lib/action_controller/cgi_ext/cgi_ext.rb
actionpack-1.13.5 lib/action_controller/cgi_ext/cgi_ext.rb
actionpack-1.13.3 lib/action_controller/cgi_ext/cgi_ext.rb
radiant-0.6.1 vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
radiant-0.6.0 vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
radiant-0.6.2 vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
radiant-0.6.3 vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb
radiant-0.6.4 vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb