Sha256: 7b75bea0350a10a1a064582ae6ee5f5019da868c8b50d6b32f226e74b09846eb

Contents?: true

Size: 555 Bytes

Versions: 117

Compression:

Stored size: 555 Bytes

Contents

module Faraday
  class Env
    attr_accessor :rels
  end
end

module FaradayMiddleware
  class RelsMiddleware < Faraday::Middleware
    def initialize(app, options = {})
      @app = app
      @options = options
    end

    def call(environment)
      @app.call(environment).on_complete do |env|
        links = (env.response_headers["Link"] || "").split(', ').map do |link|
          href, name = link.match(/<(.*?)>; rel="(\w+)"/).captures

          [name.to_sym, href]
        end

        env.rels = Hash[*links.flatten]
      end
    end
  end
end

Version data entries

117 entries across 117 versions & 1 rubygems

Version Path
fastlane-2.65.0.beta.20171107010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.64.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.64.0.beta.20171106010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.64.0.beta.20171105010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.64.0.beta.20171104010004 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.64.0.beta.20171103010004 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.64.0.beta.20171102010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.64.0.beta.20171101010004 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171031010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171030010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171029010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171028010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171027010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171026010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171025010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171024010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.62.1 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171023010003 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.63.0.beta.20171022010003 spaceship/lib/spaceship/helper/rels_middleware.rb