is_it_mobile 1.0.0 → 1.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ === 1.0.0.1 / 2008-04-17
2
+
3
+ * 1 major enhancement
4
+
5
+ * Botched the Rails module - Fixed!
6
+
7
+
1
8
  === 1.0.0 / 2008-04-17
2
9
 
3
10
  * 1 major enhancement
@@ -1,17 +1,18 @@
1
1
  class IsItMobile
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.0.1'
3
3
 
4
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-']
5
5
 
6
6
  module ForRails
7
- def included?(base)
7
+ def self.included(base)
8
8
  base.class_eval do
9
9
  before_filter :wrangle_format_if_request_is_mobile
10
10
  end
11
11
  end
12
12
 
13
+ protected
13
14
  def wrangle_format_if_request_is_mobile
14
- request.format = :mobile if IsItMobile.mobile?( @env['HTTP_USER_AGENT'], @env['HTTP_ACCEPT'])
15
+ request.format = :mobile if IsItMobile.mobile?( request.env['HTTP_USER_AGENT'], request.env['HTTP_ACCEPT'])
15
16
  end
16
17
  end
17
18
 
@@ -1 +1,12 @@
1
- # TODO: Tests!
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 CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: is_it_mobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Myron
metadata.gz.sig CHANGED
Binary file