Skip to content

Instantly share code, notes, and snippets.

@czarneckid
Created August 23, 2011 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czarneckid/1166184 to your computer and use it in GitHub Desktop.
Save czarneckid/1166184 to your computer and use it in GitHub Desktop.
Enable warnings in irb as well using -W
dczarnecki-agora:~ dczarnecki$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
dczarnecki-agora:~ dczarnecki$ irb -W
ruby-1.9.2-p180 :001 > def hello
ruby-1.9.2-p180 :002?> p 'world'
ruby-1.9.2-p180 :003?> end
=> nil
ruby-1.9.2-p180 :004 > hello
"world"
=> "world"
ruby-1.9.2-p180 :005 > def hello
ruby-1.9.2-p180 :006?> p 'hello world'
ruby-1.9.2-p180 :007?> end
(irb):5: warning: method redefined; discarding old hello
(irb):1: warning: previous definition of hello was here
=> nil
ruby-1.9.2-p180 :008 > hello
"hello world"
=> "hello world"
ruby-1.9.2-p180 :009 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment