mobylette 2.2 → 2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- Copyright 2011 YOURNAME
1
+ Copyright 2011 Tiago Scolari
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -137,9 +137,7 @@ This will force the session_override value in the users session. Values possible
137
137
 
138
138
  Friendly note: on your tests, call these functions BEFORE you make the request, otherwise they are useless =p
139
139
 
140
- == Contributions and Credits
141
140
 
142
- these pages were very usefull when creating this gem:
143
- * http://stackoverflow.com/questions/5126085/ruby-on-rails-mobile-application
144
- * http://www.arctickiwi.com/blog/mobile-enable-your-ruby-on-rails-site-for-small-screens
145
- * http://metautonomo.us/2011/01/05/mobile-devices-and-rails-maintaining-your-sanity/
141
+ = LICENSE
142
+
143
+ MIT License. Copyright 2012 Tiago Scolari.
data/Rakefile CHANGED
@@ -12,6 +12,11 @@ rescue LoadError
12
12
  RDoc::Task = Rake::RDocTask
13
13
  end
14
14
 
15
+ require "rspec/core/rake_task"
16
+ RSpec::Core::RakeTask.new(:spec)
17
+ task :default => :spec
18
+
19
+
15
20
  RDoc::Task.new(:rdoc) do |rdoc|
16
21
  rdoc.rdoc_dir = 'rdoc'
17
22
  rdoc.title = 'Mobylette'
@@ -46,8 +46,12 @@ module Mobylette
46
46
  # using fallback if needed
47
47
  #
48
48
  def find_templates(name, prefix, partial, details)
49
- details[:formats] = Array.wrap(fallback_list) if details[:formats].first == :mobile
50
- super
49
+ if details[:formats].first == :mobile
50
+ details = details.dup
51
+ details[:formats] = Array.wrap(fallback_list)
52
+ end
53
+
54
+ super(name, prefix, partial, details)
51
55
  end
52
56
 
53
57
  private
@@ -6,5 +6,5 @@ module Mobylette
6
6
  'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' +
7
7
  'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' +
8
8
  'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' +
9
- 'mobile|maemo|fennec'
9
+ 'mobile|maemo|fennec|silk'
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module Mobylette
2
- VERSION = "2.2"
2
+ VERSION = "2.3"
3
3
  end
@@ -1,63 +0,0 @@
1
- Processing by DefaultFallbackController#index as HTML
2
- Completed 200 OK in 19ms (Views: 17.9ms)
3
- Processing by DefaultFallbackController#index as HTML
4
- Completed 200 OK in 2ms (Views: 2.2ms)
5
- Processing by DefaultFallbackController#test as HTML
6
- Completed 200 OK in 2ms (Views: 2.0ms)
7
- Processing by DefaultFallbackController#test as JS
8
- Completed 200 OK in 8ms (Views: 7.4ms)
9
- Processing by ForceFallbackController#index as HTML
10
- Completed 200 OK in 4ms (Views: 3.4ms)
11
- Processing by ForceFallbackController#index as HTML
12
- Completed 200 OK in 2ms (Views: 1.8ms)
13
- Processing by ForceFallbackController#test as HTML
14
- Completed 200 OK in 2ms (Views: 1.8ms)
15
- Processing by ForceFallbackController#test as HTML
16
- Completed 200 OK in 1ms (Views: 0.9ms)
17
- Processing by ForceFallbackController#test as JS
18
- Completed 200 OK in 1ms (Views: 0.7ms)
19
- Processing by HomeController#index as HTML
20
- Completed 200 OK in 4ms (Views: 3.4ms)
21
- Processing by HomeController#index as HTML
22
- Completed 200 OK in 1ms (Views: 1.2ms)
23
- Processing by HomeController#index as HTML
24
- Completed 200 OK in 2ms (Views: 2.2ms)
25
- Processing by HomeController#index as HTML
26
- Completed 200 OK in 2ms (Views: 1.5ms)
27
- Processing by HomeController#index as HTML
28
- Completed 200 OK in 1ms (Views: 1.1ms)
29
- Processing by HomeController#index as HTML
30
- Completed 200 OK in 1ms (Views: 1.0ms)
31
- Processing by HomeController#index as HTML
32
- Completed 200 OK in 2ms (Views: 1.8ms)
33
- Processing by HomeController#index as HTML
34
- Completed 200 OK in 2ms (Views: 1.3ms)
35
- Processing by HomeController#index as HTML
36
- Completed 200 OK in 1ms (Views: 1.0ms)
37
- Processing by HomeController#respond_to_test as HTML
38
- Completed 200 OK in 2ms (Views: 1.7ms)
39
- Processing by HomeController#respond_to_test as HTML
40
- Completed 200 OK in 2ms (Views: 1.7ms)
41
- Processing by HomeController#respond_to_test as MOBILE
42
- Completed 200 OK in 1ms (Views: 0.9ms)
43
- Processing by HomeController#index as JS
44
- Completed 200 OK in 5ms (Views: 5.2ms)
45
- Processing by HomeController#index as HTML
46
- Completed 200 OK in 1ms (Views: 1.1ms)
47
- Processing by HomeController#index as HTML
48
- Completed 200 OK in 1ms (Views: 1.1ms)
49
- Processing by HomeController#index as HTML
50
- Parameters: {"skip_mobile"=>"true"}
51
- Completed 200 OK in 1ms (Views: 1.1ms)
52
- Processing by NoFallbackController#index as HTML
53
- Completed 200 OK in 4ms (Views: 3.7ms)
54
- Processing by NoFallbackController#index as HTML
55
- Completed 200 OK in 3ms (Views: 2.5ms)
56
- Processing by NoFallbackController#test as HTML
57
- Completed 500 Internal Server Error in 1ms
58
- Processing by NoFallbackController#test as HTML
59
- Completed 500 Internal Server Error in 1ms
60
- Processing by NoFallbackController#test as HTML
61
- Completed 500 Internal Server Error in 1ms
62
- Processing by SkipXhrRequestController#index as JS
63
- Completed 200 OK in 6ms (Views: 5.3ms)
@@ -27,6 +27,7 @@ module Mobylette
27
27
  @formats = []
28
28
  Array.stub(:wrap).and_return(@formats)
29
29
  @details = {:formats => []}
30
+ @details.stub(:dup).and_return(@details)
30
31
  end
31
32
 
32
33
  context "mobile request" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobylette
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.2'
4
+ version: '2.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-21 00:00:00.000000000 Z
12
+ date: 2012-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
16
- requirement: &70171537575480 !ruby/object:Gem::Requirement
16
+ requirement: &70147243123000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70171537575480
24
+ version_requirements: *70147243123000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70171537574560 !ruby/object:Gem::Requirement
27
+ requirement: &70147243121340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70171537574560
35
+ version_requirements: *70147243121340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &70171537573200 !ruby/object:Gem::Requirement
38
+ requirement: &70147243119240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70171537573200
46
+ version_requirements: *70147243119240
47
47
  description: Adds the mobile format for rendering views for mobile device.
48
48
  email:
49
49
  - tscolari@gmail.com
@@ -117,7 +117,6 @@ files:
117
117
  - spec/dummy/config/routes.rb
118
118
  - spec/dummy/config.ru
119
119
  - spec/dummy/db/schema.rb
120
- - spec/dummy/log/development.log
121
120
  - spec/dummy/log/test.log
122
121
  - spec/dummy/public/404.html
123
122
  - spec/dummy/public/422.html
@@ -125,14 +124,6 @@ files:
125
124
  - spec/dummy/public/favicon.ico
126
125
  - spec/dummy/Rakefile
127
126
  - spec/dummy/script/rails
128
- - spec/dummy/tmp/cache/assets/C82/3E0/sprockets%2F48eb4ac616538f8f36870451073315da
129
- - spec/dummy/tmp/cache/assets/CE4/1C0/sprockets%2F18d93e1533d585b2f64ec90b33176ac9
130
- - spec/dummy/tmp/cache/assets/CED/A70/sprockets%2F621683d8791730a9cc7ce45e17a7e46d
131
- - spec/dummy/tmp/cache/assets/CFC/200/sprockets%2F716f89d85d4855706b8a9abec1969c62
132
- - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
133
- - spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
134
- - spec/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
135
- - spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
136
127
  - spec/integration/navigation_spec.rb
137
128
  - spec/lib/fallback_resolver_spec.rb
138
129
  - spec/lib/respond_to_mobile_requests_spec.rb
@@ -154,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
145
  version: '0'
155
146
  segments:
156
147
  - 0
157
- hash: -3270955912998944964
148
+ hash: 1262445420216473146
158
149
  required_rubygems_version: !ruby/object:Gem::Requirement
159
150
  none: false
160
151
  requirements:
@@ -163,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
154
  version: '0'
164
155
  segments:
165
156
  - 0
166
- hash: -3270955912998944964
157
+ hash: 1262445420216473146
167
158
  requirements: []
168
159
  rubyforge_project:
169
160
  rubygems_version: 1.8.10
@@ -225,7 +216,6 @@ test_files:
225
216
  - spec/dummy/config/routes.rb
226
217
  - spec/dummy/config.ru
227
218
  - spec/dummy/db/schema.rb
228
- - spec/dummy/log/development.log
229
219
  - spec/dummy/log/test.log
230
220
  - spec/dummy/public/404.html
231
221
  - spec/dummy/public/422.html
@@ -233,14 +223,6 @@ test_files:
233
223
  - spec/dummy/public/favicon.ico
234
224
  - spec/dummy/Rakefile
235
225
  - spec/dummy/script/rails
236
- - spec/dummy/tmp/cache/assets/C82/3E0/sprockets%2F48eb4ac616538f8f36870451073315da
237
- - spec/dummy/tmp/cache/assets/CE4/1C0/sprockets%2F18d93e1533d585b2f64ec90b33176ac9
238
- - spec/dummy/tmp/cache/assets/CED/A70/sprockets%2F621683d8791730a9cc7ce45e17a7e46d
239
- - spec/dummy/tmp/cache/assets/CFC/200/sprockets%2F716f89d85d4855706b8a9abec1969c62
240
- - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
241
- - spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
242
- - spec/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
243
- - spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
244
226
  - spec/integration/navigation_spec.rb
245
227
  - spec/lib/fallback_resolver_spec.rb
246
228
  - spec/lib/respond_to_mobile_requests_spec.rb
@@ -1,116 +0,0 @@
1
-
2
-
3
- Started GET "/" for 127.0.0.1 at 2012-03-25 16:04:55 -0300
4
- Processing by HomeController#index as HTML
5
- Rendered home/index.html.erb within layouts/application (2.2ms)
6
- Compiled application.css (0ms) (pid 45506)
7
- Compiled application.js (0ms) (pid 45506)
8
- Completed 200 OK in 25ms (Views: 24.5ms)
9
-
10
-
11
- Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-03-25 16:04:55 -0300
12
- Served asset /application.css - 200 OK (5ms)
13
-
14
-
15
- Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-03-25 16:04:55 -0300
16
- Served asset /application.js - 200 OK (3ms)
17
-
18
-
19
- Started GET "/" for 192.168.0.5 at 2012-03-25 16:05:53 -0300
20
- Processing by HomeController#index as HTML
21
- Rendered home/index.mobile.erb within layouts/application (0.6ms)
22
- Compiled application_mobile.css (0ms) (pid 45506)
23
- Compiled application_mobile.js (0ms) (pid 45506)
24
- Completed 200 OK in 30ms (Views: 29.3ms)
25
-
26
-
27
- Started GET "/assets/application_mobile.css?body=1" for 192.168.0.5 at 2012-03-25 16:05:53 -0300
28
- Served asset /application_mobile.css - 200 OK (5ms)
29
-
30
-
31
- Started GET "/assets/application_mobile.js?body=1" for 192.168.0.5 at 2012-03-25 16:05:53 -0300
32
- Served asset /application_mobile.js - 200 OK (2ms)
33
-
34
-
35
- Started GET "/" for 127.0.0.1 at 2012-03-25 16:11:35 -0300
36
- Processing by HomeController#index as HTML
37
- Rendered home/index.html.erb within layouts/application (2.5ms)
38
- Completed 200 OK in 34ms (Views: 33.9ms)
39
-
40
-
41
- Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-03-25 16:11:35 -0300
42
- Served asset /application.css - 304 Not Modified (0ms)
43
-
44
-
45
- Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-03-25 16:11:35 -0300
46
- Served asset /application.js - 304 Not Modified (0ms)
47
-
48
-
49
- Started GET "/" for 192.168.0.5 at 2012-03-25 16:11:43 -0300
50
- Processing by HomeController#index as HTML
51
- Rendered home/index.mobile.erb within layouts/application (0.8ms)
52
- Completed 200 OK in 8ms (Views: 8.1ms)
53
-
54
-
55
- Started GET "/assets/application_mobile.css?body=1" for 192.168.0.5 at 2012-03-25 16:11:43 -0300
56
- Served asset /application_mobile.css - 304 Not Modified (0ms)
57
-
58
-
59
- Started GET "/assets/application_mobile.js?body=1" for 192.168.0.5 at 2012-03-25 16:11:43 -0300
60
- Served asset /application_mobile.js - 304 Not Modified (0ms)
61
-
62
-
63
- Started GET "/" for 127.0.0.1 at 2012-03-25 16:12:03 -0300
64
- Processing by HomeController#index as HTML
65
- Rendered home/index.html.erb within layouts/application (0.3ms)
66
- Completed 200 OK in 26ms (Views: 25.6ms)
67
-
68
-
69
- Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-03-25 16:12:03 -0300
70
- Served asset /application.css - 304 Not Modified (0ms)
71
-
72
-
73
- Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-03-25 16:12:03 -0300
74
- Served asset /application.js - 304 Not Modified (0ms)
75
-
76
-
77
- Started GET "/" for 127.0.0.1 at 2012-03-25 16:12:05 -0300
78
- Processing by HomeController#index as HTML
79
- Rendered home/index.html.erb within layouts/application (0.2ms)
80
- Completed 200 OK in 4ms (Views: 3.7ms)
81
-
82
-
83
- Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-03-25 16:12:05 -0300
84
- Served asset /application.css - 304 Not Modified (0ms)
85
-
86
-
87
- Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-03-25 16:12:05 -0300
88
- Served asset /application.js - 304 Not Modified (0ms)
89
-
90
-
91
- Started GET "/" for 127.0.0.1 at 2012-03-25 16:12:12 -0300
92
- Processing by HomeController#index as HTML
93
- Rendered home/index.html.erb within layouts/application (0.2ms)
94
- Completed 200 OK in 4ms (Views: 3.6ms)
95
-
96
-
97
- Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-03-25 16:12:12 -0300
98
- Served asset /application.css - 304 Not Modified (0ms)
99
-
100
-
101
- Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-03-25 16:12:12 -0300
102
- Served asset /application.js - 304 Not Modified (0ms)
103
-
104
-
105
- Started GET "/" for 192.168.0.5 at 2012-03-25 16:12:15 -0300
106
- Processing by HomeController#index as HTML
107
- Rendered home/index.mobile.erb within layouts/application (0.5ms)
108
- Completed 200 OK in 4ms (Views: 3.7ms)
109
-
110
-
111
- Started GET "/assets/application_mobile.css?body=1" for 192.168.0.5 at 2012-03-25 16:12:15 -0300
112
- Served asset /application_mobile.css - 200 OK (1ms)
113
-
114
-
115
- Started GET "/assets/application_mobile.js?body=1" for 192.168.0.5 at 2012-03-25 16:12:15 -0300
116
- Served asset /application_mobile.js - 200 OK (0ms)
@@ -1,14 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1332702353.878731: @value{ I" length:EFi�I" digest;
2
- F"%769c3433f6bf172ce80327c044c94eb8I" source;
3
- FI"�// This is a manifest file that'll be compiled into including all the files listed below.
4
- // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
5
- // be included in the compiled file accessible from http://example.com/assets/application.js
6
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
7
- // the compiled file.
8
- //
9
- //
10
-
11
- alert("MOBILE JS");
12
- ;
13
- FI"
14
- F"%34fa2587d444e6aea52cea430c668ccd
@@ -1,16 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1332702353.869955: @value{ I" length:EFiaI" digest;
2
- F"%7b5b4d1463c8ab2cd40517c7d780541aI" source;
3
- FI"a/*
4
- * This is the application mobile CSS
5
- *
6
- *
7
- *
8
- */
9
-
10
-
11
- body {
12
- background-color: green;
13
- }
14
- ;
15
- FI"
16
- F"%dcc110379513c5a0ef6f15e1c0fd77c0
@@ -1,16 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1332702295.254518: @value{ I" length:EFi`I" digest;
2
- F"%da492739dcaff65c608e68791e24b0b5I" source;
3
- FI"`/*
4
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
5
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
6
- * the top of the compiled file, but it's generally better to create a new file per style scope.
7
- */
8
-
9
-
10
-
11
- body {
12
- background-color: blue;
13
- }
14
- ;
15
- FI"
16
- F"%4445ed39e85707f3677849c0aa9f18ed
@@ -1,14 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1332702295.262975: @value{ I" length:EFi�I" digest;
2
- F"%e9b5a652b2cb6afb7f4abf460034a746I" source;
3
- FI"�// This is a manifest file that'll be compiled into including all the files listed below.
4
- // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
5
- // be included in the compiled file accessible from http://example.com/assets/application.js
6
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
7
- // the compiled file.
8
- //
9
- //
10
-
11
- alert("HTML JS");
12
- ;
13
- FI"
14
- F"%22b0e19566c0b533398b54fe8fbd3f62