README.md in read_source-0.2.0 vs README.md in read_source-0.2.1
- old
+ new
@@ -26,12 +26,14 @@
## Usage
This gem adds instance methods to the Method and UnboundMethod objects.
* `Method#vim`
+* `Method#attr?`
* `Method#read_source`
* `UnboundMethod#vim`
+* `UnboundMethod#attr?`
* `UnboundMethod#read_source`
Currently this assumes VIM is in your executable path. Future versions of this gem will be more
accommodating to where VIM may be.
@@ -42,14 +44,20 @@
puts Pathname.instance_method(:root?).read_source
#def root?
# !!(chop_basename(@path) == nil && /#{SEPARATOR_PAT}/o =~ @path)
#end
+Pathname.instance_method(:root?).attr?
+# => nil
+
require 'prime'
puts Integer.method(:each_prime).read_source
#def Integer.each_prime(ubound, &block) # :yields: prime
# Prime.each(ubound, &block)
#end
+
+Gem::BasicSpecification.instance_method(:base_dir=).attr?
+# => :attr_writer
```
You can type `vim` instead of the `read_source` method on either the `Method` or `UnboundMethod` objects
and it will close irb (or rails console) and open the source code file in VIM at the exact line where
the method is defined.