summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorAdam Sanderson <netghost@gmail.com>2010-12-17 10:55:16 -0800
committerJohn Mair <jrmair@gmail.com>2010-12-18 19:28:42 +1300
commite61e36e4f937b18e258fe0f8f2733528d132cc5c (patch)
tree5a6eb4d0e9ab2d570ac4d23200059ce80c889cff /README.markdown
parent32e6e8495c36782e6362676a32d7a7e808226437 (diff)
downloadmethod_source-e61e36e4f937b18e258fe0f8f2733528d132cc5c.tar.gz
version 0.2.0, support for method comments (and a few minor changes), thanks to Adam Sanderson
* Merged in Adam's changes * Refactored source_helper to reflect comment_helper style * Made some adjustments to Adam's code: removed buffer.strip, now doing an lstrip on each line before adding to buffer * No longer including blank lines in comment buffer (blank lines ignored) * Added large number of comment-related tests
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown21
1 files changed, 18 insertions, 3 deletions
diff --git a/README.markdown b/README.markdown
index 44382c2..820be23 100644
--- a/README.markdown
+++ b/README.markdown
@@ -11,17 +11,19 @@ in Ruby 1.9
`method_source` is a utility to return a method's sourcecode as a
Ruby string. Also returns `Proc` and `Lambda` sourcecode.
+Method comments can also be extracted using the `comment` method.
+
It is written in pure Ruby (no C).
-`method_source` provides the `source` method to the `Method` and
+`method_source` provides the `source` and `comment` methods to the `Method` and
`UnboundMethod` and `Proc` classes.
* Install the [gem](https://rubygems.org/gems/method_source): `gem install method_source`
* Read the [documentation](http://rdoc.info/github/banister/method_source/master/file/README.markdown)
* See the [source code](http://github.com/banister/method_source)
-Example: methods
-----------------
+Example: display method source
+------------------------------
Set.instance_method(:merge).source.display
# =>
@@ -35,6 +37,14 @@ Example: methods
self
end
+Example: display method comments
+--------------------------------
+
+ Set.instance_method(:merge).comment.display
+ # =>
+ # Merges the elements of the given enumerable object to the set and
+ # returns self.=> nil
+
Limitations:
------------
@@ -49,3 +59,8 @@ Possible Applications:
for extra fun.
+Special Thanks
+--------------
+
+[Adam Sanderson](https://github.com/adamsanderson) for `comment` functionality.
+