cocoapods-square-stable 0.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +1296 -0
- data/LICENSE +20 -0
- data/README.md +94 -0
- data/bin/pod +16 -0
- data/bin/sandbox-pod +120 -0
- data/lib/cocoapods.rb +77 -0
- data/lib/cocoapods/command.rb +116 -0
- data/lib/cocoapods/command/help.rb +23 -0
- data/lib/cocoapods/command/inter_process_communication.rb +178 -0
- data/lib/cocoapods/command/list.rb +77 -0
- data/lib/cocoapods/command/outdated.rb +56 -0
- data/lib/cocoapods/command/podfile_info.rb +91 -0
- data/lib/cocoapods/command/project.rb +88 -0
- data/lib/cocoapods/command/push.rb +172 -0
- data/lib/cocoapods/command/repo.rb +145 -0
- data/lib/cocoapods/command/search.rb +61 -0
- data/lib/cocoapods/command/setup.rb +134 -0
- data/lib/cocoapods/command/spec.rb +590 -0
- data/lib/cocoapods/config.rb +231 -0
- data/lib/cocoapods/downloader.rb +59 -0
- data/lib/cocoapods/executable.rb +118 -0
- data/lib/cocoapods/external_sources.rb +363 -0
- data/lib/cocoapods/file_list.rb +36 -0
- data/lib/cocoapods/gem_version.rb +7 -0
- data/lib/cocoapods/generator/acknowledgements.rb +107 -0
- data/lib/cocoapods/generator/acknowledgements/markdown.rb +40 -0
- data/lib/cocoapods/generator/acknowledgements/plist.rb +64 -0
- data/lib/cocoapods/generator/bridge_support.rb +22 -0
- data/lib/cocoapods/generator/copy_resources_script.rb +54 -0
- data/lib/cocoapods/generator/dummy_source.rb +22 -0
- data/lib/cocoapods/generator/prefix_header.rb +82 -0
- data/lib/cocoapods/generator/target_environment_header.rb +86 -0
- data/lib/cocoapods/generator/xcconfig.rb +185 -0
- data/lib/cocoapods/hooks/installer_representation.rb +134 -0
- data/lib/cocoapods/hooks/library_representation.rb +94 -0
- data/lib/cocoapods/hooks/pod_representation.rb +74 -0
- data/lib/cocoapods/installer.rb +571 -0
- data/lib/cocoapods/installer/analyzer.rb +559 -0
- data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +253 -0
- data/lib/cocoapods/installer/file_references_installer.rb +179 -0
- data/lib/cocoapods/installer/pod_source_installer.rb +248 -0
- data/lib/cocoapods/installer/target_installer.rb +379 -0
- data/lib/cocoapods/installer/user_project_integrator.rb +180 -0
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +224 -0
- data/lib/cocoapods/library.rb +202 -0
- data/lib/cocoapods/open_uri.rb +24 -0
- data/lib/cocoapods/project.rb +209 -0
- data/lib/cocoapods/resolver.rb +212 -0
- data/lib/cocoapods/sandbox.rb +343 -0
- data/lib/cocoapods/sandbox/file_accessor.rb +217 -0
- data/lib/cocoapods/sandbox/headers_store.rb +96 -0
- data/lib/cocoapods/sandbox/path_list.rb +208 -0
- data/lib/cocoapods/sources_manager.rb +276 -0
- data/lib/cocoapods/user_interface.rb +304 -0
- data/lib/cocoapods/user_interface/error_report.rb +101 -0
- data/lib/cocoapods/validator.rb +350 -0
- metadata +238 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 - 2012 Eloy Durán <eloy.de.enige@gmail.com>
|
2
|
+
Copyright (c) 2012 Fabio Pelosin <fabiopelosin@gmail.com>
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
12
|
+
all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# CocoaPods – an Objective-C library manager
|
2
|
+
|
3
|
+
[](https://travis-ci.org/CocoaPods/CocoaPods)
|
4
|
+
[](https://codeclimate.com/github/CocoaPods/CocoaPods)
|
5
|
+
[](https://gemnasium.com/CocoaPods/CocoaPods)
|
6
|
+
[](http://badge.fury.io/rb/cocoapods)
|
7
|
+
|
8
|
+
CocoaPods manages library dependencies for your Xcode project.
|
9
|
+
|
10
|
+
You specify the dependencies for your project in one easy text file. CocoaPods
|
11
|
+
resolves dependencies between libraries, fetches source code for the
|
12
|
+
dependencies, and creates and maintains an Xcode workspace to build your
|
13
|
+
project.
|
14
|
+
|
15
|
+
Ultimately, the goal is to improve discoverability of, and engagement in, third
|
16
|
+
party open-source libraries, by creating a more centralized ecosystem.
|
17
|
+
|
18
|
+
Installing and updating CocoaPods is very easy. Don't miss the [Installation
|
19
|
+
guide](http://docs.cocoapods.org/guides/installing_cocoapods.html) and the
|
20
|
+
[Getting started guide](http://docs.cocoapods.org/guides/getting_started.html).
|
21
|
+
See the [NSScreencast](https://twitter.com/NSScreencast) episode about [using
|
22
|
+
CocoaPods](http://nsscreencast.com/episodes/5-cocoapods) for a quick overview.
|
23
|
+
|
24
|
+
|
25
|
+
## Links
|
26
|
+
|
27
|
+
| Link | Description |
|
28
|
+
| :----- | :------ |
|
29
|
+
[CocoaPods.org](http://cocoapods.org/) | Homepage and search for Pods.
|
30
|
+
[@CocoaPods](http://twitter.com/CocoaPods) | Follow CocoaPods on Twitter to get up to date information about what's going on in the CocoaPods world.
|
31
|
+
[Mailing List](http://groups.google.com/group/cocoapods) | Announcements and support. Feel free to ask any kind of question.
|
32
|
+
[Documentation](http://docs.cocoapods.org) | Everything you want to know about CocoaPods.
|
33
|
+
[Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) | See the changes introduced by each CocoaPods version.
|
34
|
+
[RSS feed](http://feeds.cocoapods.org/new-pods.rss) | Don't miss any new Pod.
|
35
|
+
|
36
|
+
|
37
|
+
## Projects
|
38
|
+
|
39
|
+
CocoaPods is composed by the following projects:
|
40
|
+
|
41
|
+
| Status | Project | Description | Info |
|
42
|
+
| :----- | :------ | :--- | :--- |
|
43
|
+
| [](http://travis-ci.org/CocoaPods/CocoaPods) | [CocoaPods](https://github.com/CocoaPods/CocoaPods) | The CocoaPods command line tool. | [docs](http://docs.cocoapods.org/cocoapods)
|
44
|
+
| [](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)
|
45
|
+
| [](http://travis-ci.org/CocoaPods/cocoapods-downloader) |[CocoaPods Downloader](https://github.com/CocoaPods/cocoapods-downloader) | A small library that provides downloaders for various source types. | [docs](http://docs.cocoapods.org/cocoapods_downloader/index.html)
|
46
|
+
| [](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)
|
47
|
+
| [](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)
|
48
|
+
| [](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)
|
49
|
+
|
50
|
+
|
51
|
+
## Collaborate
|
52
|
+
|
53
|
+
All CocoaPods development happens on GitHub, contributions make good karma and
|
54
|
+
we welcome with joy new contributors.
|
55
|
+
|
56
|
+
# Donations
|
57
|
+
|
58
|
+
- [@fngtps](http://twitter.com/fngtps) is donating time to work on the design
|
59
|
+
of the forthcoming cocoapods.org website and donated the money to hire [Max
|
60
|
+
Steenbergen](http://twitter.com/maxsteenbergen) to design [an
|
61
|
+
icon](http://drbl.in/cpmL) for it.
|
62
|
+
- [@sauspiel](http://twitter.com/Sauspiel) uses CocoaPods for their games and
|
63
|
+
have hired me to add features and specs they needed. These are Nimbus,
|
64
|
+
QuincyKit, and HockeyKit. For the [Nimbus
|
65
|
+
spec](https://github.com/CocoaPods/Specs/blob/master/Nimbus/0.9.0/Nimbus.podspec),
|
66
|
+
the ‘subspecs’ feature was added.
|
67
|
+
|
68
|
+
# Endorsements
|
69
|
+
|
70
|
+
- “I am crazy excited about this. With the growing number of Objective-C
|
71
|
+
libraries, this will make things so much better.” –– [Sam
|
72
|
+
Soffes](http://news.ycombinator.com/item?id=3009154)
|
73
|
+
- “Are you doing open source iOS components? You really should support
|
74
|
+
@CocoaPods!” –– [Matthias
|
75
|
+
Tretter](http://twitter.com/#!/myell0w/status/134955697740840961)
|
76
|
+
- “So glad someone has finally done this...” –– [Tom
|
77
|
+
Wilson](http://news.ycombinator.com/item?id=3009349)
|
78
|
+
- “Anybody who has tasted the coolness of RubyGems (and @gembundler)
|
79
|
+
understands how cool CocoaPods might be.” –– [StuFF
|
80
|
+
mc](http://twitter.com/#!/stuffmc/status/115374231591731200)
|
81
|
+
- “I will be working on getting several of my Objective-C libraries ready for
|
82
|
+
CocoaPods this week!” –– [Luke
|
83
|
+
Redpath](http://twitter.com/#!/lukeredpath/status/115510581921988608)
|
84
|
+
- “Really digg how @alloy is building a potential game changer” –– [Klaas
|
85
|
+
Speller](https://twitter.com/#!/spllr/status/115914209438601216)
|
86
|
+
- “@alloy's making an Objective-C package manager. This is fantastic news
|
87
|
+
kids!” –– [Josh
|
88
|
+
Abernathy](http://twitter.com/#!/joshaber/status/115273577703555073)
|
89
|
+
- “A package manager for Cocoa/Objective-C, built with @MacRuby. Awesomeness!”
|
90
|
+
–– [Johannes
|
91
|
+
Fahrenkrug](http://twitter.com/#!/jfahrenkrug/status/115303240286998528)
|
92
|
+
- “This is awesome, I love endorsements!” –– [Appie
|
93
|
+
Durán](http://twitter.com/#!/AppieDuran)
|
94
|
+
|
data/bin/pod
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if $0 == __FILE__
|
4
|
+
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
|
5
|
+
require "rubygems"
|
6
|
+
require "bundler/setup"
|
7
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
8
|
+
end
|
9
|
+
|
10
|
+
if (ENV['CP_STDOUT_SYNC'] == 'TRUE')
|
11
|
+
STDOUT.sync = true
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'cocoapods'
|
15
|
+
|
16
|
+
Pod::Command.run(ARGV)
|
data/bin/sandbox-pod
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This bin wrapper runs the `pod` command in a OS X sandbox. The reason for this
|
4
|
+
# is to ensure that people can’t use malicious code from pod specifications.
|
5
|
+
#
|
6
|
+
# It does this by creating a ‘seatbelt’ profile on the fly and executing the
|
7
|
+
# given command through `/usr/bin/sandbox-exec`. This profile format is an
|
8
|
+
# undocumented format, which uses TinyScheme to implement its DSL.
|
9
|
+
#
|
10
|
+
# Even though it uses a undocumented format, it’s actually very self-explanatory.
|
11
|
+
# Because we use a whitelist approach, `(deny default)`, any action that is
|
12
|
+
# denied is logged to `/var/log/system.log`. So tailing that should provide
|
13
|
+
# enough information on steps that need to be take to get something to work.
|
14
|
+
#
|
15
|
+
# For more information see:
|
16
|
+
#
|
17
|
+
# * https://github.com/CocoaPods/CocoaPods/issues/939
|
18
|
+
# * http://reverse.put.as/wp-content/uploads/2011/08/The-Apple-Sandbox-BHDC2011-Slides.pdf
|
19
|
+
# * http://reverse.put.as/wp-content/uploads/2011/08/The-Apple-Sandbox-BHDC2011-Paper.pdf
|
20
|
+
# * https://github.com/s7ephen/OSX-Sandbox--Seatbelt--Profiles
|
21
|
+
# * `$ man sandbox-exec`
|
22
|
+
# * `$ ls /usr/share/sandbox`
|
23
|
+
|
24
|
+
if $0 == __FILE__
|
25
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
26
|
+
end
|
27
|
+
require 'pathname'
|
28
|
+
require 'cocoapods/config'
|
29
|
+
|
30
|
+
|
31
|
+
pod_bin = File.expand_path('../pod', __FILE__)
|
32
|
+
pod_prefix = File.expand_path('../..', pod_bin)
|
33
|
+
|
34
|
+
require 'rbconfig'
|
35
|
+
ruby_bin = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
|
36
|
+
ruby_prefix = RbConfig::CONFIG['prefix']
|
37
|
+
|
38
|
+
prefixes = ['/bin', '/usr/bin', '/usr/libexec']
|
39
|
+
prefixes << `brew --prefix`.strip unless `which brew`.strip.empty?
|
40
|
+
# TODO add MacPorts. More?
|
41
|
+
|
42
|
+
developer_prefix = `xcode-select --print-path`.strip
|
43
|
+
xcode_app_path = File.expand_path('../..', developer_prefix)
|
44
|
+
|
45
|
+
|
46
|
+
require 'erb'
|
47
|
+
profile = ERB.new(DATA.read, 0, '>').result(TOPLEVEL_BINDING)
|
48
|
+
puts profile
|
49
|
+
|
50
|
+
command = ['/usr/bin/sandbox-exec', '-p', profile, pod_bin, *ARGV]
|
51
|
+
#puts command
|
52
|
+
exec *command
|
53
|
+
|
54
|
+
|
55
|
+
__END__
|
56
|
+
(version 1)
|
57
|
+
(debug allow)
|
58
|
+
|
59
|
+
(import "mDNSResponder.sb")
|
60
|
+
|
61
|
+
(allow file-ioctl)
|
62
|
+
(allow sysctl-read)
|
63
|
+
(allow mach-lookup)
|
64
|
+
(allow ipc-posix-shm)
|
65
|
+
(allow process-fork)
|
66
|
+
(allow system-socket)
|
67
|
+
|
68
|
+
; TODO make this stricter if possible
|
69
|
+
(allow network-outbound)
|
70
|
+
|
71
|
+
(allow process-exec
|
72
|
+
(regex
|
73
|
+
#"^<%= pod_bin %>"
|
74
|
+
#"^<%= ruby_bin %>"
|
75
|
+
#"^<%= File.join(developer_prefix, 'usr/bin/xcrun') %>"
|
76
|
+
#"^<%= File.join(developer_prefix, 'usr/bin/xcodebuild') %>"
|
77
|
+
<% prefixes.each do |prefix| %>
|
78
|
+
#"^<%= prefix %>/*"
|
79
|
+
<% end %>
|
80
|
+
)
|
81
|
+
)
|
82
|
+
|
83
|
+
(allow file-read-metadata)
|
84
|
+
(allow file-read*
|
85
|
+
(regex
|
86
|
+
; TODO see if we can restrict this more, but it's going to be hard
|
87
|
+
#"^/Users/[^.]+/*"
|
88
|
+
;#"^/Users/[^.]+/.netrc"
|
89
|
+
;#"^/Users/[^.]+/.gemrc"
|
90
|
+
;#"^/Users/[^.]+/.gem/*"
|
91
|
+
;#"^/Users/[^.]+/Library/.*"
|
92
|
+
#"^/Library/*"
|
93
|
+
#"^/System/Library/*"
|
94
|
+
#"^/usr/lib/*"
|
95
|
+
#"^/usr/share/*"
|
96
|
+
#"^/private/*"
|
97
|
+
#"^/dev/*"
|
98
|
+
#"^<%= ruby_prefix %>"
|
99
|
+
#"^<%= pod_prefix %>"
|
100
|
+
#"^<%= xcode_app_path %>"
|
101
|
+
#"^<%= Pod::Config.instance.repos_dir %>"
|
102
|
+
<% prefixes.each do |prefix| %>
|
103
|
+
#"^<%= prefix %>/*"
|
104
|
+
<% end %>
|
105
|
+
)
|
106
|
+
)
|
107
|
+
|
108
|
+
(allow file-write*
|
109
|
+
(regex
|
110
|
+
#"^<%= Pod::Config.instance.project_root %>"
|
111
|
+
#"^<%= Pod::Config.instance.repos_dir %>"
|
112
|
+
#"^/Users/[^.]+/Library/Caches/CocoaPods/*"
|
113
|
+
#"^/dev/dtracehelper"
|
114
|
+
#"^/dev/tty"
|
115
|
+
#"^/dev/null"
|
116
|
+
#"^/private/var"
|
117
|
+
)
|
118
|
+
)
|
119
|
+
|
120
|
+
(deny default)
|
data/lib/cocoapods.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
autoload :Xcodeproj, 'xcodeproj'
|
4
|
+
|
5
|
+
module Pod
|
6
|
+
require 'pathname'
|
7
|
+
|
8
|
+
require 'cocoapods/gem_version'
|
9
|
+
require 'cocoapods-core'
|
10
|
+
require 'cocoapods/file_list'
|
11
|
+
require 'cocoapods/config'
|
12
|
+
|
13
|
+
autoload :Downloader, 'cocoapods/downloader'
|
14
|
+
|
15
|
+
# Indicates an user error. This is defined in cocoapods-core.
|
16
|
+
#
|
17
|
+
class Informative < PlainInformative
|
18
|
+
def message
|
19
|
+
"[!] #{super}".red
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [Pathname] The directory where CocoaPods caches the downloads.
|
24
|
+
#
|
25
|
+
# @todo The {Installer::PodSourceInstaller} and the #{ExternalSources}
|
26
|
+
# classes build and configure the downloader from scratch.
|
27
|
+
#
|
28
|
+
CACHE_ROOT = Pathname.new(File.join(ENV['HOME'], 'Library/Caches/CocoaPods'))
|
29
|
+
CACHE_ROOT.mkpath unless CACHE_ROOT.exist?
|
30
|
+
|
31
|
+
# @return [Fixnum] The maximum size for the cache expressed in Mb.
|
32
|
+
#
|
33
|
+
# @todo The {Installer::PodSourceInstaller} and the #{ExternalSources}
|
34
|
+
# classes build and configure the downloader from scratch.
|
35
|
+
#
|
36
|
+
MAX_CACHE_SIZE = 500
|
37
|
+
|
38
|
+
# @return [Pathname] The file to use a cache of the statistics provider.
|
39
|
+
#
|
40
|
+
STATISTICS_CACHE_FILE = CACHE_ROOT + 'statistics.yml'
|
41
|
+
|
42
|
+
autoload :Command, 'cocoapods/command'
|
43
|
+
autoload :Executable, 'cocoapods/executable'
|
44
|
+
autoload :ExternalSources, 'cocoapods/external_sources'
|
45
|
+
autoload :Installer, 'cocoapods/installer'
|
46
|
+
autoload :SourcesManager, 'cocoapods/sources_manager'
|
47
|
+
autoload :Library, 'cocoapods/library'
|
48
|
+
autoload :Project, 'cocoapods/project'
|
49
|
+
autoload :Resolver, 'cocoapods/resolver'
|
50
|
+
autoload :Sandbox, 'cocoapods/sandbox'
|
51
|
+
autoload :UI, 'cocoapods/user_interface'
|
52
|
+
autoload :Validator, 'cocoapods/validator'
|
53
|
+
|
54
|
+
module Generator
|
55
|
+
autoload :Acknowledgements, 'cocoapods/generator/acknowledgements'
|
56
|
+
autoload :BridgeSupport, 'cocoapods/generator/bridge_support'
|
57
|
+
autoload :CopyResourcesScript, 'cocoapods/generator/copy_resources_script'
|
58
|
+
autoload :DummySource, 'cocoapods/generator/dummy_source'
|
59
|
+
autoload :Markdown, 'cocoapods/generator/acknowledgements/markdown'
|
60
|
+
autoload :Plist, 'cocoapods/generator/acknowledgements/plist'
|
61
|
+
autoload :PrefixHeader, 'cocoapods/generator/prefix_header'
|
62
|
+
autoload :TargetEnvironmentHeader, 'cocoapods/generator/target_environment_header'
|
63
|
+
autoload :XCConfig, 'cocoapods/generator/xcconfig'
|
64
|
+
end
|
65
|
+
|
66
|
+
module Hooks
|
67
|
+
autoload :InstallerRepresentation, 'cocoapods/hooks/installer_representation'
|
68
|
+
autoload :LibraryRepresentation, 'cocoapods/hooks/library_representation'
|
69
|
+
autoload :PodRepresentation, 'cocoapods/hooks/pod_representation'
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
if ENV['COCOA_PODS_ENV'] == 'development'
|
75
|
+
# require 'awesome_print'
|
76
|
+
# require 'pry'
|
77
|
+
end
|
@@ -0,0 +1,116 @@
|
|
1
|
+
require 'colored'
|
2
|
+
require 'claide'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
class PlainInformative
|
6
|
+
include CLAide::InformativeError
|
7
|
+
end
|
8
|
+
|
9
|
+
class Command < CLAide::Command
|
10
|
+
|
11
|
+
require 'cocoapods/command/list'
|
12
|
+
require 'cocoapods/command/outdated'
|
13
|
+
require 'cocoapods/command/project'
|
14
|
+
require 'cocoapods/command/push'
|
15
|
+
require 'cocoapods/command/repo'
|
16
|
+
require 'cocoapods/command/search'
|
17
|
+
require 'cocoapods/command/setup'
|
18
|
+
require 'cocoapods/command/spec'
|
19
|
+
require 'cocoapods/command/help'
|
20
|
+
require 'cocoapods/command/inter_process_communication'
|
21
|
+
require 'cocoapods/command/podfile_info'
|
22
|
+
|
23
|
+
self.abstract_command = true
|
24
|
+
self.command = 'pod'
|
25
|
+
self.description = 'CocoaPods, the Objective-C library package manager.'
|
26
|
+
|
27
|
+
def self.options
|
28
|
+
[
|
29
|
+
['--silent', 'Show nothing'],
|
30
|
+
['--version', 'Show the version of CocoaPods'],
|
31
|
+
].concat(super)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.parse(argv)
|
35
|
+
command = super
|
36
|
+
unless SourcesManager.master_repo_functional? || command.is_a?(Setup) || command.is_a?(Repo::Add) || ENV['SKIP_SETUP']
|
37
|
+
Setup.new(CLAide::ARGV.new([])).run
|
38
|
+
end
|
39
|
+
command
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.run(argv)
|
43
|
+
argv = CLAide::ARGV.new(argv)
|
44
|
+
if argv.flag?('version')
|
45
|
+
puts VERSION
|
46
|
+
exit!(0)
|
47
|
+
end
|
48
|
+
super(argv)
|
49
|
+
UI.print_warnings
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.report_error(exception)
|
53
|
+
if exception.is_a?(Interrupt)
|
54
|
+
puts "[!] Cancelled".red
|
55
|
+
Config.instance.verbose? ? raise : exit(1)
|
56
|
+
else
|
57
|
+
if ENV['COCOA_PODS_ENV'] != 'development'
|
58
|
+
puts UI::ErrorReport.report(exception)
|
59
|
+
exit 1
|
60
|
+
else
|
61
|
+
raise exception
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# @todo If a command is run inside another one some settings which where
|
67
|
+
# true might return false.
|
68
|
+
#
|
69
|
+
# @todo We should probably not even load colored unless needed.
|
70
|
+
#
|
71
|
+
# @todo Move silent flag to CLAide.
|
72
|
+
#
|
73
|
+
# @note It is important that the commands don't override the default
|
74
|
+
# settings if their flag is missing (i.e. their value is nil)
|
75
|
+
#
|
76
|
+
def initialize(argv)
|
77
|
+
super
|
78
|
+
config.silent = argv.flag?('silent', config.silent)
|
79
|
+
config.verbose = self.verbose? unless self.verbose.nil?
|
80
|
+
unless self.colorize_output?
|
81
|
+
String.send(:define_method, :colorize) { |string , _| string }
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
#-------------------------------------------------------------------------#
|
86
|
+
|
87
|
+
include Config::Mixin
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
# Checks that the podfile exists.
|
92
|
+
#
|
93
|
+
# @raise If the podfile does not exists.
|
94
|
+
#
|
95
|
+
# @return [void]
|
96
|
+
#
|
97
|
+
def verify_podfile_exists!
|
98
|
+
unless config.podfile
|
99
|
+
raise Informative, "No `Podfile' found in the current working directory."
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks that the lockfile exists.
|
104
|
+
#
|
105
|
+
# @raise If the lockfile does not exists.
|
106
|
+
#
|
107
|
+
# @return [void]
|
108
|
+
#
|
109
|
+
def verify_lockfile_exists!
|
110
|
+
unless config.lockfile
|
111
|
+
raise Informative, "No `Podfile.lock' found in the current working directory, run `pod install'."
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|