jsduck 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. data/README.md +14 -9
  2. data/Rakefile +31 -230
  3. data/jsduck.gemspec +2 -2
  4. data/lib/jsduck/accessors.rb +14 -6
  5. data/lib/jsduck/aggregator.rb +9 -4
  6. data/lib/jsduck/app.rb +1 -0
  7. data/lib/jsduck/app_data.rb +14 -7
  8. data/lib/jsduck/app_exporter.rb +3 -3
  9. data/lib/jsduck/class.rb +8 -5
  10. data/lib/jsduck/class_formatter.rb +1 -3
  11. data/lib/jsduck/css_parser.rb +1 -1
  12. data/lib/jsduck/doc_formatter.rb +140 -36
  13. data/lib/jsduck/doc_parser.rb +27 -44
  14. data/lib/jsduck/index_html.rb +0 -3
  15. data/lib/jsduck/inherit_doc.rb +20 -4
  16. data/lib/jsduck/js_parser.rb +1 -1
  17. data/lib/jsduck/lint.rb +15 -0
  18. data/lib/jsduck/logger.rb +9 -7
  19. data/lib/jsduck/merger.rb +18 -16
  20. data/lib/jsduck/meta_tag.rb +28 -5
  21. data/lib/jsduck/meta_tag_loader.rb +38 -21
  22. data/lib/jsduck/meta_tag_registry.rb +79 -0
  23. data/lib/jsduck/options.rb +69 -12
  24. data/lib/jsduck/renderer.rb +10 -38
  25. data/lib/jsduck/search_data.rb +53 -3
  26. data/lib/jsduck/tag/abstract.rb +14 -0
  27. data/lib/jsduck/{author_tag.rb → tag/author.rb} +2 -2
  28. data/lib/jsduck/tag/deprecated.rb +33 -0
  29. data/lib/jsduck/{doc_author_tag.rb → tag/docauthor.rb} +2 -2
  30. data/lib/jsduck/tag/markdown.rb +12 -0
  31. data/lib/jsduck/tag/preventable.rb +28 -0
  32. data/lib/jsduck/tag/protected.rb +14 -0
  33. data/lib/jsduck/tag/readonly.rb +14 -0
  34. data/lib/jsduck/tag/required.rb +21 -0
  35. data/lib/jsduck/tag/static.rb +14 -0
  36. data/lib/jsduck/tag/template.rb +23 -0
  37. data/opt/example.js +149 -0
  38. metadata +17 -9
  39. data/opt/extjs-welcome.html +0 -74
  40. data/opt/touch-iframe.html +0 -85
  41. data/opt/touch-welcome.html +0 -122
data/README.md CHANGED
@@ -77,15 +77,18 @@ documentation. Guides, videos and examples will not be present.
77
77
  These can be added using more command line options as explained in the
78
78
  [Advanced Usage][adv] section of wiki.
79
79
 
80
- Running JSDuck against older Ext JS than 4.0.7 is expected to generate
81
- a lot of warnings. Similarly your own .js files will probably
82
- generate warnings too. Sorry for that, JSDuck just wants to be
83
- helpful. If you are overwhelmed by the warnings, you can disable them
84
- using `--no-warnings` switch. Another thing that often happens is
85
- that JSDuck is unable to determine into which class a member belongs
86
- and will place all such items into a global class - you can disable
87
- this using the `--ignore-global` switch. For full list of command
88
- line options type `jsduck --help=full`.
80
+ Running latest JSDuck is expected to generate lots of warnings.
81
+ That's because some warning types were added after Ext JS 4.0.7
82
+ release. Sorry for that, JSDuck just wants to be helpful. If you are
83
+ overwhelmed by the warnings, you can disable them selectively using
84
+ something like `--warnings=-link_ambiguous,-no_doc` or you could
85
+ disable them all by `--warnings=-all`.
86
+
87
+ Another thing that often happens is that JSDuck is unable to determine
88
+ into which class a member belongs and will place all such items into a
89
+ global class - you can disable this using the `--ignore-global`
90
+ switch. For full list of all command line options type
91
+ `jsduck --help=full`.
89
92
 
90
93
  [adv]: https://github.com/senchalabs/jsduck/wiki/Advanced-Usage
91
94
 
@@ -100,7 +103,9 @@ Documenting your code
100
103
  ---------------------
101
104
 
102
105
  All the supported syntax is described in the [Guide][].
106
+ For quick overview take a look at [example.js][example].
103
107
 
108
+ [example]: https://github.com/senchalabs/jsduck/blob/master/opt/example.js
104
109
 
105
110
  Copying
106
111
  -------
data/Rakefile CHANGED
@@ -154,34 +154,6 @@ class JsDuckRunner
154
154
  @options += options
155
155
  end
156
156
 
157
- def add_sdk
158
- head_html = <<-EOHTML
159
- <link rel="canonical" href="http://docs.sencha.com/ext-js/4-0/" />
160
- <meta name="description" content="Ext JS 4.0 API Documentation from Sencha. Class documentation, Guides and Videos on how to create Javascript applications with Ext JS 4" />
161
- EOHTML
162
-
163
- @options += [
164
- "--title", "Sencha Docs - Ext JS 4.0",
165
- "--head-html", head_html,
166
- "--footer", "Ext JS 4.0.7 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> rev #{revision}",
167
- "--welcome", "opt/extjs-welcome.html",
168
- "--guides", "#{@sdk_dir}/extjs/docs/guides.json",
169
- "--videos", "#{@sdk_dir}/extjs/docs/videos.json",
170
- "--examples", "#{@sdk_dir}/extjs/examples/examples.json",
171
- "--categories", "#{@sdk_dir}/extjs/docs/categories.json",
172
- "--local-storage-db", "ext-4",
173
- "--output", "#{@out_dir}",
174
- "--builtin-classes",
175
- "--images", "#{@sdk_dir}/extjs/docs/resources",
176
- "--images", "#{@sdk_dir}/platform/docs/resources",
177
- "--stats",
178
- "#{@sdk_dir}/extjs/src",
179
- "#{@sdk_dir}/platform/src",
180
- "#{@sdk_dir}/platform/core/src",
181
- "#{@sdk_dir}/extjs/examples/ux",
182
- ]
183
- end
184
-
185
157
  def add_relative_examples_path
186
158
  @options += ["--head-html", <<-EOHTML]
187
159
  <script type="text/javascript">
@@ -215,34 +187,10 @@ class JsDuckRunner
215
187
  end
216
188
  end
217
189
 
218
- def add_ext3
219
- head_html = <<-EOHTML
220
- <link rel="canonical" href="http://docs.sencha.com/ext-js/3-4/" />
221
- <meta name="description" content="Ext JS 3.4 API Documentation from Sencha. Class documentation, Guides and Videos on how to create Javascript applications with Ext JS 3.4" />
222
- EOHTML
223
-
224
- @options += [
225
- "--title", "Sencha Docs - Ext JS 3.4",
226
- "--footer", "Ext JS 3.4 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
227
- "--categories", "#{@sdk_dir}/../ext-3.4.0/src/categories.json",
228
- "--ignore-global",
229
- "--local-storage-db", "ext-3",
230
- "--output", "#{@out_dir}",
231
- "#{@sdk_dir}/../ext-3.4.0/src/core",
232
- "#{@sdk_dir}/../ext-3.4.0/src/data",
233
- "#{@sdk_dir}/../ext-3.4.0/src/dd",
234
- "#{@sdk_dir}/../ext-3.4.0/src/direct",
235
- "#{@sdk_dir}/../ext-3.4.0/src/ext-core/src",
236
- "#{@sdk_dir}/../ext-3.4.0/src/state",
237
- "#{@sdk_dir}/../ext-3.4.0/src/util",
238
- "#{@sdk_dir}/../ext-3.4.0/src/widgets"
239
- ]
240
- end
241
-
242
190
  def add_ext4
243
191
  @options += [
244
192
  "--title", "Sencha Docs - Ext JS 4.0",
245
- "--footer", "Ext JS 4.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
193
+ "--footer", "Ext JS 4.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> VERSION. <a href='http://www.sencha.com/legal/terms-of-use/'>Terms of Use</a>",
246
194
  "--ignore-global",
247
195
  "--no-warnings",
248
196
  "--images", "#{@ext_dir}/docs/doc-resources",
@@ -252,74 +200,22 @@ class JsDuckRunner
252
200
  ]
253
201
  end
254
202
 
255
- def add_touch
256
- head_html = <<-EOHTML
257
- <link rel="canonical" href="http://docs.sencha.com/touch/1-1/" />
258
- <meta name="description" content="Sencha Touch 1.1 API Documentation from Sencha. Documentation on how to create Javascript applications with Sencha Touch" />
259
- EOHTML
260
-
261
- @options += [
262
- "--title", "Sencha Docs - Touch 1.1",
263
- "--head-html", head_html,
264
- "--footer", "Sencha Touch 1.1 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
265
- "--categories", "#{@sdk_dir}/touch/doc-resources/categories.json",
266
- "--videos", "#{@sdk_dir}/touch/doc-resources/videos.json",
267
- "--local-storage-db", "touch-1",
268
- "--output", "#{@out_dir}",
269
- "--external=google.maps.Map,google.maps.LatLng",
270
- "--images", "#{@sdk_dir}/touch/doc-resources",
271
- "#{@sdk_dir}/touch/resources/themes/stylesheets/sencha-touch/default",
272
- ]
273
-
274
- @options += extract_jsb_build_files("#{@sdk_dir}/touch/sencha-touch.jsb3")
275
- end
276
-
277
- def add_touch2
278
- head_html = <<-EOHTML
279
- <link rel="canonical" href="http://docs.sencha.com/touch/2-0/" />
280
- <meta name="description" content="Sencha Touch 2.0 API Documentation from Sencha. Documentation on how to create Javascript applications with Sencha Touch" />
281
- EOHTML
282
-
283
- @options += [
284
- "--title", "Sencha Docs - Touch 2.0",
285
- "--head-html", head_html,
286
- "--footer", "Sencha Touch 2.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
287
- "--categories", "#{@sdk_dir}/touch/docs/categories.json",
288
- "--welcome", "opt/touch-welcome.html",
289
- "--videos", "#{@sdk_dir}/touch/docs/videos.json",
290
- "--guides", "#{@sdk_dir}/touch/docs/guides.json",
291
- "--examples", "#{@sdk_dir}/touch/docs/examples.json",
292
- "--touch-examples-ui",
293
- "--local-storage-db", "touch-2",
294
- "--output", "#{@out_dir}",
295
- "--external=google.maps.Map,google.maps.LatLng",
296
- "--builtin-classes",
297
- "--img", "<p class='screenshot'><img src='%u' alt='%a'><span>%a</span></p>",
298
- "--eg-iframe", "opt/touch-iframe.html",
299
- "--warnings=-image",
300
- # "--stats",
301
- "#{@sdk_dir}/touch/resources/themes/stylesheets/sencha-touch/default",
302
- ]
303
-
304
- @options += extract_jsb_build_files("#{@sdk_dir}/touch/touch.jsb3")
305
- end
306
-
307
203
  def add_touch_export
308
204
  @options += [
309
205
  "--json",
310
206
  "--output", "#{@out_dir}/../export/touch1",
311
207
  "--external=google.maps.Map,google.maps.LatLng",
208
+ "#{@sdk_dir}/touch/sencha-touch.jsb3",
312
209
  ]
313
- @options += extract_jsb_build_files("#{@sdk_dir}/touch/sencha-touch.jsb3")
314
210
  end
315
211
 
316
212
  def add_touch2_export
317
213
  @options += [
318
- "--json",
214
+ "--export", "full",
319
215
  "--output", "#{@out_dir}/../export/touch2",
320
216
  "--external=google.maps.Map,google.maps.LatLng",
217
+ "#{@sdk_dir}/touch/touch.jsb3",
321
218
  ]
322
- @options += extract_jsb_build_files("#{@sdk_dir}/touch/touch.jsb3")
323
219
  end
324
220
 
325
221
  def set_touch2_src
@@ -354,82 +250,6 @@ class JsDuckRunner
354
250
  ]
355
251
  end
356
252
 
357
- def add_touch_charts
358
- head_html = <<-EOHTML
359
- <link rel="canonical" href="http://docs.sencha.com/touch-charts/1-0/" />
360
- <meta name="description" content="Sencha Touch Charts 1.0 API Documentation. Documentation on how to create Charts with Sencha Touch" />
361
- EOHTML
362
-
363
- @options += [
364
- "--title", "Sencha Docs - Touch Charts 1.0",
365
- "--head-html", head_html,
366
- "--footer", "Sencha Touch Charts 1.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a>",
367
- "--categories", "#{@sdk_dir}/charts/docs/categories.json",
368
- "--guides", "#{@sdk_dir}/charts/docs/guides.json",
369
- "--images", "#{@sdk_dir}/charts/docs/resources",
370
- "--local-storage-db", "touch-charts",
371
- "--output", "#{@out_dir}"
372
- ]
373
-
374
- @options += extract_jsb_build_files("#{@sdk_dir}/charts/touch-charts.jsb3")
375
- end
376
-
377
- def add_sencha_io
378
- head_html = <<-EOHTML
379
- <link rel="canonical" href="http://docs.sencha.com/sencha-io/1-0/" />
380
- <meta name="description" content="Sencha.io 1.0 API Documentation. Documentation on how to use the Sencha.io SDK" />
381
- EOHTML
382
-
383
- @options += [
384
- "--title", "Sencha Docs - IO 1.0",
385
- "--head-html", head_html,
386
- "--footer", "Sencha.io 1.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a>",
387
- "--guides", "#{@sdk_dir}/../sync/docs/guides.json",
388
- "--images", "#{@sdk_dir}/../sync/docs/resources",
389
- "--local-storage-db", "sencha-io",
390
- "--ignore-global",
391
- "--output", "#{@out_dir}"
392
- ]
393
-
394
- @options += extract_jsb_build_files("#{@sdk_dir}/../sync/sencha-io.jsb3")
395
- end
396
-
397
- def add_animator
398
- head_html = <<-EOHTML
399
- <link rel="canonical" href="http://docs.sencha.com/animator/1-0/" />
400
- <meta name="description" content="Sencha Animator 1.0 API Documentation from Sencha. Documentation on how to create Javascript applications with Sencha Touch" />
401
- EOHTML
402
-
403
- @options += [
404
- "--title", "Sencha Docs - Animator 1.0",
405
- "--head-html", head_html,
406
- "--footer", "Sencha Animator 1.0 Docs - Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> revison #{revision}",
407
- # "--videos", "#{@animator_dir}/docs/videos.json",
408
- "--guides", "#{@animator_dir}/docs/guides.json",
409
- # "--examples", "#{@animator_dir}/docs/examples/examples.json",
410
- "--local-storage-db", "animator",
411
- "--output", "#{@out_dir}",
412
- ]
413
- end
414
-
415
- # Extracts files of first build in jsb file
416
- def extract_jsb_build_files(jsb_file)
417
- json = JSON.parse(IO.read(jsb_file))
418
- basedir = File.dirname(jsb_file)
419
-
420
- return json["builds"][0]["packages"].map do |package_id|
421
- package = json["packages"].find {|p| p["id"] == package_id }
422
- package["files"].map do |file|
423
- basedir + "/" + file["path"] + file["name"]
424
- end
425
- end.flatten
426
- end
427
-
428
- # Returns shortened hash of naming current git revision
429
- def revision
430
- `git rev-parse HEAD`.slice(0, 7)
431
- end
432
-
433
253
  def add_debug
434
254
  @options += [
435
255
  "--extjs-path", "extjs/ext-all-debug.js",
@@ -444,21 +264,11 @@ class JsDuckRunner
444
264
  ]
445
265
  end
446
266
 
447
- def add_sdk_export_notice
448
- @options += [
449
- "--body-html", <<-EOHTML
450
- <div id="notice-text" style="display: none">
451
- Use <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a> for up to date documentation and features
452
- </div>
453
- EOHTML
454
- ]
455
- end
456
-
457
- def add_touch2_export_notice
267
+ def add_export_notice path
458
268
  @options += [
459
269
  "--body-html", <<-EOHTML
460
270
  <div id="notice-text" style="display: none">
461
- Use <a href="http://docs.sencha.com/touch/2-0">http://docs.sencha.com/touch/2-0</a> for up to date documentation and features
271
+ Use <a href="http://docs.sencha.com/#{path}">http://docs.sencha.com/#{path}</a> for up to date documentation and features
462
272
  </div>
463
273
  EOHTML
464
274
  ]
@@ -530,6 +340,10 @@ class JsDuckRunner
530
340
  {
531
341
  text: 'Sencha Animator',
532
342
  href: 'http://docs.sencha.com/animator/1-0'
343
+ },
344
+ {
345
+ text: 'Sencha.io',
346
+ href: 'http://docs.sencha.com/io/1-0'
533
347
  }
534
348
  ];
535
349
  </script>
@@ -547,11 +361,6 @@ class JsDuckRunner
547
361
  system "cp -r #{@ext_dir}/welcome #{@out_dir}/extjs"
548
362
  end
549
363
 
550
- def copy_animator_examples
551
- system "mkdir -p #{@out_dir}/extjs"
552
- system "cp -r #{@animator_dir}/docs/examples #{@out_dir}/extjs"
553
- end
554
-
555
364
  # Copy over Sencha Touch
556
365
  def copy_touch2_build
557
366
  system "cp -r #{@sdk_dir}/touch/build #{@out_dir}/touch"
@@ -568,12 +377,6 @@ task :sass do
568
377
  system "compass compile --quiet template/resources/sass"
569
378
  end
570
379
 
571
- desc "Updates JSB3 file for Docs app.\n"+
572
- "Run this before every commit that changes JS dependencies."
573
- task :jsb do
574
- system("sencha", "create", "jsb", "-a", "template/build-js.html", "-p", "template/app.jsb3")
575
- end
576
-
577
380
  desc "Run JSDuck on Ext JS SDK (for internal use at Sencha)\n" +
578
381
  "sdk - creates debug/development version\n" +
579
382
  "sdk[export] - creates export version\n" +
@@ -584,10 +387,10 @@ task :sdk, [:mode] => :sass do |t, args|
584
387
  compress if mode == "export" || mode == "live"
585
388
 
586
389
  runner = JsDuckRunner.new
587
- runner.add_sdk
390
+ runner.add_options ["--output", OUT_DIR, "--config", "#{SDK_DIR}/extjs/docs/config.json"]
588
391
  runner.add_debug if mode == "debug"
589
392
  runner.add_seo if mode == "debug" || mode == "live"
590
- runner.add_sdk_export_notice if mode == "export"
393
+ runner.add_export_notice("ext-js/4-0") if mode == "export"
591
394
  runner.add_google_analytics if mode == "live"
592
395
  runner.add_comments('comments-ext-js-4') if mode == "debug" || mode == "live"
593
396
  runner.run
@@ -634,7 +437,7 @@ task :ext3, [:mode] => :sass do |t, args|
634
437
  compress if mode == "export"
635
438
 
636
439
  runner = JsDuckRunner.new
637
- runner.add_ext3
440
+ runner.add_options ["--output", OUT_DIR, "--config", "#{SDK_DIR}/../ext-3.4.0/src/doc-config.json"]
638
441
  runner.add_debug if mode == "debug"
639
442
  runner.add_seo if mode == "live"
640
443
  runner.add_google_analytics if mode == "live"
@@ -650,7 +453,7 @@ task :touch, [:mode] => :sass do |t, args|
650
453
  compress if mode == "live"
651
454
 
652
455
  runner = JsDuckRunner.new
653
- runner.add_touch
456
+ runner.add_options ["--output", OUT_DIR, "--config", "#{SDK_DIR}/touch/doc-resources/config.json"]
654
457
  runner.add_debug if mode == "debug"
655
458
  runner.add_seo if mode == "debug" || mode == "live"
656
459
  runner.add_google_analytics if mode == "live"
@@ -667,9 +470,9 @@ task :touch2, [:mode] => :sass do |t, args|
667
470
  compress if mode == "live" || mode == "export"
668
471
 
669
472
  runner = JsDuckRunner.new
670
- runner.add_touch2
473
+ runner.add_options ["--output", OUT_DIR, "--config", "#{SDK_DIR}/touch/docs/config.json"]
671
474
  runner.add_debug if mode == "debug"
672
- runner.add_touch2_export_notice if mode == "export"
475
+ runner.add_export_notice("touch/2-0") if mode == "export"
673
476
  runner.set_touch2_src if mode == "export"
674
477
  runner.add_seo if mode == "debug" || mode == "live"
675
478
  runner.add_google_analytics if mode == "live"
@@ -689,7 +492,7 @@ task :charts, [:mode] => :sass do |t, args|
689
492
  compress if mode == "live"
690
493
 
691
494
  runner = JsDuckRunner.new
692
- runner.add_touch_charts
495
+ runner.add_options ["--output", OUT_DIR, "--config", "#{SDK_DIR}/charts/docs/config.json"]
693
496
  runner.add_debug if mode == "debug"
694
497
  runner.add_seo if mode == "debug" || mode == "live"
695
498
  runner.add_google_analytics if mode == "live"
@@ -706,26 +509,13 @@ task :senchaio, [:mode] => :sass do |t, args|
706
509
  compress if mode == "live"
707
510
 
708
511
  runner = JsDuckRunner.new
709
- runner.add_sencha_io
512
+ runner.add_options ["--output", OUT_DIR, "--config", "#{SDK_DIR}/../sync/docs/config.json"]
710
513
  runner.add_debug if mode == "debug"
711
514
  runner.add_seo if mode == "debug" || mode == "live"
712
515
  runner.add_google_analytics if mode == "live"
713
516
  runner.run
714
517
  end
715
518
 
716
- desc "Run JSDuck JSON Export (for internal use at Sencha)\n" +
717
- "export[touch] - creates export for Touch 1\n" +
718
- "export[touch2] - creates export for Touch 2"
719
- task :export, [:mode] do |t, args|
720
- mode = args[:mode]
721
- throw "Unknown mode #{mode}" unless ["touch", "touch2"].include?(mode)
722
-
723
- runner = JsDuckRunner.new
724
- runner.add_touch_export if mode == "touch"
725
- runner.add_touch2_export if mode == "touch2"
726
- runner.run
727
- end
728
-
729
519
  desc "Run JSDuck on Sencha Animator (for internal use at Sencha)\n" +
730
520
  "animator - creates debug/development version\n" +
731
521
  "animator[export] - create live version for deployment\n"
@@ -736,13 +526,24 @@ task :animator, [:mode] => :sass do |t, args|
736
526
  compress if mode == "live"
737
527
 
738
528
  runner = JsDuckRunner.new
739
- runner.add_animator
529
+ runner.add_options ["--output", OUT_DIR, "--config", "#{ANIMATOR_DIR}/docs/config.json"]
740
530
  runner.add_debug if mode == "debug"
741
531
  runner.add_seo if mode == "debug" || mode == "live"
742
532
  runner.add_google_analytics if mode == "live"
743
533
  runner.run
534
+ end
744
535
 
745
- runner.copy_animator_examples
536
+ desc "Run JSDuck JSON Export (for internal use at Sencha)\n" +
537
+ "export[touch] - creates export for Touch 1\n" +
538
+ "export[touch2] - creates export for Touch 2"
539
+ task :export, [:mode] do |t, args|
540
+ mode = args[:mode]
541
+ throw "Unknown mode #{mode}" unless ["touch", "touch2"].include?(mode)
542
+
543
+ runner = JsDuckRunner.new
544
+ runner.add_touch_export if mode == "touch"
545
+ runner.add_touch2_export if mode == "touch2"
546
+ runner.run
746
547
  end
747
548
 
748
549
  desc "Build JSDuck gem"
data/jsduck.gemspec CHANGED
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
2
2
  s.required_rubygems_version = ">= 1.3.5"
3
3
 
4
4
  s.name = 'jsduck'
5
- s.version = '3.1.0'
6
- s.date = '2011-11-16'
5
+ s.version = '3.2.1'
6
+ s.date = '2011-12-07'
7
7
  s.summary = "Simple JavaScript Duckumentation generator"
8
8
  s.description = "Documentation generator for Sencha JS frameworks"
9
9
  s.homepage = "https://github.com/senchalabs/jsduck"
@@ -57,8 +57,7 @@ module JsDuck
57
57
  :owner => cfg[:owner],
58
58
  :files => cfg[:files],
59
59
  :id => "method-" + name,
60
- :deprecated => cfg[:deprecated],
61
- :meta => cfg[:meta],
60
+ :meta => clone_meta(cfg),
62
61
  }
63
62
  end
64
63
 
@@ -80,8 +79,7 @@ module JsDuck
80
79
  :owner => cfg[:owner],
81
80
  :files => cfg[:files],
82
81
  :id => "method-" + name,
83
- :deprecated => cfg[:deprecated],
84
- :meta => cfg[:meta]
82
+ :meta => clone_meta(cfg),
85
83
  }
86
84
  end
87
85
 
@@ -117,14 +115,24 @@ module JsDuck
117
115
  :owner => cfg[:owner],
118
116
  :files => cfg[:files],
119
117
  :id => "event-" + name,
120
- :deprecated => cfg[:deprecated],
121
- :meta => cfg[:meta]
118
+ :meta => clone_meta(cfg),
122
119
  }
123
120
  end
124
121
 
125
122
  def upcase_first(str)
126
123
  str[0,1].upcase + str[1..-1]
127
124
  end
125
+
126
+ # Create copy of all meta attributes of config, except the
127
+ # :required which only applies to configs and must not be
128
+ # propagated to methods or events.
129
+ def clone_meta(cfg)
130
+ h = {}
131
+ cfg[:meta].each_pair do |key, value|
132
+ h[:key] = value unless key == :required
133
+ end
134
+ h
135
+ end
128
136
  end
129
137
 
130
138
  end