ruby/sample/cgi-session-pstore.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 строки
328 B
Ruby
Исходник Обычный вид История

require 'cgi'
require 'cgi/session/pstore'
STDIN.reopen(IO::NULL)
cgi = CGI.new
session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore)
session['key'] = {'k' => 'v'}
puts session['key'].class
fail unless Hash === session['key']
puts session['key'].inspect
fail unless session['key'].inspect == '{"k"=>"v"}'