Sha256: f31e8f4f78509e834ab50e604967d43e8ace35c88425afaa11965841ad200fb3

Contents?: true

Size: 384 Bytes

Versions: 17

Compression:

Stored size: 384 Bytes

Contents

require 'rest-core/middleware'

class RestCore::DefaultSite
  def self.members; [:site]; end
  include RestCore::Middleware

  def call env, &k
    path = if env[REQUEST_PATH].to_s.include?('://')
             env[REQUEST_PATH]
           else
             File.join(site(env).to_s, env[REQUEST_PATH].to_s)
           end

    app.call(env.merge(REQUEST_PATH => path), &k)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rest-core-3.6.0 lib/rest-core/middleware/default_site.rb
rest-core-3.5.92 lib/rest-core/middleware/default_site.rb
rest-core-3.5.91 lib/rest-core/middleware/default_site.rb
rest-core-3.5.9 lib/rest-core/middleware/default_site.rb
rest-core-3.5.8 lib/rest-core/middleware/default_site.rb
rest-core-3.5.7 lib/rest-core/middleware/default_site.rb
rest-core-3.5.6 lib/rest-core/middleware/default_site.rb
rest-core-3.5.5 lib/rest-core/middleware/default_site.rb
rest-core-3.5.4 lib/rest-core/middleware/default_site.rb
rest-core-3.5.3 lib/rest-core/middleware/default_site.rb
rest-core-3.5.2 lib/rest-core/middleware/default_site.rb
rest-core-3.5.1 lib/rest-core/middleware/default_site.rb
rest-core-3.5.0 lib/rest-core/middleware/default_site.rb
rest-core-3.4.1 lib/rest-core/middleware/default_site.rb
rest-core-3.4.0 lib/rest-core/middleware/default_site.rb
rest-core-3.3.3 lib/rest-core/middleware/default_site.rb
rest-core-3.3.2 lib/rest-core/middleware/default_site.rb