yard-js 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +138 -0
  4. data/lib/yard-js.rb +30 -0
  5. data/lib/yard-js/code_objects.rb +8 -0
  6. data/lib/yard-js/code_objects/event_object.rb +11 -0
  7. data/lib/yard-js/code_objects/property_object.rb +83 -0
  8. data/lib/yard-js/core_ext/parsejs.rb +13 -0
  9. data/lib/yard-js/core_ext/yard.rb +17 -0
  10. data/lib/yard-js/core_ext/yard/code_objects.rb +45 -0
  11. data/lib/yard-js/core_ext/yard/registry.rb +29 -0
  12. data/lib/yard-js/core_ext/yard/tags.rb +48 -0
  13. data/lib/yard-js/core_ext/yard/templates.rb +116 -0
  14. data/lib/yard-js/core_ext/yard/yardoc.rb +23 -0
  15. data/lib/yard-js/handlers.rb +7 -0
  16. data/lib/yard-js/handlers/base.rb +53 -0
  17. data/lib/yard-js/handlers/class_handler.rb +43 -0
  18. data/lib/yard-js/handlers/comment_handler.rb +33 -0
  19. data/lib/yard-js/handlers/constant_handler.rb +50 -0
  20. data/lib/yard-js/handlers/instance_method_handler.rb +26 -0
  21. data/lib/yard-js/handlers/mixin_handler.rb +18 -0
  22. data/lib/yard-js/handlers/module_handler.rb +33 -0
  23. data/lib/yard-js/parser.rb +23 -0
  24. data/lib/yard-js/plugin.rb +23 -0
  25. data/lib/yard-js/tags.rb +37 -0
  26. data/lib/yard-js/version.rb +3 -0
  27. data/templates/default/class/setup.rb +11 -0
  28. data/templates/default/fulldoc/html/css/highlight.github.css +127 -0
  29. data/templates/default/fulldoc/html/css/style.css +10 -0
  30. data/templates/default/fulldoc/html/full_list_property.erb +12 -0
  31. data/templates/default/fulldoc/html/js/highlight.pack.js +1 -0
  32. data/templates/default/fulldoc/html/setup.rb +18 -0
  33. data/templates/default/layout/html/headers.erb +17 -0
  34. data/templates/default/layout/html/setup.rb +14 -0
  35. data/templates/default/method_details/setup.rb +13 -0
  36. data/templates/default/module/html/constructor_summary.erb +9 -0
  37. data/templates/default/module/html/events_details.erb +8 -0
  38. data/templates/default/module/html/events_summary.erb +20 -0
  39. data/templates/default/module/html/inherited_methods.erb +8 -0
  40. data/templates/default/module/html/inherited_properties.erb +8 -0
  41. data/templates/default/module/html/item_summary.erb +38 -0
  42. data/templates/default/module/html/method_summary.erb +11 -0
  43. data/templates/default/module/html/methods_details.erb +8 -0
  44. data/templates/default/module/html/properties_details.erb +8 -0
  45. data/templates/default/module/html/properties_summary.erb +11 -0
  46. data/templates/default/module/setup.rb +75 -0
  47. data/templates/default/tags/callback.erb +21 -0
  48. data/templates/default/tags/setup.rb +24 -0
  49. data/templates/default/tags/value.erb +6 -0
  50. data/yard-js.gemspec +15 -0
  51. metadata +92 -0
@@ -0,0 +1,37 @@
1
+ require 'yard'
2
+
3
+ module YARDJS
4
+ module Tags
5
+ include YARD::Tags
6
+
7
+ class CallbackTag < OverloadTag
8
+ attr_accessor :param_name
9
+
10
+ def initialize(tag_name, text)
11
+ name, text = *text.split(" ", 2)
12
+ self.param_name = name
13
+ super(tag_name, text)
14
+ end
15
+ end
16
+
17
+ class EventDirective < Directive
18
+ def call
19
+ overload = YARD::Tags::OverloadTag.new(:overload, tag.name)
20
+ name = overload.name
21
+ ns = YARD::CodeObjects::NamespaceObject === object ? object : handler.namespace
22
+ obj = CodeObjects::EventObject.new(ns, name)
23
+ ds = YARD::DocstringParser.new
24
+ handler.register_group(obj)
25
+ obj.parameters = overload.parameters
26
+ obj.docstring = ds.parse(tag.text, obj, parser.handler).to_docstring
27
+ obj
28
+ end
29
+ end
30
+
31
+ class IgnoreDirective < Directive
32
+ def call
33
+ handler.extra_state.ignore_next_statement = true
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,3 @@
1
+ module YARDJS
2
+ VERSION = '0.1.1'
3
+ end
@@ -0,0 +1,11 @@
1
+ def constructor_details
2
+ object.inheritance_tree.find do |superclass|
3
+ next if superclass.type == :proxy
4
+ ctor = superclass.child(:name => :constructor)
5
+ if ctor && !prune_method_listing([ctor]).empty?
6
+ @ctor = ctor
7
+ break
8
+ end
9
+ end
10
+ erb(:constructor_details) if @ctor
11
+ end
@@ -0,0 +1,127 @@
1
+ /*
2
+
3
+ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
4
+
5
+ */
6
+
7
+ pre code {
8
+ display: block; padding: 0.5em;
9
+ color: #333;
10
+ /*background: #f8f8ff*/
11
+ }
12
+
13
+ pre .comment,
14
+ pre .template_comment,
15
+ pre .diff .header,
16
+ pre .javadoc {
17
+ color: #998;
18
+ font-style: italic
19
+ }
20
+
21
+ pre .keyword,
22
+ pre .css .rule .keyword,
23
+ pre .winutils,
24
+ pre .javascript .title,
25
+ pre .nginx .title,
26
+ pre .subst,
27
+ pre .request,
28
+ pre .status {
29
+ color: #333;
30
+ font-weight: bold
31
+ }
32
+
33
+ pre .number,
34
+ pre .hexcolor,
35
+ pre .ruby .constant {
36
+ color: #099;
37
+ }
38
+
39
+ pre .string,
40
+ pre .tag .value,
41
+ pre .phpdoc,
42
+ pre .tex .formula {
43
+ color: #d14
44
+ }
45
+
46
+ pre .title,
47
+ pre .id {
48
+ color: #900;
49
+ font-weight: bold
50
+ }
51
+
52
+ pre .javascript .title,
53
+ pre .lisp .title,
54
+ pre .clojure .title,
55
+ pre .subst {
56
+ font-weight: normal
57
+ }
58
+
59
+ pre .class .title,
60
+ pre .haskell .type,
61
+ pre .vhdl .literal,
62
+ pre .tex .command {
63
+ color: #458;
64
+ font-weight: bold
65
+ }
66
+
67
+ pre .tag,
68
+ pre .tag .title,
69
+ pre .rules .property,
70
+ pre .django .tag .keyword {
71
+ color: #000080;
72
+ font-weight: normal
73
+ }
74
+
75
+ pre .attribute,
76
+ pre .variable,
77
+ pre .lisp .body {
78
+ color: #008080
79
+ }
80
+
81
+ pre .regexp {
82
+ color: #009926
83
+ }
84
+
85
+ pre .class {
86
+ color: #458;
87
+ font-weight: bold
88
+ }
89
+
90
+ pre .symbol,
91
+ pre .ruby .symbol .string,
92
+ pre .lisp .keyword,
93
+ pre .tex .special,
94
+ pre .prompt {
95
+ color: #990073
96
+ }
97
+
98
+ pre .built_in,
99
+ pre .lisp .title,
100
+ pre .clojure .built_in {
101
+ color: #0086b3
102
+ }
103
+
104
+ pre .preprocessor,
105
+ pre .pi,
106
+ pre .doctype,
107
+ pre .shebang,
108
+ pre .cdata {
109
+ color: #999;
110
+ font-weight: bold
111
+ }
112
+
113
+ pre .deletion {
114
+ background: #fdd
115
+ }
116
+
117
+ pre .addition {
118
+ background: #dfd
119
+ }
120
+
121
+ pre .diff .change {
122
+ background: #0086b3
123
+ }
124
+
125
+ pre .chunk {
126
+ color: #aaa
127
+ }
@@ -0,0 +1,10 @@
1
+ {{{__super__}}}
2
+
3
+ pre.value_tag { font-size: 1.2em; }
4
+ .tags .callback .callback_item { list-style: none; margin-bottom: 25px; }
5
+ .tags .callback .callback_item .signature {
6
+ padding: 6px 12px;
7
+ margin-bottom: 7px;
8
+ background: #fcfcfc; border: 1px solid #eee; -moz-border-radius: 3px; -webkit-border-radius: 3px;
9
+ margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em;
10
+ }
@@ -0,0 +1,12 @@
1
+ <% n = 1 %>
2
+ <% @items.each do |item| %>
3
+ <li class="r<%= n %> <%= item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
4
+ <%= linkify item, h(item.name(true)) %>
5
+ <% if item.namespace && !item.namespace.root? %>
6
+ <small><%= item.namespace %></small>
7
+ <% else %>
8
+ <small>Top Level Namespace</small>
9
+ <% end %>
10
+ </li>
11
+ <% n = n == 2 ? 1 : 2 %>
12
+ <% end %>
@@ -0,0 +1 @@
1
+ var hljs=new function(){function l(o){return o.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o<p.length;o++){if(e[p[o]]||p[o]=="no-highlight"){return p[o]}}}function c(q){var o=[];(function p(r,s){for(var t=r.firstChild;t;t=t.nextSibling){if(t.nodeType==3){s+=t.nodeValue.length}else{if(t.nodeName=="BR"){s+=1}else{if(t.nodeType==1){o.push({event:"start",offset:s,node:t});s=p(t,s);o.push({event:"stop",offset:s,node:t})}}}}return s})(q,0);return o}function j(x,v,w){var p=0;var y="";var r=[];function t(){if(x.length&&v.length){if(x[0].offset!=v[0].offset){return(x[0].offset<v[0].offset)?x:v}else{return v[0].event=="start"?x:v}}else{return x.length?x:v}}function s(A){function z(B){return" "+B.nodeName+'="'+l(B.value)+'"'}return"<"+A.nodeName+Array.prototype.map.call(A.attributes,z).join("")+">"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q<r.length){y+=s(r[q]);q++}}}}return y+l(w.substr(p))}function f(q){function o(s,r){return RegExp(s,"m"+(q.cI?"i":"")+(r?"g":""))}function p(y,w){if(y.compiled){return}y.compiled=true;var s=[];if(y.k){var r={};function z(A,t){t.split(" ").forEach(function(B){var C=B.split("|");r[C[0]]=[A,C[1]?Number(C[1]):1];s.push(C[0])})}y.lR=o(y.l||hljs.IR,true);if(typeof y.k=="string"){z("keyword",y.k)}else{for(var x in y.k){if(!y.k.hasOwnProperty(x)){continue}z(x,y.k[x])}}y.k=r}if(w){if(y.bWK){y.b="\\b("+s.join("|")+")\\s"}y.bR=o(y.b?y.b:"\\B|\\b");if(!y.e&&!y.eW){y.e="\\B|\\b"}if(y.e){y.eR=o(y.e)}y.tE=y.e||"";if(y.eW&&w.tE){y.tE+=(y.e?"|":"")+w.tE}}if(y.i){y.iR=o(y.i)}if(y.r===undefined){y.r=1}if(!y.c){y.c=[]}for(var v=0;v<y.c.length;v++){if(y.c[v]=="self"){y.c[v]=y}p(y.c[v],y)}if(y.starts){p(y.starts,w)}var u=[];for(var v=0;v<y.c.length;v++){u.push(y.c[v].b)}if(y.tE){u.push(y.tE)}if(y.i){u.push(y.i)}y.t=u.length?o(u.join("|"),true):{exec:function(t){return null}}}p(q)}function d(D,E){function o(r,M){for(var L=0;L<M.c.length;L++){var K=M.c[L].bR.exec(r);if(K&&K.index==0){return M.c[L]}}}function s(K,r){if(K.e&&K.eR.test(r)){return K}if(K.eW){return s(K.parent,r)}}function t(r,K){return K.i&&K.iR.test(r)}function y(L,r){var K=F.cI?r[0].toLowerCase():r[0];return L.k.hasOwnProperty(K)&&L.k[K]}function G(){var K=l(w);if(!A.k){return K}var r="";var N=0;A.lR.lastIndex=0;var L=A.lR.exec(K);while(L){r+=K.substr(N,L.index-N);var M=y(A,L);if(M){v+=M[1];r+='<span class="'+M[0]+'">'+L[0]+"</span>"}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+="</span>"}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"<br>")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.bash=function(a){var g="true false";var e="if then else elif fi for break continue while in do done echo exit return set declare";var c={cN:"variable",b:"\\$[a-zA-Z0-9_#]+"};var b={cN:"variable",b:"\\${([^}]|\\\\})+}"};var h={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE,c,b],r:0};var d={cN:"string",b:"'",e:"'",c:[{b:"''"}],r:0};var f={cN:"test_condition",b:"",e:"",c:[h,d,c,b],k:{literal:g},r:0};return{k:{keyword:e,literal:g},c:[{cN:"shebang",b:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",r:10},c,b,a.HCM,h,d,a.inherit(f,{b:"\\[ ",e:" \\]",r:0}),a.inherit(f,{b:"\\[\\[ ",e:" \\]\\]"})]}}(hljs);hljs.LANGUAGES.diff=function(a){return{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}(hljs);hljs.LANGUAGES.javascript=function(a){return{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",i:"\\n",c:[{b:"\\\\/"}]},{b:"<",e:">;",sL:"xml"}],r:0},{cN:"function",bWK:true,e:"{",k:"function",c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[a.CLCM,a.CBLCLM],i:"[\"'\\(]"}],i:"\\[|%"}]}}(hljs);hljs.LANGUAGES.css=function(a){var b={cN:"function",b:a.IR+"\\(",e:"\\)",c:[a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:"import page media charset",c:[b,a.ASM,a.QSM,a.NM]},{cN:"tag",b:a.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[b,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.http=function(a){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}}(hljs);hljs.LANGUAGES.sql=function(a){return{cI:true,c:[{cN:"operator",b:"(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b(?!:)",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}],r:0},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}],r:0},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}}(hljs);hljs.LANGUAGES.ini=function(a){return{cI:true,i:"[^\\s]",c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM]}]}]}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);
@@ -0,0 +1,18 @@
1
+ def generate_method_list
2
+ @items = prune_method_listing(Registry.all(:property), false)
3
+ @items = @items.select {|m| m.property_type == :function }
4
+ @items = @items.reject {|m| m.constructor? }
5
+ @items = @items.sort_by {|m| m.name.to_s }
6
+ @list_title = "Method List"
7
+ @list_type = "method"
8
+ generate_list_contents
9
+ end
10
+
11
+ def generate_property_list
12
+ @items = prune_method_listing(Registry.all(:property), false)
13
+ @items = @items.select {|m| m.property_type != :function }
14
+ @items = @items.sort_by {|m| m.name.to_s }
15
+ @list_title = "Property List"
16
+ @list_type = "property"
17
+ generate_list_contents
18
+ end
@@ -0,0 +1,17 @@
1
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= charset %>" />
2
+ <title>
3
+ <%= h @page_title %>
4
+ <% if options.title && @page_title != options.title %>
5
+ &mdash; <%= h options.title %>
6
+ <% end %>
7
+ </title>
8
+ <% stylesheets.each do |stylesheet| %>
9
+ <link rel="stylesheet" href="<%= url_for(stylesheet) %>" type="text/css" media="screen" charset="utf-8" />
10
+ <% end %>
11
+ <%= erb :script_setup %>
12
+ <% javascripts.each do |javascript| %>
13
+ <script type="text/javascript" charset="utf-8" src="<%= url_for(javascript) %>"></script>
14
+ <% end %>
15
+ <script type="text/javascript" charset="utf-8">
16
+ hljs.initHighlightingOnLoad();
17
+ </script>
@@ -0,0 +1,14 @@
1
+ def stylesheets
2
+ super + %w(css/highlight.github.css)
3
+ end
4
+
5
+ def javascripts
6
+ super + %w(js/highlight.pack.js)
7
+ end
8
+
9
+ def menu_lists
10
+ [ { :type => 'class', :title => 'Classes', :search_title => 'Class List' },
11
+ { :type => 'method', :title => 'Methods', :search_title => 'Method List' },
12
+ { :type => 'property', :title => 'Properties', :search_title => 'Property List' },
13
+ { :type => 'file', :title => 'Files', :search_title => 'File List' } ]
14
+ end
@@ -0,0 +1,13 @@
1
+ def source; end
2
+
3
+ def method_signature
4
+ if object.type == :event
5
+ <<-eof
6
+ <h3 class="signature #{'first' if @index == 0}" id="#{anchor_for(object)}">
7
+ <strong>'#{object.name}'</strong> &mdash; <strong>function</strong> (#{object.parameters.map(&:first).join(", ")})
8
+ </h3>
9
+ eof
10
+ else
11
+ erb(:method_signature)
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ <h2>Constructor Summary
2
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
3
+ </h2>
4
+
5
+ <ul class="summary">
6
+ <% [@constructor].each do |prop| %>
7
+ <%= yieldall :item => prop %>
8
+ <% end %>
9
+ </ul>
@@ -0,0 +1,8 @@
1
+ <% if event_listing.size > 0 %>
2
+ <div id="event_details" class="method_details">
3
+ <h2>Event Details</h2>
4
+ <% event_listing.each_with_index do |prop, i| %>
5
+ <%= yieldall :object => prop, :owner => object, :index => i %>
6
+ <% end %>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% groups(event_listing, "Event") do |list, title| %>
2
+ <h2><%= title %>
3
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
4
+ </h2>
5
+
6
+ <ul class="summary">
7
+ <% list.each do |event| %>
8
+ <li class="<%= event.visibility %> <%= event.has_tag?(:deprecated) ? 'deprecated' : '' %>">
9
+ <span class="summary_signature"><strong><%= link_object event, "'#{event.name}'" %></strong></span>
10
+ <span class="note title"><strong>function</strong> (<%= event.parameters.map(&:first).join(", ") %>)</span>
11
+
12
+ <% if event.has_tag?(:deprecated) %>
13
+ <span class="summary_desc"><strong>Deprecated.</strong> <%= htmlify_line event.tag(:deprecated).text %></span>
14
+ <% else %>
15
+ <span class="summary_desc"><%= htmlify_line docstring_summary(event) %></span>
16
+ <% end %>
17
+ </li>
18
+ <% end %>
19
+ </ul>
20
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% found_prop = false %>
2
+ <% inherited_method_list do |superclass, props| %>
3
+ <% if method_listing.size == 0 && !found_prop %><h2>Method Summary</h2><% end %>
4
+ <% found_prop = true %>
5
+ <h3 class="inherited">Methods <%= superclass.type == :class ? 'inherited' : 'included' %>
6
+ from <%= linkify superclass %></h3>
7
+ <p class="inherited"><%= props.map {|c| linkify c, c.name }.join(", ") %></p>
8
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% found_prop = false %>
2
+ <% inherited_property_list do |superclass, props| %>
3
+ <% if property_listing.size == 0 && !found_prop %><h2>Property Summary</h2><% end %>
4
+ <% found_prop = true %>
5
+ <h3 class="inherited">Properties <%= superclass.type == :class ? 'inherited' : 'included' %>
6
+ from <%= linkify superclass %></h3>
7
+ <p class="inherited"><%= props.map {|c| linkify c, c.name }.join(", ") %></p>
8
+ <% end %>
@@ -0,0 +1,38 @@
1
+ <li class="<%= @item.visibility %> <%= @item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
2
+ <span class="summary_signature">
3
+ <% if @item.tags(:overload).size == 1 %>
4
+ <%= signature(@item.tag(:overload), true, @item.respond_to?(:attr_info) && !@item.attr_info) %>
5
+ <% else %>
6
+ <%= signature(@item, true, false, @item.respond_to?(:attr_info) && !@item.attr_info) %>
7
+ <% end %>
8
+
9
+ <% if @item.aliases.size > 0 %>
10
+ (also: <%= @item.aliases.map {|o| h(o.name(true)) }.join(", ") %>)
11
+ <% end %>
12
+ </span>
13
+ <% if @item.has_tag?(:static) %>
14
+ <span class="note title constructor">static</span>
15
+ <% end %>
16
+ <% if @item.respond_to?(:constructor?) && @item.constructor? %>
17
+ <span class="note title constructor">constructor</span>
18
+ <% end %>
19
+ <% if !@item.tag(:readonly) && !@item.tag(:writeonly) && ![:function, :event].include?(@item.property_type) %>
20
+ <span class="note title readonly">readwrite</span>
21
+ <% end %>
22
+ <% if @item.has_tag?(:readonly) %>
23
+ <span class="note title readonly">readonly</span>
24
+ <% end %>
25
+ <% if @item.has_tag?(:writeonly) %>
26
+ <span class="note title writeonly">writeonly</span>
27
+ <% end %>
28
+ <% if @item.visibility != :public %><span class="note title <%= @item.visibility %>"><%= @item.visibility %></span><% end %>
29
+ <% if @item.has_tag?(:abstract) %><span class="abstract note title">abstract</span><% end %>
30
+ <% if @item.has_tag?(:deprecated) %><span class="deprecated note title">deprecated</span><% end %>
31
+ <% if @item.has_tag?(:api) && @item.tag(:api).text == 'private' %><span class="private note title">private</span><% end %>
32
+
33
+ <% if @item.has_tag?(:deprecated) %>
34
+ <span class="summary_desc"><strong>Deprecated.</strong> <%= htmlify_line @item.tag(:deprecated).text %></span>
35
+ <% else %>
36
+ <span class="summary_desc"><%= htmlify_line docstring_summary(@item) %></span>
37
+ <% end %>
38
+ </li>
@@ -0,0 +1,11 @@
1
+ <% groups(method_listing, "Method") do |list, title| %>
2
+ <h2><%= title %>
3
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
4
+ </h2>
5
+
6
+ <ul class="summary">
7
+ <% list.each do |prop| %>
8
+ <%= yieldall :item => prop %>
9
+ <% end %>
10
+ </ul>
11
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% if method_listing.size > 0 %>
2
+ <div id="method_details" class="method_details">
3
+ <h2>Method Details</h2>
4
+ <% method_listing.each_with_index do |prop, i| %>
5
+ <%= yieldall :object => prop, :owner => object, :index => i %>
6
+ <% end %>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% if property_listing.size > 0 %>
2
+ <div id="prop_details" class="method_details">
3
+ <h2>Property Details</h2>
4
+ <% property_listing.each_with_index do |prop, i| %>
5
+ <%= yieldall :object => prop, :owner => object, :index => i %>
6
+ <% end %>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <% groups(property_listing, "Property") do |list, title| %>
2
+ <h2><%= title %>
3
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
4
+ </h2>
5
+
6
+ <ul class="summary">
7
+ <% list.each do |prop| %>
8
+ <%= yieldall :item => prop %>
9
+ <% end %>
10
+ </ul>
11
+ <% end %>
@@ -0,0 +1,75 @@
1
+ def init
2
+ sections :header, :box_info, :pre_docstring, T('docstring'), :children,
3
+ :constant_summary, [T('docstring')], :inherited_constants,
4
+ :constructor_summary, [:item_summary],
5
+ :events_summary, [:item_summary],
6
+ :properties_summary, [:item_summary], :inherited_properties,
7
+ :method_summary, [:item_summary], :inherited_methods,
8
+ :methodmissing,
9
+ :events_details, [T('method_details')],
10
+ :properties_details, [T('method_details')],
11
+ :methods_details, [T('method_details')]
12
+ end
13
+
14
+ # Placeholder for class inheritance
15
+ def methodmissing; end
16
+
17
+ def constructor_summary
18
+ list = object.properties.select {|p| p.constructor? }
19
+ list = sort_listing(prune_method_listing(list))
20
+ if @constructor = list.first
21
+ erb(:constructor_summary)
22
+ end
23
+ end
24
+
25
+ def event_listing
26
+ @event_listing ||= object.events
27
+ end
28
+
29
+ def property_listing
30
+ return @property_listing if @property_listing
31
+
32
+ list = object.properties.
33
+ select {|p| p.property_type != :function }.
34
+ reject {|p| p.constructor? || p.tag(:constant) }
35
+ list = sort_listing(prune_method_listing(list))
36
+ @property_listing = list
37
+ end
38
+
39
+ def inherited_property_list
40
+ object.inheritance_tree(true)[1..-1].each do |superclass|
41
+ next if superclass.is_a?(YARD::CodeObjects::Proxy)
42
+ props = prune_method_listing(superclass.properties, false)
43
+ props = props.
44
+ select {|p| p.property_type != :function }.
45
+ reject {|p| object.child(:name => p.name) }.
46
+ reject {|p| p.constructor? || p.tag(:constant) }
47
+ yield superclass, props if props.size > 0
48
+ end
49
+ end
50
+
51
+ def method_listing
52
+ return @method_listing if @method_listing
53
+
54
+ list = object.properties.
55
+ select {|p| p.property_type == :function }.
56
+ reject {|p| p.constructor? }
57
+ list = sort_listing(prune_method_listing(list))
58
+ @method_listing = list
59
+ end
60
+
61
+ def inherited_method_list
62
+ object.inheritance_tree(true)[1..-1].each do |superclass|
63
+ next if superclass.is_a?(YARD::CodeObjects::Proxy)
64
+ props = prune_method_listing(superclass.properties, false)
65
+ props = props.
66
+ select {|p| p.property_type == :function }.
67
+ reject {|p| object.child(:name => p.name) }.
68
+ reject {|p| p.constructor? }
69
+ yield superclass, props if props.size > 0
70
+ end
71
+ end
72
+
73
+ def scopes(list)
74
+ yield(list, '') if list.size > 0
75
+ end