davejacobs / letters

A tiny debugging library for Ruby
Other
271 stars 9 forks source link

How do I restrict the letters library to just my development environment? #17

Closed marcamillion closed 11 years ago

marcamillion commented 11 years ago

I tried this in my application.rb

if defined?(Bundler) Bundler.require(*Rails.groups(:assets => %w(development test))) require "letters/patch/rails"(*Rails.groups(:assets => %w(development test))) end

But that threw an error on Heroku.

Any thoughts on how I might get this to not conflict with Heroku, but not force me to comment out when I am pushing to Heroku?

Thanks!

davejacobs commented 11 years ago

I'm going to think about this. When you say you don't want to comment out Letters, do you mean the inline calls or the requirement? For example, would it be acceptable to come up with a Rails-aware gem that disables side effects for all methods in production?

marcamillion commented 11 years ago

I had to comment out both the require call in application.rb and all the uses of letters methods in my code before pushing to production.

It would be very acceptable to come up with a Rails-aware gem that disables side effects for all methods in production. Most definitely.

Marc Gayle www.marcgayle.com www.twitter.com/marcgayle

On Fri, Nov 30, 2012 at 7:45 PM, David Jacobs notifications@github.comwrote:

I'm going to think about this. When you say you don't want to comment out Letters, do you mean the inline calls or the requirement? For example, would it be acceptable to come up with a Rails-aware gem that disables side effects for all methods in production?

— Reply to this email directly or view it on GitHubhttps://github.com/davejacobs/letters/issues/17#issuecomment-10910082.

davejacobs commented 11 years ago

This should be fixed!

Try out the following to disable Letters in whatever environment you choose:

    Letters.config do
      all :disable => true
    end

And yeah, sorry for the long delay. I'm back in action supporting this library.