Skip to content

Commit

Permalink
added Prism/Fluid support
Browse files Browse the repository at this point in the history
  • Loading branch information
yolk committed Jul 1, 2009
1 parent 781f107 commit b20356c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/user_agent.rb
Expand Up @@ -42,8 +42,8 @@ def extract_products_from_agent_string
def identify_browser
identify_browser_opera or
identify_browser_chrome or
identify_browser_safari or
identify_browser_honest or
identify_browser_safari or
identify_browser_compatible or
identify_browser_mozilla or
identify_browser_other
Expand Down Expand Up @@ -87,7 +87,7 @@ def identify_browser_safari
end

def identify_browser_honest
honest_browsers = %w(Firefox Netscape Camino Mosaic Galeon)
honest_browsers = %w(Firefox Netscape Camino Mosaic Galeon prism Fluid)
if browser = @products.detect{|product| honest_browsers.include? product[0]}
@browser_version = browser[1]
@browser_name = browser[0]
Expand Down
2 changes: 2 additions & 0 deletions spec/user_agent_spec.rb
Expand Up @@ -29,6 +29,8 @@
"Safari" => "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092816 Mobile Safari 1.1.3",
"Safari" => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_1 like Mac OS X; fr-fr) AppleWebKit/525.18.1 (KHTML, like Gecko) Mobile/5F136",
"Chrome 1.0.154.53" => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19",
"prism 0.8" => "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a9pre) Gecko/2007110108 prism/0.8",
"Fluid 0.9.6" => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; de-de) AppleWebKit/528.16 (KHTML, like Gecko) Fluid/0.9.6 Safari/528.16",
"" => ""
}
examples.keys.sort.each do |expected|
Expand Down

0 comments on commit b20356c

Please sign in to comment.