require "div/div" require "div/tofusession" require 'rabbit/utils' module WEBrick class Tofulet def mobile? %r[(DoCoMo|J-PHONE|Vodafone|MOT-|UP\.Browser|DDIPOCKET|ASTEL|PDXGW|Palmscape|Xiino|sharp pda browser|Windows CE|L-mode|WILLCOM)]i =~ @req["user-agent"] end end end module Rabbit module Div module RabbitDiv def initialize(*args) super @cache = {} end def to_div_i(context) to_html_i(context) rescue "
error! #{h($!)}
" end def to_html_i(context) to_html(context) end private def rabbit @session.rabbit end def form2(attrs, method_name, context_or_param, context_or_empty=nil) result = form(method_name, context_or_param, context_or_empty) attrs = attrs.collect do |key, value| "#{h(key)}=\"#{h(value)}\"" end.join(" ") result.gsub!(/(