Warning for instance variable. #132

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

I noticed that while running the tests in rails3 there are warnings. instance variable @mute not initialized. Hope i didn't broke anything.
Added defined? @mute to get rid of "instance variable @mute not initialized" when running rails3 railties tests.

Added defined? @mute to get rid of "instance variable @mute not initi…
…alized" when running rails3 railties tests.

elmar commented Jun 9, 2011

I was tripped by this too and it turns out I had the environment variable RUBYOPT="-w" set. I was puzzled when I wanted to reproduce this bug in a clean install on a test account. The clean test account showed no warnings while my regular development account showed many.

I hope this comment helps people if they want to reproduce such bug reports.

The fix is probably worthwile anyway but it may be better to add @mute = nil to Thor::Shell::Basic#initialize

Owner

wycats commented Nov 21, 2011

I prefer @elmar's solution here.

Contributor

rohit commented Mar 18, 2012

Why can't it be ―

  def mute?
    @mute ||= false
  end

That will avoid the warning AFAIK and will give the same result right? If things are good as it is then maybe this pull request can be closed. :)

Owner

wycats commented Mar 18, 2012

@rohit want to submit a pull request for this? I'm closing this one as I like your solution.

@wycats wycats closed this Mar 18, 2012

Contributor

rohit commented Mar 18, 2012

sferik added a commit that referenced this pull request Jun 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment