Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically wire up middleware for rails apps #27

Closed
SamSaffron opened this issue Apr 11, 2012 · 6 comments
Closed

Automatically wire up middleware for rails apps #27

SamSaffron opened this issue Apr 11, 2012 · 6 comments
Assignees

Comments

@SamSaffron
Copy link
Owner

When the gem is included in the Gemfile it should automatically wire up middleware so people don't need to muck with config, it should set it up so MP is enabled in debug but totally dormant in prd (unless a hook it added)

@ghost ghost assigned eviltrout Apr 11, 2012
@eviltrout
Copy link
Collaborator

Is this comment on the right issue? Because I fixed a bug with
instrumenting the render (other issue) and it seems to work for me!

On Fri, Apr 13, 2012 at 12:19 AM, Sam
reply@reply.github.com
wrote:

see: http://stackoverflow.com/questions/10135147/why-does-this-method-fail-to-instrument-actionviewtemplate-render


Reply to this email directly or view it on GitHub:
#27 (comment)

@SamSaffron
Copy link
Owner Author

oops, should not have asked that

getting a sane name seems to be quite challenging
x.instance_variable_get '@virtual_path'

seems to get us a bit of info ... but it is not enough

@SamSaffron
Copy link
Owner Author

oops apologies ... yeah my mistake my patch was not needed, though we still need to figure out a way of getting nice names for the partials etc

@SamSaffron
Copy link
Owner Author

k ... I think I got it working now for views ... still need to wire up rack middleware

eviltrout added a commit that referenced this issue Apr 13, 2012
@eviltrout
Copy link
Collaborator

Okay, this is working now in my Rails project automatically.

It defaults to off unless the environment is development.

I have added a configuration method so you can configure it in rails with an initializer since you don't have access to the constructor.

Here's an example from my project, where I want it visible in development and production:

# config/initializers/mini_profiler.rb
Rack::MiniProfiler.configuration[:authorize_cb] = lambda {|env| true }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants