yard 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yard might be problematic. Click here for more details.

Files changed (43) hide show
  1. data/ChangeLog +205 -0
  2. data/README.md +52 -73
  3. data/Rakefile +17 -2
  4. data/docs/GettingStarted.md +6 -2
  5. data/lib/yard.rb +1 -1
  6. data/lib/yard/cli/yri.rb +1 -1
  7. data/lib/yard/code_objects/macro_object.rb +1 -1
  8. data/lib/yard/handlers/base.rb +1 -1
  9. data/lib/yard/handlers/ruby/attribute_handler.rb +1 -1
  10. data/lib/yard/handlers/ruby/base.rb +2 -2
  11. data/lib/yard/handlers/ruby/exception_handler.rb +9 -7
  12. data/lib/yard/handlers/ruby/legacy/exception_handler.rb +3 -4
  13. data/lib/yard/handlers/ruby/visibility_handler.rb +1 -1
  14. data/lib/yard/parser/c_parser.rb +40 -5
  15. data/lib/yard/parser/ruby/ast_node.rb +2 -1
  16. data/lib/yard/parser/ruby/ruby_parser.rb +47 -7
  17. data/lib/yard/parser/source_parser.rb +13 -2
  18. data/lib/yard/rubygems/specification.rb +2 -2
  19. data/lib/yard/templates/helpers/html_helper.rb +13 -8
  20. data/lib/yard/templates/helpers/markup_helper.rb +1 -1
  21. data/lib/yard/verifier.rb +2 -2
  22. data/spec/cli/server_spec.rb +7 -6
  23. data/spec/cli/yri_spec.rb +1 -1
  24. data/spec/code_objects/extra_file_object_spec.rb +1 -1
  25. data/spec/config_spec.rb +0 -1
  26. data/spec/handlers/base_spec.rb +2 -2
  27. data/spec/handlers/constant_handler_spec.rb +1 -1
  28. data/spec/handlers/examples/exception_handler_001.rb.txt +4 -0
  29. data/spec/handlers/exception_handler_spec.rb +4 -0
  30. data/spec/handlers/ruby/base_spec.rb +3 -3
  31. data/spec/parser/c_parser_spec.rb +100 -11
  32. data/spec/parser/ruby/ast_node_spec.rb +2 -1
  33. data/spec/parser/ruby/ruby_parser_spec.rb +43 -2
  34. data/spec/parser/source_parser_spec.rb +2 -1
  35. data/spec/templates/examples/method001.html +3 -2
  36. data/spec/templates/helpers/html_helper_spec.rb +26 -5
  37. data/templates/default/fulldoc/html/css/full_list.css +2 -0
  38. data/templates/default/fulldoc/html/css/style.css +2 -0
  39. data/templates/default/fulldoc/html/full_list_methods.erb +1 -1
  40. data/templates/default/fulldoc/html/js/full_list.js +23 -6
  41. data/templates/default/tags/html/option.erb +2 -2
  42. data/templates/guide/fulldoc/html/css/style.css +2 -0
  43. metadata +23 -28
@@ -16,6 +16,8 @@ h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; }
16
16
  #noresults { padding: 7px 12px; }
17
17
  #content.insearch #noresults { margin-left: 7px; }
18
18
  ul.collapsed ul, ul.collapsed li { display: none; }
19
+ ul.collapsed.search_uncollapsed { display: block; }
20
+ ul.collapsed.search_uncollapsed li { display: list-item; }
19
21
  li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
20
22
  li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
21
23
  li { color: #888; cursor: pointer; }
@@ -24,6 +24,8 @@ h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right;
24
24
  .docstring h2 { font-size: 1.1em; }
25
25
  .docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; }
26
26
  .summary_desc .object_link, .docstring .object_link { font-family: monospace; }
27
+ .rdoc-term { padding-right: 25px; font-weight: bold; }
28
+ .rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; }
27
29
 
28
30
  /* style for <ul> */
29
31
  #filecontents li > p, .docstring li > p { margin: 0px; }
@@ -1,7 +1,7 @@
1
1
  <% n = 1 %>
2
2
  <% @items.each do |item| %>
3
3
  <li class="r<%= n %> <%= item.has_tag?(:deprecated) ? 'deprecated' : '' %>">
4
- <%= linkify item, item.name(true) %>
4
+ <%= linkify item, h(item.name(true)) %>
5
5
  <% if item.namespace && !item.namespace.root? %>
6
6
  <small><%= item.namespace %></small>
7
7
  <% else %>
@@ -2,20 +2,35 @@ var inSearch = null;
2
2
  var searchIndex = 0;
3
3
  var searchCache = [];
4
4
  var searchString = '';
5
+ var regexSearchString = '';
6
+ var caseSensitiveMatch = false;
7
+
8
+ RegExp.escape = function(text) {
9
+ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
10
+ }
5
11
 
6
12
  function fullListSearch() {
7
13
  // generate cache
8
14
  searchCache = [];
9
15
  $('#full_list li').each(function() {
10
16
  var link = $(this).find('.object_link a');
11
- searchCache.push({name:link.text(), node:$(this), link:link});
17
+ var fullName = link.attr('title').split(' ')[0];
18
+ searchCache.push({name:link.text(), fullName:fullName, node:$(this), link:link});
12
19
  });
13
20
 
14
21
  $('#search input').keyup(function() {
15
- searchString = this.value.toLowerCase();
22
+ searchString = this.value;
23
+ caseSensitiveMatch = searchString.match(/[A-Z]/) != null;
24
+ regexSearchString = RegExp.escape(searchString);
25
+ if (caseSensitiveMatch) {
26
+ regexSearchString += "|" +
27
+ $.map(searchString.split(''), function(e) { return RegExp.escape(e); }).
28
+ join('.+?');
29
+ }
16
30
  if (searchString === "") {
17
31
  clearTimeout(inSearch);
18
32
  inSearch = null;
33
+ $('ul .search_uncollapsed').removeClass('search_uncollapsed');
19
34
  $('#full_list, #content').removeClass('insearch');
20
35
  $('#full_list li').removeClass('found').each(function() {
21
36
 
@@ -47,16 +62,18 @@ var lastRowClass = '';
47
62
  function searchItem() {
48
63
  for (var i = 0; i < searchCache.length / 50; i++) {
49
64
  var item = searchCache[searchIndex];
50
- if (item.name.toLowerCase().indexOf(searchString) == -1) {
65
+ var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name);
66
+ var matchString = regexSearchString;
67
+ var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i");
68
+ if (searchName.match(matchRegexp) == null) {
51
69
  item.node.removeClass('found');
52
70
  }
53
71
  else {
54
72
  item.node.css('padding-left', '10px').addClass('found');
73
+ item.node.parents().addClass('search_uncollapsed');
55
74
  item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1');
56
75
  lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2';
57
- item.link.html(item.name.replace(new RegExp("(" +
58
- searchString.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
59
- '<strong>$1</strong>'));
76
+ item.link.html(item.name.replace(matchRegexp, "<strong>$&</strong>"));
60
77
  }
61
78
 
62
79
  if (searchCache.length === searchIndex + 1) {
@@ -15,8 +15,8 @@
15
15
  <% end %>
16
16
  </span>
17
17
  <%= "&mdash; " + htmlify_line(tag.pair.text) if tag.pair.text %>
18
- </tr>
18
+ </li>
19
19
  <% end %>
20
20
  </ul>
21
21
  <% end %>
22
- <% end %>
22
+ <% end %>
@@ -28,6 +28,8 @@ ul { list-style: square; }
28
28
  .docstring h3 { font-size: 1.1em; }
29
29
  #filecontents strong { font-weight: normal; color: #000; }
30
30
  .readonly { font-size: 0.75em; color: #888; vertical-align: super; }
31
+ .rdoc-term { padding-right: 25px; font-weight: bold; }
32
+ .rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; }
31
33
 
32
34
  #page { width: 940px; margin: 0px auto; }
33
35
  #top_nav { background: #8e0; padding: 4px 8px; }
metadata CHANGED
@@ -1,30 +1,29 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yard
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.3
4
5
  prerelease:
5
- version: 0.7.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Loren Segal
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-14 00:00:00 -04:00
12
+ date: 2011-10-15 00:00:00.000000000 -04:00
14
13
  default_executable:
15
14
  dependencies: []
16
-
17
- description: " YARD is a documentation generation tool for the Ruby programming language.\n It enables the user to generate consistent, usable documentation that can be\n exported to a number of formats very easily, and also supports extending for\n custom Ruby constructs such as custom class level definitions.\n"
15
+ description: ! " YARD is a documentation generation tool for the Ruby programming
16
+ language.\n It enables the user to generate consistent, usable documentation
17
+ that can be\n exported to a number of formats very easily, and also supports
18
+ extending for\n custom Ruby constructs such as custom class level definitions.\n"
18
19
  email: lsegal@soen.ca
19
- executables:
20
+ executables:
20
21
  - yard
21
22
  - yardoc
22
23
  - yri
23
24
  extensions: []
24
-
25
25
  extra_rdoc_files: []
26
-
27
- files:
26
+ files:
28
27
  - docs/CodeObjects.md
29
28
  - docs/GettingStarted.md
30
29
  - docs/Glossary.md
@@ -509,30 +508,26 @@ files:
509
508
  has_rdoc: yard
510
509
  homepage: http://yardoc.org
511
510
  licenses: []
512
-
513
511
  post_install_message:
514
512
  rdoc_options: []
515
-
516
- require_paths:
513
+ require_paths:
517
514
  - lib
518
- required_ruby_version: !ruby/object:Gem::Requirement
515
+ required_ruby_version: !ruby/object:Gem::Requirement
519
516
  none: false
520
- requirements:
521
- - - ">="
522
- - !ruby/object:Gem::Version
523
- version: "0"
524
- required_rubygems_version: !ruby/object:Gem::Requirement
517
+ requirements:
518
+ - - ! '>='
519
+ - !ruby/object:Gem::Version
520
+ version: '0'
521
+ required_rubygems_version: !ruby/object:Gem::Requirement
525
522
  none: false
526
- requirements:
527
- - - ">="
528
- - !ruby/object:Gem::Version
529
- version: "0"
523
+ requirements:
524
+ - - ! '>='
525
+ - !ruby/object:Gem::Version
526
+ version: '0'
530
527
  requirements: []
531
-
532
528
  rubyforge_project: yard
533
- rubygems_version: 1.3.9.1
529
+ rubygems_version: 1.3.9.3
534
530
  signing_key:
535
531
  specification_version: 3
536
532
  summary: Documentation tool for consistent and usable documentation in Ruby.
537
533
  test_files: []
538
-