yard 0.6.1 → 0.6.2

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 (93) hide show
  1. data/ChangeLog +356 -0
  2. data/README.md +27 -5
  3. data/docs/GettingStarted.md +45 -6
  4. data/docs/Tags.md +16 -5
  5. data/docs/WhatsNew.md +60 -2
  6. data/lib/yard.rb +16 -37
  7. data/lib/yard/autoload.rb +5 -0
  8. data/lib/yard/cli/command.rb +18 -6
  9. data/lib/yard/cli/command_parser.rb +1 -0
  10. data/lib/yard/cli/config.rb +113 -0
  11. data/lib/yard/cli/gems.rb +16 -7
  12. data/lib/yard/cli/server.rb +30 -8
  13. data/lib/yard/cli/stats.rb +1 -1
  14. data/lib/yard/cli/yardoc.rb +16 -1
  15. data/lib/yard/code_objects/base.rb +7 -2
  16. data/lib/yard/code_objects/class_object.rb +1 -0
  17. data/lib/yard/code_objects/method_object.rb +1 -0
  18. data/lib/yard/code_objects/proxy.rb +8 -2
  19. data/lib/yard/config.rb +225 -0
  20. data/lib/yard/handlers/base.rb +29 -2
  21. data/lib/yard/handlers/processor.rb +1 -1
  22. data/lib/yard/handlers/ruby/class_handler.rb +6 -1
  23. data/lib/yard/handlers/ruby/constant_handler.rb +13 -15
  24. data/lib/yard/handlers/ruby/exception_handler.rb +1 -1
  25. data/lib/yard/handlers/ruby/extend_handler.rb +3 -0
  26. data/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +1 -0
  27. data/lib/yard/handlers/ruby/legacy/class_handler.rb +7 -1
  28. data/lib/yard/handlers/ruby/legacy/constant_handler.rb +8 -10
  29. data/lib/yard/handlers/ruby/legacy/exception_handler.rb +1 -1
  30. data/lib/yard/handlers/ruby/legacy/extend_handler.rb +3 -0
  31. data/lib/yard/handlers/ruby/legacy/method_handler.rb +1 -0
  32. data/lib/yard/handlers/ruby/legacy/mixin_handler.rb +13 -2
  33. data/lib/yard/handlers/ruby/method_handler.rb +1 -0
  34. data/lib/yard/handlers/ruby/mixin_handler.rb +14 -4
  35. data/lib/yard/handlers/ruby/struct_handler_methods.rb +10 -1
  36. data/lib/yard/handlers/ruby/visibility_handler.rb +1 -1
  37. data/lib/yard/parser/c_parser.rb +26 -11
  38. data/lib/yard/parser/ruby/legacy/statement_list.rb +26 -9
  39. data/lib/yard/parser/source_parser.rb +5 -2
  40. data/lib/yard/serializers/yardoc_serializer.rb +2 -2
  41. data/lib/yard/server.rb +11 -0
  42. data/lib/yard/server/commands/frames_command.rb +1 -1
  43. data/lib/yard/server/commands/library_command.rb +22 -13
  44. data/lib/yard/server/commands/library_index_command.rb +1 -0
  45. data/lib/yard/server/commands/search_command.rb +2 -0
  46. data/lib/yard/server/commands/static_file_command.rb +6 -1
  47. data/lib/yard/server/templates/doc_server/processing/html/processing.erb +3 -3
  48. data/lib/yard/templates/helpers/html_helper.rb +1 -1
  49. data/lib/yard/templates/helpers/markup_helper.rb +13 -12
  50. data/lib/yard/verifier.rb +3 -1
  51. data/spec/cli/config_spec.rb +72 -0
  52. data/spec/cli/gems_spec.rb +81 -0
  53. data/spec/cli/server_spec.rb +35 -5
  54. data/spec/cli/stats_spec.rb +15 -0
  55. data/spec/cli/yardoc_spec.rb +39 -1
  56. data/spec/code_objects/base_spec.rb +2 -0
  57. data/spec/code_objects/method_object_spec.rb +5 -0
  58. data/spec/code_objects/proxy_spec.rb +20 -5
  59. data/spec/config_spec.rb +165 -0
  60. data/spec/handlers/alias_handler_spec.rb +7 -0
  61. data/spec/handlers/base_spec.rb +64 -0
  62. data/spec/handlers/class_condition_handler_spec.rb +13 -8
  63. data/spec/handlers/class_handler_spec.rb +54 -46
  64. data/spec/handlers/constant_handler_spec.rb +13 -0
  65. data/spec/handlers/examples/alias_handler_001.rb.txt +2 -0
  66. data/spec/handlers/examples/class_handler_001.rb.txt +12 -1
  67. data/spec/handlers/examples/constant_handler_001.rb.txt +6 -0
  68. data/spec/handlers/examples/exception_handler_001.rb.txt +8 -0
  69. data/spec/handlers/examples/method_handler_001.rb.txt +6 -0
  70. data/spec/handlers/examples/visibility_handler_001.rb.txt +3 -0
  71. data/spec/handlers/exception_handler_spec.rb +5 -0
  72. data/spec/handlers/extend_handler_spec.rb +4 -0
  73. data/spec/handlers/method_handler_spec.rb +5 -0
  74. data/spec/handlers/mixin_handler_spec.rb +10 -0
  75. data/spec/handlers/visibility_handler_spec.rb +4 -0
  76. data/spec/parser/base_spec.rb +1 -1
  77. data/spec/parser/c_parser_spec.rb +39 -1
  78. data/spec/parser/examples/override.c.txt +424 -0
  79. data/spec/parser/ruby/legacy/statement_list_spec.rb +11 -0
  80. data/spec/parser/source_parser_spec.rb +33 -1
  81. data/spec/server/commands/static_file_command_spec.rb +20 -3
  82. data/spec/server_spec.rb +10 -0
  83. data/spec/templates/examples/method001.html +33 -3
  84. data/spec/templates/examples/method001.txt +8 -1
  85. data/spec/templates/helpers/markup_helper_spec.rb +21 -26
  86. data/spec/templates/method_spec.rb +3 -1
  87. data/spec/verifier_spec.rb +5 -0
  88. data/templates/default/fulldoc/html/css/style.css +4 -1
  89. data/templates/default/fulldoc/html/js/app.js +1 -1
  90. data/templates/default/tags/html/option.erb +1 -3
  91. data/templates/default/tags/setup.rb +18 -15
  92. metadata +11 -4
  93. data/spec/yard_spec.rb +0 -55
@@ -1,55 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "spec_helper")
2
-
3
- describe YARD do
4
- describe '.load_plugins' do
5
- it "should load any plugin starting with 'yard_' or 'yard-'" do
6
- plugins = {
7
- 'yard' => mock('yard'),
8
- 'yard_plugin' => mock('yard_plugin'),
9
- 'yard-plugin' => mock('yard-plugin'),
10
- 'my-yard-plugin' => mock('yard-plugin'),
11
- 'rspec' => mock('rspec'),
12
- }
13
- plugins.each do |k, v|
14
- v.should_receive(:name).at_least(1).times.and_return(k)
15
- end
16
-
17
- source_mock = mock(:source_index)
18
- source_mock.should_receive(:find_name).with('').and_return(plugins.values)
19
- Gem.should_receive(:source_index).and_return(source_mock)
20
- YARD.should_receive(:require).with('yard_plugin').and_return(true)
21
- YARD.should_receive(:require).with('yard-plugin').and_return(true)
22
- log.should_receive(:debug).with(/Loading plugin 'yard_plugin'/).once
23
- log.should_receive(:debug).with(/Loading plugin 'yard-plugin'/).once
24
- YARD.load_plugins.should == true
25
- end
26
-
27
- it "should ignore any plugins specified in '~/.yard/ignored_plugins'" do
28
- path = File.expand_path("~/.yard/ignored_plugins")
29
- plugins = {
30
- 'yard-plugin' => mock('yard-plugin'),
31
- 'yard-plugin2' => mock('yard-plugin2'),
32
- 'yard-plugin3' => mock('yard-plugin3'),
33
- }
34
- plugins.each do |k, v|
35
- v.should_receive(:name).at_least(1).times.and_return(k)
36
- end
37
- source_mock = mock(:source_index)
38
- source_mock.should_receive(:find_name).with('').and_return(plugins.values)
39
- File.should_receive(:file?).with(path).and_return(true)
40
- IO.should_receive(:read).with(path).and_return('yard-plugin yard-plugin2')
41
- Gem.should_receive(:source_index).and_return(source_mock)
42
- YARD.should_receive(:require).with('yard-plugin3').and_return(true)
43
- log.should_receive(:debug).with(/Loading plugin 'yard-plugin3'/).once
44
- YARD.load_plugins.should == true
45
- end
46
-
47
- it "should not load plugins starting with yard-doc-" do
48
- mock = mock('yard-doc-core')
49
- mock.should_receive(:name).at_least(1).times.and_return('yard-doc-core')
50
- Gem.source_index.should_receive(:find_name).with('').and_return([mock])
51
- YARD.should_not_receive(:require)
52
- YARD.load_plugins.should == true
53
- end
54
- end
55
- end