diff --git a/CHANGELOG.md b/CHANGELOG.md index cb9e9dbb..e75ecd71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ master === +* Remove deprecated `request` instance * Remove old module-style extension support * Placed all `config.rb` evaluation inside the `ConfigContext` class diff --git a/middleman-core/features/current_page_request_path_backwards.feature b/middleman-core/features/current_page_request_path_backwards.feature deleted file mode 100644 index 41853e75..00000000 --- a/middleman-core/features/current_page_request_path_backwards.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Support old request.path object used by many extensions - - Scenario: Viewing the root path - Given the Server is running at "current-page-app" - When I go to "/request-path.html" - Then I should see "true" \ No newline at end of file diff --git a/middleman-core/features/request_params.feature b/middleman-core/features/request_params.feature deleted file mode 100644 index 968d0bfc..00000000 --- a/middleman-core/features/request_params.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Support request parameters - Scenario: Use request params in a template - Given the Server is running at "request-app" - When I go to "/index.html?say=Hello+World" - Then I should see "Quote Hello World" - Then I should see "Symbol Hello World" diff --git a/middleman-core/fixtures/current-page-app/config.rb b/middleman-core/fixtures/current-page-app/config.rb deleted file mode 100644 index dc0297e1..00000000 --- a/middleman-core/fixtures/current-page-app/config.rb +++ /dev/null @@ -1,3 +0,0 @@ -with_layout false do - page "/request-path.html" -end diff --git a/middleman-core/fixtures/current-page-app/source/request-path.html.erb b/middleman-core/fixtures/current-page-app/source/request-path.html.erb deleted file mode 100644 index cb134235..00000000 --- a/middleman-core/fixtures/current-page-app/source/request-path.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= current_path == request.path %> \ No newline at end of file diff --git a/middleman-core/fixtures/request-app/config.rb b/middleman-core/fixtures/request-app/config.rb deleted file mode 100644 index e69de29b..00000000 diff --git a/middleman-core/fixtures/request-app/source/index.html.erb b/middleman-core/fixtures/request-app/source/index.html.erb deleted file mode 100644 index f87a2bd9..00000000 --- a/middleman-core/fixtures/request-app/source/index.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -Dot <%= request.params.say %> -Quote <%= request.params["say"] %> -Symbol <%= request.params[:say] %> diff --git a/middleman-core/lib/middleman-core/core_extensions/request.rb b/middleman-core/lib/middleman-core/core_extensions/request.rb index 0447ff18..352dc557 100644 --- a/middleman-core/lib/middleman-core/core_extensions/request.rb +++ b/middleman-core/lib/middleman-core/core_extensions/request.rb @@ -151,10 +151,6 @@ module Middleman # Methods to be mixed-in to Middleman::Application module InstanceMethods - # Backwards-compatibility with old request.path signature - def request - Thread.current[:legacy_request] - end # Accessor for current path # @return [String] @@ -168,24 +164,11 @@ module Middleman # @return [void] def current_path=(path) Thread.current[:current_path] = path - Thread.current[:legacy_request] = ::Thor::CoreExt::HashWithIndifferentAccess.new({ - :path => path, - :params => req ? ::Thor::CoreExt::HashWithIndifferentAccess.new(req.params) : {} - }) end delegate :use, :to => :"self.class" delegate :map, :to => :"self.class" - # Rack request - # @return [Rack::Request] - def req - Thread.current[:req] - end - def req=(value) - Thread.current[:req] = value - end - def call(env) dup.call!(env) end @@ -195,7 +178,7 @@ module Middleman # @param env Rack environment def call!(env) # Store environment, request and response for later - self.req = req = ::Rack::Request.new(env) + req = ::Rack::Request.new(env) res = ::Rack::Response.new logger.debug "== Request: #{env["PATH_INFO"]}" @@ -253,7 +236,6 @@ module Middleman begin # Write out the contents of the page output = resource.render do - self.req = req self.current_path = current_path end