Skip to content

Instantly share code, notes, and snippets.

@fabiopelosin
Created November 2, 2012 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiopelosin/4001403 to your computer and use it in GitHub Desktop.
Save fabiopelosin/4001403 to your computer and use it in GitHub Desktop.

Podspec attributes

Overview

Root specification attributes

name version authors
license homepage source
summary description documentation

Regular attributes

source_files exclude_source_files public_header_files

Root specification attributes

name

[Required] The name of the Pod.

Examples
s.name = 'MyPod'

version

[Required] The version of the Pod (see Semver).

Examples
s.version = '0.0.1'

authors

[Required] The email and the name of the authors of the library.

Examples
s.authors = 'Darth Vader'
s.authors = 'Darth Vader', 'Wookiee'
s.authors = { 'Darth Vader' => 'darthvader@darkside.com',
              'Wookiee' => 'wookiee@aggrrttaaggrrt.com' }

license

[Required] The license of the Pod, unless the source contains a file named LICENSE.* or LICENCE.* the path of the file containing the license or the text of the license should be specified.

This attribute supports the following keys: type, file, text.

Examples
s.license = 'MIT'
s.license = { :type => 'MIT', :file => 'MIT-LICENSE.txt' }
s.license = { :type => 'MIT', :text => <<-LICENSE
                Copyright 2012
                Permission is granted to...
              LICENSE
            }

homepage

[Required] The URL of the homepage of the Pod.

Examples
s.homepage = 'www.example.com'

source

[Required] The location from where the library should be retrieved.

This attribute supports the following keys:

  • git: commit, tag, submodules

  • hg: todo

  • svn: todo

  • http: todo

Examples
s.source = :git => www.example.com/repo.git
s.source = :git => www.example.com/repo.git, :tag => 'v0.0.1'
s.source = :git => www.example.com/repo.git, :tag => "v#{0.0.1}"

summary

[Required] A short description (max 140 characters).

Examples
s.summary = 'A library that computes the meaning of life.'

description

An optional longer description that can be used in place of the summary.

Examples
s.description = <<-DESC
                  A library that computes the meaning of life. Features:
                  1. Is self aware
                  ...
                  42. Likes candies.
                DESC

documentation

Any additional option to pass to the appledoc tool.

Examples
s.documentation = :appledoc => ['--no-repeat-first-par',
                                '--no-warn-invalid-crossref']

Regular attributes

source_files

The source files of the specification.

This attribute supports multi-platform values.

Examples
s.source_files = "Classes/**/*.{h,m}"
s.source_files = "Classes/**/*.{h,m}", "More_Classes/**/*.{h,m}"

exclude_source_files

The pattern to ignore source files.

This attribute supports multi-platform values.

Examples
s.ios.exclude_source_files = "Classes/osx"
s.exclude_source_files = "Classes/**/unused.{h,m}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment