ress 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # Ress
2
2
 
3
- Ress implements a set of best practices that allow you to progressively
4
- enhance you Rails application to improve the user experience on mobile
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 if there is an
50
- alternate version available that matches the client. If there is, the user is
51
- redirected to that site.
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
- device.js script and do your own server-side UA-based pushing.
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.
@@ -12,7 +12,7 @@ There is some setup you must do manually if you haven't yet:
12
12
  <head>
13
13
  <title>My App</title>
14
14
  <%= stylesheet_link_tag "application", :media => "all" %>
15
- <%= ress_link_tags %>
15
+ <%= ress_annotation_tags %>
16
16
  <%= csrf_meta_tags %>
17
17
  </head>
18
18
 
data/lib/ress/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ress
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -2,7 +2,7 @@ module Ress
2
2
 
3
3
  module ViewHelpers
4
4
 
5
- def ress_link_tags
5
+ def ress_annotation_tags
6
6
  path = "#{request.host_with_port}#{request.fullpath}"
7
7
  if canonical_request?
8
8
  Ress.alternate_versions.map do |category|
@@ -3,7 +3,7 @@ require_relative '../../lib/ress'
3
3
 
4
4
  describe ActionView::Base do
5
5
 
6
- describe '#ress_link_tags' do
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.ress_link_tags.should == "<link href=\"http://foo.com/bar\" rel=\"canonical\" />"
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.ress_link_tags.should == ''
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.ress_link_tags.should ==
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.1
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-28 00:00:00.000000000 Z
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