Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove :nodoc: from Time::Format #6214

Merged
merged 2 commits into from
Jun 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/time/format/custom/yaml_date.cr
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# :nodoc:
struct Time::Format
# Even though the standard library has Time parsers given a *fixed* format,
# the format in YAML, http://yaml.org/type/timestamp.html,
# can consist of just the date part, and following it any number of spaces,
# or 't', or 'T' can follow, with many optional components. So, we implement
# this in a more efficient way to avoid parsing the same string with many
# possible formats (there's also no way to specify any number of spaces
# with Time::Format, or an "or" like in a Regex).
#
# As an additional note, Ruby's Psych YAML parser also implements a
# custom time parser, probably for this same reason.
module YAML_DATE
# Even though the standard library has Time parsers given a *fixed* format,
# the format in YAML, http://yaml.org/type/timestamp.html,
# can consist of just the date part, and following it any number of spaces,
# or 't', or 'T' can follow, with many optional components. So, we implement
# this in a more efficient way to avoid parsing the same string with many
# possible formats (there's also no way to specify any number of spaces
# with Time::Format, or an "or" like in a Regex).
#
# As an additional note, Ruby's Psych YAML parser also implements a
# custom time parser, probably for this same reason.

# Parses a string into a `Time`.
def self.parse?(string) : Time?
parser = Parser.new(string)
Expand Down