Changeset 5335 for platform/tdiary/spec
- Timestamp:
- 01/23/08 15:04:01 (11 months ago)
- Files:
-
- 1 modified
-
platform/tdiary/spec/spec_helper.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/spec/spec_helper.rb
r5312 r5335 39 39 class Config 40 40 41 attr_accessor :index, :html_title 41 attr_accessor :index, :html_title, :cgi 42 42 43 43 def initialize 44 @cgi = CGIFake.new 44 45 @options = {} 45 46 @options2 = {} 46 47 @index = './' 47 48 @html_title = '' 49 50 bot = ["bot", "spider", "antenna", "crawler", "moget", "slurp"] 51 bot += @options['bot'] || [] 52 @bot = Regexp::new( "(#{bot.uniq.join( '|' )})", true ) 48 53 end 49 54 … … 69 74 end 70 75 end 76 77 def mobile_agent? 78 @cgi.mobile_agent? 79 end 80 81 def bot? 82 @bot =~ @cgi.user_agent 83 end 84 85 def iphone? 86 @cgi.iphone? 87 end 88 alias ipod? iphone? 71 89 end 72 90 end 73 91 74 def fake_plugin( name_sym, base=nil, &block ) 92 class CGIFake 93 attr_accessor :user_agent 94 95 def initialize 96 @user_agent = "" 97 end 98 99 def mobile_agent? 100 self.user_agent =~ %r[(DoCoMo|J-PHONE|Vodafone|MOT-|UP\.Browser|DDIPOCKET|ASTEL|PDXGW|Palmscape|Xiino|sharp pda browser|Windows CE|L-mode|WILLCOM|SoftBank)]i 101 end 102 103 def iphone? 104 self.user_agent =~ /iPhone|iPod/ 105 end 106 end 107 108 109 def fake_plugin( name_sym, cgi=nil, base=nil, &block ) 75 110 plugin = PluginFake.new 76 111 yield plugin if block_given?
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)