ress 0.0.1 → 0.0.2
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/README.md +7 -14
- data/lib/generators/ress/templates/README +1 -1
- data/lib/ress/version.rb +1 -1
- data/lib/ress/view_helpers.rb +1 -1
- data/spec/ress/view_helpers_spec.rb +4 -4
- metadata +2 -2
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# Ress
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
devices.
|
3
|
+
A system for building mobile optimized Rails applications using semantic,
|
4
|
+
media query-based device detection and server side progressive enhancement.
|
6
5
|
|
7
6
|
## Background
|
8
7
|
|
@@ -40,15 +39,13 @@ as documented by Google
|
|
40
39
|
|
41
40
|
### Feature Detection
|
42
41
|
|
43
|
-
semantic, media query-based device detection
|
44
|
-
|
45
42
|
Device.js will read all of the version links in your markup, and
|
46
43
|
redirect you to the appropriate URL that serves the correct version of
|
47
44
|
your webapp.
|
48
45
|
|
49
|
-
When a request comes into your site, ress runs a some javascript
|
50
|
-
alternate version available that matches the client. If there
|
51
|
-
redirected to that
|
46
|
+
When a request comes into your site, ress runs a some javascript to determine
|
47
|
+
if there is an alternate version available that matches the client. If there
|
48
|
+
is, the user is redirected to the url for that version.
|
52
49
|
|
53
50
|
### Server Side Components
|
54
51
|
|
@@ -117,8 +114,7 @@ URL of the tablet site, you can load `http://tablet.foo.com/?force=1`.
|
|
117
114
|
|
118
115
|
### Dependencies
|
119
116
|
|
120
|
-
TODO: Modernizr
|
121
|
-
|
117
|
+
TODO: Document Modernizr Dependency
|
122
118
|
|
123
119
|
## Performance considerations
|
124
120
|
|
@@ -127,7 +123,7 @@ redirection to point users to the right version of your webapp. Client-side
|
|
127
123
|
redirection can have a performance overhead (though I haven't measured it).
|
128
124
|
If you find this is true, you can keep your DOM the same, still using the
|
129
125
|
SEO-friendly `<link rel="alternate">` tags, but simply remove the
|
130
|
-
|
126
|
+
ress.js script and do your own server-side UA-based pushing.
|
131
127
|
|
132
128
|
## Browser support
|
133
129
|
|
@@ -137,9 +133,6 @@ to work in IE7 and below, please include a [polyfill](https://gist.github.com/27
|
|
137
133
|
|
138
134
|
## Contributing
|
139
135
|
|
140
|
-
The goal of Ress is to provide a SEO-compatible best practice and
|
141
|
-
starting point for reliable cross-device, cross-browser redirection.
|
142
|
-
|
143
136
|
Given how many browsers and devices we have these days, there are bound
|
144
137
|
to be bugs. If you find them, please report them and (ideally) fix them
|
145
138
|
in a pull request.
|
data/lib/ress/version.rb
CHANGED
data/lib/ress/view_helpers.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative '../../lib/ress'
|
|
3
3
|
|
4
4
|
describe ActionView::Base do
|
5
5
|
|
6
|
-
describe '#
|
6
|
+
describe '#ress_annotation_tags' do
|
7
7
|
|
8
8
|
let(:view) { ActionView::Base.new }
|
9
9
|
let(:request) { stub('request', :protocol => 'http://', :host_with_port => 'x.foo.com', :fullpath => '/bar', :subdomain => 'x') }
|
@@ -18,7 +18,7 @@ describe ActionView::Base do
|
|
18
18
|
before { view.stub(:canonical_request? => false) }
|
19
19
|
|
20
20
|
it 'returns the canonical link' do
|
21
|
-
view.
|
21
|
+
view.ress_annotation_tags.should == "<link href=\"http://foo.com/bar\" rel=\"canonical\" />"
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
@@ -29,7 +29,7 @@ describe ActionView::Base do
|
|
29
29
|
before { view.stub(:canonical_request? => true) }
|
30
30
|
|
31
31
|
it 'returns an empty string if there are no registered categories' do
|
32
|
-
view.
|
32
|
+
view.ress_annotation_tags.should == ''
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'generates the link tags when there is one category' do
|
@@ -38,7 +38,7 @@ describe ActionView::Base do
|
|
38
38
|
r.add_alternate :name => 'm', :media_type => 'stuff'
|
39
39
|
end
|
40
40
|
|
41
|
-
view.
|
41
|
+
view.ress_annotation_tags.should ==
|
42
42
|
"<link href=\"http://m.foo.com/bar\" id=\"m\" media=\"stuff\" rel=\"alternate\" />"
|
43
43
|
end
|
44
44
|
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: ress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Matthew Robertson
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|