rack-pjax 0.5.0 → 0.5.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 +20 -0
- data/README.md +88 -0
- data/lib/rack/pjax/version.rb +1 -1
- metadata +6 -4
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Gert Goet, ThinkCreate
|
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.md
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
Rack-pjax [](http://stillmaintained.com/eval/rack-pjax)
|
2
|
+
========
|
3
|
+
|
4
|
+
Rack-pjax is middleware that lets you serve 'chrome-less' pages in respond to [pjax-requests](https://github.com/defunkt/jquery-pjax).
|
5
|
+
|
6
|
+
While responding to a pjax-request is quite easy on a per application basis (e.g. just skip the layout), there are less optimal situations.
|
7
|
+
For example when you have:
|
8
|
+
|
9
|
+
- a rack stack, consisting of several pieces of middleware
|
10
|
+
- an application you can't or don't want to customize server-side (e.g. Spree, Radiant)
|
11
|
+
|
12
|
+
Usage
|
13
|
+
------------
|
14
|
+
|
15
|
+
I. Include **rack-pjax** as middleware to your application(-stack)
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
# config.ru
|
19
|
+
require ::File.expand_path('../config/environment', __FILE__)
|
20
|
+
use Rack::Pjax
|
21
|
+
run RackApp::Application
|
22
|
+
```
|
23
|
+
II. Install [jquery-pjax](https://github.com/defunkt/jquery-pjax). Make sure to add the 'data-pjax-container'-attribute to the container.
|
24
|
+
|
25
|
+
```html
|
26
|
+
<head>
|
27
|
+
...
|
28
|
+
<script src="/javascripts/jquery.js"></script>
|
29
|
+
<script src="/javascripts/jquery.pjax.js"></script>
|
30
|
+
<script type="text/javascript">
|
31
|
+
$(function(){
|
32
|
+
$('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('[data-pjax-container]')
|
33
|
+
})
|
34
|
+
</script>
|
35
|
+
...
|
36
|
+
</head>
|
37
|
+
<body>
|
38
|
+
<div data-pjax-container>
|
39
|
+
...
|
40
|
+
</div>
|
41
|
+
</body>
|
42
|
+
```
|
43
|
+
|
44
|
+
III. Fire up your [pushState-enabled browser](http://caniuse.com/#search=pushstate) and enjoy!
|
45
|
+
|
46
|
+
|
47
|
+
Installation
|
48
|
+
------------
|
49
|
+
|
50
|
+
$ gem install rack-pjax
|
51
|
+
|
52
|
+
|
53
|
+
Requirements
|
54
|
+
------------
|
55
|
+
|
56
|
+
- Nokogiri
|
57
|
+
|
58
|
+
|
59
|
+
Author
|
60
|
+
------
|
61
|
+
|
62
|
+
Gert Goet (eval) :: gert@thinkcreate.nl :: @gertgoet
|
63
|
+
|
64
|
+
License
|
65
|
+
------
|
66
|
+
|
67
|
+
(The MIT license)
|
68
|
+
|
69
|
+
Copyright (c) 2011 Gert Goet, ThinkCreate
|
70
|
+
|
71
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
72
|
+
a copy of this software and associated documentation files (the
|
73
|
+
"Software"), to deal in the Software without restriction, including
|
74
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
75
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
76
|
+
permit persons to whom the Software is furnished to do so, subject to
|
77
|
+
the following conditions:
|
78
|
+
|
79
|
+
The above copyright notice and this permission notice shall be
|
80
|
+
included in all copies or substantial portions of the Software.
|
81
|
+
|
82
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
83
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
84
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
85
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
86
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
87
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
88
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/rack/pjax/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-pjax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gert Goet
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-07 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -61,6 +61,8 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
63
|
- Gemfile
|
64
|
+
- LICENSE
|
65
|
+
- README.md
|
64
66
|
- Rakefile
|
65
67
|
- lib/rack-pjax.rb
|
66
68
|
- lib/rack/pjax.rb
|