README.rdoc in sexp_path-0.5.0 vs README.rdoc in sexp_path-0.5.1
- old
+ new
@@ -84,10 +84,14 @@
[Not] Negates a matcher
-s(:a) => s(:a,:b), s(:b), but not s(:a)
s(is_not :a) => s(:b), s(:c), but not s(:a) or s(:a, :b)
+[Remaining] Matches the remainder of an s-expression.
+
+ s(:a, ___) => s(:a), s(:a, :b, :c), but not s(:b)
+
== Searching
You may use any SexpPath to search an S-Expression. SexpPath defines the `/` operator as search,
so to search `s( s(:a) )` for `s(:a)` you may just do:
@@ -125,11 +129,10 @@
== Examples
Here is an example of using SexpPath to grab all the classes and their methods from
a file:
- require 'rubygems'
require 'sexp_path'
require 'ruby_parser' # `gem install ruby_parser`
path = ARGV.shift
code = File.read(path)
@@ -162,6 +165,7 @@
* Add new matchers
* Convenience matchers, for instance canned matchers for matching ruby classes, methods, etc
I'd love to see what people do with this library, let me know if you find it useful.
- Adam Sanderson, netghost@gmail.com
+ Adam Sanderson, netghost@gmail.com
+ http://monkeyandcrow.com
\ No newline at end of file