Commit 93caccd2 authored by Robert Zuber's avatar Robert Zuber

Merge branch 'master' of github.com:CocoaPods/CocoaPods into command-list-added-pod-versions

parents 160b1b3f 621a85fb
language: objective-c
env:
# This is what 10.8.x comes with and we want to support that.
- RVM_RUBY_VERSION=system NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo gem update --system && sudo gem install bundler --no-ri --no-rdoc' GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com
- RVM_RUBY_VERSION=1.9.3-p392 NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2 && curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem' SSL_CERT_FILE=/usr/local/share/cacert.pem GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com
- RVM_RUBY_VERSION=system NOEXEC_DISABLE=1 XCODEPROJ_BUILD=1 BUNDLE_WITHOUT='debugging:documentation' RUBY_VERSION_SPECIFIC='sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2' SSL_CERT_FILE=/usr/local/share/cacert.pem GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
- RVM_RUBY_VERSION=2.0.0-p247 NOEXEC_DISABLE=1 XCODEPROJ_BUILD=1 BUNDLE_WITHOUT='debugging:documentation' RUBY_VERSION_SPECIFIC='sudo gem install bundler --no-ri --no-rdoc' GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
before_install:
- curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
# - sh -c 'if [ "$RVM_RUBY_VERSION" != "system" ]; then rvm install $RVM_RUBY_VERSION --without-tcl --without-tk; fi'
- source ~/.rvm/scripts/rvm && rvm use $RVM_RUBY_VERSION
- brew update && brew install bzr
install: eval $RUBY_VERSION_SPECIFIC && rake bootstrap[use_bundle_dir]
script: bundle exec rake spec:ci
notifications:
......
......@@ -3,9 +3,75 @@
To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).
## Master
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.30.0...master)
[CocoaPods-Core](https://github.com/CocoaPods/Core/compare/0.30.0...master)
##### Enhancements
##### Bug Fixes
* Fix for when using s.version as the :tag for a git repository in a Podspec
[Joel Parsons](https://github.com/joelparsons)
[#1721](https://github.com/CocoaPods/CocoaPods/issues/1721)
[Core#72](https://github.com/CocoaPods/Core/pull/72)
## 0.30.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.29.0...0.30.0)
###### Enhancements
* Radically reduce first run pod setup bandwidth by creating a shallow clone of
the ‘master’ repo by default. Use the `--no-shallow` option to perform a full
clone instead.
[Jeff Verkoeyen](https://github.com/jverkoey)
[#1803](https://github.com/CocoaPods/CocoaPods/pull/1803)
* Improves the error message when searching with an invalid regular expression.
[Kyle Fuller](https://github.com/kylef)
* Improves `pod init` to save Xcode project file in Podfile when one was supplied.
[Kyle Fuller](https://github.com/kylef)
* Adds functionality to specify a template URL for the `pod lib create` command.
[Piet Brauer](https://github.com/pietbrauer)
###### Bug Fixes
* Fixes a bug with `pod repo remove` silently handling permission errors.
[Kyle Fuller](https://github.com/kylef)
[#1778](https://github.com/CocoaPods/CocoaPods/issues/1778)
* `pod push` now properly checks that the repo has changed before attempting
to commit. This only affected pods with special characters (such as `+`) in
their names.
[Gordon Fontenot](https://github.com/gfontenot)
[#1739](https://github.com/CocoaPods/CocoaPods/pull/1739)
## 0.29.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.28.0...0.29.0)
[CocoaPods-core](https://github.com/CocoaPods/Core/compare/0.28.0...0.29.0)
[cocoapods-downloader](https://github.com/CocoaPods/cocoapods-downloader/compare/0.2.0...0.3.0)
###### Breaking
* The command `podfile_info` is now a plugin offered by CocoaPods.
As a result, the command has been removed from CocoaPods.
[Joshua Kalpin](https://github.com/Kapin)
[#1589](https://github.com/CocoaPods/CocoaPods/issues/1589)
* JSON has been adopted as the format to store specifications. As a result
the `pod ipc spec` command returns a JSON representation and the YAML
specifications are not supported anymore. JSON specifications adopt the
`.podspec.json` extension.
[Fabio Pelosin](https://github.com/irrationalfab)
[#1568](https://github.com/CocoaPods/CocoaPods/pull/1568)
###### Enhancements
* Introduced `pod try` the easiest way to test the example project of a pod.
[Fabio Pelosin](https://github.com/irrationalfab)
[#1568](https://github.com/CocoaPods/CocoaPods/pull/1568)
* Pod headers are now provided to the user target as a system
header. This means that any warnings in a Pod's code will show
under its target in Xcode's build navigator, and never under the
......@@ -13,10 +79,39 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Swizzlr](https://github.com/swizzlr)
[#1596](https://github.com/CocoaPods/CocoaPods/pull/1596)
* Support LZMA2 compressed tarballs in the downloader
* Support LZMA2 compressed tarballs in the downloader.
[Kyle Fuller](https://github.com/kylef)
[cocoapods-downloader#5](https://github.com/CocoaPods/cocoapods-downloader/pull/5)
* Add Bazaar support for installing directly from a repo.
[Fred McCann](https://github.com/fmccann)
[#1632](https://github.com/CocoaPods/CocoaPods/pull/1632)
* The `pod search <query>` command now supports regular expressions
for the query parameter when searching using the option `--full`.
[Florian Hanke](https://github.com/floere)
[#1643](https://github.com/CocoaPods/CocoaPods/pull/1643)
* Pod lib lint now accepts multiple podspecs in the same folder.
[kra Larivain/OpenTable](https://github.com/opentable)
[#1635](https://github.com/CocoaPods/CocoaPods/pull/1635)
* The `pod push` command will now silently test the upcoming CocoaPods trunk
service. The service is only tested when pushing to the master repo and the
test doesn't affect the normal workflow.
[Fabio Pelosin](https://github.com/irrationalfab)
* The `pod search <query>` command now supports searching on cocoapods.org
when searching using the option `--web`. Options `--ios` and `--osx` are
fully supported.
[Florian Hanke](https://github.com/floere)
[#1643](https://github.com/CocoaPods/CocoaPods/pull/1682)
* The `pod search <query>` command now supports multiword queries when using
the `--web` option.
[Florian Hanke](https://github.com/floere)
[#1643](https://github.com/CocoaPods/CocoaPods/pull/1682)
###### Bug Fixes
* Fixed a bug which resulted in `pod lib lint` not being able to find the
......@@ -26,9 +121,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
* Fixed the developer frameworks search paths so that
`$(SDKROOT)/Developer/Library/Frameworks` is used for iOS and
`$(DEVELOPER_LIBRARY_DIR)/Frameworks` is used for OS X
`$(DEVELOPER_LIBRARY_DIR)/Frameworks` is used for OS X.
[Kevin Wales](https://github.com/kwales)
[#1562](https://github.com/CocoaPods/pull/1562)
[#1562](https://github.com/CocoaPods/CocoaPods/pull/1562)
* When updating the pod repos, repositories with unreachable remotes
are now ignored. This fixes an issue with certain private repositories.
......@@ -36,6 +131,46 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[#1595](https://github.com/CocoaPods/CocoaPods/pull/1595)
[#1571](https://github.com/CocoaPods/CocoaPods/issues/1571)
* The linter will now display an error if a Pod's name contains whitespace.
[Joshua Kalpin](https://github.com/Kapin)
[Core#39](https://github.com/CocoaPods/Core/pull/39)
[#1610](https://github.com/CocoaPods/CocoaPods/issues/1610)
* Having the silent flag enabled in the config will no longer cause issues
with `pod search`. In addition, the flag `--silent` is no longer supported
for the command.
[Joshua Kalpin](https://github.com/Kapin)
[#1627](https://github.com/CocoaPods/CocoaPods/pull/1627)
* The linter will now display an error if a framework ends with `.framework`
(i.e. `QuartzCore.framework`).
[Joshua Kalpin](https://github.com/Kapin)
[#1331](https://github.com/CocoaPods/CocoaPods/issues/1336)
[Core#45](https://github.com/CocoaPods/Core/pull/45)
* The linter will now display an error if a library ends with `.a` or `.dylib`
(i.e. `z.dylib`). It will also display an error if it begins with `lib`
(i.e. `libxml`).
[Joshua Kalpin](https://github.com/Kapin)
[Core#44](https://github.com/CocoaPods/Core/issues/44)
* The ARCHS build setting can come back as an array when more than one
architecture is specified.
[Carson McDonald](https://github.com/carsonmcdonald)
[#1628](https://github.com/CocoaPods/CocoaPods/issues/1628)
* Fixed all issues caused by `/tmp` being a symlink to `/private/tmp`.
This affected mostly `pod lib lint`, causing it to fail when the
Pod used `prefix_header_*` or when the pod headers imported headers
using the namespaced syntax (e.g. `#import <MyPod/Header.h>`).
[kra Larivain/OpenTable](https://github.com/opentable)
[#1514](https://github.com/CocoaPods/CocoaPods/pull/1514)
* Fixed an incorrect path being used in the example app Podfile generated by
`pod lib create`.
[Eloy Durán](https://github.com/alloy)
[cocoapods-try#5](https://github.com/CocoaPods/cocoapods-try/issues/5)
## 0.28.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0)
......
# Do’s and Don’ts
* **Search the solutions in the [troubleshooting guide](http://guides.cocoapods.org/using/troubleshooting.html).** Or any of the many other [guides](http://guides.cocoapods.org).
* **Search tickets before you file a new one.** Add to tickets if you have new information about the issue.
* **Only file tickets about the CocoaPods tool itself.** This includes [CocoaPods](https://github.com/CocoaPods/CocoaPods/issues),
[CocoaPods/Core](https://github.com/CocoaPods/Core/issues), and [Xcodeproj](https://github.com/CocoaPods/Xcodeproj/issues).
......@@ -29,7 +30,7 @@ $ xcodeproj project-diff
If you are familiar with Ruby, making a pull request with a failing test case
can speed up the resolution of the bug. If the issue is more complex you can
add an [integration test](https://github.com/CocoaPods/CocoaPods/tree/master/spec/integration)
add an [integration test](https://github.com/CocoaPods/cocoapods-integration-specs/)
which doesn't require any ruby knowledge.
......@@ -38,11 +39,38 @@ which doesn't require any ruby knowledge.
Please try to be precise about the proposed outcome of the feature and how it
would related to existing features.
From the [CocoaPods blog](http://blog.cocoapods.org/CocoaPods-0.28/):
> Fighting feature creep in CocoaPods is not easy. We hear about a lot of great ideas and many of them don't make the cut as they would not be useful for at least 80% of our users.
Should you require a feature isn't suited for mainstream users, consider suggesting a [CocoaPods plugin](http://blog.cocoapods.org/CocoaPods-0.28/) instead.
## Pull Requests
We **love** pull requests and if a contribution is significant we tend to offer
push access.
All contributions will be licenced under the MIT license.
All contributions _will_ be licenced under the MIT license.
Code/comments should adhere to the following rules:
* Names should be descriptive and concise.
* Use two spaces and no tabs.
* All changes require test coverage to ensure it does not break during refactor
work. (There are a few exceptions to this, which can be recognized by there
not being any coverage for similar code.)
* All enhancements and bug fixes need to be documented in the CHANGELOG.
* When writing comments, use properly constructed sentences, including
punctuation.
* When documenting APIs and/or source code, don't make assumptions or make
implications about race, gender, religion, political orientation or anything
else that isn't relevant to the project.
* Remember that source code usually gets written once and read often: ensure
the reader doesn't have to make guesses. Make sure that the purpose and inner
logic are either obvious to a reasonably skilled professional, or add a
comment that explains it.
* The message of the commit should be prefixed by the name of the file which is
the main focus of the patch enclosed by square brackets (.e.g. `[Installer]
install pods`).
......@@ -12,12 +12,16 @@ group :development do
gem 'xcodeproj', :git => "https://github.com/CocoaPods/Xcodeproj.git", :branch => 'master'
gem 'cocoapods-downloader', :git => "https://github.com/CocoaPods/cocoapods-downloader.git", :branch => 'master'
gem 'claide', :git => 'https://github.com/CocoaPods/CLAide.git', :branch => 'master'
gem 'cocoapods-try', :git => 'https://github.com/CocoaPods/cocoapods-try.git', :branch => 'master'
gem "mocha"
gem "bacon"
gem "mocha-on-bacon"
gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
gem "rake"
gem 'rake', '~> 10.1.0' # Ruby 1.8.7
# For the integration tests
gem "diffy"
gem 'mime-types', '< 2' # v2 is 1.9.x only
gem 'coveralls', :require => false
......@@ -27,12 +31,15 @@ group :development do
end
group :debugging do
# Only while we test the trunk app.
gem 'cocoapods-trunk', :git => "https://github.com/alloy/cocoapods-trunk.git"
gem "rb-fsevent"
gem "kicker", :git => "https://github.com/alloy/kicker.git", :branch => "master"
gem "awesome_print"
gem "pry"
gem "diffy"
gem "ruby-prof"
# The released gem leads to stack too deep when profiling a full run.
gem "ruby-prof", :git => "https://github.com/ruby-prof/ruby-prof.git"
end
group :documentation do
......
GIT
remote: https://github.com/CocoaPods/CLAide.git
revision: b662b54098aa6ba5832c2382342cc363111bb3e6
revision: d14c7622e87fb19e3158656b2a459c284fbe4015
branch: master
specs:
claide (0.4.0)
claide (0.5.0)
GIT
remote: https://github.com/CocoaPods/Core.git
revision: 16b15ee5d783653ba2ccac8735abd49c039ca4d3
revision: 76c726cb88ec60dc64c62e2a87b1845319e84569
branch: master
specs:
cocoapods-core (0.28.0)
cocoapods-core (0.30.0)
activesupport (>= 3.2.15, < 4)
fuzzy_match (~> 2.0.4)
json (~> 1.8)
json_pure (~> 1.8)
nap (~> 0.5)
GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision: ceae7a7be45e760830ee95a7b4481bdab6df149d
revision: 4cc95f412d47fe8b31c5619c6705070b7849663f
branch: master
specs:
xcodeproj (0.14.1)
xcodeproj (0.15.3)
activesupport (~> 3.0)
colored (~> 1.2)
rake
GIT
remote: https://github.com/CocoaPods/cocoapods-downloader.git
revision: b3a95be1468bd6d8a46a82a027460965581e2c21
revision: d064235f1ddc2823cb5f5f1d32f51f36e719051a
branch: master
specs:
cocoapods-downloader (0.2.0)
cocoapods-downloader (0.4.0)
GIT
remote: https://github.com/CocoaPods/cocoapods-try.git
revision: 0dff2c697f487bf1b3b3ecf21deefa99020b948e
branch: master
specs:
cocoapods-try (0.2.0)
GIT
remote: https://github.com/alloy/cocoapods-trunk.git
revision: febc522b4e462bacd013a48adb704c769586bd7e
specs:
cocoapods-trunk (0.0.1)
json (~> 1.8)
nap (>= 0.6)
netrc
GIT
remote: https://github.com/alloy/kicker.git
revision: 56d7bc857278cc00900d37ef0cf2167cf606b57c
revision: 87b0047202c0320d4ef62e1f1a4b2cbdefadf008
branch: master
specs:
kicker (2.6.1)
listen (~> 1.1.0)
kicker (3.0.0)
listen (~> 1.3.0)
notify (~> 0.5.2)
GIT
remote: https://github.com/irrationalfab/PrettyBacon.git
revision: 926c214ade1ec1cbc9544d603e36f15a780f7e68
revision: eaf7e6c786fd5ccc6fb88e943bf7c5e6c27569a3
branch: master
specs:
prettybacon (0.0.1)
bacon (~> 1.2)
GIT
remote: https://github.com/ruby-prof/ruby-prof.git
revision: b56c1268ba001f5eb55f940ca1c83bc6b83a9752
specs:
ruby-prof (0.14.2)
PATH
remote: .
specs:
cocoapods (0.28.0)
cocoapods (0.30.0)
activesupport (>= 3.2.15, < 4)
claide (~> 0.4.0)
cocoapods-core (= 0.28.0)
cocoapods-downloader (~> 0.2.0)
claide (~> 0.5.0)
cocoapods-core (= 0.30.0)
cocoapods-downloader (~> 0.4.0)
cocoapods-try (~> 0.2.0)
colored (~> 1.2)
escape (~> 0.0.4)
json_pure (~> 1.8)
nap (~> 0.5)
open4 (~> 1.3)
xcodeproj (~> 0.14.1)
xcodeproj (~> 0.15.0)
GEM
remote: http://rubygems.org/
specs:
activesupport (3.2.15)
activesupport (3.2.17)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
awesome_print (1.2.0)
......@@ -79,61 +103,60 @@ GEM
simplecov (>= 0.7)
term-ansicolor
thor
diffy (3.0.1)
docile (1.1.0)
diffy (3.0.3)
docile (1.1.3)
escape (0.0.4)
ffi (1.9.3)
fuzzy_match (2.0.4)
github-markup (0.7.5)
i18n (0.6.5)
github-markup (1.1.0)
i18n (0.6.9)
json (1.8.1)
json_pure (1.8.1)
listen (1.1.6)
listen (1.3.1)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
lockfile (2.1.0)
metaclass (0.0.1)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (1.25)
mocha (0.14.0)
mime-types (1.25.1)
mocha (1.0.0)
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.2)
mocha (>= 0.13.0)
multi_json (1.8.2)
nap (0.5.1)
open4 (1.3.0)
posix-spawn (0.3.6)
pry (0.9.12.3)
multi_json (1.9.2)
nap (0.6.0)
netrc (0.7.7)
notify (0.5.2)
open4 (1.3.3)
posix-spawn (0.3.8)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
pygments.rb (0.5.4)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rake (10.1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
rake (10.1.1)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
ffi (>= 0.5.0)
rb-kqueue (0.2.0)
rb-kqueue (0.2.2)
ffi (>= 0.5.0)
redcarpet (2.3.0)
rest-client (1.6.7)
mime-types (>= 1.16)
ruby-prof (0.13.0)
simplecov (0.8.1)
simplecov (0.8.2)
docile (~> 1.1.0)
lockfile (>= 2.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.4.6)
term-ansicolor (1.2.2)
tins (~> 0.8)
thor (0.18.1)
tins (0.13.1)
slop (3.5.0)
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
tins (1.0.1)
yajl-ruby (1.1.0)
yard (0.8.7.3)
yard (0.8.7.4)
PLATFORMS
ruby
......@@ -145,6 +168,8 @@ DEPENDENCIES
cocoapods!
cocoapods-core!
cocoapods-downloader!
cocoapods-trunk!
cocoapods-try!
coveralls
diffy
github-markup
......@@ -155,10 +180,10 @@ DEPENDENCIES
prettybacon!
pry
pygments.rb
rake
rake (~> 10.1.0)
rb-fsevent
redcarpet (< 3.0.0)
ruby-prof
ruby-prof!
simplecov
xcodeproj!
yard
This project is licensed under the MIT license.
Copyright (c) 2011 - 2012 Eloy Durán <eloy.de.enige@gmail.com>
Copyright (c) 2012 Fabio Pelosin <fabiopelosin@gmail.com>
Copyright (c) 2011 - 2013 Eloy Durán <eloy.de.enige@gmail.com>
Copyright (c) 2012 - 2013 Fabio Pelosin <fabiopelosin@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
# CocoaPods
![CocoaPods Logo](https://raw.github.com/CocoaPods/shared_resources/master/assets/cocoapods-banner-readme.png)
### the Objective-C dependency manager
### CocoaPods: The Objective-C dependency manager
[![Build Status](https://travis-ci.org/CocoaPods/CocoaPods.png?branch=master)](https://travis-ci.org/CocoaPods/CocoaPods)
[![Gem Version](https://badge.fury.io/rb/cocoapods.png)](http://badge.fury.io/rb/cocoapods)
[![Code Climate](https://codeclimate.com/github/CocoaPods/CocoaPods.png)](https://codeclimate.com/github/CocoaPods/CocoaPods)
[![Build Status](http://img.shields.io/travis/CocoaPods/CocoaPods/master.svg)](https://travis-ci.org/CocoaPods/CocoaPods)
[![Gem Version](http://img.shields.io/gem/v/cocoapods.svg)](http://badge.fury.io/rb/cocoapods)
[![Code Climate](http://img.shields.io/codeclimate/github/CocoaPods/CocoaPods.svg)](https://codeclimate.com/github/CocoaPods/CocoaPods)
CocoaPods manages dependencies for your Xcode project.
CocoaPods manages dependencies for your Xcode projects.
You specify the dependencies for your project in one easy text file. CocoaPods
resolves dependencies between libraries, fetches source code for the
......@@ -17,10 +17,8 @@ Ultimately, the goal is to improve discoverability of, and engagement in, third
party open-source libraries, by creating a more centralized ecosystem.
Installing and updating CocoaPods is very easy. Don't miss the [Installation
guide](http://docs.cocoapods.org/guides/installing_cocoapods.html) and the
[Getting started guide](http://docs.cocoapods.org/guides/getting_started.html).
See the [NSScreencast](https://twitter.com/NSScreencast) episode about [using
CocoaPods](http://nsscreencast.com/episodes/5-cocoapods) for a quick overview.
guide](http://guides.cocoapods.org/using/getting-started.html#installation) and the
[Getting started guide](http://guides.cocoapods.org/using/getting-started.html).
## Sponsors
......@@ -52,10 +50,10 @@ CocoaPods is composed by the following projects:
| Status | Project | Description | Info |
| :----- | :------ | :--- | :--- |
| [![Build Status](https://secure.travis-ci.org/CocoaPods/CocoaPods.png?branch=master)](http://travis-ci.org/CocoaPods/CocoaPods) | [CocoaPods](https://github.com/CocoaPods/CocoaPods) | The CocoaPods command line tool. | [docs](http://docs.cocoapods.org/cocoapods)
| [![Build Status](https://secure.travis-ci.org/CocoaPods/Core.png?branch=master)](http://travis-ci.org/CocoaPods/Core) | [CocoaPods Core](https://github.com/CocoaPods/Core) | Support for working with specifications and podfiles. | [docs](http://docs.cocoapods.org/cocoapods_core)
| [![Build Status](https://secure.travis-ci.org/CocoaPods/cocoapods-downloader.png?branch=master)](http://travis-ci.org/CocoaPods/cocoapods-downloader) |[CocoaPods Downloader](https://github.com/CocoaPods/cocoapods-downloader) | Downloaders for various source types. | [docs](http://docs.cocoapods.org/cocoapods_downloader/index.html)
| [![Build Status](https://travis-ci.org/CocoaPods/Xcodeproj.png?branch=master)](https://travis-ci.org/CocoaPods/Xcodeproj) | [Xcodeproj](https://github.com/CocoaPods/Xcodeproj) | Create and modify Xcode projects from Ruby. | [docs](http://docs.cocoapods.org/xcodeproj/index.html)
| [![Build Status](https://travis-ci.org/CocoaPods/CLAide.png?branch=master)](https://travis-ci.org/CocoaPods/CLAide) | [CLAide](https://github.com/CocoaPods/CLAide) | A small command-line interface framework. | [docs](http://docs.cocoapods.org/claide/index.html)
| [![Build Status](https://secure.travis-ci.org/CocoaPods/Specs.png?branch=master)](http://travis-ci.org/CocoaPods/Specs) | [Master Repo ](https://github.com/CocoaPods/Specs) | Master repository of specifications. | [guide](http://docs.cocoapods.org/guides/contributing_to_the_master_repo.html)
| [![Build Status](http://img.shields.io/travis/CocoaPods/CocoaPods/master.svg)](http://travis-ci.org/CocoaPods/CocoaPods) | [CocoaPods](https://github.com/CocoaPods/CocoaPods) | The CocoaPods command line tool. | [docs](http://docs.cocoapods.org/cocoapods)
| [![Build Status](http://img.shields.io/travis/CocoaPods/Core/master.svg)](http://travis-ci.org/CocoaPods/Core) | [CocoaPods Core](https://github.com/CocoaPods/Core) | Support for working with specifications and podfiles. | [docs](http://docs.cocoapods.org/cocoapods_core)
| [![Build Status](http://img.shields.io/travis/CocoaPods/cocoapods-downloader/master.svg)](http://travis-ci.org/CocoaPods/cocoapods-downloader) |[CocoaPods Downloader](https://github.com/CocoaPods/cocoapods-downloader) | Downloaders for various source types. | [docs](http://docs.cocoapods.org/cocoapods_downloader/index.html)
| [![Build Status](http://img.shields.io/travis/CocoaPods/Xcodeproj/master.svg)](https://travis-ci.org/CocoaPods/Xcodeproj) | [Xcodeproj](https://github.com/CocoaPods/Xcodeproj) | Create and modify Xcode projects from Ruby. | [docs](http://docs.cocoapods.org/xcodeproj/index.html)
| [![Build Status](http://img.shields.io/travis/CocoaPods/CLAide/master.svg)](https://travis-ci.org/CocoaPods/CLAide) | [CLAide](https://github.com/CocoaPods/CLAide) | A small command-line interface framework. | [docs](http://docs.cocoapods.org/claide/index.html)
| [![Build Status](http://img.shields.io/travis/CocoaPods/Specs/master.svg)](http://travis-ci.org/CocoaPods/Specs) | [Master Repo ](https://github.com/CocoaPods/Specs) | Master repository of specifications. | [guide](http://docs.cocoapods.org/guides/contributing_to_the_master_repo.html)
def execute_command(command)
if ENV['VERBOSE']
sh(command)
else
output = `#{command} 2>&1`
raise output unless $?.success?
end
task :build do
title "Building the gem"
end
#-----------------------------------------------------------------------------#
namespace :gem do
def gem_version
require File.expand_path('../lib/cocoapods/gem_version.rb', __FILE__)
Pod::VERSION
end
def gem_filename
"cocoapods-#{gem_version}.gem"
end
#--------------------------------------#
desc "Build a gem for the current version"
task :build do
sh "gem build cocoapods.gemspec"
end
#--------------------------------------#
desc "Install a gem version of the current code"
task :install => :build do
sh "gem install #{gem_filename}"
end
#--------------------------------------#
def silent_sh(command)
output = `#{command} 2>&1`
unless $?.success?
puts output
exit 1
end
output
end
desc "Run all specs, build and install gem, commit version change, tag version change, and push everything"
task :release do
require "bundler/gem_tasks"
unless ENV['SKIP_CHECKS']
if `git symbolic-ref HEAD 2>/dev/null`.strip.split('/').last != 'master'
$stderr.puts "[!] You need to be on the `master' branch in order to be able to do a release."
exit 1
end
# Bootstrap task
#-----------------------------------------------------------------------------#
if `git tag`.strip.split("\n").include?(gem_version)
$stderr.puts "[!] A tag for version `#{gem_version}' already exists. Change the version in lib/cocoapods/gem_version.rb"
silent_sh "open lib/cocoapods/gem_version.rb"
exit 1
end
desc "Initializes your working copy to run the specs"
task :bootstrap, :use_bundle_dir? do |t, args|
title "Environment bootstrap"
diff_lines = `git diff --name-only`.strip.split("\n")
diff_lines.delete('CHANGELOG.md')
diff_lines.delete('Gemfile.lock')
puts "Updating submodules"
execute_command "git submodule update --init --recursive"
if diff_lines.size == 0
$stderr.puts "[!] Change the version number yourself in lib/cocoapods/gem_version.rb"
exit 1
require 'rbconfig'
if RbConfig::CONFIG['prefix'] == '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr'
# Workaround Apple's mess. See https://github.com/CocoaPods/Xcodeproj/issues/137
#
# TODO This is not as correct as actually fixing the issue, figure out if we
# can override these build flags:
#
# ENV['DLDFLAGS'] = '-undefined dynamic_lookup -multiply_defined suppress'
ENV['ARCHFLAGS'] = '-Wno-error=unused-command-line-argument-hard-error-in-future'
end
if diff_lines != ['lib/cocoapods/gem_version.rb']
$stderr.puts "[!] Only change the version number in a release commit!"
exit 1
puts "Installing gems"
if args[:use_bundle_dir?]
execute_command "env XCODEPROJ_BUILD=1 bundle install --path ./travis_bundle_dir"
else
execute_command "env XCODEPROJ_BUILD=1 bundle install"
end
puts "You are about to release `#{gem_version}', is that correct? [y/n]"
exit if $stdin.gets.strip.downcase != 'y'
puts "Checking for hg and bzr..."
if `which hg`.strip.empty?
puts "Please install Mercurial: `brew install hg`"
end
require 'date'
# First check if the required gems have been pushed
gem_spec = eval(File.read(File.expand_path('../cocoapods.gemspec', __FILE__)))
gem_names = ['xcodeproj', 'cocoapods-core', 'cocoapods-downloader', 'claide']
gem_names.each do |gem_name|
gem = gem_spec.dependencies.find { |d| d.name == gem_name }
required_version = gem.requirement.requirements.first.last.to_s
puts "* Checking if #{gem_name} #{required_version} exists on the gem host"
search_result = silent_sh("gem search --all --pre --remote #{gem_name}")
remote_versions = search_result.match(/#{gem_name} \((.*)\)/m)[1].split(', ')
unless remote_versions.include?(required_version)
$stderr.puts "[!] The #{gem_name} version `#{required_version}' required by " \
"this version of CocoaPods does not exist on the gem host. " \
"Either push that first, or fix the version requirement."
exit 1
if `which bzr`.strip.empty?
puts "Please install Bazaar: `brew install bzr`"
end
end
# Ensure that the branches are up to date with the remote
sh "git pull"
puts "* Updating Bundle"
silent_sh('bundle update')
unless ENV['SKIP_SPECS']
puts "* Running specs"
silent_sh('rake spec:all')
end
tmp = File.expand_path('../tmp', __FILE__)
tmp_gems = File.join(tmp, 'gems')
Rake::Task['gem:build'].invoke
puts "* Testing gem installation (tmp/gems)"
silent_sh "rm -rf '#{tmp}'"
silent_sh "gem install --install-dir='#{tmp_gems}' #{gem_filename}"
end
# Then release
sh "git commit lib/cocoapods/gem_version.rb CHANGELOG.md Gemfile.lock -m 'Release #{gem_version}'"
sh "git tag -a #{gem_version} -m 'Release #{gem_version}'"
sh "git push origin master"
sh "git push origin --tags"
sh "gem push #{gem_filename}"
# Post release
#-----------------------------------------------------------------------------#
# Update the last version in CocoaPods-version.yml
puts "* Updating last known version in Specs repo"
desc "Updates the last know version of CocoaPods in the specs repo"
task :post_release do
title "Updating last known version in Specs repo"
specs_branch = 'master'
Dir.chdir('../Specs') do
puts Dir.pwd
......@@ -149,9 +69,9 @@ namespace :gem do
sh "git commit #{yaml_file} -m 'CocoaPods release #{gem_version}'"
sh "git push"
end
end
end
# Spec
#-----------------------------------------------------------------------------#
namespace :spec do
......@@ -219,9 +139,6 @@ namespace :spec do
Rake::Task['examples:build'].invoke
end
# Travis
#--------------------------------------#
#
# The integration 2 tests and the examples use the normal CocoaPods setup.
#
desc "Run all specs and build all examples"
......@@ -242,8 +159,6 @@ namespace :spec do
Rake::Task['examples:build'].invoke
end
#--------------------------------------#
desc "Rebuild all the fixture tarballs"
task :rebuild_fixture_tarballs do
tarballs = FileList['spec/fixtures/**/*.tar.gz']
......@@ -253,8 +168,6 @@ namespace :spec do
end
end
#--------------------------------------#
desc "Unpacks all the fixture tarballs"
task :unpack_fixture_tarballs do
tarballs = FileList['spec/fixtures/**/*.tar.gz']
......@@ -266,15 +179,11 @@ namespace :spec do
end
end
#--------------------------------------#
desc "Removes the stored VCR fixture"
task :clean_vcr do
sh "rm -f spec/fixtures/vcr/tarballs.yml"
end
#--------------------------------------#
desc "Rebuilds integration fixtures"
task :rebuild_integration_fixtures do
title 'Running Integration tests'
......@@ -302,11 +211,10 @@ namespace :spec do
puts "Integration fixtures updated, commit and push in the `spec/cocoapods-integration-specs` submodule"
end
#--------------------------------------#
task :clean_env => [:clean_vcr, :unpack_fixture_tarballs, "ext:cleanbuild"]
end
# Examples
#-----------------------------------------------------------------------------#
task :examples => "examples:build"
......@@ -324,13 +232,14 @@ namespace :examples do
end
end
#--------------------------------------#
desc "Build all examples"
task :build do
Dir.chdir("examples/AFNetworking Example") do
puts "Installing Pods"
pod_command = ENV['FROM_GEM'] ? 'sandbox-pod' : 'bundle exec ../../bin/sandbox-pod'
# pod_command = ENV['FROM_GEM'] ? 'sandbox-pod' : 'bundle exec ../../bin/sandbox-pod'
# TODO: The sandbox is blocking local git repos making bundler crash
pod_command = ENV['FROM_GEM'] ? 'sandbox-pod' : 'bundle exec ../../bin/pod'
execute_command "rm -rf Pods"
execute_command "#{pod_command} install --verbose --no-repo-update"
......@@ -347,29 +256,8 @@ namespace :examples do
sdk = Dir.glob("#{`xcode-select -print-path`.chomp}/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*.sdk").last
execute_command "xcodebuild -workspace 'AFNetworking Examples.xcworkspace' -scheme 'AFNetworking iOS Example' clean install ONLY_ACTIVE_ARCH=NO -sdk #{sdk}"
end
end
end
#--------------------------------------#
end
#-----------------------------------------------------------------------------#
desc "Initializes your working copy to run the specs"
task :bootstrap, :use_bundle_dir? do |t, args|
title "Environment bootstrap"
puts "Updating submodules"
execute_command "git submodule update --init --recursive"
puts "Installing gems"
if args[:use_bundle_dir?]
execute_command "bundle install --path ./travis_bundle_dir"
else
execute_command "bundle install"
end
end
#-----------------------------------------------------------------------------#
......@@ -379,9 +267,22 @@ task :spec => 'spec:all'
task :default => :spec
# Helpers
#-----------------------------------------------------------------------------#
# group helpers
def execute_command(command)
if ENV['VERBOSE']
sh(command)
else
output = `#{command} 2>&1`
raise output unless $?.success?
end
end
def gem_version
require File.expand_path('../lib/cocoapods/gem_version.rb', __FILE__)
Pod::VERSION
end
def title(title)
cyan_title = "\033[0;36m#{title}\033[0m"
......
#!/usr/bin/env ruby
if RUBY_VERSION > '1.8.7' && Encoding.default_external != Encoding::UTF_8
puts "\e[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding."
if ENV["TRAVIS"]
puts <<-DOC
Consider adding the following settings to .travis.yml
before_script:
- export LANG=en_US.UTF-8\e[0m\n
DOC
else
puts <<-DOC
\e[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
See https://github.com/CocoaPods/guides.cocoapods.org/issues/26 for
possible solutions.\e[0m\n
DOC
end
end
if $PROGRAM_NAME == __FILE__ && !ENV['COCOAPODS_NO_BUNDLER']
......
......@@ -28,15 +28,17 @@ s.files = Dir["lib/**/*.rb"] + %w{ bin/pod bin/sandbox-pod README.md LICENSE CHA
# Link with the version of CocoaPods-Core
s.add_runtime_dependency 'cocoapods-core', "= #{Pod::VERSION}"
s.add_runtime_dependency 'claide', '~> 0.4.0'
s.add_runtime_dependency 'cocoapods-downloader', '~> 0.2.0'
s.add_runtime_dependency 'xcodeproj', '~> 0.14.1'
s.add_runtime_dependency 'claide', '~> 0.5.0'
s.add_runtime_dependency 'cocoapods-downloader', '~> 0.4.0'
s.add_runtime_dependency 'xcodeproj', '~> 0.15.0'
s.add_runtime_dependency 'cocoapods-try', '~> 0.2.0'
s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_runtime_dependency 'json_pure', '~> 1.8'
s.add_runtime_dependency 'open4', '~> 1.3'
s.add_runtime_dependency 'activesupport', '>= 3.2.15', '< 4'
s.add_runtime_dependency 'nap', '~> 0.5'
s.add_development_dependency 'bacon', '~> 1.1'
......
......@@ -298,7 +298,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = E74E8E7AFD3F4DCF9FEAB5B4 /* Pods-AFNetworking Example.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "AFNetworking Example.entitlements";
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
......@@ -313,7 +312,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = E74E8E7AFD3F4DCF9FEAB5B4 /* Pods-AFNetworking Example.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "AFNetworking Example.entitlements";
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
......
require 'rubygems'
require 'xcodeproj'
# It is very likely that we'll need these and as some of those paths will atm
# result in a I18n deprecation warning, we load those here now so that we can
# get rid of that warning.
require 'active_support/core_ext/string/strip'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/array/conversions'
# TODO check what this actually does by the time we're going to add support for
# other locales.
I18n.enforce_available_locales = false
module Pod
require 'pathname'
......@@ -55,3 +65,24 @@ if ENV['COCOA_PODS_ENV'] == 'development'
# require 'awesome_print'
# require 'pry'
end
# TODO remove for CocoaPods 0.31
#
module Pod
class Specification
def pre_install(&block)
UI.warn "[#{self}] The pre install hook of the specification " \
"DSL has been deprecated, use the `resource_bundles` or the " \
"`prepare_command` attributes."
UI.puts "[#{self}] The pre_install hook will be removed in the next release".red
@pre_install_callback = block
end
def post_install(&block)
UI.warn "[#{self}] The post install hook of the specification " \
"DSL has been deprecated, use the `resource_bundles` or the " \
"`prepare_command` attributes."
UI.puts "[#{self}] The post_install hook will be removed in the next release".red
@post_install_callback = block
end
end
end
......@@ -13,7 +13,6 @@ module Pod
require 'cocoapods/command/lib'
require 'cocoapods/command/list'
require 'cocoapods/command/outdated'
require 'cocoapods/command/podfile_info'
require 'cocoapods/command/project'
require 'cocoapods/command/push'
require 'cocoapods/command/repo'
......@@ -46,8 +45,8 @@ module Pod
def self.run(argv)
argv = CLAide::ARGV.new(argv)
if argv.flag?('version')
puts VERSION
exit!(0)
UI.puts VERSION
exit 0
end
super(argv)
UI.print_warnings
......@@ -81,7 +80,7 @@ module Pod
super
config.silent = argv.flag?('silent', config.silent)
config.verbose = self.verbose? unless self.verbose.nil?
unless self.colorize_output?
unless self.ansi_output?
String.send(:define_method, :colorize) { |string , _| string }
end
end
......
......@@ -31,12 +31,13 @@ module Pod
raise Informative, "Existing Podfile found in directory" unless config.podfile.nil?
if @project_path
help! "Xcode project at #{@project_path} does not exist" unless File.exist? @project_path
project_path = @project_path
else
raise Informative, "No xcode project found, please specify one" unless @project_paths.length > 0
raise Informative, "Multiple xcode projects found, please specify one" unless @project_paths.length == 1
@project_path = @project_paths.first
project_path = @project_paths.first
end
@xcode_project = Xcodeproj::Project.open(@project_path)
@xcode_project = Xcodeproj::Project.open(project_path)
end
def run
......@@ -51,7 +52,9 @@ module Pod
# @return [String] the text of the Podfile for the provided project
#
def podfile_template(project)
podfile = <<-PLATFORM.strip_heredoc
podfile = ''
podfile << "xcodeproj '#{@project_path}'\n\n" if @project_path
podfile << <<-PLATFORM.strip_heredoc
# Uncomment this line to define a global platform for your project
# platform :ios, "6.0"
PLATFORM
......
......@@ -13,8 +13,8 @@ module Pod
class Spec < IPC
self.summary = 'Converts a podspec to YAML.'
self.description = 'Converts a podspec to YAML and prints it to STDOUT.'
self.summary = 'Converts a podspec to JSON.'
self.description = 'Converts a podspec to JSON and prints it to STDOUT.'
self.arguments = 'PATH'
def initialize(argv)
......@@ -29,7 +29,7 @@ module Pod
def run
spec = Specification.from_file(@path)
output_pipe.puts spec.to_yaml
output_pipe.puts spec.to_json
end
end
......
......@@ -10,13 +10,15 @@ module Pod
self.summary = 'Creates a new Pod'
self.description = <<-DESC
Creates a new Pod with the given name from the template in the working directory.
Creates a scaffold for the development of a new Pod according to the CocoaPods best practices.
If a `TEMPLATE_URL`, pointing to a git repo containing a compatible template, is specified, it will be used in place of the default one.
DESC
self.arguments = '[NAME]'
self.arguments = 'NAME [TEMPLATE_URL]'
def initialize(argv)
@name = argv.shift_argument
@template_url = argv.shift_argument
super
end
......@@ -44,6 +46,7 @@ module Pod
TEMPLATE_REPO = "https://github.com/CocoaPods/pod-template.git"
TEMPLATE_INFO_URL = "https://github.com/CocoaPods/pod-template"
CREATE_NEW_POD_INFO_URL = "http://guides.cocoapods.org/making/making-a-cocoapod"
# Clones the template from the remote in the working directory using
# the name of the Pod.
......@@ -52,7 +55,7 @@ module Pod
#
def clone_template
UI.section("Creating `#{@name}` Pod") do
git!"clone '#{TEMPLATE_REPO}' #{@name}"
git!"clone '#{template_repo_url}' #{@name}"
end
end
......@@ -73,9 +76,17 @@ module Pod
# @return [void]
#
def print_info
UI.puts "\nTo learn more about the template see `#{TEMPLATE_INFO_URL}`."
UI.puts "\nTo learn more about the template see `#{template_repo_url}`."
UI.puts "To learn more about creating a new pod, see `#{CREATE_NEW_POD_INFO_URL}`."
end
# Checks if a template URL is given else returns the TEMPLATE_REPO URL
#
# @return String
#
def template_repo_url
@template_url || TEMPLATE_REPO
end
end
#-----------------------------------------------------------------------#
......@@ -90,6 +101,8 @@ module Pod
def self.options
[ ["--quick", "Lint skips checks that would require to download and build the spec"],
["--only-errors", "Lint validates even if warnings are present"],
["--subspec=NAME","Lint validates only the given subspec"],
["--no-subspecs", "Lint skips validation of subspecs"],
["--no-clean", "Lint leaves the build directory intact for inspection"] ].concat(super)
end
......@@ -97,6 +110,9 @@ module Pod
@quick = argv.flag?('quick')
@only_errors = argv.flag?('only-errors')
@clean = argv.flag?('clean', true)
@subspecs = argv.flag?('subspecs', true)
@only_subspec = argv.option('subspec')
@podspecs_paths = argv.arguments!
super
end
......@@ -106,18 +122,21 @@ module Pod
def run
UI.puts
validator = Validator.new(podspec_to_lint)
podspecs_to_lint.each do |podspec|
validator = Validator.new(podspec)
validator.local = true
validator.quick = @quick
validator.no_clean = !@clean
validator.only_errors = @only_errors
validator.no_subspecs = !@subspecs || @only_subspec
validator.only_subspec = @only_subspec
validator.validate
unless @clean
UI.puts "Pods project available at `#{validator.validation_dir}/Pods/Pods.xcodeproj` for inspection."
UI.puts
end
if validator.validated?
UI.puts "#{validator.spec.name} passed validation.".green
else
......@@ -129,6 +148,7 @@ module Pod
raise Informative, message
end
end
end
private
......@@ -142,11 +162,14 @@ module Pod
# @raise If no podspec is found.
# @raise If multiple podspecs are found.
#
def podspec_to_lint
def podspecs_to_lint
if !@podspecs_paths.empty? then
Array(@podspecs_paths)
else
podspecs = Pathname.glob(Pathname.pwd + '*.podspec{.yaml,}')
raise Informative, "Unable to find a podspec in the working directory" if podspecs.count.zero?
raise Informative, "Multiple podspecs detected in the working directory" if podspecs.count > 1
podspecs.first
podspecs
end
end
end
......
module Pod
class Command
class PodfileInfo < Command
self.summary = 'Shows information on installed Pods.'
self.description = <<-DESC
Shows information on installed Pods in current Project.
If optional `PODFILE_PATH` provided, the info will be shown for
that specific Podfile
DESC
self.arguments = '[PODFILE_PATH]'
def self.options
[
["--all", "Show information about all Pods with dependencies that are used in a project"],
["--md", "Output information in Markdown format"]
].concat(super)
end
def initialize(argv)
@info_all = argv.flag?('all')
@info_in_md = argv.flag?('md')
@info_license = argv.flag?('license')
@podfile_path = argv.shift_argument
super
end
def run
use_podfile = (@podfile_path || !config.lockfile)
if !use_podfile
UI.puts "Using lockfile" if config.verbose?
verify_lockfile_exists!
lockfile = config.lockfile
pods = lockfile.pod_names
if @info_all
deps = lockfile.dependencies.map{|d| d.name}
pods = (deps + pods).uniq
end
elsif @podfile_path
podfile = Pod::Podfile.from_file(@podfile_path)
pods = pods_from_podfile(podfile)
else
verify_podfile_exists!
podfile = config.podfile
pods = pods_from_podfile(podfile)
end
UI.puts "\nPods used:\n".yellow unless @info_in_md
pods_info(pods, @info_in_md)
end
def pods_from_podfile(podfile)
pods = []
podfile.root_target_definitions.each {|e| h = e.to_hash; pods << h['dependencies'] if h['dependencies']}
pods.flatten!
pods.collect! {|pod| (pod.is_a?(Hash)) ? pod.keys.first : pod}
end
def pods_info_hash(pods, keys=[:name, :homepage, :summary, :license])
pods_info = []
pods.each do |pod|
spec = (Pod::SourcesManager.search_by_name(pod).first rescue nil)
if spec
info = {}
keys.each { |k| info[k] = spec.specification.send(k) }
pods_info << info
else
end
end
pods_info
end
def pods_info(pods, in_md=false)
pods = pods_info_hash(pods, [:name, :homepage, :summary, :license])
pods.each do |pod|
if in_md
UI.puts "* [#{pod[:name]}](#{pod[:homepage]}) [#{pod[:license][:type]}] - #{pod[:summary]}"
else
UI.puts "- #{pod[:name]} [#{pod[:license][:type]}]".green
UI.puts " #{pod[:summary]}\n\n"
end
end
end
end
end
end
......@@ -122,7 +122,7 @@ module Pod
FileUtils.cp(spec_file, output_path)
Dir.chdir(repo_dir) do
# only commit if modified
if git!("status --porcelain 2>&1") =~ /#{spec.name}/
if git!("status --porcelain 2>&1").include?(spec.name)
UI.puts " - #{message}"
git!("add #{spec.name}")
git!("commit --no-verify -m '#{message}'")
......
......@@ -19,7 +19,14 @@ module Pod
self.arguments = 'NAME URL [BRANCH]'
def self.options
[
["--shallow", "Create a shallow clone (fast clone, but no push capabilities)"],
].concat(super)
end
def initialize(argv)
@shallow = argv.flag?('shallow', false)
@name, @url, @branch = argv.shift_argument, argv.shift_argument, argv.shift_argument
super
end
......@@ -32,9 +39,14 @@ module Pod
end
def run
UI.section("Cloning spec repo `#{@name}` from `#{@url}`#{" (branch `#{@branch}`)" if @branch}") do
prefix = @shallow ? 'Creating shallow clone of' : 'Cloning'
UI.section("#{prefix} spec repo `#{@name}` from `#{@url}`#{" (branch `#{@branch}`)" if @branch}") do
config.repos_dir.mkpath
Dir.chdir(config.repos_dir) { git!("clone '#{@url}' #{@name}") }
Dir.chdir(config.repos_dir) do
command = "clone '#{@url}' #{@name}"
command << ' --depth=1' if @shallow
git!(command)
end
Dir.chdir(dir) { git!("checkout #{@branch}") } if @branch
SourcesManager.check_version_information(dir)
end
......@@ -151,6 +163,8 @@ module Pod
super
help! 'Deleting a repo needs a `NAME`.' unless @name
help! "repo #{@name} does not exist" unless File.directory?(dir)
help! "You do not have permission to delete the #{@name} repository." \
"Perhaps try prefixing this command with sudo." unless File.writable?(dir)
end
def run
......
......@@ -9,15 +9,16 @@ module Pod
description of the pods.
DESC
self.arguments = '[QUERY]'
self.arguments = 'QUERY'
def self.options
[
["--full", "Search by name, summary, and description"],
["--stats", "Show additional stats (like GitHub watchers and forks)"],
["--ios", "Restricts the search to Pods supported on iOS"],
["--osx", "Restricts the search to Pods supported on OS X"]
].concat(super)
["--osx", "Restricts the search to Pods supported on OS X"],
["--web", "Searches on cocoapods.org"]
].concat(super.reject { |option, _| option == '--silent' })
end
def initialize(argv)
......@@ -25,17 +26,49 @@ module Pod
@stats = argv.flag?('stats')
@supported_on_ios = argv.flag?('ios')
@supported_on_osx = argv.flag?('osx')
@query = argv.shift_argument
@web = argv.flag?('web')
@query = argv.arguments! unless argv.arguments.empty?
config.silent = false
super
end
def validate!
super
help! "A search query is required." unless @query
unless @web
begin
/#{@query.join(' ').strip}/
rescue RegexpError
help! "A valid regular expression is required."
end
end
end
def run
sets = SourcesManager.search_by_name(@query.strip, @full_text_search)
if @web
web_search
else
local_search
end
end
extend Executable
executable :open
def web_search
query_parameter = [
('on:osx' if @supported_on_osx),
('on:ios' if @supported_on_ios),
@query
].compact.flatten.join(' ')
url = "http://cocoapods.org/?q=#{CGI.escape(query_parameter).gsub("+", "%20")}"
UI.puts("Opening #{url}")
open!(url)
end
def local_search
sets = SourcesManager.search_by_name(@query.join(' ').strip, @full_text_search)
if @supported_on_ios
sets.reject!{ |set| !set.specification.available_platforms.map(&:name).include?(:ios) }
end
......@@ -56,6 +89,7 @@ module Pod
end
end
end
end
end
end
......@@ -15,7 +15,10 @@ module Pod
DESC
def self.options
[["--push", "Use this option to enable push access once granted"]].concat(super)
[
["--no-shallow", "Clone full history so push will work"],
["--push", "Use this option to enable push access once granted"],
].concat(super)
end
extend Executable
......@@ -23,6 +26,7 @@ module Pod
def initialize(argv)
@push_option = argv.flag?('push')
@shallow = argv.flag?('shallow', !@push_option)
super
end
......@@ -77,7 +81,9 @@ module Pod
# @return [void]
#
def add_master_repo
@command ||= Repo::Add.parse(['master', url, 'master']).run
cmd = ['master', url, 'master']
cmd << '--shallow' if @shallow
Repo::Add.parse(cmd).run
end
# Updates the master repo against the remote.
......@@ -109,7 +115,7 @@ module Pod
# be enabled.
#
def url
(push?) ? read_write_url : read_only_url
push? ? read_write_url : read_only_url
end
# @return [String] the read only url of the master repo.
......
......@@ -61,6 +61,8 @@ module Pod
def self.options
[ ["--quick", "Lint skips checks that would require to download and build the spec"],
["--only-errors", "Lint validates even if warnings are present"],
["--subspec=NAME","Lint validates only the given subspec"],
["--no-subspecs", "Lint skips validation of subspecs"],
["--no-clean", "Lint leaves the build directory intact for inspection"] ].concat(super)
end
......@@ -68,6 +70,8 @@ module Pod
@quick = argv.flag?('quick')
@only_errors = argv.flag?('only-errors')
@clean = argv.flag?('clean', true)
@subspecs = argv.flag?('subspecs', true)
@only_subspec = argv.option('subspec')
@podspecs_paths = argv.arguments!
super
end
......@@ -80,6 +84,8 @@ module Pod
validator.quick = @quick
validator.no_clean = !@clean
validator.only_errors = @only_errors
validator.no_subspecs = !@subspecs || @only_subspec
validator.only_subspec = @only_subspec
validator.validate
invalid_count += 1 unless validator.validated?
......@@ -129,7 +135,7 @@ module Pod
end
def podspecs_tmp_dir
Pathname.new('/tmp/CocoaPods/Lint_podspec')
Pathname.new(File.join(Pathname.new('/tmp').realpath, '/CocoaPods/Lint_podspec'))
end
end
......@@ -201,7 +207,7 @@ module Pod
get_path_of_spec(@spec)
end
UI.puts File.open(filepath).read
UI.puts File.read(filepath)
end
end
......@@ -294,10 +300,10 @@ module Pod
UI.puts "#{ index + 1 }: #{ item }"
end
print message
UI.puts message
index = STDIN.gets.chomp.to_i - 1
if index < 0 || index > array.count
index = UI.gets.chomp.to_i - 1
if index < 0 || index > array.count - 1
raise Informative, "#{ index + 1 } is invalid [1-#{ array.count }]"
else
index
......@@ -364,15 +370,20 @@ module Pod
def spec_and_source_from_set(set)
sources = set.sources
best_source = sources.first
best_version = best_source.versions(set.name).first
best_source = best_version = nil
sources.each do |source|
version = source.versions(set.name).first
if version > best_version
versions = source.versions(set.name)
versions.each do |version|
if !best_version or version > best_version
best_source = source
best_version = version
end
end
end
if !best_source or !best_version
raise Informative, "Unable to locate highest known specification for `#{ set.name }'"
end
return best_source.specification(set.name, best_version), best_source
end
......@@ -479,21 +490,24 @@ Pod::Spec.new do |s|
# Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
#
s.license = 'MIT (example)'
# s.license = { :type => 'MIT', :file => 'FILE_LICENSE' }
s.license = "MIT (example)"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the authors of the library, with email addresses. Email addresses
# of the authors by using the SCM log. E.g. $ git log. If no email can be
# found CocoaPods accept just the names.
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
# accepts just a name if you'd rather not provide an email address.
#
# Specify a social_media_url where others can refer to, for example a twitter
# profile URL.
#
s.author = { "#{data[:author_name]}" => "#{data[:author_email]}" }
# s.authors = { "#{data[:author_name]}" => "#{data[:author_email]}", "other author" => "email@address.com" }
# s.author = '#{data[:author_name]}', 'other author'
# Or just: s.author = "#{data[:author_name]}"
# s.authors = { "#{data[:author_name]}" => "#{data[:author_email]}" }
# s.social_media_url = "http://twitter.com/#{data[:author_name]}"
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
......@@ -502,17 +516,17 @@ Pod::Spec.new do |s|
#
# s.platform = :ios
# s.platform = :ios, '5.0'
# s.platform = :ios, "5.0"
# When using multiple platforms
# s.ios.deployment_target = '5.0'
# s.osx.deployment_target = '10.7'
# s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the location from where the source should be retrieved.
# Supports git, hg, svn and HTTP.
# Supports git, hg, bzr, svn and HTTP.
#
s.source = { :git => "#{data[:source_url]}", #{data[:ref_type]} => "#{data[:ref]}" }
......@@ -526,10 +540,10 @@ Pod::Spec.new do |s|
# Not including the public_header_files will make all headers public.
#
s.source_files = 'Classes', 'Classes/**/*.{h,m}'
s.exclude_files = 'Classes/Exclude'
s.source_files = "Classes", "Classes/**/*.{h,m}"
s.exclude_files = "Classes/Exclude"
# s.public_header_files = 'Classes/**/*.h'
# s.public_header_files = "Classes/**/*.h"
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
......@@ -552,11 +566,11 @@ Pod::Spec.new do |s|
# the lib prefix of their name.
#
# s.framework = 'SomeFramework'
# s.frameworks = 'SomeFramework', 'AnotherFramework'
# s.framework = "SomeFramework"
# s.frameworks = "SomeFramework", "AnotherFramework"
# s.library = 'iconv'
# s.libraries = 'iconv', 'xml2'
# s.library = "iconv"
# s.libraries = "iconv", "xml2"
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
......@@ -567,8 +581,8 @@ Pod::Spec.new do |s|
# s.requires_arc = true
# s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
# s.dependency 'JSONKit', '~> 1.4'
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
# s.dependency "JSONKit", "~> 1.4"
end
SPEC
......
......@@ -16,6 +16,7 @@ module Pod
klass = if params.key?(:git) then GitSource
elsif params.key?(:svn) then SvnSource
elsif params.key?(:hg) then MercurialSource
elsif params.key?(:bzr) then BazaarSource
elsif params.key?(:podspec) then PodspecSource
elsif params.key?(:path) then PathSource
end
......@@ -261,6 +262,35 @@ module Pod
#-------------------------------------------------------------------------#
# Provides support for fetching a specification file from a Bazaar
# source remote.
#
# Supports all the options of the downloader (is similar to the git key of
# `source` attribute of a specification).
#
# @note The podspec must be in the root of the repository and should have a
# name matching the one of the dependency.
#
class BazaarSource < AbstractExternalSource
# @see AbstractExternalSource#fetch
#
def fetch(sandbox)
pre_download(sandbox)
end
# @see AbstractExternalSource#description
#
def description
"from `#{params[:bzr]}`".tap do |description|
description << ", tag `#{params[:tag]}`" if params[:tag]
description << ", revision `#{params[:revision]}`" if params[:revision]
end
end
end
#-------------------------------------------------------------------------#
# Provides support for fetching a specification file from an URL. Can be
# http, file, etc.
#
......@@ -348,7 +378,7 @@ module Pod
pathname = Pathname.new(absolute_path)
unless pathname.exist?
raise Informative, "No podspec found for `#{name}` in `#{params[:local]}`"
raise Informative, "No podspec found for `#{name}` in `#{declared_path}`"
end
pathname
end
......
module Pod
# The version of the cocoapods command line tool.
#
VERSION = '0.28.0' unless defined? Pod::VERSION
VERSION = '0.30.0' unless defined? Pod::VERSION
end
require 'active_support/core_ext/string/inflections'
module Pod
# The Installer is responsible of taking a Podfile and transform it in the
......@@ -155,15 +157,15 @@ module Pod
# @return [void]
#
# @note The warning about the version of the Lockfile doesn't uses the
# @note The warning about the version of the Lockfile doesn't use the
# `UI.warn` method because it prints the output only at the end
# of the installation. At that time CocoaPods could have crashed.
#
def analyze
if lockfile && lockfile.cocoapods_version > Version.new(VERSION)
STDERR.puts '[!] The version of CocoaPods used to generate the lockfile is '\
'higher that the one of the current executable. Incompatibility ' \
'issues might arise.'.yellow
'higher than the version of the current executable. Incompatibility ' \
'issues may arise.'.yellow
end
analyzer = Analyzer.new(sandbox, podfile, lockfile)
......
......@@ -461,7 +461,8 @@ module Pod
def compute_archs_for_target_definition(target_definition, user_targets)
archs = []
user_targets.each do |target|
archs << target.common_resolved_build_setting('ARCHS')
target_archs = target.common_resolved_build_setting('ARCHS')
archs.concat(Array(target_archs))
end
archs = archs.compact.uniq.sort
......
......@@ -15,7 +15,6 @@ module Pod
add_target
add_files_to_build_phases
add_resources_bundle_targets
# create_suport_files_group
create_xcconfig_file
create_prefix_header
create_dummy_source
......
require 'active_support'
require 'active_support/core_ext/string/inflections'
module Pod
class Installer
......
......@@ -61,16 +61,17 @@ module Pod
def search_by_name(query, full_text_search = false)
if full_text_search
set_names = []
query_regexp = /#{query}/i
updated_search_index.each do |name, set_data|
text = name.dup
texts = [name]
if full_text_search
text << set_data['authors'].to_s if set_data['authors']
text << set_data['summary'] if set_data['summary']
text << set_data['description'] if set_data['description']
texts << set_data['authors'].to_s if set_data['authors']
texts << set_data['summary'] if set_data['summary']
texts << set_data['description'] if set_data['description']
end
set_names << name if text.downcase.include?(query.downcase)
set_names << name unless texts.grep(query_regexp).empty?
end
sets = set_names.sort.map { |name| aggregate.represenative_set(name) }
sets = set_names.sort.map { |name| aggregate.representative_set(name) }
else
sets = aggregate.search_by_name(query, false)
end
......@@ -142,19 +143,19 @@ module Pod
if source_name
specified_source = aggregate.all.find { |s| s.name == source_name }
raise Informative, "Unable to find the `#{source_name}` repo." unless specified_source
raise Informative, "The `#{source_name}` repo is not a git repo." unless git_repo?(specified_source.repo)
raise Informative, "The `#{source_name}` repo is not a git repo." unless git_repo?(specified_source.data_provider.repo)
sources = [specified_source]
else
sources = aggregate.all.select { |source| git_repo?(source.repo) && git_remote_reachable?(source.repo) }
sources = aggregate.all.select { |source| git_repo?(source.data_provider.repo) && git_remote_reachable?(source.data_provider.repo) }
end
sources.each do |source|
UI.section "Updating spec repo `#{source.name}`" do
Dir.chdir(source.repo) do
Dir.chdir(source.data_provider.repo) do
output = git!("pull")
UI.puts output if show_output && !config.verbose?
end
check_version_information(source.repo)
check_version_information(source.data_provider.repo)
end
end
end
......@@ -205,7 +206,8 @@ module Pod
end
if config.new_version_message? && cocoapods_update?(versions)
UI.puts "\nCocoaPods #{versions['last']} is available.\n".green
UI.puts "\nCocoaPods #{versions['last']} is available.\n" \
"To update use: [sudo] gem install cocoapods\n".green
end
end
......
......@@ -242,6 +242,12 @@ module Pod
STDOUT.print(message) unless config.silent?
end
# gets input from $stdin
#
def gets
$stdin.gets
end
# Stores important warning to the user optionally followed by actions
# that the user should take. To print them use {#print_warnings}.
#
......
......@@ -87,7 +87,8 @@ EOS
def repo_information
SourcesManager.all.map do |source|
repo = source.repo
next unless source.type == 'file system'
repo = source.data_provider.repo
Dir.chdir(repo) do
url = `git config --get remote.origin.url 2>&1`.strip
sha = `git rev-parse HEAD 2>&1`.strip
......
......@@ -46,7 +46,7 @@ module Pod
#-------------------------------------------------------------------------#
# Lints the specification adding a {Specification::Linter::Result} for any
# Lints the specification adding a {Result} for any
# failed check to the {#results} list.
#
# @note This method shows immediately which pod is being processed and
......@@ -56,13 +56,21 @@ module Pod
#
def validate
@results = []
UI.print " -> #{spec ? spec.name : file.basename}\r" unless config.silent?
# Replace default spec with a subspec if asked for
a_spec = spec
if spec && @only_subspec
a_spec = spec.subspec_by_name(@only_subspec)
@subspec_name = a_spec.name
end
UI.print " -> #{a_spec ? a_spec.name : file.basename}\r" unless config.silent?
$stdout.flush
perform_linting
perform_extensive_analysis if spec && !quick
perform_extensive_analysis(a_spec) if a_spec && !quick
UI.puts " -> ".send(result_color) << (spec ? spec.to_s : file.basename.to_s)
UI.puts " -> ".send(result_color) << (a_spec ? a_spec.to_s : file.basename.to_s)
print_results
validated?
end
......@@ -79,12 +87,22 @@ module Pod
platform_message = "[OSX] "
end
subspecs_message = ""
if result.is_a?(Result)
subspecs = result.subspecs.uniq
if subspecs.count > 2
subspecs_message = "[" + subspecs[0..2].join(', ') + ", and more...] "
elsif subspecs.count > 0
subspecs_message = "[" + subspecs.join(',') + "] "
end
end
case result.type
when :error then type = "ERROR"
when :warning then type = "WARN"
when :note then type = "NOTE"
else raise "#{result.type}" end
UI.puts " - #{type.ljust(5)} | #{platform_message}#{result.message}"
UI.puts " - #{type.ljust(5)} | #{platform_message}#{subspecs_message}#{result.message}"
end
UI.puts
end
......@@ -116,6 +134,14 @@ module Pod
#
attr_accessor :only_errors
# @return [String] name of the subspec to check, if nil all subspecs are checked.
#
attr_accessor :only_subspec
# @return [Bool] Whether the validator should validate all subspecs
#
attr_accessor :no_subspecs
#-------------------------------------------------------------------------#
# !@group Lint results
......@@ -151,7 +177,7 @@ module Pod
# @return [Pathname] the temporary directory used by the linter.
#
def validation_dir
Pathname.new('/tmp/CocoaPods/Lint')
Pathname.new(File.join(Pathname.new('/tmp').realpath,'CocoaPods/Lint'))
end
#-------------------------------------------------------------------------#
......@@ -167,9 +193,9 @@ module Pod
@results.concat(linter.results)
end
# Perform analysis for a given spec (or subspec)
#
#
def perform_extensive_analysis
def perform_extensive_analysis(spec)
spec.available_platforms.each do |platform|
UI.message "\n\n#{spec} - Analyzing on #{platform} platform.".green.reversed
@consumer = spec.consumer(platform)
......@@ -179,9 +205,20 @@ module Pod
check_file_patterns
tear_down_validation_environment
end
perform_extensive_subspec_analysis(spec) unless @no_subspecs
end
# Recurively perform the extensive analysis on all subspecs
#
def perform_extensive_subspec_analysis(spec)
spec.subspecs.each do |subspec|
@subspec_name = subspec.name
perform_extensive_analysis(subspec)
end
end
attr_accessor :consumer
attr_accessor :subspec_name
def setup_validation_environment
validation_dir.rmtree if validation_dir.exist?
......@@ -283,10 +320,24 @@ module Pod
def add_result(type, message)
result = results.find { |r| r.type == type && r.message == message }
unless result
result = Specification::Linter::Result.new(type, message)
result = Result.new(type, message)
results << result
end
result.platforms << consumer.platform_name if consumer
result.subspecs << subspec_name if subspec_name && !result.subspecs.include?(subspec_name)
end
# Specialized Result to support subspecs aggregation
#
class Result < Specification::Linter::Result
def initialize(type, message)
super(type, message)
@subspecs = []
end
attr_reader :subspecs
end
#-------------------------------------------------------------------------#
......@@ -302,7 +353,7 @@ module Pod
# in local mode.
#
def podfile_from_spec(platform_name, deployment_target)
name = spec.name
name = subspec_name ? subspec_name : spec.name
podspec = file.realpath
local = local?
podfile = Pod::Podfile.new do
......@@ -341,9 +392,10 @@ module Pod
end
# @return [String] Executes xcodebuild in the current working directory and
# returns its output (bot STDOUT and STDERR).
# returns its output (both STDOUT and STDERR).
#
def xcodebuild
UI.puts 'xcodebuild clean build -target Pods' if config.verbose?
`xcodebuild clean build -target Pods 2>&1`
end
......
Subproject commit e6127aca6fb1a7387afaa25d38f1caf3640c0876
Subproject commit 27a44d7c15b58e8fa431ae774f13d348ad315721
This is a Bazaar control directory.
Do not change any files in this directory.
See http://bazaar.canonical.com/ for more information about Bazaar.
Bazaar-NG meta directory, format 1
Bazaar Branch Format 7 (needs bzr 1.6)
2 fred@sharpnoodles.com-20131030202140-gg5dfrrtaotfxlrh
Bazaar Working Tree Format 6 (bzr 1.14)
Bazaar repository format 2a (needs bzr 1.16 or later)
B+Tree Graph Index 2
node_ref_lists=1
key_elements=1
len=1
row_lengths=1
xQ
;0޺tK-R4n?'oCwK;l-W.6l
"ǰ^c:BMF@,B
\ No newline at end of file
B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=0
row_lengths=
B+Tree Graph Index 2
node_ref_lists=1
key_elements=2
len=3
row_lengths=1
xM0@a֜ Lg ԅ71P,ȏ-+M W'ܦ5CH>xi& ("ükA boax{oļ#PB][а^IR`2
4i,FE;;t
"tJ57sL :*7}v e
\ No newline at end of file
B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=1
row_lengths=1
x PLZ
8'@8x0ы&V|6Hcr7eyhZCbr"&s?-
\ No newline at end of file
B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=0
row_lengths=
Pod::Spec.new do |s|
s.name = "BazaarSource"
s.version = "0.0.1"
s.summary = "A short description of BazaarSource."
s.homepage = "http://EXAMPLE/BazaarSource"
s.license = 'MIT (example)'
s.author = { "Fred McCann" => "fred@sharpnoodles.com" }
s.source = { :git => "http://EXAMPLE/BazaarSource.git", :tag => "0.0.1" }
s.source_files = 'Classes', 'Classes/**/*.{h,m}'
end
......@@ -122,5 +122,27 @@ module Pod
end
end
it "saves xcode project file in Podfile if one was supplied" do
Dir.chdir(temporary_directory) do
Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
Xcodeproj::Project.new(temporary_directory + 'Project.xcodeproj').save
run_command('init', 'Project.xcodeproj')
target_definition = config.podfile.target_definitions.values.first
target_definition.user_project_path.should == 'Project.xcodeproj'
end
end
it "doesn't save xcode project file in Podfile if one wasn't supplied" do
Dir.chdir(temporary_directory) do
Xcodeproj::Project.new(temporary_directory + 'Project.xcodeproj').save
run_command('init')
target_definition = config.podfile.target_definitions.values.first
target_definition.user_project_path.should == nil
end
end
end
end
......@@ -13,12 +13,11 @@ module Pod
describe Command::IPC::Spec do
it "converts a podspec to yaml and prints it to STDOUT" do
it "converts a podspec to JSON and prints it to STDOUT" do
out = run_command('ipc', 'spec', fixture('banana-lib/BananaLib.podspec'))
out.should.include('---')
out.should.match /name: BananaLib/
out.should.match /version: .1\.0./
out.should.match /description: Full of chunky bananas./
out.should.match /"name":"BananaLib"/
out.should.match /"version":"1.0"/
out.should.match /"description":"Full of chunky bananas."/
end
end
......@@ -41,7 +40,7 @@ module Pod
describe Command::IPC::List do
it "converts a podspec to yaml and prints it to STDOUT" do
it "prints a list of podspecs in the yaml format and prints it to STDOUT" do
spec = fixture_spec('banana-lib/BananaLib.podspec')
set = Specification.new('BananaLib')
set.stubs(:specification).returns(spec)
......
require File.expand_path('../../../spec_helper', __FILE__)
require 'xcodeproj'
module Pod
describe Command::Lib::Create do
it "complains if wrong parameters" do
......@@ -12,5 +10,89 @@ module Pod
lambda { run_command('lib', 'create', 'Pod Name With Spaces') }.should.raise CLAide::Help
end
end
end
describe Command::Lib::Lint do
it "lints the current working directory" do
Dir.chdir(fixture('integration/Reachability')) do
cmd = command('lib', 'lint', '--only-errors')
cmd.run
UI.output.should.include "passed validation"
end
end
it "lints a single spec in the current working directory" do
Dir.chdir(fixture('integration/Reachability')) do
cmd = command('lib', 'lint', 'Reachability.podspec', '--quick', '--only-errors')
cmd.run
UI.output.should.include "passed validation"
end
end
it "fails to lint a broken spec file and cleans up" do
Dir.chdir(temporary_directory) do
open(temporary_directory + 'Broken.podspec', 'w') { |f|
f << 'Pod::Spec.new do |spec|'
f << "spec.name = 'Broken'"
f << 'end'
}
tmp_validator = Validator.new('Broken.podspec')
lint_path = tmp_validator.validation_dir
lambda { run_command('lib', 'lint', 'Broken.podspec') }.should.raise Pod::Informative
UI.output.should.include "Missing required attribute"
lint_path.exist?.should == false
end
end
it "fails to lint a broken spec file and leaves lint directory" do
Dir.chdir(temporary_directory) do
open(temporary_directory + 'Broken.podspec', 'w') { |f|
f << 'Pod::Spec.new do |spec|'
f << "spec.name = 'Broken'"
f << 'end'
}
lambda { run_command('lib', 'lint', 'Broken.podspec', '--no-clean') }.should.raise Pod::Informative
UI.output.should.include "Pods project available at"
UI.output.should.include "Missing required attribute"
lint_dir = UI.output[/.*Pods project available at `(.*)` for inspection./,1]
Pathname.new(lint_dir).exist?.should == true
end
end
end
describe Command::Lib do
it "should create a new dir for the newly created pod" do
run_command('lib', 'create', 'TestPod')
Dir.chdir(temporary_directory) do
Pathname.new(temporary_directory + 'TestPod').exist?.should == true
end
end
it "should show link to new pod guide after creation" do
output = run_command('lib', 'create', 'TestPod')
output.should.include? 'http://guides.cocoapods.org/making/making-a-cocoapod'
end
before do
Command::Lib::Create.any_instance.stubs(:configure_template)
Command::Lib::Create.any_instance.stubs(:git!)
end
it "should use the given template URL" do
template_url = 'https://github.com/custom/template.git'
Command::Lib::Create.any_instance.expects(:git!).with("clone '#{template_url}' TestPod").once
sut = run_command('lib', 'create', 'TestPod', template_url)
end
it "should use the default URL if no template URL is given" do
template_url = 'https://github.com/CocoaPods/pod-template.git'
Command::Lib::Create.any_instance.expects(:git!).with("clone '#{template_url}' TestPod").once
run_command('lib', 'create', 'TestPod')
end
end
end
require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Command::PodfileInfo do
extend SpecHelper::TemporaryRepos
before do
@test_source = Source.new(fixture('spec-repos/test_repo'))
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.updated_search_index = nil
end
it "tells the user pods info from Podfile" do
file = temporary_directory + 'Podfile'
text = <<-PODFILE
platform :ios
pod 'BananaLib'
pod 'JSONKit'
PODFILE
File.open(file, 'w') {|f| f.write(text) }
Dir.chdir(temporary_directory) do
output = run_command('podfile-info')
output.should.include? '- BananaLib'
output.should.include? 'Chunky bananas!'
output.should.include? '- JSONKit'
output.should.include? 'A Very High Performance Objective-C JSON Library.'
end
end
end
end
......@@ -49,7 +49,7 @@ module Pod
`git remote add origin #{@upstream}`
`git remote -v`
`git fetch -q`
`git branch --set-upstream master origin/master`
`git branch --set-upstream-to=origin/master master`
end
# prepare the spec
......
......@@ -2,7 +2,7 @@ require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Command::Repo do
describe "In general" do
describe Command::Repo::Update do
extend SpecHelper::Command
extend SpecHelper::TemporaryRepos
......@@ -18,15 +18,44 @@ module Pod
`git remote add origin #{upstream}`
`git remote -v`
`git fetch -q`
`git branch --set-upstream master origin/master`
`git branch --set-upstream-to=origin/master master`
end
lambda { command('repo', 'update').run }.should.not.raise
end
it "updates a spec-repo" do
repo1 = repo_make('repo1')
repo2 = repo_clone('repo1', 'repo2')
repo_make_readme_change(repo1, 'Updated')
Dir.chdir(repo1) {`git commit -a -m "Update"`}
run_command('repo', 'update', 'repo2')
(repo2 + 'README').read.should.include 'Updated'
end
end
describe Command::Repo::Lint do
extend SpecHelper::Command
extend SpecHelper::TemporaryRepos
before do
set_up_test_repo
config.repos_dir = SpecHelper.tmp_repos_path
end
it "lints a repository" do
repo = fixture('spec-repos/test_repo').to_s
lambda { run_command('repo', 'lint', repo) }.should.not.raise
end
end
describe Command::Repo::Add do
extend SpecHelper::Command
extend SpecHelper::TemporaryRepos
before do
set_up_test_repo
config.repos_dir = SpecHelper.tmp_repos_path
end
it "adds a spec-repo" do
run_command('repo', 'add', 'private', test_repo_path)
......@@ -46,13 +75,41 @@ module Pod
Dir.chdir(repo2.dir) { `git symbolic-ref HEAD` }.should.include? 'my-branch'
end
it "updates a spec-repo" do
repo1 = repo_make('repo1')
repo2 = repo_clone('repo1', 'repo2')
repo_make_readme_change(repo1, 'Updated')
Dir.chdir(repo1) {`git commit -a -m "Update"`}
run_command('repo', 'update', 'repo2')
(repo2 + 'README').read.should.include 'Updated'
it "adds a spec-repo by creating a shallow clone" do
Dir.chdir(test_repo_path) do
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
# Need to use file:// to test local use of --depth=1
run_command('repo', 'add', 'private', '--shallow', "file://#{test_repo_path}")
Dir.chdir(config.repos_dir + 'private') do
`git log --pretty=oneline`.strip.split("\n").size.should == 1
end
end
end
describe Command::Repo::Remove do
extend SpecHelper::Command
extend SpecHelper::TemporaryRepos
before do
set_up_test_repo
config.repos_dir = SpecHelper.tmp_repos_path
end
it "complains when a repository name is missing" do
lambda { run_command('repo', 'remove') }.should.raise CLAide::Help
end
it "complains if the repository doesn't exist" do
lambda { run_command('repo', 'remove', 'nonexistant') }.should.raise CLAide::Help
end
it "complains if we do not have permission" do
File.stubs(:writable?).returns(false)
upstream = SpecHelper.temporary_directory + 'upstream'
FileUtils.cp_r(test_repo_path, upstream)
lambda { run_command('repo', 'remove', upstream) }.should.raise CLAide::Help
FileUtils.rm_rf(upstream)
end
it "removes a spec-repo" do
......
......@@ -18,7 +18,6 @@ module Pod
it "complains for wrong parameters" do
lambda { run_command('search') }.should.raise CLAide::Help
lambda { run_command('search', 'too', 'many') }.should.raise CLAide::Help
lambda { run_command('search', 'too', '--wrong') }.should.raise CLAide::Help
lambda { run_command('search', '--wrong') }.should.raise CLAide::Help
end
......@@ -45,5 +44,54 @@ module Pod
output = run_command('search', 'BananaLib', '--osx')
output.should.not.include? 'BananaLib'
end
it "outputs with the silent parameter" do
output = run_command('search', 'BananaLib', '--silent')
output.should.include? 'BananaLib'
end
it "shows a friendly message when locally searching with invalid regex" do
lambda { run_command('search', '+') }.should.raise CLAide::Help
end
describe "option --web" do
extend SpecHelper::TemporaryRepos
it "searches with invalid regex" do
Command::Search.any_instance.expects(:open!).with('http://cocoapods.org/?q=NSAttributedString%2BCCLFormat')
run_command('search', '--web', 'NSAttributedString+CCLFormat')
end
it "should url encode search queries" do
Command::Search.any_instance.expects(:open!).with('http://cocoapods.org/?q=NSAttributedString%2BCCLFormat')
run_command('search', '--web', 'NSAttributedString+CCLFormat')
end
it "searches the web via the open! command" do
Command::Search.any_instance.expects(:open!).with('http://cocoapods.org/?q=bananalib')
run_command('search', '--web', 'bananalib')
end
it "includes option --osx correctly" do
Command::Search.any_instance.expects(:open!).with('http://cocoapods.org/?q=on%3Aosx%20bananalib')
run_command('search', '--web', '--osx', 'bananalib')
end
it "includes option --ios correctly" do
Command::Search.any_instance.expects(:open!).with('http://cocoapods.org/?q=on%3Aios%20bananalib')
run_command('search', '--web', '--ios', 'bananalib')
end
it "does not matter in which order the ios/osx options are set" do
Command::Search.any_instance.expects(:open!).with('http://cocoapods.org/?q=on%3Aosx%20on%3Aios%20bananalib')
run_command('search', '--web', '--ios', '--osx', 'bananalib')
Command::Search.any_instance.expects(:open!).with('http://cocoapods.org/?q=on%3Aosx%20on%3Aios%20bananalib')
run_command('search', '--web', '--osx', '--ios', 'bananalib')
end
end
end
end
......@@ -39,6 +39,40 @@ module Pod
url.should == test_repo_path.to_s
end
it "creates a shallow clone of the `master` repo by default" do
Dir.chdir(test_repo_path) do
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
# Need to use file:// to test local use of --depth=1
Command::Setup.any_instance.stubs(:read_only_url).returns("file://#{test_repo_path}")
run_command('setup')
Dir.chdir(config.repos_dir + 'master') do
`git log --pretty=oneline`.strip.split("\n").size.should == 1
end
end
it "creates a full clone of the `master` repo if requested" do
Dir.chdir(test_repo_path) do
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
run_command('setup', '--no-shallow')
Dir.chdir(config.repos_dir + 'master') do
`git log --pretty=oneline`.strip.split("\n").size.should > 1
end
end
it "creates a full clone of the `master` repo when push access is requested" do
Dir.chdir(test_repo_path) do
`echo 'touch' > touch && git add touch && git commit -m 'updated'`
end
# Need to use file:// to test local use of --depth=1
Command::Setup.any_instance.stubs(:read_write_url).returns("file://#{test_repo_path}")
cmd = run_command('setup', '--push')
Dir.chdir(config.repos_dir + 'master') do
`git log --pretty=oneline`.strip.split("\n").size.should > 1
end
end
it "preserves push access for the `master` repo" do
output = run_command('setup')
output.should.not.include "push"
......
......@@ -205,27 +205,73 @@ module Pod
describe Command::Spec::Cat do
it_should_check_for_existence("cat")
it_should_check_for_ambiguity("cat")
it "cats the given podspec" do
lambda { command('spec', 'cat', 'AFNetworking').run }.should.not.raise
UI.output.should.include fixture('spec-repos/master/AFNetworking/1.2.0/AFNetworking.podspec').read
end
it "cats the first podspec from all podspecs" do
UI.next_input = "1\n"
run_command('spec', 'cat', '--show-all', 'AFNetworking')
UI.output.should.include fixture('spec-repos/master/AFNetworking/1.2.0/AFNetworking.podspec').read
end
end
#-------------------------------------------------------------------------#
describe Command::Spec::Edit do
before do
@path_saved = ENV['PATH']
end
after do
ENV['PATH'] = @path_saved
end
it_should_check_for_existence("edit")
it_should_check_for_ambiguity("edit")
it "would execute the editor specified in ENV with the given podspec" do
ENV['EDITOR'] = 'podspeceditor'
lambda { command('spec', 'edit', 'AFNetworking').run }.should.raise SystemExit
UI.output.should.include '/bin/sh -i -c podspeceditor "$@" --'
UI.output.should.include 'fixtures/spec-repos/master/AFNetworking'
end
it "will raise if no editor is found" do
ENV['PATH'] = ''
ENV['EDITOR'] = nil
lambda { command('spec', 'edit', 'AFNetworking').run }.should.raise Informative
end
it "would execute an editor with the first podspec from all podspecs" do
ENV['EDITOR'] = 'podspeceditor'
UI.next_input = "1\n"
lambda { command('spec', 'edit', '--show-all', 'AFNetworking').run }.should.raise SystemExit
UI.output.should.include '/bin/sh -i -c podspeceditor "$@" --'
UI.output.should.include 'fixtures/spec-repos/master/AFNetworking/1.2.0/AFNetworking.podspec'
end
it "complains if it can't find a spec file for the given spec" do
File.stubs(:exists?).returns(false)
lambda { command('spec', 'edit', 'AFNetworking').run }.should.raise Informative
File.unstub(:exists?)
end
end
#-------------------------------------------------------------------------#
describe "Private helpers" do
describe "#get_path_of_spec" do
before do
# TODO Use class methods
@sut = Command::Spec.new(CLAide::ARGV.new([]))
end
describe "#get_path_of_spec" do
it "returns the path of the specification with the given name" do
path = @sut.send(:get_path_of_spec, 'AFNetworking')
path.should == fixture('spec-repos') + 'master/AFNetworking/1.2.0/AFNetworking.podspec'
......@@ -233,6 +279,24 @@ module Pod
end
describe "#choose_from_array" do
it "should return a valid index for the given array" do
UI.next_input = "1\n"
index = @sut.send(:choose_from_array, ['item1', 'item2', 'item3'], 'A message')
UI.output.should.include "1: item1\n2: item2\n3: item3\nA message\n"
index.should == 0
end
it "should raise when the index is out of bounds" do
UI.next_input = "4\n"
lambda { @sut.send(:choose_from_array, ['item1', 'item2', 'item3'], 'A message') }.should.raise Pod::Informative
UI.next_input = "0\n"
lambda { @sut.send(:choose_from_array, ['item1', 'item2', 'item3'], 'A message') }.should.raise Pod::Informative
end
end
end
#-------------------------------------------------------------------------#
......
require File.expand_path('../../spec_helper', __FILE__)
module Pod
describe Command do
extend SpecHelper::Command
it "displays the current version number with the --version flag" do
lambda { Pod::Command.run(['--version']) }.should.raise SystemExit
UI.output.should.include VERSION
end
it "reports the location of the AFNetworking spec" do
lambda { Pod::Command.run(['spec', 'which', 'AFNetworking']) }.should.not.raise
UI.output.should.include 'spec/fixtures/spec-repos/master/AFNetworking'
end
end
end
......@@ -89,7 +89,7 @@ end
# environment.
#
def launch_binary(arguments, folder)
command = "CP_AGGRESSIVE_CACHE=TRUE #{POD_BINARY} #{arguments} --verbose --no-color 2>&1"
command = "CP_AGGRESSIVE_CACHE=TRUE #{POD_BINARY} #{arguments} --verbose --no-ansi 2>&1"
Dir.chdir(TMP_DIR + folder) do
output = `#{command}`
it "$ pod #{arguments}" do
......@@ -186,8 +186,8 @@ end
# The file in the temporary directory after running the pod command.
#
def yaml_should_match(expected, produced)
expected_yaml = YAML::load(File.open(expected))
produced_yaml = YAML::load(File.open(produced))
expected_yaml = File.open(expected) { |f| YAML.load(f) }
produced_yaml = File.open(produced) { |f| YAML.load(f) }
# Remove CocoaPods version
expected_yaml.delete('COCOAPODS')
produced_yaml.delete('COCOAPODS')
......
# Set up coverage analysis
#-----------------------------------------------------------------------------#
if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new("1.9")
if ENV['CI'] || ENV['GENERATE_COVERAGE']
require 'simplecov'
require 'coveralls'
if ENV['CI']
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
elsif ENV['GENERATE_COVERAGE']
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
end
SimpleCov.start do
add_filter "/spec_helper/"
end
end
end
# if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new("1.9")
# if ENV['CI'] || ENV['GENERATE_COVERAGE']
# require 'simplecov'
# require 'coveralls'
#
# if ENV['CI']
# SimpleCov.formatter = Coveralls::SimpleCov::Formatter
# elsif ENV['GENERATE_COVERAGE']
# SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
# end
# SimpleCov.start do
# add_filter "/spec_helper/"
# end
# end
# end
# Set up
#-----------------------------------------------------------------------------#
......@@ -35,7 +34,7 @@ $:.unshift((ROOT + 'spec').to_s)
require 'cocoapods'
require 'claide'
require 'awesome_print'
#require 'awesome_print'
require 'spec_helper/command' # Allows to run Pod commands and returns their output.
require 'spec_helper/fixture' # Provides access to the fixtures and unpacks them if needed.
......@@ -68,6 +67,24 @@ module Pod
end
end
# README!
#
# Adds {Command::Spec::Edit#exec} to fake the {Kernel#exec} call that would
# normally be made during an edit.
#
module Pod
class Command
class Spec
class Edit
def exec(cmd, *args)
UI.puts "#{cmd} #{args.join(' ')}"
raise SystemExit
end
end
end
end
end
#-----------------------------------------------------------------------------#
ENV['SKIP_SETUP'] = 'true'
......
......@@ -5,7 +5,7 @@ module SpecHelper
end
def command(*argv)
argv << '--no-color'
argv << '--no-ansi'
Pod::Command.parse(argv)
end
......
......@@ -9,10 +9,12 @@ module Pod
module UI
@output = ''
@warnings = ''
@next_input = ''
class << self
attr_accessor :output
attr_accessor :warnings
attr_accessor :next_input
def puts(message = '')
@output << "#{message}\n"
......@@ -25,6 +27,13 @@ module Pod
def print(message)
@output << message
end
def gets
@next_input
end
def print_warnings
end
end
end
end
......@@ -148,6 +148,31 @@ module Pod
#---------------------------------------------------------------------------#
describe ExternalSources::BazaarSource do
before do
dependency = Dependency.new("BazaarSource", :bzr => fixture('bzr-repo'))
@external_source = ExternalSources.from_dependency(dependency, nil)
end
it "creates a copy of the podspec" do
@external_source.fetch(config.sandbox)
path = config.sandbox.root + 'Local Podspecs/BazaarSource.podspec'
path.should.exist?
end
it "marks a LocalPod as downloaded" do
@external_source.fetch(config.sandbox)
config.sandbox.predownloaded_pods.should == ["BazaarSource"]
end
it "returns the description" do
@external_source.description.should.match %r|from `.*/bzr-repo`|
end
end
#---------------------------------------------------------------------------#
describe ExternalSources::PodspecSource do
before do
......@@ -270,7 +295,7 @@ module Pod
it "raises if the podspec cannot be found" do
@external_source.stubs(:params).returns(:path => temporary_directory)
e = lambda { @external_source.send(:podspec_path) }.should.raise Informative
e.message.should.match /No podspec found/
e.message.should.match /No podspec found for `Reachability` in `#{temporary_directory}`/
end
end
end
......
require File.expand_path("../../../../spec_helper", __FILE__)
require 'xcodeproj'
describe Pod::Generator::Plist do
before do
@file_accessor = fixture_file_accessor('banana-lib/BananaLib.podspec')
......
......@@ -331,6 +331,68 @@ module Pod
#--------------------------------------#
describe "#compute_archs_for_target_definition" do
it "handles a single ARCH defined in a single user target" do
user_project = Xcodeproj::Project.new('path')
target = user_project.new_target(:application, 'Target', :ios)
target.build_configuration_list.set_setting('ARCHS', 'armv7')
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [target]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
it "handles a single ARCH defined in multiple user targets" do
user_project = Xcodeproj::Project.new('path')
targeta = user_project.new_target(:application, 'Target', :ios)
targeta.build_configuration_list.set_setting('ARCHS', 'armv7')
targetb = user_project.new_target(:application, 'Target', :ios)
targetb.build_configuration_list.set_setting('ARCHS', 'armv7')
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [targeta, targetb]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
it "handles an Array of ARCHs defined in a single user target" do
user_project = Xcodeproj::Project.new('path')
target = user_project.new_target(:application, 'Target', :ios)
target.build_configuration_list.set_setting('ARCHS', 'armv7')
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [target]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
it "handles an Array of ARCHs defined multiple user targets" do
user_project = Xcodeproj::Project.new('path')
targeta = user_project.new_target(:application, 'Target', :ios)
targeta.build_configuration_list.set_setting('ARCHS', 'armv7')
targetb = user_project.new_target(:application, 'Target', :ios)
targetb.build_configuration_list.set_setting('ARCHS', ['armv7', 'i386'])
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '4.0')
user_targets = [targeta, targetb]
archs = @analyzer.send(:compute_archs_for_target_definition, target_definition, user_targets)
archs.should == 'armv7'
end
end
#--------------------------------------#
describe "#compute_platform_for_target_definition" do
it "returns the platform specified in the target definition" do
......
......@@ -89,6 +89,12 @@ module Pod
it "returns the directory where to store the documentation" do
@sandbox.documentation_dir.should == temporary_directory + 'Sandbox/Documentation'
end
it "handles symlinks in /tmp" do
tmp_sandbox = Pod::Sandbox.new("/tmp/CocoaPods")
tmp_sandbox.root.should.be == Pathname.new("/private/tmp/CocoaPods")
tmp_sandbox.implode
end
end
#-------------------------------------------------------------------------#
......
......@@ -50,6 +50,13 @@ module Pod
sets.any?{ |s| s.name == 'BananaLib'}.should.be.true
end
it "can perform a full text regexp search of the sets" do
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
sets = SourcesManager.search_by_name('Ch[aeiou]nky', true)
sets.all?{ |s| s.class == Specification::Set}.should.be.true
sets.any?{ |s| s.name == 'BananaLib'}.should.be.true
end
it "generates the search index before performing a search if it doesn't exits" do
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
Source::Aggregate.any_instance.expects(:generate_search_index).returns({'BananaLib' => {}})
......@@ -87,7 +94,7 @@ module Pod
`git remote add origin #{upstream}`
`git remote -v`
`git fetch -q`
`git branch --set-upstream master origin/master`
`git branch --set-upstream-to=origin/master master`
end
config.repos_dir = SpecHelper.tmp_repos_path
......
......@@ -69,6 +69,13 @@ module Pod
sut.results.map(&:to_s).first.should.match /summary.*meaningful/
sut.validated?.should.be.true
end
it "handles symlinks" do
file = write_podspec(stub_podspec)
validator = Validator.new(file)
validator.validate
validator.validation_dir.should.be == Pathname.new("/private/tmp/CocoaPods/Lint")
end
end
#-------------------------------------------------------------------------#
......@@ -136,7 +143,6 @@ module Pod
sut.validated?.should.be.true
end
end
#-------------------------------------------------------------------------#
end
......
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