Sha256: aec63b770d092df2046662aadd5631706e1a346a1d6429e1847f144483a224c8

Contents?: true

Size: 366 Bytes

Versions: 10

Compression:

Stored size: 366 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] =~ /[.]xml([?].*)?$/)
          env[key].gsub!(/^\/#{@rootpath}/, "")
        end
      end
      @app.call(env)
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ixtlan-0.4.3 lib/ixtlan/child_path.rb
ixtlan-0.4.2 lib/ixtlan/child_path.rb
ixtlan-0.4.1 lib/ixtlan/child_path.rb
ixtlan-0.4.0 lib/ixtlan/child_path.rb
ixtlan-0.4.0.pre5 lib/ixtlan/child_path.rb
ixtlan-0.4.0.pre4 lib/ixtlan/child_path.rb
ixtlan-0.4.0.pre3 lib/ixtlan/child_path.rb
ixtlan-0.4.0.pre2 lib/ixtlan/child_path.rb
ixtlan-0.4.0.pre lib/ixtlan/child_path.rb
ixtlan-0.3.0 lib/ixtlan/child_path.rb