faraday 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6ed59b880f0d605e4efc8ce513ced0b4688c4ef
4
- data.tar.gz: 21d3a0326416db1e19add553b8d5c0ef1c5a3b50
3
+ metadata.gz: cbb31a41849c965d7f7afab1cdf77d26fb4abef3
4
+ data.tar.gz: 035b9e1a381df32a062208689d48d5f05ad91553
5
5
  SHA512:
6
- metadata.gz: 9e882a5072cc36a986e8fc2f23f0563755bae2d0c4e6fed4adc51a6fd46b449ea6be3dd189662ea0aa4f427c5402969bfb0ad626c837e9bad68d06aa0a3cc6d3
7
- data.tar.gz: 63856c35cbcceda6abeb3dc076574d7e880343e8ee7af5e80971c08637a647a079433b1220161c24871d3718c268d018ebdce009ca46d89c4da7c059fdaeaf72
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
data/lib/faraday/error.rb CHANGED
@@ -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
data/lib/faraday.rb CHANGED
@@ -14,7 +14,7 @@ require 'forwardable'
14
14
  # conn.get '/'
15
15
  #
16
16
  module Faraday
17
- VERSION = "0.12.0"
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.
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
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-01 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