Sha256: cce2fadeaa59d3794b50b4c8489cf03e4bfeae5a0236e388849fc0ea2c5c3071

Contents?: true

Size: 574 Bytes

Versions: 660

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

660 entries across 660 versions & 5 rubygems

Version Path
fastlane-2.225.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.224.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.223.1 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.223.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.222.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.221.1 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.221.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.220.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.219.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.218.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-security-patched-2.216.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.217.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.216.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.215.1 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.215.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-mercafacil-2.214.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.214.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.213.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.212.2 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane_pricing_fix-2.212.1 spaceship/lib/spaceship/helper/rels_middleware.rb