Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

docs, Cakefile

  • Loading branch information...
commit cc02f7e4395f361464eb10e2f75ddfbae0b4b1ed 1 parent d6a59f2
Nicolas Perriault authored February 01, 2012
16  Cakefile
@@ -80,7 +80,7 @@ exit = (status) ->
80 80
 info = (message) -> log statuses.info, ansi.blue, message
81 81
 
82 82
 load = (callback) ->
83  
-    connect -> Fortune.remove ->
  83
+    Fortune.remove ->
84 84
         processed = 0
85 85
         info "loading fixtures…"
86 86
         for ref, fortune of fortunes
@@ -120,8 +120,10 @@ setup = (env, callback) ->
120 120
 
121 121
 test = (callback) ->
122 122
     info "launching unit test suite…"
123  
-    options = ['--require', 'should']
124  
-    options = options.concat(utils.findFiles("src/test", matchFiles: /\.coffee$/, excludeDirs: ["casperjs"]))
  123
+    testFiles = utils.findFiles "src/test",
  124
+        matchFiles: /\.coffee$/
  125
+        excludeDirs: ["casperjs"]
  126
+    options = testFiles.concat ['--require', 'should']
125 127
     command "./node_modules/.bin/mocha", options, (status) ->
126 128
         if status is 0 then ok "unit test suite ok" else ko "unit test suite failed"
127 129
         callback?(status)
@@ -137,17 +139,19 @@ task 'casper', 'Launches casperjs test suite', ->
137 139
     setup 'test', -> build -> load -> casper (status) -> exit(1 if status)
138 140
 
139 141
 task 'docs', 'Generate annotated source code with Docco', ->
140  
-    files = utils.findFiles("src", matchFiles: /\.coffee$/, excludeDirs: "views")
  142
+    files = utils.findFiles "src",
  143
+        matchFiles: /\.coffee$/
  144
+        excludeDirs: "views"
141 145
     setup -> command './node_modules/.bin/docco', files, (status) -> exit(1 if status)
142 146
 
143 147
 task 'funk', 'Fantastic stuff', ->
144  
-    setup 'test', -> build -> load -> test -> casper (status) -> exit(1 if status)
  148
+    setup 'test', -> build -> connect -> load -> test -> load -> casper (status) -> exit(1 if status)
145 149
 
146 150
 task 'load', 'Load test fixtures', ->
147 151
     setup -> load (err) -> exit(1 if err)
148 152
 
149 153
 task 'test', 'Run test suite', ->
150  
-    setup 'test', -> build -> test (status) -> exit(1 if status)
  154
+    setup 'test', -> build -> connect -> load -> test (status) -> exit(1 if status)
151 155
 
152 156
 task 'server', 'Start server', ->
153 157
     setup -> build -> server()
2  docs/Fortune.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>Fortune.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               Fortune.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">mongoose       = </span><span class="nx">require</span> <span class="s2">&quot;mongoose&quot;</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>Fortune.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               Fortune.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">mongoose       = </span><span class="nx">require</span> <span class="s2">&quot;mongoose&quot;</span>
2 2
 <span class="p">{</span><span class="nx">slugify</span><span class="p">}</span>      <span class="o">=</span> <span class="nx">require</span> <span class="s2">&quot;../lib/helpers&quot;</span>
3 3
 
4 4
 <span class="nv">Fortune = </span><span class="k">new</span> <span class="nx">mongoose</span><span class="p">.</span><span class="nx">Schema</span>
2  docs/config.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>config.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               config.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">module.exports =</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>config.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               config.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">module.exports =</span>
2 2
     <span class="nv">production:</span>
3 3
         <span class="nv">mongo:</span>
4 4
             <span class="nv">uri: </span><span class="s2">&quot;mongodb://localhost/nodetunes&quot;</span>
2  docs/errors.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>errors.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               errors.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.NotFound = </span><span class="k">class</span> <span class="k">extends</span> <span class="nb">Error</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>errors.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               errors.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.NotFound = </span><span class="k">class</span> <span class="k">extends</span> <span class="nb">Error</span>
2 2
     <span class="nv">name: </span><span class="s2">&quot;NotFound&quot;</span>
3 3
     <span class="nv">constructor: </span><span class="nf">(@message) -&gt;</span>
4 4
         <span class="nb">Error</span><span class="p">.</span><span class="nx">call</span> <span class="err">@</span><span class="p">,</span> <span class="nx">@message</span>
2  docs/form.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>form.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               form.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="k">class</span> <span class="nx">Form</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>form.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               form.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="k">class</span> <span class="nx">Form</span>
2 2
     <span class="nv">constructor: </span><span class="nf">(model, data) -&gt;</span>
3 3
         <span class="vi">@model = </span><span class="nx">model</span>
4 4
         <span class="vi">@bound = </span><span class="kc">false</span>
2  docs/helpers-test.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>helpers-test.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               helpers-test.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">ck = </span><span class="nx">require</span> <span class="s2">&quot;coffeekup&quot;</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>helpers-test.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               helpers-test.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">ck = </span><span class="nx">require</span> <span class="s2">&quot;coffeekup&quot;</span>
2 2
 <span class="nv">helpers = </span><span class="nx">require</span> <span class="s2">&quot;../lib/helpers&quot;</span>
3 3
 
4 4
 <span class="nx">describe</span> <span class="s1">&#39;extractFortuneData&#39;</span><span class="p">,</span> <span class="o">-&gt;</span>
2  docs/helpers.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>helpers.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               helpers.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">ck   = </span><span class="nx">require</span> <span class="s2">&quot;coffeekup&quot;</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>helpers.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               helpers.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">ck   = </span><span class="nx">require</span> <span class="s2">&quot;coffeekup&quot;</span>
2 2
 <span class="nv">util = </span><span class="nx">require</span> <span class="s2">&quot;util&quot;</span></pre></div>             </td>           </tr>                               <tr id="section-2">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-2">&#182;</a>               </div>               <p>Extracts a fortune data structure from a source text.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">extractFortuneData = </span><span class="nf">(source) -&gt;</span>
3 3
     <span class="nv">data = </span><span class="p">[]</span>
4 4
     <span class="k">if</span> <span class="o">not</span> <span class="nx">source</span>
2  docs/index.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>index.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               index.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">Fortune    = </span><span class="nx">require</span> <span class="s2">&quot;../models/Fortune&quot;</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>index.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               index.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">Fortune    = </span><span class="nx">require</span> <span class="s2">&quot;../models/Fortune&quot;</span>
2 2
 <span class="p">{</span><span class="nx">Form</span><span class="p">}</span>     <span class="o">=</span> <span class="nx">require</span> <span class="s2">&quot;../lib/form&quot;</span>
3 3
 <span class="p">{</span><span class="nx">NotFound</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span> <span class="s2">&quot;../lib/errors&quot;</span>
4 4
 
2  docs/model.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>model.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               model.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">config = </span><span class="nx">require</span> <span class="s2">&quot;../config&quot;</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>model.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               model.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">config = </span><span class="nx">require</span> <span class="s2">&quot;../config&quot;</span>
2 2
 <span class="nv">mongoose = </span><span class="nx">require</span> <span class="s2">&quot;mongoose&quot;</span>
3 3
 <span class="nv">Fortune = </span><span class="nx">require</span> <span class="s2">&quot;../models/Fortune&quot;</span>
4 4
 
2  docs/test.html
... ...
@@ -1,4 +1,4 @@
1  
-<!DOCTYPE html>  <html> <head>   <title>test.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               test.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">t = </span><span class="nx">casper</span><span class="p">.</span><span class="nx">test</span>
  1
+<!DOCTYPE html>  <html> <head>   <title>test.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               test.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">t = </span><span class="nx">casper</span><span class="p">.</span><span class="nx">test</span>
2 2
 
3 3
 <span class="nx">casper</span><span class="p">.</span><span class="kc">on</span> <span class="s1">&#39;location.changed&#39;</span><span class="p">,</span> <span class="nf">(url) -&gt;</span> <span class="nx">t</span><span class="p">.</span><span class="nx">comment</span> <span class="nx">url</span>
4 4
 
22  docs/utils.html
... ...
@@ -0,0 +1,22 @@
  1
+<!DOCTYPE html>  <html> <head>   <title>utils.coffee</title>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">   <link rel="stylesheet" media="all" href="docco.css" /> </head> <body>   <div id="container">     <div id="background"></div>            <div id="jump_to">         Jump To &hellip;         <div id="jump_wrapper">           <div id="jump_page">                                           <a class="source" href="config.html">                 config.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="errors.html">                 errors.coffee               </a>                                           <a class="source" href="form.html">                 form.coffee               </a>                                           <a class="source" href="helpers.html">                 helpers.coffee               </a>                                           <a class="source" href="utils.html">                 utils.coffee               </a>                                           <a class="source" href="Fortune.html">                 Fortune.coffee               </a>                                           <a class="source" href="index.html">                 index.coffee               </a>                                           <a class="source" href="test.html">                 test.coffee               </a>                                           <a class="source" href="helpers-test.html">                 helpers-test.coffee               </a>                                           <a class="source" href="model.html">                 model.coffee               </a>                        </div>         </div>       </div>          <table cellpadding="0" cellspacing="0">       <thead>         <tr>           <th class="docs">             <h1>               utils.coffee             </h1>           </th>           <th class="code">           </th>         </tr>       </thead>       <tbody>                               <tr id="section-1">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-1">&#182;</a>               </div>                            </td>             <td class="code">               <div class="highlight"><pre><span class="nv">fs   = </span><span class="nx">require</span><span class="p">(</span><span class="s1">&#39;fs&#39;</span><span class="p">)</span>
  2
+<span class="nv">path = </span><span class="nx">require</span><span class="p">(</span><span class="s1">&#39;path&#39;</span><span class="p">)</span>
  3
+
  4
+<span class="nv">findFiles = </span><span class="nf">(dir, options) -&gt;</span>
  5
+    <span class="nx">options</span> <span class="o">?=</span> <span class="nv">excludeDirs: </span><span class="p">[</span><span class="s1">&#39;.&#39;</span><span class="p">,</span> <span class="s1">&#39;..&#39;</span><span class="p">]</span>
  6
+    <span class="nx">options</span><span class="p">.</span><span class="nx">excludeDirs</span> <span class="o">?=</span> <span class="p">[</span><span class="s1">&#39;.&#39;</span><span class="p">,</span> <span class="s1">&#39;..&#39;</span><span class="p">]</span>
  7
+    <span class="nx">options</span><span class="p">.</span><span class="nx">excludeFiles</span> <span class="o">?=</span> <span class="p">[]</span>
  8
+    <span class="nx">options</span><span class="p">.</span><span class="nx">matchDirs</span> <span class="o">?=</span> <span class="kc">null</span>
  9
+    <span class="nx">options</span><span class="p">.</span><span class="nx">matchFiles</span> <span class="o">?=</span> <span class="kc">null</span>
  10
+    <span class="nv">files = </span><span class="p">[]</span>
  11
+    <span class="k">for</span> <span class="nx">entry</span> <span class="k">in</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">readdirSync</span><span class="p">(</span><span class="nx">dir</span><span class="p">)</span>
  12
+        <span class="nv">_entry = </span><span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span> <span class="s2">&quot;#{dir}/#{entry}&quot;</span>
  13
+        <span class="nv">stats = </span><span class="nx">fs</span><span class="p">.</span><span class="nx">statSync</span> <span class="nx">_entry</span>
  14
+        <span class="k">if</span> <span class="nx">stats</span><span class="p">.</span><span class="nx">isFile</span><span class="p">(</span><span class="nx">entry</span><span class="p">)</span>
  15
+            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">options</span><span class="p">.</span><span class="nx">matchFiles</span> <span class="o">or</span> <span class="nx">options</span><span class="p">.</span><span class="nx">matchFiles</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">_entry</span><span class="p">))</span> <span class="o">and</span> <span class="o">!~</span><span class="nx">options</span><span class="p">.</span><span class="nx">excludeFiles</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">entry</span><span class="p">)</span>
  16
+                <span class="nx">files</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">_entry</span><span class="p">)</span>
  17
+        <span class="k">else</span> <span class="k">if</span> <span class="nx">stats</span><span class="p">.</span><span class="nx">isDirectory</span><span class="p">(</span><span class="nx">entry</span><span class="p">)</span> <span class="o">and</span> <span class="o">!~</span><span class="nx">options</span><span class="p">.</span><span class="nx">excludeDirs</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">entry</span><span class="p">)</span>
  18
+            <span class="nv">files = </span><span class="nx">files</span><span class="p">.</span><span class="nx">concat</span><span class="p">(</span><span class="nx">findFiles</span><span class="p">(</span><span class="nx">_entry</span><span class="p">,</span> <span class="nx">options</span><span class="p">))</span>
  19
+    <span class="nx">files</span>
  20
+<span class="nv">exports.findFiles = </span><span class="nx">findFiles</span>
  21
+
  22
+</pre></div>             </td>           </tr>                </tbody>     </table>   </div> </body> </html> 

0 notes on commit cc02f7e

Please sign in to comment.
Something went wrong with that request. Please try again.