forked from lsegal/yard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
103 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module YARD | ||
module Tags | ||
class OptionTag < Tag | ||
attr_accessor :pair | ||
|
||
def initialize(tag_name, name, pair) | ||
super(tag_name, nil, nil, name) | ||
@pair = pair | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
<div class="option"> | ||
<h3>Options Hash:</h3> | ||
<table> | ||
<tr> | ||
<th class="name">Key Name</th> | ||
<th class="default">Default Value</th> | ||
<th class="type">Accepted Types</th> | ||
<th class="desc">Description</th> | ||
</tr> | ||
<% for tag in object.tags(:option) %> | ||
<dt>Options Hash <tt><%= param %></tt></dt> | ||
<dd> | ||
<div class="option"> | ||
<table> | ||
<tr> | ||
<td class="name"><%= tag.name %></td> | ||
<td class="default"> | ||
<% if tag.defaults %> | ||
<%= tag.defaults.map {|t| "<tt>#{h t}</tt>" }.join(", ") %> | ||
<% else %> | ||
<span class="na">N/A</span> | ||
<% end %> | ||
</td> | ||
<td class="type"><%= format_types (tag.types || ['Object']) %></td> | ||
<td class="desc"><%= htmlify tag.text %></td> | ||
<th class="name">Key Name</th> | ||
<th class="default">Default Value</th> | ||
<th class="type">Accepted Types</th> | ||
<th class="desc">Description</th> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> | ||
<% for tag in object.tags(:option).select {|x| x.name.to_s == param } %> | ||
<tr> | ||
<td class="name"><%= tag.pair.name %></td> | ||
<td class="default"> | ||
<% if tag.pair.defaults %> | ||
<%= tag.pair.defaults.map {|t| "<tt>#{h t}</tt>" }.join(", ") %> | ||
<% else %> | ||
<span class="na">N/A</span> | ||
<% end %> | ||
</td> | ||
<td class="type"><%= format_types (tag.pair.types || ['Object']) %></td> | ||
<td class="desc"><%= htmlify tag.pair.text %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> | ||
</dd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="param"> | ||
<h3><%= YARD::Tags::Library.labels[:param] %>:</h3> | ||
<dl> | ||
<% for tag in tags_by_param(object) %> | ||
<% if tag.is_a?(YARD::Tags::OptionTag) %> | ||
<%= render object, 'option', :param => tag.name.to_s %> | ||
<% else %> | ||
<dt> | ||
<span class='type'><%= format_types (tag.types || ['Object']) %></span> | ||
<span class='name'><%= h tag.name %></span> | ||
<% if (o=object.parameters.assoc(tag.name.to_sym)) && o[1] %> | ||
<em class="default">(defaults to: <tt><%= h o[1] %></tt>)</em> | ||
<% end %> | ||
</dt> | ||
<dd> | ||
<span class='desc'><%= htmlify tag.text if tag.text %></span> | ||
</dd> | ||
<% end %> | ||
<% end %> | ||
</dl> | ||
</div> |