Module: Faraday
- Defined in:
 - lib/puppet/feature/faraday.rb,
lib/puppet/feature/faraday/error.rb,
lib/puppet/feature/faraday/utils.rb,
lib/puppet/feature/faraday/adapter.rb,
lib/puppet/feature/faraday/options.rb,
lib/puppet/feature/faraday/request.rb,
lib/puppet/feature/faraday/autoload.rb,
lib/puppet/feature/faraday/response.rb,
lib/puppet/feature/faraday/upload_io.rb,
lib/puppet/feature/faraday/connection.rb,
lib/puppet/feature/faraday/middleware.rb,
lib/puppet/feature/faraday/parameters.rb,
lib/puppet/feature/faraday/adapter/rack.rb,
lib/puppet/feature/faraday/adapter/test.rb,
lib/puppet/feature/faraday/rack_builder.rb,
lib/puppet/feature/faraday/adapter/excon.rb,
lib/puppet/feature/faraday/request/retry.rb,
lib/puppet/feature/faraday/adapter/patron.rb,
lib/puppet/feature/faraday/adapter/em_http.rb,
lib/puppet/feature/faraday/response/logger.rb,
lib/puppet/feature/faraday/adapter/net_http.rb,
lib/puppet/feature/faraday/adapter/typhoeus.rb,
lib/puppet/feature/faraday/request/multipart.rb,
lib/puppet/feature/faraday/adapter/httpclient.rb,
lib/puppet/feature/faraday/request/url_encoded.rb,
lib/puppet/feature/faraday/adapter/em_synchrony.rb,
lib/puppet/feature/faraday/response/raise_error.rb,
lib/puppet/feature/faraday/request/authorization.rb,
lib/puppet/feature/faraday/request/instrumentation.rb,
lib/puppet/feature/faraday/adapter/net_http_persistent.rb,
lib/puppet/feature/faraday/request/basic_authentication.rb,
lib/puppet/feature/faraday/request/token_authentication.rb,
lib/puppet/feature/faraday/adapter/em_synchrony/parallel_manager.rb 
Overview
Rely on autoloading instead of explicit require; helps avoid the “already initialized constant” warning on Ruby 1.8.7 when NetHttp is refereced below. require ‘faraday/adapter/net_http’
Defined Under Namespace
Modules: AutoloadHelper, FlatParamsEncoder, MiddlewareRegistry, NestedParamsEncoder, Utils Classes: Adapter, ClientError, CompositeReadIO, Connection, ConnectionFailed, ConnectionOptions, Env, Error, Middleware, MissingDependency, Options, ParsingError, ProxyOptions, RackBuilder, Request, RequestOptions, ResourceNotFound, Response, SSLError, SSLOptions, TimeoutError
Constant Summary collapse
Class Attribute Summary collapse
- 
  
    
      .default_adapter  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Public: Gets or sets the Symbol key identifying a default Adapter to use for the default Faraday::Connection.
 - 
  
    
      .default_connection  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Gets the default connection used for simple scripts.
 - 
  
    
      .default_connection_options  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Gets the default connection options used when calling Faraday#new.
 - 
  
    
      .lib_path  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Public: Gets or sets the path that the Faraday libs are loaded from.
 - 
  
    
      .root_path  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Public: Gets or sets the root path that Faraday is being loaded from.
 
Class Method Summary collapse
- .const_missing(name) ⇒ Object
 - 
  
    
      .new(url = nil, options = nil)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Public: Initializes a new Faraday::Connection.
 - 
  
    
      .require_libs(*libs)  ⇒ Object 
    
    
      (also: require_lib)
    
  
  
  
  
  
  
  
  
  
    
Internal: Requires internal Faraday libraries.
 
Class Attribute Details
.default_adapter ⇒ Object
Public: Gets or sets the Symbol key identifying a default Adapter to use for the default Faraday::Connection.
      29 30 31  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 29 def default_adapter @default_adapter end  | 
  
.default_connection ⇒ Object
Gets the default connection used for simple scripts.
Returns a Faraday::Connection, configured with the #default_adapter.
      110 111 112  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 110 def self.default_connection @default_connection ||= Connection.new end  | 
  
.default_connection_options ⇒ Object
Gets the default connection options used when calling Faraday#new.
Returns a Faraday::ConnectionOptions.
      117 118 119  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 117 def self. @default_connection_options ||= ConnectionOptions.new end  | 
  
.lib_path ⇒ Object
Public: Gets or sets the path that the Faraday libs are loaded from.
      25 26 27  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 25 def lib_path @lib_path end  | 
  
.root_path ⇒ Object
Public: Gets or sets the root path that Faraday is being loaded from. This is the root from where the libraries are auto-loaded from.
      22 23 24  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 22 def root_path @root_path end  | 
  
Class Method Details
.const_missing(name) ⇒ Object
      231 232 233 234 235 236 237 238  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 231 def self.const_missing(name) if name.to_sym == :Builder warn "Faraday::Builder is now Faraday::RackBuilder." const_set name, RackBuilder else super end end  | 
  
.new(url = nil, options = nil) ⇒ Object
Public: Initializes a new Faraday::Connection.
url - The optional String base URL to use as a prefix for all
requests.  Can also be the options Hash.
options - The optional Hash used to configure this Faraday::Connection.
Any of these values will be set on every request made, unless
overridden for a specific request.
:url     - String base URL.
:params  - Hash of URI query unencoded key/value pairs.
:headers - Hash of unencoded HTTP header key/value pairs.
:request - Hash of request options.
:ssl     - Hash of SSL options.
:proxy   - Hash of Proxy options.
Examples
Faraday.new 'http://faraday.com'
# http://faraday.com?page=1
Faraday.new 'http://faraday.com', :params => {:page => 1}
# same
Faraday.new :url => 'http://faraday.com',
  :params => {:page => 1}
Returns a Faraday::Connection.
      67 68 69 70 71  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 67 def new(url = nil, = nil) block = block_given? ? Proc.new : nil = ? .merge() : .dup Faraday::Connection.new(url, , &block) end  | 
  
.require_libs(*libs) ⇒ Object Also known as: require_lib
Internal: Requires internal Faraday libraries.
*libs - One or more relative String names to Faraday classes.
Returns nothing.
      78 79 80 81 82  | 
    
      # File 'lib/puppet/feature/faraday.rb', line 78 def require_libs(*libs) libs.each do |lib| require "#{lib_path}/#{lib}" end end  |