faraday 0.12.0.1 → 0.12.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: 19aa1b9e26fa3eb2cd5fc8d670bb2b5064b6f706
4
- data.tar.gz: 344fb4a41a3210f73a35a4473a83c95730f9452e
3
+ metadata.gz: cbb31a41849c965d7f7afab1cdf77d26fb4abef3
4
+ data.tar.gz: 035b9e1a381df32a062208689d48d5f05ad91553
5
5
  SHA512:
6
- metadata.gz: 686c0cfc4afa288944cb02bc7881933ddc5028dea9cc80aba4cb5c835b65414de747cd3e354aa50cdeda7691aa93f3543fdb176642e51e7c50df8005d5ffad24
7
- data.tar.gz: af7ad744cf2b343b096de1f37a796f1dde183bc3c429b79ee885865925186da59927909d5fc5a308c2ad5a277867e3f1f08b1e0b1ee7bf314e1b3761056270b9
6
+ metadata.gz: e9a7ea04f7acf4b878d687ec1c3981563d82b76687e4f2e5e9b804f3bc1feb99c160c91b1807552fd1012406ece4b3fdb59cb421ecb890975a6d07971e71eab9
7
+ data.tar.gz: 15d8bfbf9bde53177db2b8c92e6b166cf19939138d9a6c4a662ffe1cd6f4e502c30fafa9c4e54e54aa88c37e49e013582fc96279f39e4e6630f30473623792a8
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2015 Rick Olson, Zack Hobson
1
+ Copyright (c) 2009-2017 Rick Olson, Zack Hobson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -140,6 +140,20 @@ The value of Faraday `params_encoder` can be any object that responds to:
140
140
  The encoder will affect both how query strings are processed and how POST bodies
141
141
  get serialized. The default encoder is Faraday::NestedParamsEncoder.
142
142
 
143
+ ## Authentication
144
+
145
+ Basic and Token authentication are handled by Faraday::Request::BasicAuthentication and Faraday::Request::TokenAuthentication respectively. These can be added as middleware manually or through the helper methods.
146
+
147
+ ```ruby
148
+ Faraday.new(...) do |conn|
149
+ conn.basic_auth('username', 'password')
150
+ end
151
+
152
+ Faraday.new(...) do |conn|
153
+ conn.token_auth('authentication-token')
154
+ end
155
+ ```
156
+
143
157
  ## Advanced middleware usage
144
158
 
145
159
  The order in which middleware is stacked is important. Like with Rack, the
@@ -325,7 +339,7 @@ of a major release, support for that Ruby version may be dropped.
325
339
 
326
340
  ## Copyright
327
341
 
328
- Copyright (c) 2009-2013 [Rick Olson](mailto:technoweenie@gmail.com), Zack Hobson.
342
+ Copyright (c) 2009-2017 [Rick Olson](mailto:technoweenie@gmail.com), Zack Hobson.
329
343
  See [LICENSE][] for details.
330
344
 
331
345
  [net_http]: http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/Net/HTTP.html
@@ -14,7 +14,7 @@ require 'forwardable'
14
14
  # conn.get '/'
15
15
  #
16
16
  module Faraday
17
- VERSION = "0.12.0.1"
17
+ VERSION = "0.12.1"
18
18
 
19
19
  class << self
20
20
  # Public: Gets or sets the root path that Faraday is being loaded from.
@@ -3,7 +3,7 @@ module Faraday
3
3
  class MissingDependency < Error; end
4
4
 
5
5
  class ClientError < Error
6
- attr_reader :response
6
+ attr_reader :response, :wrapped_exception
7
7
 
8
8
  def initialize(ex, response = nil)
9
9
  @wrapped_exception = nil
@@ -151,8 +151,9 @@ module Faraday
151
151
  @options.methods.include?(env[:method]) || @options.retry_if.call(env, exception)
152
152
  end
153
153
 
154
- def rewind_files(env)
155
- env && env.each do |_, value|
154
+ def rewind_files(body)
155
+ return unless body.is_a?(Hash)
156
+ body.each do |_, value|
156
157
  if value.is_a? UploadIO
157
158
  value.rewind
158
159
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0.1
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Olson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-02 00:00:00.000000000 Z
11
+ date: 2017-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post