Permalink
Browse files

Don't add period to summary if entire summary is `{include:...}` expr…

…ession.

Closes #569
  • Loading branch information...
1 parent f374d2b commit c7eaa9701fc05afb8af688b9d900af8503db4cf4 @lsegal committed Jul 14, 2012
Showing with 9 additions and 1 deletion.
  1. +3 −1 lib/yard/docstring.rb
  2. +6 −0 spec/docstring_spec.rb
View
@@ -173,7 +173,9 @@ def summary
end
end
@summary = self[0..idx]
- @summary += '.' unless @summary.empty?
+ if !@summary.empty? && @summary !~ /\A\s*\{include:.+\}\s*\Z/
+ @summary += '.'
+ end
@summary
end
View
@@ -83,6 +83,12 @@
doc.summary.should == "Returns a list of tags specified by +name+ or all tags if +name+ is not specified."
end
+ it "should not attach period if entire summary is include" do
+ YARD.parse_string "# docstring\ndef foo; end"
+ Docstring.new("{include:#foo}").summary.should == '{include:#foo}'
+ Registry.clear
+ end
+
it "should handle references embedded in summary" do
Docstring.new("Aliasing {Test.test}. Done.").summary.should == "Aliasing {Test.test}."
end

0 comments on commit c7eaa97

Please sign in to comment.