class Pod::Generator::Acknowledgements
Attributes
@return [Array<Sandbox::FileAccessor>] the list of the file accessors
for the specs of the target that needs to generate the acknowledgements.
Public Class Methods
@return [Array<Class>] The classes of the acknowledgements generator
subclasses.
# File lib/cocoapods/generator/acknowledgements.rb, line 7 def self.generators [Plist, Markdown] end
@param [Array<Sandbox::FileAccessor>] @see file_accessors.
# File lib/cocoapods/generator/acknowledgements.rb, line 19 def initialize(file_accessors) @file_accessors = file_accessors end
Public Instance Methods
@return [String] the foot notes.
# File lib/cocoapods/generator/acknowledgements.rb, line 47 def footnote_text 'Generated by CocoaPods - https://cocoapods.org' end
@return [String] The title of the foot notes.
# File lib/cocoapods/generator/acknowledgements.rb, line 41 def footnote_title '' end
@return [String] A text to present before listing the acknowledgements.
# File lib/cocoapods/generator/acknowledgements.rb, line 35 def header_text 'This application makes use of the following third party libraries:' end
@return [String] The title of the acknowledgements file.
# File lib/cocoapods/generator/acknowledgements.rb, line 29 def header_title 'Acknowledgements' end
Protected Instance Methods
Returns the file accessor for the given spec.
@param [Specification] spec
the specification for which the file accessor is needed.
@return [Sandbox::FileAccessor] The file accessor.
# File lib/cocoapods/generator/acknowledgements.rb, line 100 def file_accessor(spec) file_accessors.find { |accessor| accessor.spec.root == spec } end
Private Instance Methods
Returns the text of the license for the given spec.
@param [Specification] spec
the specification for which license is needed.
@return [String] The text of the license. @return [Nil] If not license text could be found.
# File lib/cocoapods/generator/acknowledgements.rb, line 72 def license_text(spec) return nil unless spec.license text = spec.license[:text] unless text if license_file = spec.license[:file] license_path = file_accessor(spec).root + license_file if File.exist?(license_path) text = IO.read(license_path) else UI.warn "Unable to read the license file `#{license_file}` " \ "for the spec `#{spec}`" end elsif license_file = file_accessor(spec).license text = IO.read(license_file) end end text end
@return [Array<Specification>] The root specifications for which the
acknowledgements should be generated.
# File lib/cocoapods/generator/acknowledgements.rb, line 60 def specs file_accessors.map { |accessor| accessor.spec.root }.uniq end