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.89.0.beta.20180328050040 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.88.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.88.0.beta.20180327050037 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.88.0.beta.20180325050025 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.88.0.beta.20180324050059 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.87.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.87.0.beta.20180323050014 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.87.0.beta.20180322050115 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.2 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.87.0.beta.20180321050017 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.1 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.87.0.beta.20180320050108 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0.beta.20180319050058 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0.beta.20180318050106 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0.beta.20180317050040 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0.beta.20180316050051 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0.beta.20180315050105 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0.beta.20180314050053 spaceship/lib/spaceship/helper/rels_middleware.rb
fastlane-2.86.0.beta.20180313050023 spaceship/lib/spaceship/helper/rels_middleware.rb