yard 0.8.3 → 0.8.4
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 +197 -38
- data/LICENSE +1 -1
- data/README.md +15 -4
- data/docs/GettingStarted.md +6 -6
- data/docs/WhatsNew.md +5 -0
- data/docs/images/code-objects-class-diagram.png +0 -0
- data/docs/images/handlers-class-diagram.png +0 -0
- data/docs/images/overview-class-diagram.png +0 -0
- data/docs/images/parser-class-diagram.png +0 -0
- data/docs/images/tags-class-diagram.png +0 -0
- data/lib/yard/autoload.rb +2 -0
- data/lib/yard/cli/graph.rb +3 -2
- data/lib/yard/cli/server.rb +3 -0
- data/lib/yard/cli/yardoc.rb +1 -0
- data/lib/yard/code_objects/base.rb +60 -30
- data/lib/yard/code_objects/extra_file_object.rb +1 -1
- data/lib/yard/code_objects/proxy.rb +1 -0
- data/lib/yard/docstring.rb +36 -2
- data/lib/yard/docstring_parser.rb +25 -2
- data/lib/yard/handlers/base.rb +18 -2
- data/lib/yard/handlers/c/handler_methods.rb +1 -1
- data/lib/yard/handlers/processor.rb +3 -0
- data/lib/yard/handlers/ruby/class_handler.rb +1 -2
- data/lib/yard/handlers/ruby/dsl_handler_methods.rb +7 -1
- data/lib/yard/handlers/ruby/exception_handler.rb +2 -2
- data/lib/yard/handlers/ruby/legacy/class_handler.rb +4 -3
- data/lib/yard/handlers/ruby/legacy/exception_handler.rb +2 -2
- data/lib/yard/handlers/ruby/legacy/method_handler.rb +4 -4
- data/lib/yard/handlers/ruby/legacy/yield_handler.rb +4 -4
- data/lib/yard/handlers/ruby/method_handler.rb +6 -6
- data/lib/yard/handlers/ruby/struct_handler_methods.rb +4 -4
- data/lib/yard/handlers/ruby/yield_handler.rb +4 -4
- data/lib/yard/i18n/locale.rb +16 -0
- data/lib/yard/parser/ruby/legacy/statement_list.rb +3 -0
- data/lib/yard/parser/ruby/ruby_parser.rb +9 -4
- data/lib/yard/rubygems/doc_manager.rb +16 -7
- data/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
- data/lib/yard/tags/directives.rb +3 -2
- data/lib/yard/tags/overload_tag.rb +1 -1
- data/lib/yard/templates/helpers/html_helper.rb +5 -2
- data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +3 -3
- data/lib/yard/version.rb +1 -1
- data/spec/cli/server_spec.rb +18 -0
- data/spec/code_objects/base_spec.rb +32 -1
- data/spec/handlers/base_spec.rb +9 -0
- data/spec/handlers/dsl_handler_spec.rb +12 -1
- data/spec/handlers/examples/dsl_handler_001.rb.txt +16 -1
- data/spec/handlers/examples/visibility_handler_001.rb.txt +5 -0
- data/spec/handlers/method_handler_spec.rb +3 -3
- data/spec/handlers/processor_spec.rb +12 -1
- data/spec/handlers/visibility_handler_spec.rb +5 -0
- data/spec/parser/ruby/ruby_parser_spec.rb +13 -0
- data/spec/parser/source_parser_spec.rb +38 -1
- data/spec/server/doc_server_helper_spec.rb +2 -0
- data/spec/tags/directives_spec.rb +8 -1
- data/spec/tags/overload_tag_spec.rb +1 -1
- data/spec/templates/helpers/html_helper_spec.rb +25 -5
- data/templates/default/class/setup.rb +1 -1
- data/templates/default/module/html/box_info.erb +1 -1
- data/templates/default/tags/html/example.erb +1 -1
- data/templates/default/tags/setup.rb +1 -1
- data/templates/guide/fulldoc/html/css/style.css +12 -5
- data/templates/guide/layout/html/layout.erb +4 -4
- metadata +3 -3
@@ -23,11 +23,11 @@ module YARD
|
|
23
23
|
output << "<span class='tstring'>" if [:tstring_beg, :regexp_beg].include?(s[0])
|
24
24
|
case s.first
|
25
25
|
when :nl, :ignored_nl, :sp
|
26
|
-
output << h(s
|
26
|
+
output << h(s[1])
|
27
27
|
when :ident
|
28
|
-
output << "<span class='id identifier rubyid_#{h(s
|
28
|
+
output << "<span class='id identifier rubyid_#{h(s[1])}'>#{h(s[1])}</span>"
|
29
29
|
else
|
30
|
-
output << "<span class='#{s.first}'>#{h(s
|
30
|
+
output << "<span class='#{s.first}'>#{h(s[1])}</span>"
|
31
31
|
end
|
32
32
|
output << "</span>" if [:tstring_end, :regexp_end].include?(s[0])
|
33
33
|
end
|
data/lib/yard/version.rb
CHANGED
data/spec/cli/server_spec.rb
CHANGED
@@ -173,6 +173,24 @@ describe YARD::CLI::Server do
|
|
173
173
|
run '--daemon'
|
174
174
|
end
|
175
175
|
|
176
|
+
it "should accept -B, --bind" do
|
177
|
+
@server_options[:Host] = 'example.com'
|
178
|
+
run '-B', 'example.com'
|
179
|
+
run '--bind', 'example.com'
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should bind address with WebRick adapter" do
|
183
|
+
@server_options[:Host] = 'example.com'
|
184
|
+
run '-B', 'example.com', '-a', 'webrick'
|
185
|
+
run '--bind', 'example.com', '-a', 'webrick'
|
186
|
+
end
|
187
|
+
|
188
|
+
it "should bind address with Rack adapter" do
|
189
|
+
@server_options[:Host] = 'example.com'
|
190
|
+
run '-B', 'example.com', '-a', 'rack'
|
191
|
+
run '--bind', 'example.com', '-a', 'rack'
|
192
|
+
end
|
193
|
+
|
176
194
|
it "should accept -p, --port" do
|
177
195
|
@server_options[:Port] = 10
|
178
196
|
run '-p', '10'
|
@@ -333,6 +333,37 @@ describe YARD::CodeObjects::Base do
|
|
333
333
|
ClassObject.new(:root, :AnotherObject) {|x| x.docstring = "FOO" }
|
334
334
|
o.docstring.should == "FOO"
|
335
335
|
end
|
336
|
+
|
337
|
+
describe 'localization' do
|
338
|
+
it "should return localized docstring" do
|
339
|
+
fr_locale = YARD::I18n::Locale.new('fr')
|
340
|
+
fr_locale.stub!(:translate).with('Hello').and_return('Bonjour')
|
341
|
+
|
342
|
+
o = ClassObject.new(:root, :Me)
|
343
|
+
o.docstring = 'Hello'
|
344
|
+
o.docstring.should == 'Hello'
|
345
|
+
|
346
|
+
Registry.stub!(:locale).with('fr').and_return(fr_locale)
|
347
|
+
o.docstring('fr').should == "Bonjour"
|
348
|
+
end
|
349
|
+
|
350
|
+
it "should return updated localized docstring" do
|
351
|
+
fr_locale = YARD::I18n::Locale.new('fr')
|
352
|
+
Registry.stub!(:locale).with('fr').and_return(fr_locale)
|
353
|
+
|
354
|
+
o = ClassObject.new(:root, :Me)
|
355
|
+
o.docstring = 'Hello'
|
356
|
+
o.docstring.should == 'Hello'
|
357
|
+
|
358
|
+
fr_locale.stub!(:translate).with('Hello').and_return('Bonjour')
|
359
|
+
o.docstring('fr').should == "Bonjour"
|
360
|
+
|
361
|
+
o.docstring = 'World'
|
362
|
+
fr_locale.stub!(:translate).with('World').and_return('Monde')
|
363
|
+
o.docstring('fr').should == "Monde"
|
364
|
+
o.docstring.should == 'World'
|
365
|
+
end
|
366
|
+
end
|
336
367
|
end
|
337
368
|
|
338
369
|
describe '#add_file' do
|
@@ -404,4 +435,4 @@ describe YARD::CodeObjects::Base do
|
|
404
435
|
foo.copy_to(bar)
|
405
436
|
end
|
406
437
|
end
|
407
|
-
end
|
438
|
+
end
|
data/spec/handlers/base_spec.rb
CHANGED
@@ -40,6 +40,15 @@ describe YARD::Handlers::Base do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
describe '#abort! (and HandlerAborted)' do
|
44
|
+
it 'should allow HandlerAborted to be raised' do
|
45
|
+
class AbortHandler1 < Handlers::Ruby::Base
|
46
|
+
process { abort! }
|
47
|
+
end
|
48
|
+
lambda { AbortHandler1.new(nil, nil).process }.should raise_error(HandlerAborted)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
43
52
|
describe 'transitive tags' do
|
44
53
|
it "should add transitive tags to children" do
|
45
54
|
Registry.clear
|
@@ -61,7 +61,7 @@ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}DSLHandler" do
|
|
61
61
|
obj = Registry.at('Foo.xyz')
|
62
62
|
obj.should_not be_nil
|
63
63
|
obj.signature.should == 'def xyz(a, b, c)'
|
64
|
-
obj.parameters.should == [[
|
64
|
+
obj.parameters.should == [['a', nil], ['b', nil], ['c', nil]]
|
65
65
|
obj.source.should == 'foo_bar'
|
66
66
|
obj.docstring.should == 'The foo method'
|
67
67
|
end
|
@@ -163,6 +163,12 @@ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}DSLHandler" do
|
|
163
163
|
Registry.at('Baz#y_parser').should_not be_nil
|
164
164
|
end
|
165
165
|
|
166
|
+
it "should look through mixins for attached macros" do
|
167
|
+
meth = Registry.at('Baz#mixin_method')
|
168
|
+
meth.should_not be_nil
|
169
|
+
meth.docstring.should == 'DSL method mixin_method'
|
170
|
+
end
|
171
|
+
|
166
172
|
it "should handle top-level DSL methods" do
|
167
173
|
obj = Registry.at('#my_other_method')
|
168
174
|
obj.should_not be_nil
|
@@ -175,6 +181,11 @@ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}DSLHandler" do
|
|
175
181
|
obj.signature.should == 'def beep(a, b, c)'
|
176
182
|
end
|
177
183
|
|
184
|
+
it "should expand attached macros in first DSL method" do
|
185
|
+
Registry.at('DSLMethods#foo').docstring.should == "Returns String for foo"
|
186
|
+
Registry.at('DSLMethods#bar').docstring.should == "Returns Integer for bar"
|
187
|
+
end
|
188
|
+
|
178
189
|
it "should not detect implicit macros with invalid method names" do
|
179
190
|
undoc_error <<-eof
|
180
191
|
##
|
@@ -93,13 +93,21 @@ class Foo
|
|
93
93
|
a_module_function :modfunc1
|
94
94
|
end
|
95
95
|
|
96
|
+
module MyMixin
|
97
|
+
# @!macro [attach] special
|
98
|
+
# DSL method $1
|
99
|
+
def defined_by_mixin; end
|
100
|
+
end
|
101
|
+
|
96
102
|
class Bar
|
97
103
|
parser :x_parser
|
98
104
|
end
|
99
105
|
|
100
106
|
class Baz < Foo
|
107
|
+
extend MyMixin
|
101
108
|
parser :y_parser
|
102
109
|
none { }
|
110
|
+
defined_by_mixin :mixin_method
|
103
111
|
end
|
104
112
|
|
105
113
|
# @!method my_other_method
|
@@ -107,4 +115,11 @@ end
|
|
107
115
|
method_that_makes_a_method
|
108
116
|
|
109
117
|
# @!macro something
|
110
|
-
foobarbaz :beep
|
118
|
+
foobarbaz :beep
|
119
|
+
|
120
|
+
module DSLMethods
|
121
|
+
# @macro [attach] dsl_method
|
122
|
+
# Returns $2 for $1
|
123
|
+
dsl_method :foo, String
|
124
|
+
dsl_method :bar, Integer
|
125
|
+
end
|
@@ -55,17 +55,17 @@ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}MethodHandler"
|
|
55
55
|
|
56
56
|
o1 = meth.tags(:overload).first
|
57
57
|
o1.name.should == :bar
|
58
|
-
o1.parameters.should == [[
|
58
|
+
o1.parameters.should == [['a', nil], ['b', "1"]]
|
59
59
|
o1.tag(:return).type.should == "String"
|
60
60
|
|
61
61
|
o2 = meth.tags(:overload)[1]
|
62
62
|
o2.name.should == :baz
|
63
|
-
o2.parameters.should == [[
|
63
|
+
o2.parameters.should == [['b', nil], ['c', nil]]
|
64
64
|
o2.tag(:return).type.should == "Fixnum"
|
65
65
|
|
66
66
|
o3 = meth.tags(:overload)[2]
|
67
67
|
o3.name.should == :bang
|
68
|
-
o3.parameters.should == [[
|
68
|
+
o3.parameters.should == [['d', nil], ['e', nil]]
|
69
69
|
o3.docstring.should be_empty
|
70
70
|
o3.docstring.should be_blank
|
71
71
|
end
|
@@ -20,4 +20,15 @@ describe YARD::Handlers::Processor do
|
|
20
20
|
it "should have a globals structure" do
|
21
21
|
@proc.globals.should be_a(OpenStruct)
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
|
+
it 'should ignore HandlerAborted exceptions (but print debug info)' do
|
25
|
+
class AbortHandlerProcessor < YARD::Handlers::Ruby::Base
|
26
|
+
process { abort! }
|
27
|
+
end
|
28
|
+
stmt = OpenStruct.new(:line => 1, :show => 'SOURCE')
|
29
|
+
@proc.stub!(:find_handlers).and_return([AbortHandlerProcessor])
|
30
|
+
log.should_receive(:debug).with(/AbortHandlerProcessor cancelled from/)
|
31
|
+
log.should_receive(:debug).with("\tin file '(stdin)':1:\n\nSOURCE\n")
|
32
|
+
@proc.process([stmt])
|
33
|
+
end
|
34
|
+
end
|
@@ -31,4 +31,9 @@ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}VisibilityHand
|
|
31
31
|
it "should handle constants passed in as symbols" do
|
32
32
|
Registry.at('Testing#Foo').visibility.should == :private
|
33
33
|
end
|
34
|
+
|
35
|
+
it 'should not register classes with visibility' do
|
36
|
+
Registry.at('Testing::Bar').visibility.should == :public
|
37
|
+
Registry.at('Testing::Baz').visibility.should == :public
|
38
|
+
end
|
34
39
|
end
|
@@ -296,6 +296,19 @@ eof
|
|
296
296
|
stmt("X = !1").jump(:unary).source.should == '!1'
|
297
297
|
end
|
298
298
|
|
299
|
+
it "should have the correct line range for class/modules" do
|
300
|
+
s = stmt(<<-eof)
|
301
|
+
class Foo
|
302
|
+
def foo; end
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
# Ending comment
|
307
|
+
end
|
308
|
+
eof
|
309
|
+
s.jump(:class).line_range.should == (1..7)
|
310
|
+
end
|
311
|
+
|
299
312
|
it "should find lone comments" do
|
300
313
|
Registry.clear
|
301
314
|
ast = YARD.parse_string(<<-eof).enumerator
|
@@ -628,6 +628,10 @@ describe YARD::Parser::SourceParser do
|
|
628
628
|
end
|
629
629
|
|
630
630
|
describe '#parse_statements' do
|
631
|
+
before do
|
632
|
+
Registry.clear
|
633
|
+
end
|
634
|
+
|
631
635
|
it "should display a warning for invalid parser type" do
|
632
636
|
log.should_receive(:warn).with(/unrecognized file/)
|
633
637
|
log.should_receive(:backtrace)
|
@@ -644,7 +648,6 @@ describe YARD::Parser::SourceParser do
|
|
644
648
|
end
|
645
649
|
|
646
650
|
it "should handle groups" do
|
647
|
-
Registry.clear
|
648
651
|
YARD.parse_string <<-eof
|
649
652
|
class A
|
650
653
|
# @group Group Name
|
@@ -666,5 +669,39 @@ describe YARD::Parser::SourceParser do
|
|
666
669
|
Registry.at('A#foo2').group.should == "Group Name"
|
667
670
|
Registry.at('A#baz').group.should == "Group 2"
|
668
671
|
end
|
672
|
+
|
673
|
+
it 'handles multi-line class/module references' do
|
674
|
+
YARD.parse_string <<-eof
|
675
|
+
class A::
|
676
|
+
B::C; end
|
677
|
+
eof
|
678
|
+
Registry.all.should == [P('A::B::C')]
|
679
|
+
end
|
680
|
+
|
681
|
+
it 'handles sclass definitions of multi-line class/module references' do
|
682
|
+
YARD.parse_string <<-eof
|
683
|
+
class << A::
|
684
|
+
B::C
|
685
|
+
def foo; end
|
686
|
+
end
|
687
|
+
eof
|
688
|
+
Registry.all.size.should == 2
|
689
|
+
Registry.at('A::B::C').should_not be_nil
|
690
|
+
Registry.at('A::B::C.foo').should_not be_nil
|
691
|
+
end
|
692
|
+
|
693
|
+
it 'handles lone comment blocks at the end of a namespace' do
|
694
|
+
YARD.parse_string <<-eof
|
695
|
+
module A
|
696
|
+
class B
|
697
|
+
def c; end
|
698
|
+
|
699
|
+
# @!method d
|
700
|
+
end
|
701
|
+
end
|
702
|
+
eof
|
703
|
+
Registry.at('A#d').should be_nil
|
704
|
+
Registry.at('A::B#d').should_not be_nil
|
705
|
+
end
|
669
706
|
end
|
670
707
|
end
|
@@ -138,6 +138,13 @@ describe YARD::Tags::MacroDirective do
|
|
138
138
|
baz.visibility.should == :public
|
139
139
|
end
|
140
140
|
|
141
|
+
it "should expand macro if defined on class method and there is no data block" do
|
142
|
+
tag_parse("@!macro [new] attached3\n expanded_data")
|
143
|
+
baz = CodeObjects::MethodObject.new(P('Foo::Bar'), :baz, :class)
|
144
|
+
doc = DocstringParser.new.parse('@!macro attached3', baz, handler).to_docstring
|
145
|
+
doc.should == 'expanded_data'
|
146
|
+
end
|
147
|
+
|
141
148
|
it "should not attempt to expand macro values if handler = nil" do
|
142
149
|
tag_parse("@!macro [attach] xyz\n $1 $2 $3")
|
143
150
|
end
|
@@ -243,7 +250,7 @@ describe YARD::Tags::MethodDirective do
|
|
243
250
|
YARD.parse_string <<-eof
|
244
251
|
# @!method foo(a, b, c = nil)
|
245
252
|
eof
|
246
|
-
Registry.at('#foo').parameters.should == [[
|
253
|
+
Registry.at('#foo').parameters.should == [['a', nil], ['b', nil], ['c', 'nil']]
|
247
254
|
end
|
248
255
|
|
249
256
|
it "should be able to define method with module scope (module function)" do
|
@@ -12,7 +12,7 @@ describe YARD::Tags::OverloadTag do
|
|
12
12
|
|
13
13
|
it "should parse the first line as a method signature" do
|
14
14
|
@tag.signature.should == "def bar(a, b = 1, &block)"
|
15
|
-
@tag.parameters.should == [[
|
15
|
+
@tag.parameters.should == [['a', nil], ['b', "1"], ['&block', nil]]
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should parse the rest of the text as a new Docstring" do
|
@@ -207,6 +207,16 @@ describe YARD::Templates::Helpers::HtmlHelper do
|
|
207
207
|
link_object("Bar").should =~ %r{>Bar</a>}
|
208
208
|
end
|
209
209
|
|
210
|
+
it "should use #title if overridden" do
|
211
|
+
CodeObjects::ModuleObject.new(:root, :YARD)
|
212
|
+
CodeObjects::ClassObject.new(P('YARD'), :Bar)
|
213
|
+
Registry.at('YARD::Bar').stub(:title).and_return('TITLE!')
|
214
|
+
stub!(:object).and_return(Registry.at('YARD::Bar'))
|
215
|
+
serializer = Serializers::FileSystemSerializer.new
|
216
|
+
stub!(:serializer).and_return(serializer)
|
217
|
+
link_object("Bar").should =~ %r{>TITLE!</a>}
|
218
|
+
end
|
219
|
+
|
210
220
|
it "should use relative path to parent class in title" do
|
211
221
|
root = CodeObjects::ModuleObject.new(:root, :YARD)
|
212
222
|
obj = CodeObjects::ModuleObject.new(root, :SubModule)
|
@@ -249,6 +259,16 @@ describe YARD::Templates::Helpers::HtmlHelper do
|
|
249
259
|
url_for(P("Mod::Class#meth")).should be_nil
|
250
260
|
end
|
251
261
|
|
262
|
+
it "should return nil if object is hidden" do
|
263
|
+
yard = CodeObjects::ModuleObject.new(:root, :YARD)
|
264
|
+
|
265
|
+
stub!(:serializer).and_return Serializers::FileSystemSerializer.new
|
266
|
+
stub!(:object).and_return Registry.root
|
267
|
+
stub!(:options).and_return OpenStruct.new(:verifier => Verifier.new('false'))
|
268
|
+
|
269
|
+
url_for(yard).should be_nil
|
270
|
+
end
|
271
|
+
|
252
272
|
it "should return nil if serializer does not implement #serialized_path" do
|
253
273
|
stub!(:serializer).and_return Serializers::Base.new
|
254
274
|
stub!(:object).and_return Registry.root
|
@@ -516,7 +536,7 @@ describe YARD::Templates::Helpers::HtmlHelper do
|
|
516
536
|
subject.should_receive(:respond_to?).with('html_syntax_highlight_NAME').and_return(true)
|
517
537
|
subject.should_receive(:html_syntax_highlight_NAME).and_return("foobar")
|
518
538
|
subject.htmlify('<pre><code>def x; end</code></pre>', :html).should ==
|
519
|
-
'<pre class="code NAME"><code>foobar</code></pre>'
|
539
|
+
'<pre class="code NAME"><code class="NAME">foobar</code></pre>'
|
520
540
|
end
|
521
541
|
|
522
542
|
it "should add !!!LANG to className in outputted pre tag" do
|
@@ -525,7 +545,7 @@ describe YARD::Templates::Helpers::HtmlHelper do
|
|
525
545
|
subject.should_receive(:respond_to?).with('html_syntax_highlight_LANG').and_return(true)
|
526
546
|
subject.should_receive(:html_syntax_highlight_LANG).and_return("foobar")
|
527
547
|
subject.htmlify("<pre><code>!!!LANG\ndef x; end</code></pre>", :html).should ==
|
528
|
-
'<pre class="code LANG"><code>foobar</code></pre>'
|
548
|
+
'<pre class="code LANG"><code class="LANG">foobar</code></pre>'
|
529
549
|
end
|
530
550
|
|
531
551
|
it "should call html_syntax_highlight_NAME if source starts with !!!NAME" do
|
@@ -563,17 +583,17 @@ describe YARD::Templates::Helpers::HtmlHelper do
|
|
563
583
|
|
564
584
|
it "shouldn't escape code snippets twice" do
|
565
585
|
subject.htmlify('<pre lang="foo"><code>{"foo" => 1}</code></pre>', :html).should ==
|
566
|
-
'<pre class="code foo"><code>{"foo" => 1}</code></pre>'
|
586
|
+
'<pre class="code foo"><code class="foo">{"foo" => 1}</code></pre>'
|
567
587
|
end
|
568
588
|
|
569
589
|
it "should highlight source when matching a pre lang= tag" do
|
570
590
|
subject.htmlify('<pre lang="foo"><code>x = 1</code></pre>', :html).should ==
|
571
|
-
'<pre class="code foo"><code>x = 1</code></pre>'
|
591
|
+
'<pre class="code foo"><code class="foo">x = 1</code></pre>'
|
572
592
|
end
|
573
593
|
|
574
594
|
it "should highlight source when matching a code class= tag" do
|
575
595
|
subject.htmlify('<pre><code class="foo">x = 1</code></pre>', :html).should ==
|
576
|
-
'<pre class="code foo"><code>x = 1</code></pre>'
|
596
|
+
'<pre class="code foo"><code class="foo">x = 1</code></pre>'
|
577
597
|
end
|
578
598
|
end
|
579
599
|
|
@@ -8,7 +8,7 @@ end
|
|
8
8
|
|
9
9
|
def constructor_details
|
10
10
|
ctors = object.meths(:inherited => true, :included => true)
|
11
|
-
return unless @ctor = ctors.find {|o| o.
|
11
|
+
return unless @ctor = ctors.find {|o| o.constructor? }
|
12
12
|
return if prune_method_listing([@ctor]).empty?
|
13
13
|
erb(:constructor_details)
|
14
14
|
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<% n = 2 %>
|
18
18
|
<% end %>
|
19
19
|
<% [[:class, "Extended by"], [:instance, "Includes"]].each do |scope, name| %>
|
20
|
-
<% if (mix = object.mixins(scope)).size > 0 %>
|
20
|
+
<% if (mix = run_verifier(object.mixins(scope))).size > 0 %>
|
21
21
|
<dt class="r<%=n%>"><%= name %>:</dt>
|
22
22
|
<dd class="r<%=n%>"><%= mix.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
|
23
23
|
<% n = n == 2 ? 1 : 2 %>
|