The master repo contains specifications of open-source Objective-C libraries.
~/.cocoapods/repos/master
To ensure a high quality, reliable collection of Pods, the master repo is
strict about the acceptable specifications. The CocoaPods linter (see the pod
spec lint
command) is used to validate specifications, and no errors or warnings
are accepted.
The highest priority of the master repo is to guarantee the integrity of existing CocoaPods installations.
In general this means that:
CocoaPods uses a versioning scheme known as Semantic Versioning, necessary for cross resolution of dependencies.
One of the CocoaPods goals is to promote the discovery of open-source software,
for this reason new Pods for libraries which are not versioned are accepted in
the master repo. The specifications of those pods should carry the version
0.0.1
under the assumption that, if the author starts versioning, she/he is
unlikely to pick 0.0.1
. This is the only exception for authoritative
version numbers.
If you add an unversioned Pod it is your responsibility to ask the author of the library to tag versions, luckily we have a template for this.
To prevent collisions with possible future versions, unversioned libraries can’t be updated until the author starts to tag them.
If you need to update an unversioned library you can:
NAME@USER
convention (e.g.
Reachability@irrationalfab
). It should also mention in the summary that it
is a versioned fork.Creating a podspec is very easy as we provide templates full of examples.
You can use the following command:
$ pod spec create Bananas
If the library is hosted on GitHub you can pass the url so CocoaPods can precompile the template:
$ pod spec create https://github.com/Bananas/Bananas
A this point you need edit compile the template (a pod specification is a Ruby source file):
$ pod spec lint Bananas.podspec --verbose
When a podspec lints you can submit it to the master repo.
You need to fork the master repo on github, then you need to:
$ cd ~/.cocoapods/repos/master
$ git checkout -b fork
$ git remote add myfork https://github.com/YOUR_USER_NAME/Specs.git
$ cp ~/Bananas.podspec ~/.cocoapods/repos/master/Bananas/VERSION/
$ git push myfork
$ git checkout master
Once you push your changes, you can make a pull request on CocoaPods/Specs.
$ pod push Bananas.podspec