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.
- data/ChangeLog +356 -0
- data/README.md +27 -5
- data/docs/GettingStarted.md +45 -6
- data/docs/Tags.md +16 -5
- data/docs/WhatsNew.md +60 -2
- data/lib/yard.rb +16 -37
- data/lib/yard/autoload.rb +5 -0
- data/lib/yard/cli/command.rb +18 -6
- data/lib/yard/cli/command_parser.rb +1 -0
- data/lib/yard/cli/config.rb +113 -0
- data/lib/yard/cli/gems.rb +16 -7
- data/lib/yard/cli/server.rb +30 -8
- data/lib/yard/cli/stats.rb +1 -1
- data/lib/yard/cli/yardoc.rb +16 -1
- data/lib/yard/code_objects/base.rb +7 -2
- data/lib/yard/code_objects/class_object.rb +1 -0
- data/lib/yard/code_objects/method_object.rb +1 -0
- data/lib/yard/code_objects/proxy.rb +8 -2
- data/lib/yard/config.rb +225 -0
- data/lib/yard/handlers/base.rb +29 -2
- data/lib/yard/handlers/processor.rb +1 -1
- data/lib/yard/handlers/ruby/class_handler.rb +6 -1
- data/lib/yard/handlers/ruby/constant_handler.rb +13 -15
- data/lib/yard/handlers/ruby/exception_handler.rb +1 -1
- data/lib/yard/handlers/ruby/extend_handler.rb +3 -0
- data/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/class_handler.rb +7 -1
- data/lib/yard/handlers/ruby/legacy/constant_handler.rb +8 -10
- data/lib/yard/handlers/ruby/legacy/exception_handler.rb +1 -1
- data/lib/yard/handlers/ruby/legacy/extend_handler.rb +3 -0
- data/lib/yard/handlers/ruby/legacy/method_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/mixin_handler.rb +13 -2
- data/lib/yard/handlers/ruby/method_handler.rb +1 -0
- data/lib/yard/handlers/ruby/mixin_handler.rb +14 -4
- data/lib/yard/handlers/ruby/struct_handler_methods.rb +10 -1
- data/lib/yard/handlers/ruby/visibility_handler.rb +1 -1
- data/lib/yard/parser/c_parser.rb +26 -11
- data/lib/yard/parser/ruby/legacy/statement_list.rb +26 -9
- data/lib/yard/parser/source_parser.rb +5 -2
- data/lib/yard/serializers/yardoc_serializer.rb +2 -2
- data/lib/yard/server.rb +11 -0
- data/lib/yard/server/commands/frames_command.rb +1 -1
- data/lib/yard/server/commands/library_command.rb +22 -13
- data/lib/yard/server/commands/library_index_command.rb +1 -0
- data/lib/yard/server/commands/search_command.rb +2 -0
- data/lib/yard/server/commands/static_file_command.rb +6 -1
- data/lib/yard/server/templates/doc_server/processing/html/processing.erb +3 -3
- data/lib/yard/templates/helpers/html_helper.rb +1 -1
- data/lib/yard/templates/helpers/markup_helper.rb +13 -12
- data/lib/yard/verifier.rb +3 -1
- data/spec/cli/config_spec.rb +72 -0
- data/spec/cli/gems_spec.rb +81 -0
- data/spec/cli/server_spec.rb +35 -5
- data/spec/cli/stats_spec.rb +15 -0
- data/spec/cli/yardoc_spec.rb +39 -1
- data/spec/code_objects/base_spec.rb +2 -0
- data/spec/code_objects/method_object_spec.rb +5 -0
- data/spec/code_objects/proxy_spec.rb +20 -5
- data/spec/config_spec.rb +165 -0
- data/spec/handlers/alias_handler_spec.rb +7 -0
- data/spec/handlers/base_spec.rb +64 -0
- data/spec/handlers/class_condition_handler_spec.rb +13 -8
- data/spec/handlers/class_handler_spec.rb +54 -46
- data/spec/handlers/constant_handler_spec.rb +13 -0
- data/spec/handlers/examples/alias_handler_001.rb.txt +2 -0
- data/spec/handlers/examples/class_handler_001.rb.txt +12 -1
- data/spec/handlers/examples/constant_handler_001.rb.txt +6 -0
- data/spec/handlers/examples/exception_handler_001.rb.txt +8 -0
- data/spec/handlers/examples/method_handler_001.rb.txt +6 -0
- data/spec/handlers/examples/visibility_handler_001.rb.txt +3 -0
- data/spec/handlers/exception_handler_spec.rb +5 -0
- data/spec/handlers/extend_handler_spec.rb +4 -0
- data/spec/handlers/method_handler_spec.rb +5 -0
- data/spec/handlers/mixin_handler_spec.rb +10 -0
- data/spec/handlers/visibility_handler_spec.rb +4 -0
- data/spec/parser/base_spec.rb +1 -1
- data/spec/parser/c_parser_spec.rb +39 -1
- data/spec/parser/examples/override.c.txt +424 -0
- data/spec/parser/ruby/legacy/statement_list_spec.rb +11 -0
- data/spec/parser/source_parser_spec.rb +33 -1
- data/spec/server/commands/static_file_command_spec.rb +20 -3
- data/spec/server_spec.rb +10 -0
- data/spec/templates/examples/method001.html +33 -3
- data/spec/templates/examples/method001.txt +8 -1
- data/spec/templates/helpers/markup_helper_spec.rb +21 -26
- data/spec/templates/method_spec.rb +3 -1
- data/spec/verifier_spec.rb +5 -0
- data/templates/default/fulldoc/html/css/style.css +4 -1
- data/templates/default/fulldoc/html/js/app.js +1 -1
- data/templates/default/tags/html/option.erb +1 -3
- data/templates/default/tags/setup.rb +18 -15
- metadata +11 -4
- data/spec/yard_spec.rb +0 -55
data/spec/yard_spec.rb
DELETED
@@ -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
|