<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>doc-src/profiling.html</filename>
    </added>
    <added>
      <filename>doc-src/tests.html</filename>
    </added>
    <added>
      <filename>doc-src/tests/autotree.html</filename>
    </added>
    <added>
      <filename>doc-src/tests/index.py</filename>
    </added>
    <added>
      <filename>doc-src/tests/tree.html</filename>
    </added>
    <added>
      <filename>examples/test_profile.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,4 @@
 
 This page describes the API exposed from the __libpry__ module.
 
-
 @!libpry(&quot;test&quot;)!@</diff>
      <filename>doc-src/api.html</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1,3 @@
+
+$!examples.pry(&quot;&quot;, &quot;--help&quot;)!$
+</diff>
      <filename>doc-src/cli.html</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,18 @@ Overview
 ========
 
 The examples in this section can be found in the _examples/project_ directory
-in the __pry__ distribution.
+in the __pry__ distribution. From this directory we can run __pry__ with the -s
+argument to provide a coverage summary:
 
+$!examples.pry(&quot;examples/project/test&quot;, &quot;-s&quot;)!$
 
+As the output shows, the test suite does not completely cover the file _one.py_
+- lines 5 and 8 to 11 have not been run. The contents of this file are as
+follows:
 
+$!examples.py(&quot;examples/project/module/one.py&quot;, linenos=&quot;inline&quot;)!$
+
+Line 5 is clearly not covered because it is unreachable. An inspection of the
+relevant portion of the test suite shows that __method2__ is never called:
+
+$!examples.py(&quot;examples/project/test/test_one.py&quot;)!$</diff>
      <filename>doc-src/coverage.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 
-
 Many projects contain code that can not be covered by unit tests. Having these
 portions show up in test coverage statistics is not helpful, so __pry__
 provides a way to annotate code to exempt lines from coverage. 
@@ -7,9 +6,14 @@ provides a way to annotate code to exempt lines from coverage.
 :::Example
 ----------
 
-&lt;!--(block | pySyntax)--&gt;
-$!test_annotation!$
-&lt;!--(end)--&gt;
-&lt;div class=&quot;fname&quot;&gt;(examples/test_basic.py)&lt;/div&gt;
+$!examples.py(&quot;examples/project/module/two.py&quot;)!$
+
+Even though the code within the __nocover__ block is unreachable, it does not
+show up in analysis output, and _two.py_ has 100% coverage:
+
+$!examples.pry(&quot;examples/project/test&quot;, &quot;-s&quot;)!$
 
+If a &lt;strong&gt;#begin nocover&lt;/strong&gt; directive is not matched by an
+&lt;strong&gt;#end nocover&lt;/strong&gt; directive, it applies to the remainder of the
+file. 
 </diff>
      <filename>doc-src/coverage/annotations.html</filename>
    </modified>
    <modified>
      <diff>@@ -38,13 +38,7 @@ should be excluded from coverage analysis. The pry unit test suite lives in a
 parallel __test__ directory. The &lt;strong&gt;.pry&lt;/strong&gt; file in the test
 directory looks like this:
 
-&lt;pre class=&quot;output&quot;&gt;
-base = ..
-coverage = ../module
-exclude = ../module/exclude.py
-&lt;/pre&gt;
-&lt;div class=&quot;fname&quot;&gt;(examples/project/test/.pry)&lt;/div&gt;
-
+$!examples.plain(&quot;examples/project/test/.pry&quot;)!$
 
 More .pry syntax
 ================</diff>
      <filename>doc-src/coverage/dotpry.html</filename>
    </modified>
    <modified>
      <diff>@@ -2,5 +2,5 @@ from countershape.doc import *
 
 pages = [
     Page(&quot;dotpry.html&quot;,  &quot;.pry config file&quot;),
-    Page(&quot;annotations.html&quot;,  &quot;Annotations&quot;),
+    Page(&quot;annotations.html&quot;,  &quot;Code Annotation&quot;),
 ]</diff>
      <filename>doc-src/coverage/index.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+import os, os.path, subprocess
 import countershape.widgets
 import countershape.layout
 import countershape.grok
@@ -14,19 +15,52 @@ ns.sidebar = countershape.widgets.SiblingPageIndex(
             )
 this.layout = countershape.layout.TwoPane(&quot;yui-t2&quot;, &quot;doc3&quot;)
 
-ns.test_basic = readFrom(&quot;../examples/test_basic.py&quot;)
-ns.test_trees = readFrom(&quot;../examples/test_trees.py&quot;)
-ns.test_autotree = readFrom(&quot;../examples/test_autotree.py&quot;)
-ns.test_annotation = readFrom(&quot;../examples/project/module/two.py&quot;)
+class Examples:
+    def __init__(self, d):
+        self.d = os.path.abspath(d)
 
+    def _wrap(self, proc, path):
+        f = file(os.path.join(self.d, path)).read()
+        if proc:
+            f = proc(f)
+        post = &quot;&lt;div class=\&quot;fname\&quot;&gt;(%s)&lt;/div&gt;&quot;%path
+        return f + post
+
+    def py(self, path, **kwargs):
+        return self._wrap(ns.pySyntax.withConf(**kwargs), path)
+
+    def _preProc(self, f):
+        return &quot;&lt;pre class=\&quot;output\&quot;&gt;%s&lt;/pre&gt;&quot;%f
+
+    def plain(self, path):
+        return self._wrap(self._preProc, path)
+
+    def pry(self, path, args):
+        cur = os.getcwd()
+        os.chdir(os.path.join(self.d, path))
+        prog = os.path.join(self.d, &quot;pry&quot;)
+        pipe = subprocess.Popen(
+                    &quot;%s &quot;%prog + args,
+                    shell=True,
+                    stdout=subprocess.PIPE,
+                    stderr=subprocess.PIPE
+                ).stdout
+        os.chdir(cur)
+
+        content = &quot;&gt; pry %s\n&quot;%args + pipe.read()
+        return self._preProc(content)
+    
+
+ns.examples = Examples(&quot;..&quot;)
 ns.libpry = countershape.grok.grok(&quot;../libpry&quot;)
 
 pages = [
     Page(&quot;index.html&quot;, &quot;Introduction&quot;),
-    Page(&quot;start.html&quot;, &quot;Writing Tests&quot;),
-    Directory(&quot;trees&quot;),
+    Page(&quot;tests.html&quot;, &quot;Writing Tests&quot;),
+    Directory(&quot;tests&quot;),
     Page(&quot;coverage.html&quot;,   &quot;Coverage&quot;),
     Directory(&quot;coverage&quot;),
+    Page(&quot;profiling.html&quot;,   &quot;Profiling&quot;),
     Page(&quot;cli.html&quot;,   &quot;The pry tool&quot;),
     Page(&quot;api.html&quot;,   &quot;API&quot;),
     Page(&quot;admin.html&quot;, &quot;Administrivia&quot;)</diff>
      <filename>doc-src/index.py</filename>
    </modified>
    <modified>
      <diff>@@ -3,3 +3,9 @@ def method():
         return 1
     else:
         return 2
+
+def method2():
+    x = 2
+    if x:
+        y = 3
+    z = 1</diff>
      <filename>examples/project/module/one.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-
 def method():
     if True:
         return 1
@@ -6,4 +5,3 @@ def method():
     else:
         return 2
     #end nocover
-</diff>
      <filename>examples/project/module/two.py</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,6 @@ import module.one
 class One(libpry.AutoTree):
     def test_a(self):
         assert module.one.method() == 1
-        
 
 tests = [
     One()</diff>
      <filename>examples/project/test/test_one.py</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,6 @@ import module.two
 class Two(libpry.AutoTree):
     def test_a(self):
         assert module.two.method() == 1
-        
 
 tests = [
     Two()</diff>
      <filename>examples/project/test/test_two.py</filename>
    </modified>
    <modified>
      <diff>@@ -217,8 +217,9 @@ class _OutputOne(_OutputZero):
                 width, funcs = s.get_print_list([])
                 s.print_title()
                 for f in funcs:
-                    # We don't want to know about libpry itself.
-                    if not &quot;/libpry/&quot; in f[0]:
+                    # We don't want to know about libpry itself or the profile
+                    # disable function.
+                    if not &quot;/libpry/&quot; in f[0] and not &quot;_lsprof&quot; in f[2]:
                         s.print_line(f)
                 lst.append(&quot;\n&quot;)
                 lst.append(s.stream.getvalue())</diff>
      <filename>libpry/test.py</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,10 @@ import libpry
 
 def main():
     from optparse import OptionParser, OptionGroup
-    parser = OptionParser(version=&quot;%prog 0.1&quot;)
-    parser.add_option(&quot;-a&quot;, &quot;--annotate&quot;,
-                      action=&quot;store_true&quot;, dest=&quot;annotate&quot;,
-                      help=&quot;Annotated coverage output.&quot;)
+    parser = OptionParser(
+                usage = &quot;%prog [options] [testfilter]&quot;,
+                version=&quot;%prog 0.1&quot;,
+            )
     parser.add_option(&quot;-c&quot;, &quot;--clear&quot;,
                       action=&quot;store_true&quot;, dest=&quot;clear&quot;,
                       help=&quot;Clear all .pyc and .pyo files in the project base&quot;
@@ -22,7 +22,7 @@ def main():
                       help=&quot;Recurse through child directories.&quot;)
     parser.add_option(&quot;-s&quot;, &quot;--stats&quot;,
                       action=&quot;store_true&quot;, dest=&quot;stats&quot;,
-                      help=&quot;Give coverage stats&quot;)
+                      help=&quot;Print coverage summary.&quot;)
     parser.add_option(&quot;-n&quot;, &quot;--benchmark&quot;,
                       action=&quot;store&quot;, dest=&quot;benchmark&quot;, type=&quot;int&quot;, default=1,
                       help=&quot;Run each test N times.&quot;)
@@ -31,11 +31,11 @@ def main():
                       help=&quot;Quiet.&quot;)
     parser.add_option(&quot;-v&quot;, &quot;--verbose&quot;,
                       action=&quot;count&quot;, dest=&quot;verbose&quot;, default=1,
-                      help=&quot;Verbose.&quot;)
+                      help=&quot;Increase verbosity. Can be passed multiple times.&quot;)
     parser.add_option(
                         &quot;--debug-dump&quot;,
                         action=&quot;store_true&quot;, dest=&quot;debug&quot;,
-                        help=&quot;For debugging only. Like list,&quot;
+                        help=&quot;For debugging only. Like -l,&quot;
                            &quot; but dump the full tree structure.&quot;
                     )
 
@@ -80,7 +80,7 @@ def main():
     else:
         parser.error(&quot;Please pass only one argument.&quot;)
 
-    if options.annotate or options.stats:
+    if options.stats:
         coverage = True
     else:
         coverage = False</diff>
      <filename>pry</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>doc-src/start.html</filename>
    </removed>
    <removed>
      <filename>doc-src/trees/autotree.html</filename>
    </removed>
    <removed>
      <filename>doc-src/trees/index.py</filename>
    </removed>
    <removed>
      <filename>doc-src/trees/tree.html</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>028d3e4f186b4d96fd05bd13c817afa33d38d9af</id>
    </parent>
  </parents>
  <author>
    <name>Aldo Cortesi</name>
    <email>aldo@nullcube.com</email>
  </author>
  <url>http://github.com/cortesi/pry/commit/22a8217e2a7bd95ec2f6a6d3b6647b5b53122fe3</url>
  <id>22a8217e2a7bd95ec2f6a6d3b6647b5b53122fe3</id>
  <committed-date>2008-04-01T02:00:17-07:00</committed-date>
  <authored-date>2008-04-01T02:00:17-07:00</authored-date>
  <message>Documentation.</message>
  <tree>7ed13901a5d3c2705e1a7cc940eef26498e026a8</tree>
  <committer>
    <name>Aldo Cortesi</name>
    <email>aldo@nullcube.com</email>
  </committer>
</commit>
