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.129.0.beta.20190723200012 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190722200021 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190721200024 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190720200049 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane_iac_publish-0.1.5 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.127.2 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190719200019 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190718200101 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190717200026 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190716200022 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190715200056 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190714200028 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190713200107 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190712200059 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190711200117 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.127.1 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.128.0.beta.20190710200106 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.127.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.127.0.beta.20190709200015 spaceship/lib/spaceship/helper/rels_middleware.rb