faraday_middleware 0.10.0 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2434c5fb11c290e271ebba1748a43ae5d320735e
4
- data.tar.gz: e0bf3f73a45c469e8e2908ba102586299adb76b2
3
+ metadata.gz: 19207ab27ddadf4621b943f32e3ee0a54ebbe0f4
4
+ data.tar.gz: 17df1b80453f02f7218052cdac77f477efe3f99d
5
5
  SHA512:
6
- metadata.gz: fcbbc5d1571c285bee8124873a91278ee3ce26eab0a7e6b5a08bf4c9a22cef8f7bd9ce13e29dc308f0c7f7537720b373a3ed4334141a009b7c971ba80f9cea92
7
- data.tar.gz: acc1a19eb83cce409d3b7586714fd787b1830e7f03e222b688d9ad5a52b41ab0a142fdc1406cb8a0d6e89afc1b5bc0915c681394f16ec8d44d88eb468dc15bbc
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 = @app.call(env)
82
- if CACHEABLE_STATUS_CODES.include?(response.status)
83
- response.on_complete { cache.write(key, response) }
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
@@ -1,3 +1,3 @@
1
1
  module FaradayMiddleware
2
- VERSION = "0.10.0" unless defined?(FaradayMiddleware::VERSION)
2
+ VERSION = "0.10.1" unless defined?(FaradayMiddleware::VERSION)
3
3
  end
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.0
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: 2015-07-07 00:00:00.000000000 Z
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.10'
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
- type: :development
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: 1.3.5
83
+ version: '0'
101
84
  requirements: []
102
85
  rubyforge_project:
103
- rubygems_version: 2.2.2
86
+ rubygems_version: 2.4.5
104
87
  signing_key:
105
88
  specification_version: 4
106
89
  summary: Various middleware for Faraday
@@ -1,10 +0,0 @@
1
- # Changelog
2
-
3
- ### 0.0.2 September 25, 2010
4
-
5
- * Mashify now handles arrays of non-hashes
6
-
7
- ### 0.0.1 June 27, 2010
8
-
9
- * MultiJSON
10
- * Mashify
@@ -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/
@@ -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