Sha256: 9999f9a6d85dcb36f4faed8ff79e660a9c7f28260ff1cf00f31d7eba5af62cbe

Contents?: true

Size: 648 Bytes

Versions: 27

Compression:

Stored size: 648 Bytes

Contents

# frozen_string_literal: true

module Proscenium
  class Middleware
    # Provides a way to render files outside of the Rails root during non-production. This is
    # primarily to support linked NPM modules, for example when using `pnpm link ...`.
    class OutsideRoot < Esbuild
      private

      # @override [Esbuild] reassigns root to '/'.
      def renderable?
        old_root = root
        @root = Pathname.new('/')

        super
      ensure
        @root = old_root
      end

      # @override [Esbuild] does not remove leading slash, ensuring it is an absolute path.
      def path
        @request.path
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
proscenium-0.6.0-arm64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.6.0-x86_64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.6.0-x86_64-linux lib/proscenium/middleware/outside_root.rb
proscenium-0.5.1-arm64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.5.1-x86_64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.5.1-x86_64-linux lib/proscenium/middleware/outside_root.rb
proscenium-0.5.0-arm64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.5.0-x86_64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.5.0-x86_64-linux lib/proscenium/middleware/outside_root.rb
proscenium-0.4.2-arm64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.4.2-x86_64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.4.2-x86_64-linux lib/proscenium/middleware/outside_root.rb
proscenium-0.4.1-arm64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.4.1-x86_64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.4.1-x86_64-linux lib/proscenium/middleware/outside_root.rb
proscenium-0.4.0-arm64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.4.0-x86_64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.4.0-x86_64-linux lib/proscenium/middleware/outside_root.rb
proscenium-0.3.0-arm64-darwin lib/proscenium/middleware/outside_root.rb
proscenium-0.3.0-x86_64-darwin lib/proscenium/middleware/outside_root.rb