js2 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,7 @@
1
+ ## Version 0.1.4
2
+ * Minor fix in doc directory
3
+
4
+ ## Version 0.1.3
5
+ * Fixed "js2 rdoc" command
6
+ * Added jamis.rb to the Manifest
7
+ * Added javascript to rewrite rdoc to look more like javascript
data/Manifest CHANGED
@@ -1,6 +1,7 @@
1
1
  Manifest
2
2
  README.md
3
3
  Rakefile
4
+ CHANGELOG
4
5
  bin/js2
5
6
  config/js2.yml
6
7
  js2.gemspec
@@ -24,6 +25,7 @@ lib/js2/util/processor.rb
24
25
  lib/js2/util/rdoc.rb
25
26
  lib/js2/util/sel_decorator.rb
26
27
  lib/js2/util/haml_filter.rb
28
+ lib/js2/util/jamis.rb
27
29
  test/compiled/bar.js
28
30
  test/compiled/basic.comp.js
29
31
  test/compiled/basic.js
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- JS2_VERSION = '0.1.2'
5
+ JS2_VERSION = '0.1.4'
6
6
  Echoe.new('js2', JS2_VERSION) do |p|
7
7
  p.description = ""
8
8
  p.url = "http://github.com/jeffsu/js2"
data/bin/js2 CHANGED
@@ -10,6 +10,7 @@ require 'js2'
10
10
  options = OpenStruct.new
11
11
  options.rails = false
12
12
  options.sleep_time = 1
13
+ options.rdoc_bin = 'rdoc'
13
14
 
14
15
 
15
16
  op = OptionParser.new do |opts|
@@ -44,9 +45,14 @@ op = OptionParser.new do |opts|
44
45
  options.out_dir = d
45
46
  end
46
47
 
47
- opts.on('-h', '--haml-dir DIR', "Direcotry where js2.haml files reside. Defaults to current directory.") do |d|
48
+ opts.on('-h', '--haml-dir DIR', "Directory where js2.haml files reside. Defaults to current directory.") do |d|
48
49
  options.haml_dir = d
49
50
  end
51
+
52
+ opts.on('-d', '--rdoc EXECUTABLE', "Rdoc executable to use. Defaults to 'rdoc'") do |d|
53
+ options.rdoc_bin = d
54
+ end
55
+
50
56
  end
51
57
 
52
58
  main_action = ARGV.first
@@ -120,5 +126,5 @@ elsif main_action == 'compile'
120
126
  puts "Compiling #{Time.now}..." if res[:changed].any?
121
127
  elsif main_action == 'rdoc'
122
128
  res = processor.process!
123
- JS2::Util::Rdoc.build(res[:klasses])
129
+ JS2::Util::Rdoc.build(res[:pages], config.file_handler, options.rdoc_bin)
124
130
  end
data/js2.gemspec CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{js2}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jeff Su"]
9
- s.date = %q{2010-09-06}
9
+ s.date = %q{2010-09-07}
10
10
  s.default_executable = %q{js2}
11
11
  s.description = %q{}
12
12
  s.email = %q{me@jeffsu.com}
13
13
  s.executables = ["js2"]
14
- s.extra_rdoc_files = ["README.md", "bin/js2", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb", "lib/js2/util/haml_filter.rb"]
15
- s.files = ["Manifest", "README.md", "Rakefile", "bin/js2", "config/js2.yml", "js2.gemspec", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb", "lib/js2/util/haml_filter.rb", "test/compiled/bar.js", "test/compiled/basic.comp.js", "test/compiled/basic.js", "test/compiled/foo.js", "test/fixtures/bar.js2", "test/fixtures/basic.js2", "test/fixtures/basic.js2.haml", "test/fixtures/basic.js2.yml", "test/fixtures/curry.js2", "test/fixtures/foo.js2", "test/fixtures/member.js2", "test/fixtures/private.js2", "test/fixtures/property.js2", "test/test_helper.rb", "test/test_js2.rb", "wiki/features.md", "wiki/installation.md"]
14
+ s.extra_rdoc_files = ["README.md", "CHANGELOG", "bin/js2", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb", "lib/js2/util/haml_filter.rb", "lib/js2/util/jamis.rb"]
15
+ s.files = ["Manifest", "README.md", "Rakefile", "CHANGELOG", "bin/js2", "config/js2.yml", "js2.gemspec", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb", "lib/js2/util/haml_filter.rb", "lib/js2/util/jamis.rb", "test/compiled/bar.js", "test/compiled/basic.comp.js", "test/compiled/basic.js", "test/compiled/foo.js", "test/fixtures/bar.js2", "test/fixtures/basic.js2", "test/fixtures/basic.js2.haml", "test/fixtures/basic.js2.yml", "test/fixtures/curry.js2", "test/fixtures/foo.js2", "test/fixtures/member.js2", "test/fixtures/private.js2", "test/fixtures/property.js2", "test/test_helper.rb", "test/test_js2.rb", "wiki/features.md", "wiki/installation.md"]
16
16
  s.homepage = %q{http://github.com/jeffsu/js2}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Js2", "--main", "README.md"]
18
18
  s.require_paths = ["lib"]
@@ -0,0 +1,600 @@
1
+ module RDoc
2
+ module Page
3
+
4
+ FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
5
+
6
+ STYLE = <<CSS
7
+ a {
8
+ color: #00F;
9
+ text-decoration: none;
10
+ }
11
+
12
+ a:hover {
13
+ color: #77F;
14
+ text-decoration: underline;
15
+ }
16
+
17
+ body, td, p {
18
+ font-family: %fonts%;
19
+ background: #FFF;
20
+ color: #000;
21
+ margin: 0px;
22
+ font-size: small;
23
+ }
24
+
25
+ #content {
26
+ margin: 2em;
27
+ }
28
+
29
+ #description p {
30
+ margin-bottom: 0.5em;
31
+ }
32
+
33
+ .sectiontitle {
34
+ margin-top: 1em;
35
+ margin-bottom: 1em;
36
+ padding: 0.5em;
37
+ padding-left: 2em;
38
+ background: #005;
39
+ color: #FFF;
40
+ font-weight: bold;
41
+ border: 1px dotted black;
42
+ }
43
+
44
+ .attr-rw {
45
+ padding-left: 1em;
46
+ padding-right: 1em;
47
+ text-align: center;
48
+ color: #055;
49
+ }
50
+
51
+ .attr-name {
52
+ font-weight: bold;
53
+ }
54
+
55
+ .attr-desc {
56
+ }
57
+
58
+ .attr-value {
59
+ font-family: monospace;
60
+ }
61
+
62
+ .file-title-prefix {
63
+ font-size: large;
64
+ }
65
+
66
+ .file-title {
67
+ font-size: large;
68
+ font-weight: bold;
69
+ background: #005;
70
+ color: #FFF;
71
+ }
72
+
73
+ .banner {
74
+ background: #005;
75
+ color: #FFF;
76
+ border: 1px solid black;
77
+ padding: 1em;
78
+ }
79
+
80
+ .banner td {
81
+ background: transparent;
82
+ color: #FFF;
83
+ }
84
+
85
+ h1 a, h2 a, .sectiontitle a, .banner a {
86
+ color: #FF0;
87
+ }
88
+
89
+ h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
90
+ color: #FF7;
91
+ }
92
+
93
+ .dyn-source {
94
+ display: none;
95
+ background: #FFE;
96
+ color: #000;
97
+ border: 1px dotted black;
98
+ margin: 0.5em 2em 0.5em 2em;
99
+ padding: 0.5em;
100
+ }
101
+
102
+ .dyn-source .cmt {
103
+ color: #00F;
104
+ font-style: italic;
105
+ }
106
+
107
+ .dyn-source .kw {
108
+ color: #070;
109
+ font-weight: bold;
110
+ }
111
+
112
+ .method {
113
+ margin-left: 1em;
114
+ margin-right: 1em;
115
+ margin-bottom: 1em;
116
+ }
117
+
118
+ .description pre {
119
+ padding: 0.5em;
120
+ border: 1px dotted black;
121
+ background: #FFE;
122
+ }
123
+
124
+ .method .title {
125
+ font-family: monospace;
126
+ font-size: large;
127
+ border-bottom: 1px dashed black;
128
+ margin-bottom: 0.3em;
129
+ padding-bottom: 0.1em;
130
+ }
131
+
132
+ .method .description, .method .sourcecode {
133
+ margin-left: 1em;
134
+ }
135
+
136
+ .description p, .sourcecode p {
137
+ margin-bottom: 0.5em;
138
+ }
139
+
140
+ .method .sourcecode p.source-link {
141
+ text-indent: 0em;
142
+ margin-top: 0.5em;
143
+ }
144
+
145
+ .method .aka {
146
+ margin-top: 0.3em;
147
+ margin-left: 1em;
148
+ font-style: italic;
149
+ text-indent: 2em;
150
+ }
151
+
152
+ h1 {
153
+ padding: 1em;
154
+ border: 1px solid black;
155
+ font-size: x-large;
156
+ font-weight: bold;
157
+ color: #FFF;
158
+ background: #007;
159
+ }
160
+
161
+ h2 {
162
+ padding: 0.5em 1em 0.5em 1em;
163
+ border: 1px solid black;
164
+ font-size: large;
165
+ font-weight: bold;
166
+ color: #FFF;
167
+ background: #009;
168
+ }
169
+
170
+ h3, h4, h5, h6 {
171
+ padding: 0.2em 1em 0.2em 1em;
172
+ border: 1px dashed black;
173
+ color: #000;
174
+ background: #AAF;
175
+ }
176
+
177
+ .sourcecode > pre {
178
+ padding: 0.5em;
179
+ border: 1px dotted black;
180
+ background: #FFE;
181
+ }
182
+
183
+ CSS
184
+
185
+ XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
186
+ <!DOCTYPE html
187
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
188
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
189
+ }
190
+
191
+ HEADER = XHTML_PREAMBLE + <<ENDHEADER
192
+ <html>
193
+ <head>
194
+ <title>%title%</title>
195
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
196
+ <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
197
+
198
+ <script language="JavaScript" type="text/javascript">
199
+ // <![CDATA[
200
+
201
+ function toggleSource( id )
202
+ {
203
+ var elem
204
+ var link
205
+
206
+ if( document.getElementById )
207
+ {
208
+ elem = document.getElementById( id )
209
+ link = document.getElementById( "l_" + id )
210
+ }
211
+ else if ( document.all )
212
+ {
213
+ elem = eval( "document.all." + id )
214
+ link = eval( "document.all.l_" + id )
215
+ }
216
+ else
217
+ return false;
218
+
219
+ if( elem.style.display == "block" )
220
+ {
221
+ elem.style.display = "none"
222
+ link.innerHTML = "show source"
223
+ }
224
+ else
225
+ {
226
+ elem.style.display = "block"
227
+ link.innerHTML = "hide source"
228
+ }
229
+ }
230
+
231
+ function openCode( url )
232
+ {
233
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
234
+ }
235
+ // ]]>
236
+ </script>
237
+ </head>
238
+
239
+ <body>
240
+ ENDHEADER
241
+
242
+ FILE_PAGE = <<HTML
243
+ <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
244
+ <tr><td>
245
+ <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
246
+ <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td>
247
+ <td align="right">
248
+ <table border='0' cellspacing="0" cellpadding="2">
249
+ <tr>
250
+ <td>Path:</td>
251
+ <td>%full_path%
252
+ IF:cvsurl
253
+ &nbsp;(<a href="%cvsurl%">CVS</a>)
254
+ ENDIF:cvsurl
255
+ </td>
256
+ </tr>
257
+ <tr>
258
+ <td>Modified:</td>
259
+ <td>%dtm_modified%</td>
260
+ </tr>
261
+ </table>
262
+ </td></tr>
263
+ </table>
264
+ </td></tr>
265
+ </table><br>
266
+ HTML
267
+
268
+ ###################################################################
269
+
270
+ CLASS_PAGE = <<HTML
271
+ <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
272
+ <td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td>
273
+ <td align="right">
274
+ <table cellspacing=0 cellpadding=2>
275
+ <tr valign="top">
276
+ <td>In:</td>
277
+ <td>
278
+ START:infiles
279
+ HREF:full_path_url:full_path:
280
+ IF:cvsurl
281
+ &nbsp;(<a href="%cvsurl%">CVS</a>)
282
+ ENDIF:cvsurl
283
+ END:infiles
284
+ </td>
285
+ </tr>
286
+ IF:parent
287
+ <tr>
288
+ <td>Parent:</td>
289
+ <td>
290
+ IF:par_url
291
+ <a href="%par_url%">
292
+ ENDIF:par_url
293
+ %parent%
294
+ IF:par_url
295
+ </a>
296
+ ENDIF:par_url
297
+ </td>
298
+ </tr>
299
+ ENDIF:parent
300
+ </table>
301
+ </td>
302
+ </tr>
303
+ </table>
304
+ HTML
305
+
306
+ ###################################################################
307
+
308
+ METHOD_LIST = <<HTML
309
+ <div id="content">
310
+ IF:diagram
311
+ <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
312
+ %diagram%
313
+ </td></tr></table>
314
+ ENDIF:diagram
315
+
316
+ IF:description
317
+ <div class="description">%description%</div>
318
+ ENDIF:description
319
+
320
+ IF:requires
321
+ <div class="sectiontitle">Required Files</div>
322
+ <ul>
323
+ START:requires
324
+ <li>HREF:aref:name:</li>
325
+ END:requires
326
+ </ul>
327
+ ENDIF:requires
328
+
329
+ IF:toc
330
+ <div class="sectiontitle">Contents</div>
331
+ <ul>
332
+ START:toc
333
+ <li><a href="#%href%">%secname%</a></li>
334
+ END:toc
335
+ </ul>
336
+ ENDIF:toc
337
+
338
+ IF:methods
339
+ <div class="sectiontitle">Methods</div>
340
+ <ul>
341
+ START:methods
342
+ <li>HREF:aref:name:</li>
343
+ END:methods
344
+ </ul>
345
+ ENDIF:methods
346
+
347
+ IF:includes
348
+ <div class="sectiontitle">Included Modules</div>
349
+ <ul>
350
+ START:includes
351
+ <li>HREF:aref:name:</li>
352
+ END:includes
353
+ </ul>
354
+ ENDIF:includes
355
+
356
+ START:sections
357
+ IF:sectitle
358
+ <div class="sectiontitle"><a nem="%secsequence%">%sectitle%</a></div>
359
+ IF:seccomment
360
+ <div class="description">
361
+ %seccomment%
362
+ </div>
363
+ ENDIF:seccomment
364
+ ENDIF:sectitle
365
+
366
+ IF:classlist
367
+ <div class="sectiontitle">Classes and Modules</div>
368
+ %classlist%
369
+ ENDIF:classlist
370
+
371
+ IF:constants
372
+ <div class="sectiontitle">Constants</div>
373
+ <table border='0' cellpadding='5'>
374
+ START:constants
375
+ <tr valign='top'>
376
+ <td class="attr-name">%name%</td>
377
+ <td>=</td>
378
+ <td class="attr-value">%value%</td>
379
+ </tr>
380
+ IF:desc
381
+ <tr valign='top'>
382
+ <td>&nbsp;</td>
383
+ <td colspan="2" class="attr-desc">%desc%</td>
384
+ </tr>
385
+ ENDIF:desc
386
+ END:constants
387
+ </table>
388
+ ENDIF:constants
389
+
390
+ IF:attributes
391
+ <div class="sectiontitle">Attributes</div>
392
+ <table border='0' cellpadding='5'>
393
+ START:attributes
394
+ <tr valign='top'>
395
+ <td class='attr-rw'>
396
+ IF:rw
397
+ [%rw%]
398
+ ENDIF:rw
399
+ </td>
400
+ <td class='attr-name'>%name%</td>
401
+ <td class='attr-desc'>%a_desc%</td>
402
+ </tr>
403
+ END:attributes
404
+ </table>
405
+ ENDIF:attributes
406
+
407
+ IF:method_list
408
+ START:method_list
409
+ IF:methods
410
+ <div class="sectiontitle">%type% %category% methods</div>
411
+ START:methods
412
+ <div class="method">
413
+ <div class="title">
414
+ IF:callseq
415
+ <a name="%aref%"></a><b>%callseq%</b>
416
+ ENDIF:callseq
417
+ IFNOT:callseq
418
+ <a name="%aref%"></a><b>%name%</b>%params%
419
+ ENDIF:callseq
420
+ IF:codeurl
421
+ [ <a href="javascript:openCode('%codeurl%')">source</a> ]
422
+ ENDIF:codeurl
423
+ </div>
424
+ IF:m_desc
425
+ <div class="description">
426
+ %m_desc%
427
+ </div>
428
+ ENDIF:m_desc
429
+ IF:aka
430
+ <div class="aka">
431
+ This method is also aliased as
432
+ START:aka
433
+ <a href="%aref%">%name%</a>
434
+ END:aka
435
+ </div>
436
+ ENDIF:aka
437
+ IF:sourcecode
438
+ <div class="sourcecode">
439
+ <p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p>
440
+ <div id="%aref%_source" class="dyn-source">
441
+ <pre>
442
+ %sourcecode%
443
+ </pre>
444
+ </div>
445
+ </div>
446
+ ENDIF:sourcecode
447
+ </div>
448
+ END:methods
449
+ ENDIF:methods
450
+ END:method_list
451
+ ENDIF:method_list
452
+ END:sections
453
+ </div>
454
+ HTML
455
+
456
+ FOOTER = <<ENDFOOTER
457
+ </body>
458
+ </html>
459
+ ENDFOOTER
460
+
461
+ BODY = HEADER + <<ENDBODY
462
+ !INCLUDE! <!-- banner header -->
463
+
464
+ <div id="bodyContent">
465
+ #{METHOD_LIST}
466
+ </div>
467
+
468
+ #{FOOTER}
469
+ ENDBODY
470
+
471
+ ########################## Source code ##########################
472
+
473
+ SRC_PAGE = XHTML_PREAMBLE + <<HTML
474
+ <html>
475
+ <head><title>%title%</title>
476
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
477
+ <style>
478
+ .ruby-comment { color: green; font-style: italic }
479
+ .ruby-constant { color: #4433aa; font-weight: bold; }
480
+ .ruby-identifier { color: #222222; }
481
+ .ruby-ivar { color: #2233dd; }
482
+ .ruby-keyword { color: #3333FF; font-weight: bold }
483
+ .ruby-node { color: #777777; }
484
+ .ruby-operator { color: #111111; }
485
+ .ruby-regexp { color: #662222; }
486
+ .ruby-value { color: #662222; font-style: italic }
487
+ .kw { color: #3333FF; font-weight: bold }
488
+ .cmt { color: green; font-style: italic }
489
+ .str { color: #662222; font-style: italic }
490
+ .re { color: #662222; }
491
+ </style>
492
+ </head>
493
+ <body bgcolor="white">
494
+ <pre>%code%</pre>
495
+ <script>
496
+ function clean () {
497
+ var eles = document.getElementsByClassName('ruby-comment');
498
+ for (var i=0,e; e=eles[i]; i++) {
499
+ e.innerHTML = e.innerHTML.replace(/^#/, '');
500
+ }
501
+ }
502
+ clean();
503
+ </script>
504
+ </body>
505
+ </html>
506
+ HTML
507
+
508
+ ########################## Index ################################
509
+
510
+ FR_INDEX_BODY = <<HTML
511
+ !INCLUDE!
512
+ HTML
513
+
514
+ FILE_INDEX = XHTML_PREAMBLE + <<HTML
515
+ <html>
516
+ <head>
517
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
518
+ <style>
519
+ <!--
520
+ body {
521
+ background-color: #EEE;
522
+ font-family: #{FONTS};
523
+ color: #000;
524
+ margin: 0px;
525
+ }
526
+ .banner {
527
+ background: #005;
528
+ color: #FFF;
529
+ padding: 0.2em;
530
+ font-size: small;
531
+ font-weight: bold;
532
+ text-align: center;
533
+ }
534
+ .entries {
535
+ margin: 0.25em 1em 0 1em;
536
+ font-size: x-small;
537
+ }
538
+ a {
539
+ color: #00F;
540
+ text-decoration: none;
541
+ white-space: nowrap;
542
+ }
543
+ a:hover {
544
+ color: #77F;
545
+ text-decoration: underline;
546
+ }
547
+ -->
548
+ </style>
549
+ <base target="docwin">
550
+ </head>
551
+ <body>
552
+ <div class="banner">%list_title%</div>
553
+ <div class="entries">
554
+ START:entries
555
+ <a href="%href%">%name%</a><br>
556
+ END:entries
557
+ </div>
558
+ </body></html>
559
+ HTML
560
+
561
+ CLASS_INDEX = FILE_INDEX
562
+ METHOD_INDEX = FILE_INDEX
563
+
564
+ INDEX = XHTML_PREAMBLE + <<HTML
565
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
566
+ <head>
567
+ <title>%title%</title>
568
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
569
+ </head>
570
+
571
+ <frameset cols="20%,*">
572
+ <frameset rows="15%,35%,50%">
573
+ <frame src="fr_file_index.html" title="Files" name="Files" />
574
+ <frame src="fr_class_index.html" name="Classes" />
575
+ <frame src="fr_method_index.html" name="Methods" />
576
+ </frameset>
577
+ IF:inline_source
578
+ <frame src="%initial_page%" name="docwin">
579
+ ENDIF:inline_source
580
+ IFNOT:inline_source
581
+ <frameset rows="80%,20%">
582
+ <frame src="%initial_page%" name="docwin">
583
+ <frame src="blank.html" name="source">
584
+ </frameset>
585
+ ENDIF:inline_source
586
+ <noframes>
587
+ <body bgcolor="white">
588
+ Click <a href="html/index.html">here</a> for a non-frames
589
+ version of this page.
590
+ </body>
591
+ </noframes>
592
+ </frameset>
593
+
594
+ </html>
595
+ HTML
596
+
597
+ end
598
+ end
599
+
600
+
data/lib/js2/util/rdoc.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  class JS2::Util::Rdoc
2
2
 
3
- def self.build (pages, file_handler)
3
+ def self.build (pages, file_handler, rdoc_bin = 'rdoc')
4
+ file_handler.doc_dir = "./.#{Time.now.to_i.to_s}-doc-code"
4
5
 
5
6
  pages.each do |p|
6
7
  str = ''
@@ -28,7 +29,8 @@ class JS2::Util::Rdoc
28
29
 
29
30
  # TODO make this portable
30
31
  jamis = File.dirname(__FILE__) + '/jamis.rb'
31
- system("rdoc --template #{jamis} --extension js=rb #{file_handler.doc_dir}")
32
+ puts `#{rdoc_bin} --template #{jamis} --extension js=rb #{file_handler.doc_dir}`
33
+ puts `rm -rf #{file_handler.doc_dir}`
32
34
  end
33
35
 
34
36
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Su
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-06 00:00:00 +08:00
18
+ date: 2010-09-07 00:00:00 +08:00
19
19
  default_executable: js2
20
20
  dependencies: []
21
21
 
@@ -27,6 +27,7 @@ extensions: []
27
27
 
28
28
  extra_rdoc_files:
29
29
  - README.md
30
+ - CHANGELOG
30
31
  - bin/js2
31
32
  - lib/js2.rb
32
33
  - lib/js2/parser/haml.rb
@@ -48,10 +49,12 @@ extra_rdoc_files:
48
49
  - lib/js2/util/rdoc.rb
49
50
  - lib/js2/util/sel_decorator.rb
50
51
  - lib/js2/util/haml_filter.rb
52
+ - lib/js2/util/jamis.rb
51
53
  files:
52
54
  - Manifest
53
55
  - README.md
54
56
  - Rakefile
57
+ - CHANGELOG
55
58
  - bin/js2
56
59
  - config/js2.yml
57
60
  - js2.gemspec
@@ -75,6 +78,7 @@ files:
75
78
  - lib/js2/util/rdoc.rb
76
79
  - lib/js2/util/sel_decorator.rb
77
80
  - lib/js2/util/haml_filter.rb
81
+ - lib/js2/util/jamis.rb
78
82
  - test/compiled/bar.js
79
83
  - test/compiled/basic.comp.js
80
84
  - test/compiled/basic.js