Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding Support of webOS and Palm

  • Loading branch information...
commit fb219c8bcc072ab62a6c42f9f09bf1604d310330 1 parent 87f3f7b
Shenouda authored
View
0  .gitignore 100644 → 100755
File mode changed
View
0  MIT-LICENSE 100644 → 100755
File mode changed
View
0  README 100644 → 100755
File mode changed
View
0  Rakefile 100644 → 100755
File mode changed
View
0  init.rb 100644 → 100755
File mode changed
View
0  install.rb 100644 → 100755
File mode changed
View
0  lib/active_device/bot.rb 100644 → 100755
File mode changed
View
1  lib/active_device/brand.rb
@@ -228,6 +228,7 @@ def self.mobile_brand user_agent
when /Vodafone/i ; :Vodafone
when /Voxtel/i ; :Voxtel
when /W3C/i ; :W3C
+ when /webOS/i ; :Palm
when /WellcoM/i ; :WellcoM
when /Wonu/i ; :Wonu
when /XDA/i ; :XDA
View
1  lib/active_device/browser.rb 100644 → 100755
@@ -158,6 +158,7 @@ def self.name user_agent
when /WDG_Validator/i ; :WDG_Validator # Validator
when /Web Downloader/i ; :'Web Downloader' # Offline Browser
when /WebCopier/i ; :WebCopier # Offline Browser
+ when /webOS/i ; :Palm
when /WebZIP/i ; :WebZIP # Offline Browser
when /Wget/i ; :Wget # Offline Browser
when /Winwap/i ; :Winwap #Embedded Mobile Based
View
0  lib/active_device/engine.rb 100644 → 100755
File mode changed
View
21 lib/active_device/model.rb
@@ -21,6 +21,8 @@ def self.brand_model user_agent
when /SonyEricsson[\w\-\.\_\ ]*/i ; sonyericsson_models user_agent
when /Opera Mini/i ; :'Opera Mini'
when /Opera Mobi/i ; :'Opera Mobile'
+ when /Palm/i ; palm_models user_agent
+ when /webOS/i ; palm_models user_agent
when /^Mozilla[0-9\-\.\_\ ]*/i ; :Unknown
else ; :"#{user_agent[/[\w\-\.\_]*/i]}"
end
@@ -68,6 +70,25 @@ def self.samsung_models user_agent
model_clear model
end
+ def self.palm_models user_agent
+ if user_agent =~ /webOS[\w\.\_\-]*/i
+ if user_agent[/Pre[\w\.\_\-]*/i]
+ model = :'Palm Pre'
+ elsif user_agent[/Pixi[\w\.\_\-]*/i]
+ model = :'Palm Pixi'
+ else
+ model = user_agent[/[\w\.\_\-]*/i]
+ end
+ elsif user_agent =~ /PalmOS[\w\.\_\-]*/i
+ model = user_agent[/Palm[\.\_\-][\w]*/i]
+ elsif user_agent =~ /PalmSource[\w\.\_\-]*/i
+ model = user_agent[/Palm[\.\_\-][\w]*/i]
+ else
+ model = user_agent[/Palm[\w\.\_\-]*/i]
+ end
+ model_clear model
+ end
+
def self.model_clear model
model = model.to_s
if model.include?("Profile")
View
2  lib/active_device/os.rb 100644 → 100755
@@ -32,6 +32,8 @@ def self.os user_agent
when /SymbianOS/i ; :SymbianOS
when /Symbian/i ; :Symbian
when /Palm/i ; :Palm
+ when /PalmOS/i ; :PalmOS
+ when /webOS/i ; :webOS
when /iPhone/i ; :iPhone
else ; :Unknown
end
View
0  lib/active_device/user_agent.rb 100644 → 100755
File mode changed
View
0  lib/active_device_helper.rb 100644 → 100755
File mode changed
View
0  rails/init.rb 100644 → 100755
File mode changed
View
0  rails/init.rb~ 100644 → 100755
File mode changed
View
0  tasks/active_device_tasks.rake 100644 → 100755
File mode changed
View
0  test/active_device_test.rb 100644 → 100755
File mode changed
View
0  test/test_helper.rb 100644 → 100755
File mode changed
View
0  uninstall.rb 100644 → 100755
File mode changed
Please sign in to comment.
Something went wrong with that request. Please try again.