Sha256: cce2fadeaa59d3794b50b4c8489cf03e4bfeae5a0236e388849fc0ea2c5c3071

Contents?: true

Size: 574 Bytes

Versions: 661

Compression:

Stored size: 574 Bytes

Contents

module Faraday
  class Env
    attr_accessor :rels
  end
end

require 'faraday'

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

661 entries across 661 versions & 5 rubygems

Version Path
fastlane-2.132.0.beta.20190920200012 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190919200100 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190918200023 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190917200011 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190916200055 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190915200038 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190914200034 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190913200058 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.132.0.beta.20190912200052 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190911200010 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190910200104 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190909200058 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190908200041 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190907200030 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190906200026 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190905200113 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190904200040 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190903200013 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.131.0.beta.20190902200022 spaceship/lib/spaceship/helper/rels_middleware.rb