Sha256: 7e29c4fbc75b8f3a9ba0f54316e8e6ad842d91c1d7c816c3749c8cdb955d2986

Contents?: true

Size: 367 Bytes

Versions: 5

Compression:

Stored size: 367 Bytes

Contents

module Ixtlan
  class ChildPath
    def initialize(app, rootpath)
      @app = app
      @rootpath = rootpath
    end

    def call(env)
      ['REQUEST_PATH','PATH_INFO','REQUEST_URI','SCRIPT_NAME'].each do |key|
        if(env[key] =~ /[.]json([?].*)?$/)
          env[key].gsub!(/^\/#{@rootpath}/, "")
        end
      end
      @app.call(env)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
resty-generators-0.7.3 lib/resty/child_path.rb~
resty-generators-0.7.2 lib/resty/child_path.rb~
resty-generators-0.7.1 lib/resty/child_path.rb~
resty-generators-0.7.0 lib/resty/child_path.rb~
resty-generators-0.6.0 lib/resty/child_path.rb~