Sha256: 0bece244621beb1b0e9b2fa2dd6e3d3ee23a0e483e86fc824a9aa25d30291306

Contents?: true

Size: 775 Bytes

Versions: 4

Compression:

Stored size: 775 Bytes

Contents

begin
  require 'rubygems'
  require 'sinatra'
rescue LoadError => e
  puts "Please install sinatra before running this demo."
  puts "Try: `gem install sinatra`"
end

require File.expand_path("../../../lib/which_browser", __FILE__)
  
get "/" do
  # add other methods you'd like to see to the list:
  [
    :user_agent,
    :ie?, 
    :ie6?, 
    :ie_lt6?, 
    :ie_lte7?, 
    :ie_gte6?, 
    :safari?, 
    :safari_version,
    :mobile_safari?,
    :ff?, 
    :ff_version,
    :opera?,
    :chrome?,
    :chrome?,
    :pc?,
    :mac?,
    :linux?,
    :mobile?
  ].collect{ |method|
    v = request.send(method)
    %(#{method} &nbsp; <span style="color: #{v == false ? 'red' : 'green' }; font-weight: #{v == false ? 'normal' : 'bold'}">#{v}</span>)
  }.join("<br/>")
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
which_browser-0.2.3 test/dummy/app.rb
which_browser-0.2.2 test/dummy/app.rb
which_browser-0.2.1 test/dummy/app.rb
which_browser-0.2.0 test/dummy/app.rb