class Middleman::AsciiDoc::AuthorData

Constants

UrlWithUsernameRx

Attributes

name[RW]
to_s[RW]

Public Class Methods

new(name, email_or_url = nil) click to toggle source
# File lib/middleman-asciidoc/extension.rb, line 352
def initialize name, email_or_url = nil
  @name = name
  if email_or_url
    if email_or_url.start_with? 'https://', 'http://'
      if (email_or_url.include? '[') && UrlWithUsernameRx =~ email_or_url
        @url, @username = $1, $2
      else
        @url = email_or_url
      end
    else
      @email = email_or_url
    end
  end
end