middleman/middleman — Issue #288: Strange behaviour using the :before hook and setting variables
Author: jmulder
Created: 2012-02-27 15:17:37+00:00
State: open

```ruby
module Middleman::Extensions
module PageMetaData
class << self
def registered (app)
app.before do
app.set :currently_requested_path, request.path
true
end
end
alias :included :registered
end
end
register :page_meta_data, PageMetaData
end

activate :page_meta_data
```

Displaying the value of `currently_requested_path` in a template shows a value of the _previous_ request. Seems to make no difference when I set it through `app.set` or by setting a global variable.

Above is in the `config.rb` (as a test). Am I doing something wrong or is there some order of execution not completely right?