Class: Pry
- Inherits:
-
Object
- Object
- Pry
- Defined in:
- lib/pry-syntax-hacks.rb
Instance Method Summary collapse
Instance Method Details
#old_retrieve_line ⇒ Object
2 |
# File 'lib/pry-syntax-hacks.rb', line 2 alias_method :old_retrieve_line, :retrieve_line |
#retrieve_line(*args) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/pry-syntax-hacks.rb', line 4 def retrieve_line(*args) val = old_retrieve_line(*args) val.gsub(/\.(@[a-z0-9_]+)/, '.instance_variable_get("\1")'). gsub(/\.:([a-z0-9_]+[?!]?)/, '.method(:\1)'). gsub(/\.!([a-z0-9_]+[?!]?)([ \(])(?=(.*))/) { ".send#{$2}:#{$1}#{$3 == ""?"":","}" } end |