-
-
Save banister/3995162 to your computer and use it in GitHub Desktop.
Run last line when enter is pressed in pry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[12] pry(main)> Pry.commands.block_command /^$/, "blah" do | |
| run "history --replay -1" | |
| end | |
=> #<class(Pry::Command /^$/)> | |
[13] pry(main)> 3 | |
=> 3 | |
[14] pry(main)> | |
=> 3 | |
[16] pry(main)> ls | |
self.methods: include private public to_s | |
locals: _ __ _dir_ _ex_ _file_ _in_ _out_ _pry_ _super | |
[17] pry(main)> | |
self.methods: include private public to_s | |
locals: _ __ _dir_ _ex_ _file_ _in_ _out_ _pry_ _super | |
[19] pry(main)> $ pry | |
From: /Users/johnmair/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/core_extensions.rb @ line 41: | |
Number of lines: 7 | |
Owner: Object | |
Visibility: public | |
def pry(object=nil, hash={}) | |
if object.nil? || Hash === object | |
Pry.start(self, object || {}) | |
else | |
Pry.start(object, hash) | |
end | |
end | |
[20] pry(main)> | |
From: /Users/johnmair/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/core_extensions.rb @ line 41: | |
Number of lines: 7 | |
Owner: Object | |
Visibility: public | |
def pry(object=nil, hash={}) | |
if object.nil? || Hash === object | |
Pry.start(self, object || {}) | |
else | |
Pry.start(object, hash) | |
end | |
end | |
[22] pry(main)> | |
From: /Users/johnmair/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/core_extensions.rb @ line 41: | |
Number of lines: 7 | |
Owner: Object | |
Visibility: public | |
def pry(object=nil, hash={}) | |
if object.nil? || Hash === object | |
Pry.start(self, object || {}) | |
else | |
Pry.start(object, hash) | |
end | |
end | |
[24] pry(main)> def hello | |
| puts "hi" | |
| | |
| show-input | |
1: def hello | |
2: puts "hi" | |
3: puts "hi" | |
| end | |
=> nil | |
[25] pry(main)> hello | |
hi | |
hi | |
=> nil | |
[26] pry(main)> | |
hi | |
hi | |
=> nil | |
[28] pry(main)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment