Sha256: 614c19181173b843e12bc02e41e47dcb704f16b6151f14a27258e1f5ca2a499a

Contents?: true

Size: 500 Bytes

Versions: 4

Compression:

Stored size: 500 Bytes

Contents

module Mascot
  module Extensions
    # Removes the file extension from the file so that /hi/there/fun.html can be
    # resolved via /hi/there/fun.
    class RailsRequestPaths
      def process_resources(resources)
        resources.each do |r|
          r.request_path = self.class.format_path r.request_path
        end
      end

      def self.format_path(request_path)
        File.join(File.dirname(File.join("/", request_path)), File.basename(request_path, ".*"))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mascot-rails-0.1.11 lib/mascot/extensions/rails_request_paths.rb
mascot-rails-0.1.10 lib/mascot/extensions/rails_request_paths.rb
mascot-rails-0.1.9 lib/mascot/extensions/rails_request_paths.rb
mascot-rails-0.1.8 lib/mascot/extensions/rails_request_paths.rb