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.92.0.beta.20180414050023 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.91.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.91.0.beta.20180413050017 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180412050111 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180411050056 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180410050128 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180409050033 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180408050113 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180407050037 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180406050006 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180405050125 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180404050031 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.90.0.beta.20180403050108 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.89.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.89.0.beta.20180402050042 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.89.0.beta.20180401050120 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.89.0.beta.20180331050023 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.89.0.beta.20180330050046 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.89.0.beta.20180329050050 spaceship/lib/spaceship/helper/rels_middleware.rb