rack-jquery 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +9 -0
- data/README.md +7 -6
- data/lib/rack/jquery.rb +7 -0
- data/lib/rack/jquery/version.rb +1 -1
- metadata +2 -2
data/CHANGES.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# CH CH CH CHANGES #
|
2
2
|
|
3
|
+
## v1.1.0 ##
|
4
|
+
|
5
|
+
Friday the 22nd of March 2013
|
6
|
+
|
7
|
+
* Improved README by adding how to use the middleware (and why).
|
8
|
+
* Should be thread safe now, by duplicating the `call` method.
|
9
|
+
|
10
|
+
----
|
11
|
+
|
3
12
|
## v1.0.4 ##
|
4
13
|
|
5
14
|
Friday the 8th of March 2013
|
data/README.md
CHANGED
@@ -7,16 +7,17 @@
|
|
7
7
|
Master branch:
|
8
8
|
[![Build Status](https://secure.travis-ci.org/yb66/rack-jquery.png?branch=master)](http://travis-ci.org/yb66/rack-jquery)
|
9
9
|
|
10
|
-
|
10
|
+
### Why? ###
|
11
11
|
|
12
12
|
I get tired of copy and pasting and downloading and moving… jQuery files and script tags etc. This does it for me, and keeps version management nice 'n' easy.
|
13
13
|
|
14
|
-
|
14
|
+
### Usage ###
|
15
15
|
|
16
16
|
Have a look in the examples directory, but here's a snippet.
|
17
17
|
|
18
18
|
* Install it (see below)
|
19
19
|
* `require 'rack/jquery'`.
|
20
|
+
* If you want fallback then add this to your middleware stack: `use Rack::JQuery`
|
20
21
|
* Put this in the head of your layout (the example is Haml but you can use whatever you like)
|
21
22
|
|
22
23
|
<pre><code>
|
@@ -30,11 +31,11 @@ It also adds in a bit of javascript that will load in a locally kept version of
|
|
30
31
|
|
31
32
|
That was easy.
|
32
33
|
|
33
|
-
|
34
|
+
### Version numbers ###
|
34
35
|
|
35
36
|
This library uses [semver](http://semver.org/) to version the **library**. That means the library version is ***not*** an indicator of quality but a way to manage changes. The version of jQuery can be found in the lib/rack/jquery/version.rb file, or via the {Rack::JQuery::JQUERY_VERSION} constant.
|
36
37
|
|
37
|
-
|
38
|
+
### Installation
|
38
39
|
|
39
40
|
Add this line to your application's Gemfile:
|
40
41
|
|
@@ -48,7 +49,7 @@ Or install it yourself as:
|
|
48
49
|
|
49
50
|
$ gem install rack-jquery
|
50
51
|
|
51
|
-
|
52
|
+
### Contributing ###
|
52
53
|
|
53
54
|
1. Fork it
|
54
55
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
@@ -56,6 +57,6 @@ Or install it yourself as:
|
|
56
57
|
4. Push to the branch (`git push origin my-new-feature`)
|
57
58
|
5. Create new Pull Request
|
58
59
|
|
59
|
-
|
60
|
+
### Licences ###
|
60
61
|
|
61
62
|
The licence for this library is contained in LICENCE.txt. The jQuery library licence is contained in JQUERY-LICENCE.txt.
|
data/lib/rack/jquery.rb
CHANGED
@@ -64,6 +64,13 @@ STR
|
|
64
64
|
|
65
65
|
# @param [Hash] env Rack request environment hash.
|
66
66
|
def call( env )
|
67
|
+
dup._call env
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
# For thread safety
|
72
|
+
# @param (see #call)
|
73
|
+
def _call( env )
|
67
74
|
request = Rack::Request.new(env.dup)
|
68
75
|
if request.path_info == @http_path_to_jquery
|
69
76
|
response = Rack::Response.new
|
data/lib/rack/jquery/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-jquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|