pry 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 27/1/2010 version 0.4.5
2
+ * fixed show_method (though fragile as it references __binding_impl__
3
+ directly, making a name change to that method difficult
1
4
  27/1/2010 version 0.4.4
2
5
  * oops, added examples/ directory
3
6
  26/1/2010 version 0.4.3
@@ -76,18 +76,22 @@ class Pry
76
76
  end
77
77
 
78
78
  command "show_method", "Show sourcecode for method <methname>." do |meth_name|
79
- if meth_name
80
- meth_name = target.eval("__method__").to_s if !meth_name
81
- doc = target.eval("method(\"#{meth_name}\")").source
82
- output.puts doc
83
- else
84
- output.puts "Error: Not in a method."
79
+ context_meth_name = target.eval("__method__")
80
+ meth_name = context_meth_name if !meth_name
81
+
82
+ # fragile as it hard-codes in the __binding_impl__ method name
83
+ # from core_extensions.rb
84
+ if meth_name && meth_name != :__binding_impl__
85
+ code = target.eval("method(\"#{meth_name.to_s}\")").source
86
+ output.puts code
87
+ next
85
88
  end
89
+ output.puts "Error: Not in a method."
86
90
  end
87
91
 
88
92
  command "show_imethod", "Show sourcecode for instance method <methname>." do |meth_name|
89
- doc = target.eval("instance_method(\"#{meth_name}\")").source
90
- output.puts doc
93
+ code = target.eval("instance_method(\"#{meth_name}\")").source
94
+ output.puts code
91
95
  end
92
96
 
93
97
  command "jump_to", "Jump to a Pry session further up the stack, exiting all sessions below." do |break_level|
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 4
9
- version: 0.4.4
8
+ - 5
9
+ version: 0.4.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Mair (banisterfiend)