faraday_middleware 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/faraday_middleware/response/caching.rb +6 -3
- data/lib/faraday_middleware/response/parse_dates.rb +1 -1
- data/lib/faraday_middleware/version.rb +1 -1
- metadata +6 -23
- data/CHANGELOG.md +0 -10
- data/CONTRIBUTING.md +0 -46
- data/faraday_middleware.gemspec +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19207ab27ddadf4621b943f32e3ee0a54ebbe0f4
|
4
|
+
data.tar.gz: 17df1b80453f02f7218052cdac77f477efe3f99d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4b8edf32f496c1c52b139390c1fe0ae9908891e2dda234958a5cb40efed32a75bebebacc275f44ba075f8d78ae342950272006c1ddf16db0bb8ea78bef04398
|
7
|
+
data.tar.gz: f024bdcfb98632eaed13da4dc6206ba4389e31c5d569b3ec67f7f10b51729b7a7a69504ca0be4ab38b6d551344810d18ccf29c9b2df5c24420f9d00e3c05bdbf
|
@@ -78,9 +78,12 @@ module FaradayMiddleware
|
|
78
78
|
if cached_response = cache.read(key)
|
79
79
|
finalize_response(cached_response, env)
|
80
80
|
else
|
81
|
-
response
|
82
|
-
|
83
|
-
|
81
|
+
# response.status is nil at this point, any checks need to be done inside on_complete block
|
82
|
+
@app.call(env).on_complete do |response|
|
83
|
+
if CACHEABLE_STATUS_CODES.include?(response.status)
|
84
|
+
cache.write(key, response)
|
85
|
+
end
|
86
|
+
response
|
84
87
|
end
|
85
88
|
end
|
86
89
|
end
|
@@ -4,7 +4,7 @@ require "faraday"
|
|
4
4
|
module FaradayMiddleware
|
5
5
|
# Parse dates from response body
|
6
6
|
class ParseDates < ::Faraday::Response::Middleware
|
7
|
-
ISO_DATE_FORMAT = /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z\Z/m
|
7
|
+
ISO_DATE_FORMAT = /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|((\+|-)\d{2}:?\d{2}))\Z/m
|
8
8
|
|
9
9
|
def initialize(app, options = {})
|
10
10
|
@regexp = options[:match] || ISO_DATE_FORMAT
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Michaels-Ober
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: 0.7.4
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '0
|
23
|
+
version: '1.0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,23 +29,9 @@ dependencies:
|
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 0.7.4
|
31
31
|
- - "<"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.10'
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: bundler
|
36
|
-
requirement: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
32
|
- !ruby/object:Gem::Version
|
40
33
|
version: '1.0'
|
41
|
-
|
42
|
-
prerelease: false
|
43
|
-
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.0'
|
48
|
-
description: Various middleware for Faraday
|
34
|
+
description:
|
49
35
|
email:
|
50
36
|
- sferik@gmail.com
|
51
37
|
- wynn.netherland@gmail.com
|
@@ -53,11 +39,8 @@ executables: []
|
|
53
39
|
extensions: []
|
54
40
|
extra_rdoc_files: []
|
55
41
|
files:
|
56
|
-
- CHANGELOG.md
|
57
|
-
- CONTRIBUTING.md
|
58
42
|
- LICENSE.md
|
59
43
|
- README.md
|
60
|
-
- faraday_middleware.gemspec
|
61
44
|
- lib/faraday_middleware.rb
|
62
45
|
- lib/faraday_middleware/addressable_patch.rb
|
63
46
|
- lib/faraday_middleware/backwards_compatibility.rb
|
@@ -97,10 +80,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
80
|
requirements:
|
98
81
|
- - ">="
|
99
82
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
83
|
+
version: '0'
|
101
84
|
requirements: []
|
102
85
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
86
|
+
rubygems_version: 2.4.5
|
104
87
|
signing_key:
|
105
88
|
specification_version: 4
|
106
89
|
summary: Various middleware for Faraday
|
data/CHANGELOG.md
DELETED
data/CONTRIBUTING.md
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
## Contributing
|
2
|
-
In the spirit of [free software][free-sw], **everyone** is encouraged to help
|
3
|
-
improve this project.
|
4
|
-
|
5
|
-
[free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
|
6
|
-
|
7
|
-
Here are some ways *you* can contribute:
|
8
|
-
|
9
|
-
* by using alpha, beta, and prerelease versions
|
10
|
-
* by reporting bugs
|
11
|
-
* by suggesting new features
|
12
|
-
* by writing or editing documentation
|
13
|
-
* by writing specifications
|
14
|
-
* by writing code (**no patch is too small**: fix typos, add comments, clean up
|
15
|
-
inconsistent whitespace)
|
16
|
-
* by refactoring code
|
17
|
-
* by fixing [issues][]
|
18
|
-
* by reviewing patches
|
19
|
-
|
20
|
-
[issues]: https://github.com/lostisland/faraday_middleware/issues
|
21
|
-
|
22
|
-
## Submitting an Issue
|
23
|
-
We use the [GitHub issue tracker][issues] to track bugs and features. Before
|
24
|
-
submitting a bug report or feature request, check to make sure it hasn't
|
25
|
-
already been submitted. When submitting a bug report, please include a [Gist][]
|
26
|
-
that includes a stack trace and any details that may be necessary to reproduce
|
27
|
-
the bug, including your gem version, Ruby version, and operating system.
|
28
|
-
Ideally, a bug report should include a pull request with failing specs.
|
29
|
-
|
30
|
-
[gist]: https://gist.github.com/
|
31
|
-
|
32
|
-
## Submitting a Pull Request
|
33
|
-
1. [Fork the repository.][fork]
|
34
|
-
2. [Create a topic branch.][branch]
|
35
|
-
3. Add specs for your unimplemented feature or bug fix.
|
36
|
-
4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
|
37
|
-
5. Implement your feature or bug fix.
|
38
|
-
6. Run `COVERAGE=true bundle exec rake spec`. If your specs fail, return to step 5.
|
39
|
-
7. Run `open coverage/index.html`. If your changes are not completely covered
|
40
|
-
by your tests, return to step 3.
|
41
|
-
8. Add, commit, and push your changes.
|
42
|
-
9. [Submit a pull request.][pr]
|
43
|
-
|
44
|
-
[fork]: http://help.github.com/fork-a-repo/
|
45
|
-
[branch]: http://learn.github.com/p/branching.html
|
46
|
-
[pr]: http://help.github.com/send-pull-requests/
|
data/faraday_middleware.gemspec
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'faraday_middleware/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.add_dependency 'faraday', ['>= 0.7.4', '< 0.10']
|
8
|
-
spec.add_development_dependency 'bundler', '~> 1.0'
|
9
|
-
spec.authors = ["Erik Michaels-Ober", "Wynn Netherland"]
|
10
|
-
spec.description = %q{Various middleware for Faraday}
|
11
|
-
spec.email = ['sferik@gmail.com', 'wynn.netherland@gmail.com']
|
12
|
-
spec.files = %w(CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md faraday_middleware.gemspec) + Dir['lib/**/*.rb']
|
13
|
-
spec.homepage = 'https://github.com/lostisland/faraday_middleware'
|
14
|
-
spec.licenses = ['MIT']
|
15
|
-
spec.name = 'faraday_middleware'
|
16
|
-
spec.require_paths = ['lib']
|
17
|
-
spec.required_rubygems_version = '>= 1.3.5'
|
18
|
-
spec.summary = spec.description
|
19
|
-
spec.version = FaradayMiddleware::VERSION
|
20
|
-
end
|