Commit f3b61866 authored by Fabio Pelosin's avatar Fabio Pelosin

[Specification] Cleaned authors.

parent f70d430d
...@@ -191,13 +191,10 @@ module Pod ...@@ -191,13 +191,10 @@ module Pod
top_attr_accessor :documentation top_attr_accessor :documentation
top_attr_accessor :requires_arc top_attr_accessor :requires_arc
top_attr_accessor :version, lambda { |v| Version.new(v) } top_attr_accessor :version, lambda { |v| Version.new(v) }
top_attr_accessor :authors, lambda { |a| parse_authors(a) }
top_attr_reader :description, lambda { |instance, ivar| ivar || instance.summary } top_attr_reader :description, lambda { |instance, ivar| ivar || instance.summary }
top_attr_writer :description, lambda { |d| d.strip_heredoc } top_attr_writer :description, lambda { |d| d.strip_heredoc }
alias_method :author=, :authors=
# @!method license # @!method license
# #
# @abstract # @abstract
...@@ -213,14 +210,21 @@ module Pod ...@@ -213,14 +210,21 @@ module Pod
license license
} }
def self.parse_authors(*names_and_email_addresses) # @!method authors
#
# @abstract
# The list of the authors (with email) of the pod.
#
top_attr_accessor :authors, lambda { |*names_and_email_addresses|
list = names_and_email_addresses.flatten list = names_and_email_addresses.flatten
unless list.first.is_a?(Hash) unless list.first.is_a?(Hash)
authors = list.last.is_a?(Hash) ? list.pop : {} authors = list.last.is_a?(Hash) ? list.pop : {}
list.each { |name| authors[name] = nil } list.each { |name| authors[name] = nil }
end end
authors || list.first authors || list.first
end }
alias_method :author=, :authors=
### Attributes **with** multiple platform support ### Attributes **with** multiple platform support
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment