Commit 26742156 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge remote-tracking branch 'origin/master' into listNew

* origin/master:
  Small styling tweak.
  Add a --force-doc option and add `appledoc` install note to README.
  Make using `pod' from directories outside of the repo work.
parents 1abf727b 7ba66f50
......@@ -21,54 +21,80 @@ Downloading and installing CocoaPods only takes a few minutes.
CocoaPods runs on [Ruby](http://www.ruby-lang.org/en/). To install it run the following commands:
$ sudo gem install cocoapods
$ pod setup
```
$ sudo gem install cocoapods
$ pod setup
```
If you want to have CocoaPods generate documentation for each library, then install the [appledoc](http://gentlebytes.com/appledoc/) tool:
```
$ brew install appledoc --HEAD
$ ln -sf "`brew --prefix`/Cellar/appledoc/HEAD/Templates" ~/Library/Application\ Support/appledoc
```
Now that you've got CocoaPods installed you can easily add it to your project.
NOTE 1: If you're using a fresh out of the box Mac with Lion using Xcode from the Mac App Store, you will need to install the Command Line Tools for Xcode first: [here](https://developer.apple.com/downloads/index.action)
**NOTES**
NOTE 2: CocoaPods re-uses some of the RubyGems 1.3.6 classes. If you have an older version (pre OS X 10.7), you will have to update RubyGems: `$ gem update --system`.
1. If you're using a fresh out of the box Mac with Lion using Xcode from the Mac App Store, you will need to install the Command Line Tools for Xcode first: [here](https://developer.apple.com/downloads/index.action)
2. CocoaPods re-uses some of the RubyGems 1.3.6 classes. If you have an older version (pre OS X 10.7), you will have to update RubyGems: `$ gem update --system`.
## Adding it to your project
Search for Pods by name or description.
$ pod search asi
==> ASIHTTPRequest (1.8.1)
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone
```
$ pod search asi
==> ASIHTTPRequest (1.8.1)
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone
==> ASIWebPageRequest (1.8.1)
The ASIWebPageRequest class included with ASIHTTPRequest lets you download
complete webpages, including external resources like images and stylesheets.
==> ASIWebPageRequest (1.8.1)
The ASIWebPageRequest class included with ASIHTTPRequest lets you download
complete webpages, including external resources like images and stylesheets.
```
After you've found your favorite dependencies you add them to your [Podfile](https://github.com/CocoaPods/CocoaPods/wiki/A-Podfile).
$ edit Podfile
platform :ios
dependency 'JSONKit', '~> 1.4'
dependency 'Reachability', '~> 2.0.4'
```
$ edit Podfile
```
```ruby
platform :ios
dependency 'JSONKit', '~> 1.4'
dependency 'Reachability', '~> 2.0.4'
```
And then you [install the dependencies](https://github.com/CocoaPods/CocoaPods/wiki/Creating-a-project-that-uses-CocoaPods) in your project.
$ pod install App.xcodeproj
```
$ pod install App.xcodeproj
```
_Where ‘App.xcodeproj’ is the name of your actual application project._
The next time you change your Podfile, you can update your project by simply running:
$ pod install
```
$ pod install
```
Remember to always open the Xcode workspace instead of the project file when you're building.
$ open App.xcworkspace
```
$ open App.xcworkspace
```
Sometimes CocoaPods doesn't have a Pod for one of your dependencies yet. Fortunately [creating a Pod](https://github.com/CocoaPods/CocoaPods/wiki/A-pod-specification) is really easy.
$ pod spec create Peanuts
$ edit Peanuts.podspec
$ pod spec lint Peanuts.podspec
```
$ pod spec create Peanuts
$ edit Peanuts.podspec
$ pod spec lint Peanuts.podspec
```
Once you've got it running [create a ticket](https://github.com/CocoaPods/CocoaPods/issues) and upload the Pod. If you're familiar with Git you can also fork the [CocoaPods specs](https://github.com/CocoaPods/Specs) repository and send a pull request. We really love contributions!
......
#!/usr/bin/env ruby
if $0 == __FILE__
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
require "rubygems"
require "bundler/setup"
$:.unshift File.expand_path('../../lib', __FILE__)
......
......@@ -20,6 +20,7 @@ module Pod
def self.options
" --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading\n" +
" --no-doc Skip documentation generation with appledoc\n" +
" --force-doc Force the generation of documentation\n" +
" --no-update Skip running `pod repo update` before install\n" +
super
end
......@@ -27,6 +28,7 @@ module Pod
def initialize(argv)
config.clean = !argv.option('--no-clean')
config.doc = !argv.option('--no-doc')
config.force_doc = argv.option('--force-doc')
@update_repo = !argv.option('--no-update')
@projpath = argv.shift_argument
super unless argv.empty?
......
......@@ -10,12 +10,13 @@ module Pod
@instance = instance
end
attr_accessor :repos_dir, :project_root, :project_pods_root, :rootspec, :clean, :verbose, :silent, :doc, :doc_install
attr_accessor :repos_dir, :project_root, :project_pods_root, :rootspec, :clean, :verbose, :silent, :doc, :doc_install, :force_doc
alias_method :clean?, :clean
alias_method :verbose?, :verbose
alias_method :silent?, :silent
alias_method :doc?, :doc
alias_method :doc_install?, :doc_install
alias_method :force_doc?, :force_doc
def initialize
@repos_dir = Pathname.new(File.expand_path("~/.cocoapods"))
......@@ -24,6 +25,7 @@ module Pod
@silent = false
@doc = true
@doc_install = true
@force_doc = false
end
def project_root
......
......@@ -46,6 +46,7 @@ module Pod
activated_specifications.map do |spec|
LocalPod.new(spec, sandbox).tap do |pod|
marker = config.verbose ? "\n-> ".green : ''
if pod.exists? || spec.local?
puts marker + "Using #{pod}" unless config.silent?
else
......@@ -58,11 +59,11 @@ module Pod
downloader.clean
pod.clean
end
end
if config.doc?
puts "Installing Documentation for #{spec}".green if config.verbose?
Generator::Documentation.new(pod).generate(config.doc_install?)
end
if (!pod.exists? && !pod.local? && config.doc?) || config.force_doc?
puts "Installing Documentation for #{spec}".green if config.verbose?
Generator::Documentation.new(pod).generate(config.doc_install?)
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