Skip to content

Instantly share code, notes, and snippets.

@dhollinger
Created August 31, 2020 15:07
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 dhollinger/86689ef75ad3fdb10241cf58d01088ce to your computer and use it in GitHub Desktop.
Save dhollinger/86689ef75ad3fdb10241cf58d01088ce to your computer and use it in GitHub Desktop.
From: /home/dhollinger/workspace/ruby/puppet_webhook/app/controllers/application_controller.rb:47 :
42: @auth.credentials == [APP_CONFIG.user, APP_CONFIG.pass]
43: end
44:
45: require 'pry'; binding.pry
46:
=> 47: def normalize(allow_upper, str)
48: allow_upper ? str : str.downcase
49: end
50:
51: def notification(message)
52: return unless APP_CONFIG.chatops || APP_CONFIG.slack_webhook
[1] pry(ApplicationController)> allow_upper = flase
NameError: undefined local variable or method `flase' for ApplicationController:Class
Did you mean? false
from (pry):1:in `<class:ApplicationController>'
[2] pry(ApplicationController)> allow_upper = false
=> false
[3] pry(ApplicationController)> str = FooBar
NameError: uninitialized constant ApplicationController::FooBar
from (pry):3:in `<class:ApplicationController>'
[4] pry(ApplicationController)> str = "FooBar"
=> "FooBar"
[5] pry(ApplicationController)> normalize
NameError: undefined local variable or method `normalize' for ApplicationController:Class
from (pry):5:in `<class:ApplicationController>'
[6] pry(ApplicationController)> allow_upper ? str : str.downcase
=> "foobar"
[7] pry(ApplicationController)> str = ""
=> ""
[8] pry(ApplicationController)> allow_upper ? str : str.downcase
=> ""
[9] pry(ApplicationController)> str = nil
=> nil
[10] pry(ApplicationController)> allow_upper ? str : str.downcase
NoMethodError: undefined method `downcase' for nil:NilClass
from (pry):10:in `<class:ApplicationController>'
[11] pry(ApplicationController)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment