rack-prefer 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/rack/prefer.rb +1 -1
- data/lib/rack/prefer/version.rb +1 -1
- data/rack-prefer.gemspec +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db5cb4b4777b2e857113d6ef19fbc7f7681795a8
|
4
|
+
data.tar.gz: ef1ebc71cb61f39a960bc2b4002724b2065b1f6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d48603e05ce13db22349cc603debbb8f89f10a5f2a3fd68295300fd8a5f4cdbedcb0f78b2f1723d3ab7cf0a4512234d9469bdd135560006bfaec7e8cfc401aec
|
7
|
+
data.tar.gz: 12f3a992f672fd51938cf36acf5184f60a29e733afaf0b0d0602de01b8052e5a259c958775c6a3673f6981ef81d9f45d812b9bef78b33ede699a7d3dfa41e906
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ require 'rack/prefer'
|
|
27
27
|
|
28
28
|
Rails automatically includes the `rack/prefer` file.
|
29
29
|
|
30
|
-
Once you have access to Rack::Request object (
|
30
|
+
Once you have access to Rack::Request object (Rails ActionDispatch::Request object
|
31
31
|
inherits from Rack's Rack::Request) you also have access to Prefer header. So for
|
32
32
|
a request like the following prefer headers:
|
33
33
|
|
@@ -41,13 +41,13 @@ you can do:
|
|
41
41
|
```ruby
|
42
42
|
request.prefer.values #{"respond-async"=>nil, "wait"=>"10", "priority"=>"5"}
|
43
43
|
request.prefer.response_async? #true
|
44
|
-
request.return_minimal? #false
|
45
|
-
request.wait? #true
|
46
|
-
request.wait # 10 (integer)
|
47
|
-
request.handling_strict? #true
|
48
|
-
request.values['handling'] #'strict'
|
49
|
-
#
|
50
|
-
request.values[:handling] #strict
|
44
|
+
request.prefer.return_minimal? #false
|
45
|
+
request.prefer.wait? #true
|
46
|
+
request.prefer.wait # 10 (integer)
|
47
|
+
request.prefer.handling_strict? #true
|
48
|
+
request.prefer.values['handling'] #'strict'
|
49
|
+
#Rails only
|
50
|
+
request.prefer.values[:handling] #strict
|
51
51
|
```
|
52
52
|
|
53
53
|
Happy coding!
|
data/lib/rack/prefer.rb
CHANGED
data/lib/rack/prefer/version.rb
CHANGED
data/rack-prefer.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'rack/prefer/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "rack-prefer"
|
8
8
|
spec.version = Rack::Prefer::VERSION
|
9
|
-
spec.authors = ["Filippos Vasilakis"]
|
10
|
-
spec.email = ["vasilakisfil@gmail.com"]
|
9
|
+
spec.authors = ["Filippos Vasilakis", "Kollegorna"]
|
10
|
+
spec.email = ["vasilakisfil@gmail.com", "admin@kollegorna.se"]
|
11
11
|
|
12
12
|
spec.summary = %q{Simple gem that parses the HTTP prefer header.}
|
13
13
|
spec.description = %q{Simple gem that parses the HTTP prefer header.}
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-prefer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filippos Vasilakis
|
8
|
+
- Kollegorna
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2015-
|
12
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -41,6 +42,7 @@ dependencies:
|
|
41
42
|
description: Simple gem that parses the HTTP prefer header.
|
42
43
|
email:
|
43
44
|
- vasilakisfil@gmail.com
|
45
|
+
- admin@kollegorna.se
|
44
46
|
executables: []
|
45
47
|
extensions: []
|
46
48
|
extra_rdoc_files: []
|