faraday-sunset 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -12
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a4675801498e8f952508acc69b12825f110e1a7
|
4
|
+
data.tar.gz: bbb3c14239abbb25c0c24f67f2776d8e1d1b69e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae1f5afed75ae1d006fdec6e9dfb2deb2d5a49cce5993c778e9f12dc29246ab215b8d6f28c36075c82cde1dea3414836748eae5bed5dc48543f75e2679413c09
|
7
|
+
data.tar.gz: ebdbb6af58e65b1154acec7e0afc39c10ad33b3faee4b637fccc19d9846000f8e5098bab3f9ad64160cf2d04212e4e2072e24833c8bda6fc4a8a1c7be16491cb
|
data/README.md
CHANGED
@@ -4,7 +4,24 @@
|
|
4
4
|
[![Coverage Status][coveralls-image]][coveralls-url]
|
5
5
|
[![MIT License][license-image]][license-url]
|
6
6
|
|
7
|
-
Watch out for
|
7
|
+
Watch out for HTTP responses declaring their end of life, using the Sunset header to signal deprecation (and eventual removal) of an endpoint.
|
8
|
+
|
9
|
+
[Sunset][sunset-draft] is an in-development HTTP response header. Check out [GitHub][sunset-github] for issues and discussion around it's development.
|
10
|
+
|
11
|
+
> This specification defines the Sunset HTTP response header field, which indicates that a URI is likely to become unresponsive at a specified point in the future.
|
12
|
+
|
13
|
+
[sunset-draft]: https://tools.ietf.org/html/draft-wilde-sunset-header-03
|
14
|
+
[sunset-github]: https://github.com/dret/I-D/tree/master/sunset-header
|
15
|
+
|
16
|
+
The header we're sniffing for looks a little like this:
|
17
|
+
|
18
|
+
```
|
19
|
+
Sunset: Sat, 31 Dec 2018 23:59:59 GMT
|
20
|
+
```
|
21
|
+
|
22
|
+
So long as the server being called is inserting a `Sunset` header to the response with a [HTTP date], this client-side code will do stuff.
|
23
|
+
|
24
|
+
[HTTP date]: https://tools.ietf.org/html/rfc7231#section-7.1.1.1
|
8
25
|
|
9
26
|
## Usage
|
10
27
|
|
@@ -17,41 +34,48 @@ gem 'faraday-sunset'
|
|
17
34
|
Enabling Sunset detection is as simple as referencing the middleware in your Faraday connection block:
|
18
35
|
|
19
36
|
``` ruby
|
20
|
-
connection = Faraday
|
37
|
+
connection = Faraday.new(url: '...') do |conn|
|
21
38
|
conn.response :sunset, active_support: true
|
22
39
|
# or
|
23
40
|
conn.response :sunset, logger: Rails.logger
|
24
41
|
end
|
25
42
|
```
|
26
43
|
|
27
|
-
You can [configure `ActiveSupport::Deprecation`]
|
44
|
+
You can [configure `ActiveSupport::Deprecation`][active-support-deprecation] to warn in a few different ways, or pass in any object that acts a bit like a Rack logger, Rails logger, or anything with a `warn` method that takes a string.
|
45
|
+
|
46
|
+
[active-support-deprecation]: http://api.rubyonrails.org/classes/ActiveSupport/Deprecation/Behavior.html
|
28
47
|
|
29
48
|
## Requirements
|
30
49
|
|
31
|
-
- **Ruby:** v2.2 - v2.
|
32
|
-
- **Faraday:** v0.
|
50
|
+
- **Ruby:** v2.2 - v2.5
|
51
|
+
- **Faraday:** v0.9 - v0.14
|
52
|
+
|
53
|
+
## Related Projects
|
54
|
+
|
55
|
+
- [rails-sunset](https://github.com/wework/rails-sunset) - Mark your endpoints as deprecated the Railsy way
|
56
|
+
- [guzzle-sunset](https://github.com/hskrasek/guzzle-sunset) - Sniff for deprecations with popular PHP client Guzzle
|
33
57
|
|
34
58
|
## TODO
|
35
59
|
|
36
|
-
- [ ] Surface `Link` with rel=sunset as per Sunset RFC draft
|
60
|
+
- [ ] Surface `Link` with rel=sunset as per Sunset RFC draft 04?
|
37
61
|
|
38
62
|
## Testing
|
39
63
|
|
40
64
|
To run tests and modify locally, you'll want to `bundle install` in this directory.
|
41
65
|
|
42
66
|
```
|
43
|
-
bundle exec rspec
|
67
|
+
bundle exec appraisal rspec
|
44
68
|
```
|
45
69
|
|
46
70
|
## Contributing
|
47
71
|
|
48
|
-
Bug reports and pull requests are welcome on GitHub at [
|
72
|
+
Bug reports and pull requests are welcome on GitHub at [wework/faraday-sunset](https://github.com/wework/faraday-sunset). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
49
73
|
|
50
|
-
[coveralls-image]:https://coveralls.io/repos/github/
|
51
|
-
[coveralls-url]:https://coveralls.io/github/
|
74
|
+
[coveralls-image]:https://coveralls.io/repos/github/wework/faraday-sunset/badge.svg?branch=master
|
75
|
+
[coveralls-url]:https://coveralls.io/github/wework/faraday-sunset?branch=master
|
52
76
|
|
53
|
-
[travis-url]:https://travis-ci.org/
|
54
|
-
[travis-image]: https://travis-ci.org/
|
77
|
+
[travis-url]:https://travis-ci.org/wework/faraday-sunset
|
78
|
+
[travis-image]: https://travis-ci.org/wework/faraday-sunset.svg?branch=master
|
55
79
|
|
56
80
|
[license-url]: LICENSE
|
57
81
|
[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-sunset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Sturgeon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 0.9.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 0.9.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: appraisal
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.6.
|
148
|
+
rubygems_version: 2.6.11
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: Automatically detect deprecated HTTP endpoints
|