-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from seanmil/add_enum_tag
(PDOC-295) Add @enum tag support for Enum data types
- Loading branch information
Showing
15 changed files
with
278 additions
and
14 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# The module for custom YARD tags. | ||
module PuppetStrings::Yard::Tags | ||
require 'puppet-strings/yard/tags/factory' | ||
require 'puppet-strings/yard/tags/parameter_directive' | ||
require 'puppet-strings/yard/tags/property_directive' | ||
require 'puppet-strings/yard/tags/overload_tag' | ||
require 'puppet-strings/yard/tags/summary_tag' | ||
require 'puppet-strings/yard/tags/enum_tag' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'yard/tags/option_tag' | ||
|
||
# Implements an enum tag for describing enumerated value data types | ||
|
||
class PuppetStrings::Yard::Tags::EnumTag < YARD::Tags::OptionTag | ||
# Registers the tag with YARD. | ||
# @return [void] | ||
def self.register! | ||
YARD::Tags::Library.define_tag("puppet.enum", :enum, :with_enums) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'yard/tags/default_factory' | ||
require 'puppet-strings/yard/tags/enum_tag' | ||
|
||
class PuppetStrings::Yard::Tags::Factory < YARD::Tags::DefaultFactory | ||
|
||
# Parses tag text and creates a new enum tag type. Modeled after | ||
# the parse_tag_with_options method in YARD::Tags::DefaultFactory. | ||
# | ||
# @param tag_name the name of the tag to parse | ||
# @param [String] text the raw tag text | ||
# @return [Tag] a tag object with the tag_name, name, and nested Tag as type | ||
def parse_tag_with_enums(tag_name, text) | ||
name, text = *extract_name_from_text(text) | ||
PuppetStrings::Yard::Tags::EnumTag.new(tag_name, name, parse_tag_with_name(tag_name, text)) | ||
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
Oops, something went wrong.