Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (37 sloc) 1.057 kB
69ecaa8 @collin working on switching to rake pipeline/qunit/minispade
authored
1 require "rake-pipeline-web-filters"
2 require "json"
3 # require "uglifier"
4
5 class PathologyDocumentFilter < Rake::Pipeline::Filter
6 # NOW WE HAVE TWO PROBLEMS
7 # this splits methods/documentation into two groups
8 # we'll flip the order four the output
9 DOC_FILTER = /((?:[ ]+#.+doc[ =].+\n)(?:[ ]+#.*\n)+)/
10 def generate_output(inputs, output)
11 inputs.each do |input|
12 result = File.read(input.fullpath)
13 result.gsub!(DOC_FILTER) do |match|
14 $1.gsub!(/[ ]+(#)/) {|match| " " * (match.length - 2) }
15 end
16 output.write result
17 end
18 end
19 end
20
1e84581 @collin got documentation generator running
authored
21
69ecaa8 @collin working on switching to rake pipeline/qunit/minispade
authored
22 output "docs"
23 input "./src" do
24 match "**/*.coffee" do
25 filter PathologyDocumentFilter
26 filter Rake::Pipeline::Web::Filters::CoffeeScriptFilter
27
28 minispade rewrite_requires: true, string: true, module_id_generator: proc { |input|
29 id = input.path.dup
30 id.sub!('/lib/', '/')
31 id.sub!(/\.js$/, '')
32 id.sub!(/\/main$/, '')
33 id
34 }
35
36 concat "AlphaSimprini-docs.js"
37 end
38 end
1e84581 @collin got documentation generator running
authored
39
40 input "./src", "doc.coffee" do
41 coffee_script
42 concat "doc.js"
43 end
Something went wrong with that request. Please try again.