is_it_mobile 1.0.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Dave Myron
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,45 @@
1
+ = is_it_mobile
2
+ * http://rubyforge.org/projects/contentfree/
3
+
4
+ == DESCRIPTION:
5
+
6
+ Simply determines if a user agent is for a mobile device.
7
+
8
+ Comes ready with a module for Rails 2 & 3 to enable multiviews (respond_to with a custom mimetype) for mobile devices (see Synopsis).
9
+
10
+
11
+ == FEATURES/PROBLEMS:
12
+
13
+ * Fast & Lightweight (doesn't use anything like WURFL, which would be overkill for a quick check)
14
+
15
+
16
+ == SYNOPSIS:
17
+
18
+ The lightweight tests used in IsItMobile are almost completely based on the work of Andy Moore in an
19
+ article at http://www.andymoore.info/php-to-detect-mobile-phones/. I added a couple more
20
+ user agents to the mix and obviously Rubified it.
21
+
22
+ It recognizes 99% of the mobile user agents from http://www.zytrax.com/tech/web/mobile_ids.html
23
+ It has nearly no false positives using the user agents from http://www.zytrax.com/tech/web/browser_ids.htm
24
+ The ones that don't quite pass are very rare (and some are even questionable appearing in their respective lists)
25
+
26
+
27
+ == INSTALL:
28
+
29
+ sudo gem install contentfree-is_it_mobile --source http://gems.github.com
30
+
31
+
32
+ == USAGE:
33
+
34
+ With Rails 2.0, simply add this to config/environment.rb:
35
+ config.gem 'contentfree-is_it_mobile', :lib => 'is_it_mobile/rails', :source => "http://gems.github.com"
36
+
37
+ Then, just create your views using suffixes of mobile.erb instead of html.erb
38
+
39
+ You can also just use IsItMobile directly:
40
+ IsItMobile.mobile?( 'NokiaN90-1/3.0545.5.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1' ) # => true
41
+
42
+
43
+ == REQUIREMENTS:
44
+
45
+ If using Rails, version must be >= 2.0 for multiview capability
data/Rakefile CHANGED
@@ -1,12 +1,48 @@
1
- # -*- ruby -*-
1
+ require 'rake'
2
2
 
3
- require 'rubygems'
4
- require 'hoe'
5
- require './lib/is_it_mobile.rb'
3
+ begin
4
+ require 'jeweler'
5
+ Jeweler::Tasks.new do |s|
6
+ s.name = "is_it_mobile"
7
+ s.summary = %Q{Simply determines if a user agent is for a mobile device.}
8
+ s.email = "dave.myron@contentfree.com"
9
+ s.homepage = "http://github.com/contentfree/is_it_mobile"
10
+ s.description = "Simply determines if a user agent is for a mobile device."
11
+ s.authors = ["Dave Myron"]
12
+ end
13
+ rescue LoadError
14
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
15
+ end
16
+
17
+ require 'rake/rdoctask'
18
+ Rake::RDocTask.new do |rdoc|
19
+ rdoc.rdoc_dir = 'rdoc'
20
+ rdoc.title = 'is_it_mobile'
21
+ rdoc.options << '--line-numbers' << '--inline-source'
22
+ rdoc.rdoc_files.include('README*')
23
+ rdoc.rdoc_files.include('lib/**/*.rb')
24
+ end
25
+
26
+ begin
27
+ require 'spec/rake/spectask'
28
+ Spec::Rake::SpecTask.new(:spec) do |t|
29
+ t.libs << 'lib' << 'spec'
30
+ t.spec_files = FileList['spec/**/*_spec.rb']
31
+ end
32
+
33
+ Spec::Rake::SpecTask.new(:rcov) do |t|
34
+ t.libs << 'lib' << 'spec'
35
+ t.spec_files = FileList['spec/**/*_spec.rb']
36
+ t.rcov = true
37
+ end
38
+ rescue LoadError
39
+ puts "RSpec 1.x is not available."
40
+ end
6
41
 
7
- Hoe.new('is_it_mobile', IsItMobile::VERSION) do |p|
8
- p.rubyforge_name = 'contentfree'
9
- p.developer('Dave Myron', 'dave.myron@contentfree.com')
42
+ begin
43
+ require 'cucumber/rake/task'
44
+ Cucumber::Rake::Task.new(:features)
45
+ rescue LoadError
46
+ puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
10
47
  end
11
48
 
12
- task :release_and_publish => [:release, :publish_docs]
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 1
3
+ :minor: 4
4
+ :patch: 1
@@ -0,0 +1,9 @@
1
+ Feature: something something
2
+ In order to something something
3
+ A user something something
4
+ something something something
5
+
6
+ Scenario: something something
7
+ Given inspiration
8
+ When I create a sweet new gem
9
+ Then everyone should see how awesome I am
File without changes
@@ -0,0 +1,11 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
2
+ require 'is_it_mobile'
3
+
4
+ require 'spec/expectations'
5
+
6
+ require 'test/unit/assertions'
7
+
8
+ World do |world|
9
+
10
+ world
11
+ end
@@ -0,0 +1,51 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{is_it_mobile}
8
+ s.version = "1.4.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Dave Myron"]
12
+ s.date = %q{2011-04-12}
13
+ s.description = %q{Simply determines if a user agent is for a mobile device.}
14
+ s.email = %q{dave.myron@contentfree.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README"
18
+ ]
19
+ s.files = [
20
+ "LICENSE",
21
+ "README",
22
+ "Rakefile",
23
+ "VERSION.yml",
24
+ "features/is_it_mobile.feature",
25
+ "features/steps/is_it_mobile_steps.rb",
26
+ "features/support/env.rb",
27
+ "is_it_mobile.gemspec",
28
+ "lib/is_it_mobile.rb",
29
+ "lib/rails/init.rb",
30
+ "spec/is_it_mobile_spec.rb",
31
+ "spec/spec_helper.rb"
32
+ ]
33
+ s.homepage = %q{http://github.com/contentfree/is_it_mobile}
34
+ s.require_paths = ["lib"]
35
+ s.rubygems_version = %q{1.7.2}
36
+ s.summary = %q{Simply determines if a user agent is for a mobile device.}
37
+ s.test_files = [
38
+ "spec/is_it_mobile_spec.rb",
39
+ "spec/spec_helper.rb"
40
+ ]
41
+
42
+ if s.respond_to? :specification_version then
43
+ s.specification_version = 3
44
+
45
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
+ else
47
+ end
48
+ else
49
+ end
50
+ end
51
+
@@ -1,44 +1,43 @@
1
1
  class IsItMobile
2
- VERSION = '1.0.1'
2
+ MOBILE_USER_AGENT_FRAGMENTS = %r{^(1207|3gso|4thp|501i|502i|503i|504i|505i|506i|6310|6590|770s|802s|a wa|acer|acs-|airn|alav|asus|attw|au-m|aur |aus |abac|acoo|aiko|alco|alca|amoi|anex|anny|anyw|aptu|arch|argo|bell|bird|bw-n|bw-u|beck|benq|bilb|blac|c55/|cdm-|chtm|capi|comp|cond|craw|dall|dbte|dc-s|dica|ds-d|ds12|dait|devi|dmob|doco|dopo|el49|erk0|esl8|ez40|ez60|ez70|ezos|ezze|elai|emul|eric|ezwa|fake|fly-|fly_|g-mo|g1 u|g560|gf-5|grun|gene|go.w|good|grad|hcit|hd-m|hd-p|hd-t|hei-|hp i|hpip|hs-c|htc |htc-|htca|htcg|htcp|htcs|htct|htc_|haie|hita|huaw|hutc|i-20|i-go|i-ma|i230|iac|iac-|iac/|ig01|im1k|inno|iris|jata|java|kddi|kgt|kgt/|kpt |kwc-|klon|lexi|lg g|lg-a|lg-b|lg-c|lg-d|lg-f|lg-g|lg-k|lg-l|lg-m|lg-o|lg-p|lg-s|lg-t|lg-u|lg-w|lg/k|lg/l|lg/u|lg50|lg54|lge-|lge/|lynx|leno|m1-w|m3ga|m50/|maui|mc01|mc21|mcca|medi|meri|mio8|mioa|mo01|mo02|mode|modo|mot |mot-|mt50|mtp1|mtv |mate|maxo|merc|mits|mobi|motv|mozz|n100|n101|n102|n202|n203|n300|n302|n500|n502|n505|n700|n701|n710|nec-|nem-|newg|neon|netf|noki|nzph|o2 x|o2-x|opwv|owg1|opti|oran|p800|pand|pg-1|pg-2|pg-3|pg-6|pg-8|pg-c|pg13|phil|pn-2|pt-g|palm|pana|pire|pock|pose|psio|qa-a|qc-2|qc-3|qc-5|qc-7|qc07|qc12|qc21|qc32|qc60|qci-|qwap|qtek|r380|r600|raks|rim9|rove|s55/|sage|sams|sc01|sch-|scp-|sdk/|se47|sec-|sec0|sec1|semc|sgh-|shar|sie-|sk-0|sl45|slid|smb3|smt5|sp01|sph-|spv |spv-|sy01|samm|sany|sava|scoo|send|siem|smar|smit|soft|sony|t-mo|t218|t250|t600|t610|t618|tcl-|tdg-|telm|tim-|ts70|tsm-|tsm3|tsm5|tx-9|tagt|talk|teli|topl|tosh|up.b|upg1|utst|v400|v750|veri|vk-v|vk40|vk50|vk52|vk53|vm40|vx98|virg|vite|voda|vulc|w3c |w3c-|wapj|wapp|wapu|wapm|wig |wapi|wapr|wapv|wapy|wapa|waps|wapt|winc|winw|wonu|x700|xda2|xdag|yas-|your|zte-|zeto|acs-|alav|alca|amoi|aste|audi|avan|benq|bird|blac|blaz|brew|brvw|bumb|ccwa|cell|cldc|cmd-|dang|doco|eml2|eric|fetc|hipt|http|ibro|idea|ikom|inno|ipaq|jbro|jemu|java|jigs|kddi|keji|kyoc|kyok|leno|lg-c|lg-d|lg-g|lge-|libw|m-cr|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|mywa|nec-|newt|nok6|noki|o2im|opwv|palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|rozo|sage|sama|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|treo|tsm-|upg1|upsi|vk-v|voda|vx52|vx53|vx60|vx61|vx70|vx80|vx81|vx83|vx85|wap-|wapa|wapi|wapp|wapr|webc|whit|winw|wmlb|xda-)}i
3
3
 
4
- POPULAR_MOBILE_USER_AGENT_BEGINNINGS = ['w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac', 'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno','ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-', 'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-','newt','noki','oper','palm','pana','pant','phil','play','port','prox', 'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar','sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-', 'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda','xda-']
4
+ MOBILE_USER_AGENTS = {
5
+ :iphone => 'i(phone|pod)',
6
+ :android => 'android',
7
+ :opera_mini => 'opera mini',
8
+ :blackberry => 'blackberry',
9
+ :palm => 'palm os|palm|avantgo|plucker|xiino|blazer|elaine|pre/\d',
10
+ :sidekick => 'hiptop',
11
+ :windows_mobile => 'windows ce; ppc;|windows ce; smartphone;|windows ce; iemobile|windows phone',
12
+ :symbian => 'symbian',
13
+ :wii => 'wii',
14
+ :playstation => 'playstation',
15
+ :other => 'up.browser|up.link|mmp|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|pda\b|psp|treo'
16
+ }
17
+ POPULAR_MOBILE_USER_AGENT_REGEX = %r{(#{MOBILE_USER_AGENTS.collect{|category,regex| regex}.join(')|(')})}i
18
+ POPULAR_DEVICES = MOBILE_USER_AGENTS.keys.reject{ |key| key == :other }
19
+
20
+ MOBILE_ACCEPTS_HEADERS = %r{(text/vnd\.wap\.wml|application/vnd\.wap\.xhtml\+xml)}i
5
21
 
6
22
  # Performs a few lightweight checks on the user agent to determine if it's a mobile device.
7
- def self.mobile?( user_agent, accepts )
8
- return !!( user_agent =~ /(mobile|up.browser|up.link|mmp|symbian|phone|midp|wap|mini|ppc;|playstation|palm|wii|nitro)/i ||
9
- accepts.index('application/vnd.wap.xhtml+xml') ||
10
- POPULAR_MOBILE_USER_AGENT_BEGINNINGS.include?(user_agent[0,4]))
23
+ def self.mobile?( user_agent, accepts = '' )
24
+ !!( user_agent.to_s =~ POPULAR_MOBILE_USER_AGENT_REGEX ||
25
+ accepts.to_s =~ MOBILE_ACCEPTS_HEADERS ||
26
+ user_agent.to_s =~ MOBILE_USER_AGENT_FRAGMENTS )
11
27
  end
12
28
 
13
- module ForRails
14
- # When ForRails is included in a controller, a before filter is added that will reset the request format to the
15
- # value of +base.mobile_format+ which defaults to :mobile. To change it to something else, simply add a line after
16
- # the inclusion that says +self.mobile_format = :handheld+ or whatever you'd like it to be.
17
- #
18
- # It also exposes the +request_is_from_mobile?+ method to the views if you don't want to create multiple erb views
19
- # for every page (or want to keep a single layout file)
20
- def self.included(base)
21
- base.class_eval do
22
- class_inheritable_accessor :mobile_format
23
- self.mobile_format = :mobile
24
-
25
- before_filter :wrangle_format_if_request_is_mobile
26
-
27
- helper_method :request_is_from_mobile?
29
+ # Create some methods to check for some popular mobile device types
30
+ POPULAR_DEVICES.each do |type|
31
+ class_eval <<-EOE
32
+ def self.#{type}?( user_agent )
33
+ !!(user_agent =~ %r{\#{MOBILE_USER_AGENTS[:#{type}]}}i)
28
34
  end
29
- end
30
-
31
- protected
32
- # Checks if the request.format is *already* @@mobile_format (set by the query string or using an
33
- # extension of 'mobile' with resourceful routes) and if not, uses IsItMobile.mobile? to
34
- # determine whether or not the request is from a mobile device
35
- def request_is_from_mobile?
36
- @request_is_from_mobile ||= request.format.to_sym == self.class.mobile_format || IsItMobile.mobile?( request.env['HTTP_USER_AGENT'] || '', request.env['HTTP_ACCEPT'] || '' )
37
- end
38
-
39
- # Sets the request format to @@mobile_format when the request is from a mobile device
40
- def wrangle_format_if_request_is_mobile
41
- request.format = self.class.mobile_format if request_is_from_mobile?
42
- end
35
+ EOE
36
+ end
37
+ end
38
+
39
+ if defined?(ActiveSupport)
40
+ ActiveSupport.on_load(:action_controller) do
41
+ Kernel.load File.join(File.dirname(__FILE__), 'rails', 'init.rb')
43
42
  end
44
- end
43
+ end
@@ -0,0 +1,65 @@
1
+ require 'is_it_mobile'
2
+
3
+ Mime::Type.register_alias( "text/html", :mobile ) if defined?(Mime) && defined?(Mime::Type)
4
+
5
+ # When IsItMobile::ForRails is included in a controller, a before filter is
6
+ # added that will reset the request format to the value of
7
+ # +base.mobile_format+ which defaults to :mobile. To change it to
8
+ # something else, simply add a line after the inclusion that says
9
+ # +self.mobile_format = :handheld+ or whatever you'd like it to be.
10
+ #
11
+ # It also exposes the +request_is_from_mobile?+ method to the views if
12
+ # you don't want to create multiple erb views for every page
13
+
14
+ module IsItMobile::ForRails
15
+ def self.included(base)
16
+ base.class_eval do
17
+ include ::IsItMobile::ForRails::InstanceMethods
18
+
19
+ class_inheritable_accessor :mobile_format
20
+ self.mobile_format = :mobile
21
+
22
+ before_filter :change_request_format_to_mobile, :if => :request_is_from_mobile?
23
+
24
+ helper_method :request_is_from_mobile?, :mobile?
25
+ IsItMobile::POPULAR_DEVICES.each do |device|
26
+ helper_method "request_is_from_#{device}?".to_sym, "#{device}?".to_sym
27
+ end
28
+ end
29
+ end
30
+
31
+ module InstanceMethods
32
+ protected
33
+ # Checks if the request.format is *already* @@mobile_format (set by the
34
+ # query string or using an extension of 'mobile' with resourceful routes)
35
+ # and if not, uses IsItMobile.mobile? to determine whether or not the
36
+ # request is from a mobile device
37
+ def request_is_from_mobile?
38
+ @request_is_from_mobile ||=
39
+ request.format.to_sym == self.class.mobile_format ||
40
+ IsItMobile.mobile?( request.env['HTTP_USER_AGENT'].to_s, request.env['HTTP_ACCEPT'].to_s )
41
+ end
42
+ alias :mobile? :request_is_from_mobile?
43
+
44
+ # Sets the request format to @@mobile_format when the request is from a mobile device
45
+ def change_request_format_to_mobile
46
+ request.format = self.class.mobile_format
47
+ end
48
+
49
+ # Some helpers for popular devices - these don't (yet) wrangle the request format
50
+ # This will create methods named "request_is_from_(device)?" which are also aliased to
51
+ # just "(device)?"
52
+ IsItMobile::POPULAR_DEVICES.each do |device|
53
+ module_eval <<-EOD
54
+ def request_is_from_#{device}?
55
+ @request_is_from_#{device} ||= IsItMobile.#{device}?( request.env['HTTP_USER_AGENT'] )
56
+ end
57
+ alias :#{device}? :request_is_from_#{device}?
58
+ EOD
59
+ end
60
+ end
61
+ end
62
+
63
+ class ActionController::Base
64
+ include ::IsItMobile::ForRails
65
+ end
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "IsItMobile" do
4
+ it "should have tests..." do
5
+
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec'
2
+
3
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+
5
+ require 'is_it_mobile'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
metadata CHANGED
@@ -1,91 +1,67 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: is_it_mobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ prerelease:
5
+ version: 1.4.1
5
6
  platform: ruby
6
7
  authors:
7
8
  - Dave Myron
8
9
  autorequire:
9
10
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDQjCCAiqgAwIBAgIBADANBgkqhkiG9w0BAQUFADBHMRMwEQYDVQQDDApkYXZl
14
- Lm15cm9uMRswGQYKCZImiZPyLGQBGRYLY29udGVudGZyZWUxEzARBgoJkiaJk/Is
15
- ZAEZFgNjb20wHhcNMDgwNDE3MTAwNTMzWhcNMDkwNDE3MTAwNTMzWjBHMRMwEQYD
16
- VQQDDApkYXZlLm15cm9uMRswGQYKCZImiZPyLGQBGRYLY29udGVudGZyZWUxEzAR
17
- BgoJkiaJk/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
18
- AQDS5jTexxypvZPqoIRWYcbNGbbgHMn5pd2dUA74fq5IJ0y0J9TK/xy2Ncf8Hv6l
19
- o43531AmDVlPQ7aTTZfqDHQQEoCsHiTxtIc8S3mRQ03exGG+sJIq5Fsgzqg2jvQh
20
- MF3lWjVgENU8/INxpW4f/iST/ojn/PciYSIKs6SBcm9tHfU/jiMOT0qxCkyVAxM0
21
- 0rD/yPQyPb7ogUNsO3RU1v5KBrlcV3lQPRQyRCDUpJ6H0AmeAa4iax/xfK0d/ta+
22
- A9t4MmelIMUohH3VYEgYzCN/SnJsLMcEWbaXYFJMUUk07f+EmV060VUi4vsqvrMy
23
- vyRmhHyxBuiyNNoSi/wfF3ebAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQD
24
- AgSwMB0GA1UdDgQWBBSYmhWA9lg6R++f6Z0m5/ZJ8mwTAzANBgkqhkiG9w0BAQUF
25
- AAOCAQEANprOIqYQsh0myh1GeHwTYo75bFHeMns5kkx44pVRSNWO4M5WEVFztyqO
26
- VW8ZS4aHOqZ/XvOZ3YIP0mNNJEOM3jVirbdRBBnu75q87xDuPX0HVkk687qXFfJ7
27
- Qb+KYshgOEn3n1iBzL6zIYyPOFRxFBEeix7uAZw9gq/EJf7isDToYKG+BE+q53ES
28
- i/ul3Zg65QMGyXWBJlDEcQ7bxD/+pdUhOqew5tBuMvgxB/9XUPTCTLK9rfhakiBd
29
- ZOWAbHDEFtZtQMT5GUHvuZ5jqfEKsE8tkFfFnUPY7DwpqWKkhuQzmmunB2J9aykn
30
- arkBVHd8TABNoJ+MQvwL/7sCwSTiTg==
31
- -----END CERTIFICATE-----
11
+ cert_chain: []
32
12
 
33
- date: 2008-04-17 00:00:00 -07:00
34
- default_executable:
35
- dependencies:
36
- - !ruby/object:Gem::Dependency
37
- name: hoe
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.5.1
44
- version:
45
- description: Simply determines if a user agent is for a mobile device. Comes ready with a module for Rails 2.0 to enable multiviews (respond_to with a custom mimetype) for mobile devices (see Synopsis).
46
- email:
47
- - dave.myron@contentfree.com
13
+ date: 2011-04-12 00:00:00 Z
14
+ dependencies: []
15
+
16
+ description: Simply determines if a user agent is for a mobile device.
17
+ email: dave.myron@contentfree.com
48
18
  executables: []
49
19
 
50
20
  extensions: []
51
21
 
52
22
  extra_rdoc_files:
53
- - History.txt
54
- - Manifest.txt
55
- - README.txt
23
+ - LICENSE
24
+ - README
56
25
  files:
57
- - History.txt
58
- - Manifest.txt
59
- - README.txt
26
+ - LICENSE
27
+ - README
60
28
  - Rakefile
29
+ - VERSION.yml
30
+ - features/is_it_mobile.feature
31
+ - features/steps/is_it_mobile_steps.rb
32
+ - features/support/env.rb
33
+ - is_it_mobile.gemspec
61
34
  - lib/is_it_mobile.rb
62
- - test/test_is_it_mobile.rb
63
- has_rdoc: true
64
- homepage: http://rubyforge.org/projects/contentfree/
35
+ - lib/rails/init.rb
36
+ - spec/is_it_mobile_spec.rb
37
+ - spec/spec_helper.rb
38
+ homepage: http://github.com/contentfree/is_it_mobile
39
+ licenses: []
40
+
65
41
  post_install_message:
66
- rdoc_options:
67
- - --main
68
- - README.txt
42
+ rdoc_options: []
43
+
69
44
  require_paths:
70
45
  - lib
71
46
  required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
72
48
  requirements:
73
49
  - - ">="
74
50
  - !ruby/object:Gem::Version
75
51
  version: "0"
76
- version:
77
52
  required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
78
54
  requirements:
79
55
  - - ">="
80
56
  - !ruby/object:Gem::Version
81
57
  version: "0"
82
- version:
83
58
  requirements: []
84
59
 
85
- rubyforge_project: contentfree
86
- rubygems_version: 1.1.1
60
+ rubyforge_project:
61
+ rubygems_version: 1.7.2
87
62
  signing_key:
88
- specification_version: 2
89
- summary: Simply determines if a user agent is for a mobile device
63
+ specification_version: 3
64
+ summary: Simply determines if a user agent is for a mobile device.
90
65
  test_files:
91
- - test/test_is_it_mobile.rb
66
+ - spec/is_it_mobile_spec.rb
67
+ - spec/spec_helper.rb
data.tar.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- ��� az�|��� Q�fz�(l��$���/ j� pA>�S�����B~�Tf�����
2
- ��@���ȿ��Ǡ�T�$����i��t5�8����Kl5��!��� �U��Yn�H;��G��N�73t_ w��󌀩3����|m(�� ��!��R��z�Aﷀ��T�M�E�F+�k:`ށ̯J��&Yd��.˵��Ta�L���Dǵ����u�C[3(����Y_C�6i�E^�
@@ -1,6 +0,0 @@
1
- === 1.0.0 / 2008-04-17
2
-
3
- * 1 major enhancement
4
-
5
- * Birthday!
6
-
@@ -1,6 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.txt
4
- Rakefile
5
- lib/is_it_mobile.rb
6
- test/test_is_it_mobile.rb
data/README.txt DELETED
@@ -1,73 +0,0 @@
1
- = is_it_mobile
2
- * http://rubyforge.org/projects/contentfree/
3
-
4
- == DESCRIPTION:
5
-
6
- Simply determines if a user agent is for a mobile device.
7
-
8
- Comes ready with a module for Rails 2.0 to enable multiviews (respond_to with a custom mimetype) for mobile devices (see Synopsis).
9
-
10
-
11
- == FEATURES/PROBLEMS:
12
-
13
- * Fast & Lightweight (doesn't use anything like WURFL, which would be overkill for a quick check)
14
-
15
-
16
- == SYNOPSIS:
17
-
18
- The lightweight tests used in IsItMobile are almost completely based on the work of Andy Moore in an
19
- article at http://www.andymoore.info/php-to-detect-mobile-phones/. I added a couple more
20
- user agents to the mix and obviously Rubified it.
21
-
22
- It recognizes 99% of the mobile user agents from http://www.zytrax.com/tech/web/mobile_ids.html
23
- It has nearly no false positives using the user agents from http://www.zytrax.com/tech/web/browser_ids.htm
24
- The ones that don't quite pass are very rare (and some are even questionable appearing in their respective lists)
25
-
26
- With Rails 2.0, you can use its multiview capabilities by simply adding this to your app:
27
- - in config/initializers/mime_types.rb
28
- Mime::Type.register_alias "text/html", :mobile
29
-
30
- - in app/controllers/application.rb
31
- require 'is_it_mobile'
32
- class ApplicationController < ActionController::Base
33
- include IsItMobile::ForRails
34
- end
35
-
36
- Then, just create your views using suffices of mobile.erb instead of html.erb
37
-
38
- You can also just use IsItMobile directly:
39
- IsItMobile.mobile? 'NokiaN90-1/3.0545.5.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1' # => true
40
-
41
-
42
- == REQUIREMENTS:
43
-
44
- None
45
-
46
-
47
- == INSTALL:
48
-
49
- sudo gem install is_it_mobile
50
-
51
-
52
- == LICENSE:
53
-
54
- Copyright (c) 2008
55
-
56
- Permission is hereby granted, free of charge, to any person obtaining
57
- a copy of this software and associated documentation files (the
58
- 'Software'), to deal in the Software without restriction, including
59
- without limitation the rights to use, copy, modify, merge, publish,
60
- distribute, sublicense, and/or sell copies of the Software, and to
61
- permit persons to whom the Software is furnished to do so, subject to
62
- the following conditions:
63
-
64
- The above copyright notice and this permission notice shall be
65
- included in all copies or substantial portions of the Software.
66
-
67
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
68
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
69
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
70
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
71
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
72
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
73
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,12 +0,0 @@
1
- require File.join( File.dirname(__FILE__), '../lib/is_it_mobile.rb' )
2
- require 'test/unit'
3
-
4
- class TestIsItMobile < Test::Unit::TestCase
5
- def test_including_rails_module
6
-
7
- end
8
-
9
- def test_mobile_eh
10
-
11
- end
12
- end
metadata.gz.sig DELETED
@@ -1 +0,0 @@
1
- ~1 ���`ڷu`�!�&��Ԍ0>�1(5E���V<�� I��e�[B&�o#�G�vsfd$[���lH“����u�Y������M��YtD�Q�I"��Z��d 2��"�C�;�럋;����+~�D)ح