Module: Pod::Specification::DSL::RootAttributesAccessors
- Defined in:
- lib/cocoapods-core/specification/root_attribute_accessors.rb
Overview
Provides the accessors methods for the root attributes. Root attributes do not support multi-platform values and inheritance.
Instance Method Summary collapse
-
#authors ⇒ Hash
A hash containing the authors as the keys and their email address as the values.
-
#base_name ⇒ String
The name of the specification not including the names of the parents, in case of ‘sub-specifications’.
-
#description ⇒ String
A longer description of the Pod.
-
#documentation_url ⇒ String, Nil
The documentation URL of the Pod if specified.
-
#homepage ⇒ String
The URL of the homepage of the Pod.
-
#license ⇒ Hash
A hash containing the license information of the Pod.
-
#name ⇒ String
The name of the specification including the names of the parents, in case of ‘sub-specifications’.
-
#prepare_command ⇒ String, Nil
The prepare command of the Pod if specified.
-
#screenshots ⇒ Array<String>
The list of the URL for the screenshots of the Pod.
-
#source ⇒ Hash{Symbol=>String}
The location from where the library should be retrieved.
-
#summary ⇒ String
A short description of the Pod.
-
#version ⇒ Version
The version of the Pod.
Instance Method Details
#authors ⇒ Hash
The value is coerced to a hash with a nil email if needed.
Returns a hash containing the authors as the keys and their email address as the values.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 47 def = attributes_hash["authors"] if .is_a?(Hash) elsif .is_a?(Array) result = {} .each do |name_or_hash| if name_or_hash.is_a?(String) result[name_or_hash] = nil else result.merge!(name_or_hash) end end result elsif .is_a?(String) { => nil } end end |
#base_name ⇒ String
13 14 15 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 13 def base_name attributes_hash["name"] end |
#description ⇒ String
The indentation is stripped from the description.
Returns A longer description of the Pod.
106 107 108 109 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 106 def description description = attributes_hash["description"] description.strip_heredoc if description end |
#documentation_url ⇒ String, Nil
123 124 125 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 123 def documentation_url attributes_hash["documentation_url"] end |
#homepage ⇒ String
85 86 87 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 85 def homepage attributes_hash["homepage"] end |
#license ⇒ Hash
The indentation is stripped from the license text.
Returns A hash containing the license information of the Pod.
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 70 def license license = attributes_hash["license"] if license.is_a?(String) { :type => license } elsif license.is_a?(Hash) license = convert_keys_to_symbol(license) license[:text] = license[:text].strip_heredoc if license[:text] license else {} end end |
#name ⇒ String
20 21 22 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 20 def name parent ? "#{parent.name}/#{base_name}" : base_name end |
#prepare_command ⇒ String, Nil
129 130 131 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 129 def prepare_command attributes_hash["prepare_command"] end |
#screenshots ⇒ Array<String>
The value is coerced to an array.
Returns The list of the URL for the screenshots of the Pod.
116 117 118 119 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 116 def screenshots value = attributes_hash["screenshots"] [*value] end |
#source ⇒ Hash{Symbol=>String}
92 93 94 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 92 def source convert_keys_to_symbol(attributes_hash["source"]) end |
#summary ⇒ String
98 99 100 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 98 def summary attributes_hash["summary"] end |
#version ⇒ Version
31 32 33 |
# File 'lib/cocoapods-core/specification/root_attribute_accessors.rb', line 31 def version @version ||= root? ? Version.new(attributes_hash["version"]) : root.version end |