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. ...@@ -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: 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. 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 ## Adding it to your project
Search for Pods by name or description. Search for Pods by name or description.
$ pod search asi ```
==> ASIHTTPRequest (1.8.1) $ pod search asi
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone ==> ASIHTTPRequest (1.8.1)
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone
==> ASIWebPageRequest (1.8.1) ==> ASIWebPageRequest (1.8.1)
The ASIWebPageRequest class included with ASIHTTPRequest lets you download The ASIWebPageRequest class included with ASIHTTPRequest lets you download
complete webpages, including external resources like images and stylesheets. 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). 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 $ edit Podfile
dependency 'JSONKit', '~> 1.4' ```
dependency 'Reachability', '~> 2.0.4'
```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. 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._ _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: 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. 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. 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 create Peanuts
$ pod spec lint Peanuts.podspec $ 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! 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 #!/usr/bin/env ruby
if $0 == __FILE__ if $0 == __FILE__
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
require "rubygems" require "rubygems"
require "bundler/setup" require "bundler/setup"
$:.unshift File.expand_path('../../lib', __FILE__) $:.unshift File.expand_path('../../lib', __FILE__)
......
...@@ -20,6 +20,7 @@ module Pod ...@@ -20,6 +20,7 @@ module Pod
def self.options def self.options
" --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading\n" + " --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading\n" +
" --no-doc Skip documentation generation with appledoc\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" + " --no-update Skip running `pod repo update` before install\n" +
super super
end end
...@@ -27,6 +28,7 @@ module Pod ...@@ -27,6 +28,7 @@ module Pod
def initialize(argv) def initialize(argv)
config.clean = !argv.option('--no-clean') config.clean = !argv.option('--no-clean')
config.doc = !argv.option('--no-doc') config.doc = !argv.option('--no-doc')
config.force_doc = argv.option('--force-doc')
@update_repo = !argv.option('--no-update') @update_repo = !argv.option('--no-update')
@projpath = argv.shift_argument @projpath = argv.shift_argument
super unless argv.empty? super unless argv.empty?
......
...@@ -10,12 +10,13 @@ module Pod ...@@ -10,12 +10,13 @@ module Pod
@instance = instance @instance = instance
end 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 :clean?, :clean
alias_method :verbose?, :verbose alias_method :verbose?, :verbose
alias_method :silent?, :silent alias_method :silent?, :silent
alias_method :doc?, :doc alias_method :doc?, :doc
alias_method :doc_install?, :doc_install alias_method :doc_install?, :doc_install
alias_method :force_doc?, :force_doc
def initialize def initialize
@repos_dir = Pathname.new(File.expand_path("~/.cocoapods")) @repos_dir = Pathname.new(File.expand_path("~/.cocoapods"))
...@@ -24,6 +25,7 @@ module Pod ...@@ -24,6 +25,7 @@ module Pod
@silent = false @silent = false
@doc = true @doc = true
@doc_install = true @doc_install = true
@force_doc = false
end end
def project_root def project_root
......
...@@ -46,6 +46,7 @@ module Pod ...@@ -46,6 +46,7 @@ module Pod
activated_specifications.map do |spec| activated_specifications.map do |spec|
LocalPod.new(spec, sandbox).tap do |pod| LocalPod.new(spec, sandbox).tap do |pod|
marker = config.verbose ? "\n-> ".green : '' marker = config.verbose ? "\n-> ".green : ''
if pod.exists? || spec.local? if pod.exists? || spec.local?
puts marker + "Using #{pod}" unless config.silent? puts marker + "Using #{pod}" unless config.silent?
else else
...@@ -58,11 +59,11 @@ module Pod ...@@ -58,11 +59,11 @@ module Pod
downloader.clean downloader.clean
pod.clean pod.clean
end end
end
if config.doc? if (!pod.exists? && !pod.local? && config.doc?) || config.force_doc?
puts "Installing Documentation for #{spec}".green if config.verbose? puts "Installing Documentation for #{spec}".green if config.verbose?
Generator::Documentation.new(pod).generate(config.doc_install?) Generator::Documentation.new(pod).generate(config.doc_install?)
end
end end
end 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