cocoapods 0.33.1 → 0.34.0.rc1
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 +4 -4
- data/CHANGELOG.md +171 -46
- data/README.md +9 -9
- data/bin/pod +5 -5
- data/bin/sandbox-pod +2 -6
- data/lib/cocoapods.rb +4 -4
- data/lib/cocoapods/command.rb +12 -10
- data/lib/cocoapods/command/init.rb +12 -13
- data/lib/cocoapods/command/inter_process_communication.rb +6 -17
- data/lib/cocoapods/command/lib.rb +27 -24
- data/lib/cocoapods/command/list.rb +9 -9
- data/lib/cocoapods/command/outdated.rb +4 -9
- data/lib/cocoapods/command/project.rb +57 -19
- data/lib/cocoapods/command/push.rb +0 -1
- data/lib/cocoapods/command/repo.rb +14 -15
- data/lib/cocoapods/command/repo/push.rb +24 -19
- data/lib/cocoapods/command/search.rb +12 -13
- data/lib/cocoapods/command/setup.rb +10 -9
- data/lib/cocoapods/command/spec.rb +67 -63
- data/lib/cocoapods/config.rb +21 -54
- data/lib/cocoapods/downloader.rb +0 -1
- data/lib/cocoapods/executable.rb +3 -8
- data/lib/cocoapods/external_sources.rb +2 -4
- data/lib/cocoapods/external_sources/abstract_external_source.rb +15 -10
- data/lib/cocoapods/external_sources/downloader_source.rb +0 -2
- data/lib/cocoapods/external_sources/path_source.rb +1 -4
- data/lib/cocoapods/external_sources/podspec_source.rb +1 -3
- data/lib/cocoapods/gem_version.rb +1 -2
- data/lib/cocoapods/generator/acknowledgements.rb +5 -8
- data/lib/cocoapods/generator/acknowledgements/markdown.rb +5 -7
- data/lib/cocoapods/generator/acknowledgements/plist.rb +9 -10
- data/lib/cocoapods/generator/bridge_support.rb +1 -1
- data/lib/cocoapods/generator/copy_resources_script.rb +10 -14
- data/lib/cocoapods/generator/dummy_source.rb +3 -3
- data/lib/cocoapods/generator/prefix_header.rb +15 -16
- data/lib/cocoapods/generator/target_environment_header.rb +122 -36
- data/lib/cocoapods/generator/xcconfig.rb +0 -4
- data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +74 -65
- data/lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb +92 -95
- data/lib/cocoapods/generator/xcconfig/public_pod_xcconfig.rb +48 -51
- data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +10 -10
- data/lib/cocoapods/hooks/installer_representation.rb +15 -18
- data/lib/cocoapods/hooks/library_representation.rb +4 -8
- data/lib/cocoapods/hooks/pod_representation.rb +1 -5
- data/lib/cocoapods/hooks_manager.rb +63 -0
- data/lib/cocoapods/installer.rb +60 -47
- data/lib/cocoapods/installer/analyzer.rb +60 -62
- data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +5 -8
- data/lib/cocoapods/installer/file_references_installer.rb +7 -10
- data/lib/cocoapods/installer/hooks_context.rb +74 -0
- data/lib/cocoapods/installer/migrator.rb +99 -0
- data/lib/cocoapods/installer/pod_source_installer.rb +9 -29
- data/lib/cocoapods/installer/target_installer.rb +7 -17
- data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +40 -41
- data/lib/cocoapods/installer/target_installer/pod_target_installer.rb +43 -54
- data/lib/cocoapods/installer/user_project_integrator.rb +54 -10
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +66 -117
- data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +116 -0
- data/lib/cocoapods/open_uri.rb +1 -2
- data/lib/cocoapods/project.rb +34 -8
- data/lib/cocoapods/resolver.rb +43 -21
- data/lib/cocoapods/sandbox.rb +80 -75
- data/lib/cocoapods/sandbox/file_accessor.rb +3 -8
- data/lib/cocoapods/sandbox/headers_store.rb +6 -7
- data/lib/cocoapods/sandbox/path_list.rb +7 -10
- data/lib/cocoapods/sources_manager.rb +81 -49
- data/lib/cocoapods/target.rb +18 -12
- data/lib/cocoapods/target/aggregate_target.rb +43 -18
- data/lib/cocoapods/target/pod_target.rb +37 -4
- data/lib/cocoapods/user_interface.rb +19 -18
- data/lib/cocoapods/user_interface/error_report.rb +23 -4
- data/lib/cocoapods/validator.rb +30 -33
- metadata +100 -73
- data/lib/cocoapods/command/help.rb +0 -25
data/README.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
### CocoaPods: The Objective-C dependency manager
|
4
4
|
|
5
|
-
[](https://travis-ci.org/CocoaPods/CocoaPods)
|
6
|
-
[](http://badge.fury.io/rb/cocoapods)
|
7
|
-
[](https://codeclimate.com/github/CocoaPods/CocoaPods)
|
5
|
+
[](https://travis-ci.org/CocoaPods/CocoaPods)
|
6
|
+
[](http://badge.fury.io/rb/cocoapods)
|
7
|
+
[](https://codeclimate.com/github/CocoaPods/CocoaPods)
|
8
8
|
|
9
9
|
CocoaPods manages dependencies for your Xcode projects.
|
10
10
|
|
@@ -50,10 +50,10 @@ CocoaPods is composed by the following projects:
|
|
50
50
|
|
51
51
|
| Status | Project | Description | Info |
|
52
52
|
| :----- | :------ | :--- | :--- |
|
53
|
-
| [](http://travis-ci.org/CocoaPods/CocoaPods) | [CocoaPods](https://github.com/CocoaPods/CocoaPods) | The CocoaPods command line tool. | [docs](http://docs.cocoapods.org/cocoapods)
|
54
|
-
| [](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)
|
55
|
-
| [](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)
|
56
|
-
| [](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)
|
57
|
-
| [](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)
|
58
|
-
|
|
53
|
+
| [](http://travis-ci.org/CocoaPods/CocoaPods) | [CocoaPods](https://github.com/CocoaPods/CocoaPods) | The CocoaPods command line tool. | [docs](http://docs.cocoapods.org/cocoapods)
|
54
|
+
| [](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)
|
55
|
+
| [](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)
|
56
|
+
| [](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)
|
57
|
+
| [](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)
|
58
|
+
| | [Master Repo ](https://github.com/CocoaPods/Specs) | Master repository of specifications. | [guide](http://docs.cocoapods.org/guides/contributing_to_the_master_repo.html)
|
59
59
|
|
data/bin/pod
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
if RUBY_VERSION > '1.8.7' && Encoding.default_external != Encoding::UTF_8
|
4
4
|
puts "\e[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding."
|
5
|
-
if ENV[
|
5
|
+
if ENV['TRAVIS']
|
6
6
|
puts <<-DOC
|
7
7
|
Consider adding the following settings to .travis.yml
|
8
8
|
|
@@ -19,12 +19,12 @@ end
|
|
19
19
|
|
20
20
|
if $PROGRAM_NAME == __FILE__ && !ENV['COCOAPODS_NO_BUNDLER']
|
21
21
|
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
|
22
|
-
require
|
23
|
-
require
|
22
|
+
require 'rubygems'
|
23
|
+
require 'bundler/setup'
|
24
24
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
25
25
|
elsif ENV['COCOAPODS_NO_BUNDLER']
|
26
|
-
require
|
27
|
-
gem
|
26
|
+
require 'rubygems'
|
27
|
+
gem 'cocoapods'
|
28
28
|
end
|
29
29
|
|
30
30
|
STDOUT.sync = true if ENV['CP_STDOUT_SYNC'] == 'TRUE'
|
data/bin/sandbox-pod
CHANGED
@@ -52,7 +52,7 @@ PROFILE_ERB_TEMPLATE = <<-EOS
|
|
52
52
|
"<%= pod_bin %>"
|
53
53
|
"<%= ruby_bin %>"
|
54
54
|
)
|
55
|
-
(regex
|
55
|
+
(regex
|
56
56
|
<% prefixes.each do |prefix| %>
|
57
57
|
#"^<%= prefix %>/*"
|
58
58
|
<% end %>
|
@@ -105,9 +105,7 @@ PROFILE_ERB_TEMPLATE = <<-EOS
|
|
105
105
|
(deny default)
|
106
106
|
EOS
|
107
107
|
|
108
|
-
|
109
108
|
class Profile
|
110
|
-
|
111
109
|
def pod_bin
|
112
110
|
File.expand_path('../pod', __FILE__)
|
113
111
|
end
|
@@ -159,14 +157,12 @@ class Profile
|
|
159
157
|
def generate
|
160
158
|
ERB.new(PROFILE_ERB_TEMPLATE, 0, '>').result(binding)
|
161
159
|
end
|
162
|
-
|
163
160
|
end
|
164
161
|
|
165
162
|
# Ensure the `pod` bin doesn’t think it needs to use Bundler.
|
166
163
|
ENV['COCOAPODS_NO_BUNDLER'] = '1'
|
167
164
|
|
168
165
|
profile = Profile.new
|
169
|
-
#puts profile.generate
|
166
|
+
# puts profile.generate
|
170
167
|
command = ['/usr/bin/sandbox-exec', '-p', profile.generate, profile.pod_bin, *ARGV]
|
171
168
|
exec(*command)
|
172
|
-
|
data/lib/cocoapods.rb
CHANGED
@@ -35,17 +35,18 @@ module Pod
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
autoload :AggregateTarget, 'cocoapods/target/aggregate_target'
|
38
39
|
autoload :Command, 'cocoapods/command'
|
39
40
|
autoload :Executable, 'cocoapods/executable'
|
40
41
|
autoload :ExternalSources, 'cocoapods/external_sources'
|
41
42
|
autoload :Installer, 'cocoapods/installer'
|
42
|
-
autoload :
|
43
|
-
autoload :Target, 'cocoapods/target'
|
44
|
-
autoload :AggregateTarget, 'cocoapods/target/aggregate_target'
|
43
|
+
autoload :HooksManager, 'cocoapods/hooks_manager'
|
45
44
|
autoload :PodTarget, 'cocoapods/target/pod_target'
|
46
45
|
autoload :Project, 'cocoapods/project'
|
47
46
|
autoload :Resolver, 'cocoapods/resolver'
|
48
47
|
autoload :Sandbox, 'cocoapods/sandbox'
|
48
|
+
autoload :SourcesManager, 'cocoapods/sources_manager'
|
49
|
+
autoload :Target, 'cocoapods/target'
|
49
50
|
autoload :Validator, 'cocoapods/validator'
|
50
51
|
|
51
52
|
module Generator
|
@@ -65,7 +66,6 @@ module Pod
|
|
65
66
|
autoload :LibraryRepresentation, 'cocoapods/hooks/library_representation'
|
66
67
|
autoload :PodRepresentation, 'cocoapods/hooks/pod_representation'
|
67
68
|
end
|
68
|
-
|
69
69
|
end
|
70
70
|
|
71
71
|
if ENV['COCOA_PODS_ENV'] == 'development'
|
data/lib/cocoapods/command.rb
CHANGED
@@ -7,8 +7,6 @@ module Pod
|
|
7
7
|
end
|
8
8
|
|
9
9
|
class Command < CLAide::Command
|
10
|
-
|
11
|
-
require 'cocoapods/command/help'
|
12
10
|
require 'cocoapods/command/inter_process_communication'
|
13
11
|
require 'cocoapods/command/lib'
|
14
12
|
require 'cocoapods/command/list'
|
@@ -29,6 +27,8 @@ module Pod
|
|
29
27
|
self.description = 'CocoaPods, the Objective-C library package manager.'
|
30
28
|
self.plugin_prefix = 'cocoapods'
|
31
29
|
|
30
|
+
[Install, Update, Outdated, IPC::Podfile, IPC::Repl].each { |c| c.send(:include, ProjectDirectory) }
|
31
|
+
|
32
32
|
def self.options
|
33
33
|
[
|
34
34
|
['--silent', 'Show nothing'],
|
@@ -44,15 +44,18 @@ module Pod
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.run(argv)
|
47
|
-
help!
|
47
|
+
help! 'You cannot run CocoaPods as root.' if Process.uid == 0
|
48
48
|
super(argv)
|
49
49
|
UI.print_warnings
|
50
50
|
end
|
51
51
|
|
52
52
|
def self.report_error(exception)
|
53
|
-
|
54
|
-
|
53
|
+
case exception
|
54
|
+
when Interrupt
|
55
|
+
puts '[!] Cancelled'.red
|
55
56
|
Config.instance.verbose? ? raise : exit(1)
|
57
|
+
when SystemExit
|
58
|
+
raise
|
56
59
|
else
|
57
60
|
if ENV['COCOA_PODS_ENV'] != 'development'
|
58
61
|
puts UI::ErrorReport.report(exception)
|
@@ -76,9 +79,9 @@ module Pod
|
|
76
79
|
def initialize(argv)
|
77
80
|
super
|
78
81
|
config.silent = argv.flag?('silent', config.silent)
|
79
|
-
config.verbose = self.verbose? unless
|
82
|
+
config.verbose = self.verbose? unless verbose.nil?
|
80
83
|
unless self.ansi_output?
|
81
|
-
String.send(:define_method, :colorize) { |string
|
84
|
+
String.send(:define_method, :colorize) { |string, _| string }
|
82
85
|
end
|
83
86
|
end
|
84
87
|
|
@@ -96,7 +99,7 @@ module Pod
|
|
96
99
|
#
|
97
100
|
def verify_podfile_exists!
|
98
101
|
unless config.podfile
|
99
|
-
raise Informative, "No `Podfile' found in the
|
102
|
+
raise Informative, "No `Podfile' found in the project directory."
|
100
103
|
end
|
101
104
|
end
|
102
105
|
|
@@ -108,9 +111,8 @@ module Pod
|
|
108
111
|
#
|
109
112
|
def verify_lockfile_exists!
|
110
113
|
unless config.lockfile
|
111
|
-
raise Informative, "No `Podfile.lock' found in the
|
114
|
+
raise Informative, "No `Podfile.lock' found in the project directory, run `pod install'."
|
112
115
|
end
|
113
116
|
end
|
114
117
|
end
|
115
118
|
end
|
116
|
-
|
@@ -4,13 +4,12 @@ require 'active_support/core_ext/string/strip'
|
|
4
4
|
module Pod
|
5
5
|
class Command
|
6
6
|
class Init < Command
|
7
|
-
|
8
7
|
self.summary = 'Generate a Podfile for the current directory.'
|
9
8
|
self.description = <<-DESC
|
10
9
|
Creates a Podfile for the current directory if none currently exists. If
|
11
|
-
an
|
12
|
-
file in the current directory, targets will be automatically
|
13
|
-
based on targets defined in the project.
|
10
|
+
an `XCODEPROJ` project file is specified or if there is only a single
|
11
|
+
project file in the current directory, targets will be automatically
|
12
|
+
generated based on targets defined in the project.
|
14
13
|
|
15
14
|
It is possible to specify a list of dependencies which will be used by
|
16
15
|
the template in the `Podfile.default` (normal targets) `Podfile.test`
|
@@ -18,11 +17,11 @@ module Pod
|
|
18
17
|
`~/.cocoapods/templates` folder.
|
19
18
|
DESC
|
20
19
|
self.arguments = [
|
21
|
-
|
20
|
+
CLAide::Argument.new('XCODEPROJ', :false),
|
22
21
|
]
|
23
22
|
|
24
23
|
def initialize(argv)
|
25
|
-
@podfile_path = Pathname.pwd +
|
24
|
+
@podfile_path = Pathname.pwd + 'Podfile'
|
26
25
|
@project_path = argv.shift_argument
|
27
26
|
@project_paths = Pathname.pwd.children.select { |pn| pn.extname == '.xcodeproj' }
|
28
27
|
super
|
@@ -30,13 +29,13 @@ module Pod
|
|
30
29
|
|
31
30
|
def validate!
|
32
31
|
super
|
33
|
-
raise Informative,
|
32
|
+
raise Informative, 'Existing Podfile found in directory' unless config.podfile_path_in_dir(Pathname.pwd).nil?
|
34
33
|
if @project_path
|
35
34
|
help! "Xcode project at #{@project_path} does not exist" unless File.exist? @project_path
|
36
35
|
project_path = @project_path
|
37
36
|
else
|
38
|
-
raise Informative,
|
39
|
-
raise Informative,
|
37
|
+
raise Informative, 'No xcode project found, please specify one' unless @project_paths.length > 0
|
38
|
+
raise Informative, 'Multiple xcode projects found, please specify one' unless @project_paths.length == 1
|
40
39
|
project_path = @project_paths.first
|
41
40
|
end
|
42
41
|
@xcode_project = Xcodeproj::Project.open(project_path)
|
@@ -60,7 +59,8 @@ module Pod
|
|
60
59
|
# Uncomment this line to define a global platform for your project
|
61
60
|
# platform :ios, "6.0"
|
62
61
|
PLATFORM
|
63
|
-
|
62
|
+
|
63
|
+
project.targets.each do |target|
|
64
64
|
podfile << target_module(target)
|
65
65
|
end
|
66
66
|
podfile << "\n"
|
@@ -82,12 +82,11 @@ module Pod
|
|
82
82
|
target_module << "\nend\n"
|
83
83
|
end
|
84
84
|
|
85
|
-
|
86
85
|
def template_contents(path)
|
87
86
|
if path.exist?
|
88
|
-
path.read.chomp.lines.map{ |line| " #{line}" }.join("\n")
|
87
|
+
path.read.chomp.lines.map { |line| " #{line}" }.join("\n")
|
89
88
|
else
|
90
|
-
|
89
|
+
''
|
91
90
|
end
|
92
91
|
end
|
93
92
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Pod
|
2
2
|
class Command
|
3
3
|
class IPC < Command
|
4
|
-
|
5
4
|
self.abstract_command = true
|
6
5
|
self.summary = 'Inter-process communication'
|
7
6
|
|
@@ -12,11 +11,10 @@ module Pod
|
|
12
11
|
#-----------------------------------------------------------------------#
|
13
12
|
|
14
13
|
class Spec < IPC
|
15
|
-
|
16
14
|
self.summary = 'Converts a podspec to JSON.'
|
17
15
|
self.description = 'Converts a podspec to JSON and prints it to STDOUT.'
|
18
16
|
self.arguments = [
|
19
|
-
|
17
|
+
CLAide::Argument.new('PATH', true),
|
20
18
|
]
|
21
19
|
|
22
20
|
def initialize(argv)
|
@@ -26,24 +24,23 @@ module Pod
|
|
26
24
|
|
27
25
|
def validate!
|
28
26
|
super
|
29
|
-
help!
|
27
|
+
help! 'A specification path is required.' unless @path
|
30
28
|
end
|
31
29
|
|
32
30
|
def run
|
31
|
+
require 'json'
|
33
32
|
spec = Specification.from_file(@path)
|
34
|
-
output_pipe.puts
|
33
|
+
output_pipe.puts(JSON.pretty_generate(spec))
|
35
34
|
end
|
36
|
-
|
37
35
|
end
|
38
36
|
|
39
37
|
#-----------------------------------------------------------------------#
|
40
38
|
|
41
39
|
class Podfile < IPC
|
42
|
-
|
43
40
|
self.summary = 'Converts a Podfile to YAML.'
|
44
41
|
self.description = 'Converts a Podfile to YAML and prints it to STDOUT.'
|
45
42
|
self.arguments = [
|
46
|
-
|
43
|
+
CLAide::Argument.new('PATH', true),
|
47
44
|
]
|
48
45
|
|
49
46
|
def initialize(argv)
|
@@ -53,20 +50,18 @@ module Pod
|
|
53
50
|
|
54
51
|
def validate!
|
55
52
|
super
|
56
|
-
help!
|
53
|
+
help! 'A Podfile path is required.' unless @path
|
57
54
|
end
|
58
55
|
|
59
56
|
def run
|
60
57
|
podfile = Pod::Podfile.from_file(@path)
|
61
58
|
output_pipe.puts podfile.to_yaml
|
62
59
|
end
|
63
|
-
|
64
60
|
end
|
65
61
|
|
66
62
|
#-----------------------------------------------------------------------#
|
67
63
|
|
68
64
|
class List < IPC
|
69
|
-
|
70
65
|
self.summary = 'Lists the specifications known to CocoaPods.'
|
71
66
|
self.description = <<-DESC
|
72
67
|
Prints to STDOUT a YAML dictionary where the keys are the name of the
|
@@ -99,13 +94,11 @@ module Pod
|
|
99
94
|
end
|
100
95
|
output_pipe.puts result.to_yaml
|
101
96
|
end
|
102
|
-
|
103
97
|
end
|
104
98
|
|
105
99
|
#-----------------------------------------------------------------------#
|
106
100
|
|
107
101
|
class UpdateSearchIndex < IPC
|
108
|
-
|
109
102
|
self.summary = 'Updates the search index.'
|
110
103
|
self.description = <<-DESC
|
111
104
|
Updates the search index and prints its path to standard output.
|
@@ -123,13 +116,11 @@ module Pod
|
|
123
116
|
SourcesManager.updated_search_index
|
124
117
|
output_pipe.puts(SourcesManager.search_index_path)
|
125
118
|
end
|
126
|
-
|
127
119
|
end
|
128
120
|
|
129
121
|
#-----------------------------------------------------------------------#
|
130
122
|
|
131
123
|
class Repl < IPC
|
132
|
-
|
133
124
|
END_OF_OUTPUT_SIGNAL = "\n\r"
|
134
125
|
|
135
126
|
self.summary = 'The repl listens to commands on standard input.'
|
@@ -172,11 +163,9 @@ module Pod
|
|
172
163
|
signal_end_of_output
|
173
164
|
end
|
174
165
|
end
|
175
|
-
|
176
166
|
end
|
177
167
|
|
178
168
|
#-----------------------------------------------------------------------#
|
179
|
-
|
180
169
|
end
|
181
170
|
end
|
182
171
|
end
|
@@ -10,13 +10,15 @@ module Pod
|
|
10
10
|
self.summary = 'Creates a new Pod'
|
11
11
|
|
12
12
|
self.description = <<-DESC
|
13
|
-
Creates a scaffold for the development of a new Pod
|
14
|
-
|
13
|
+
Creates a scaffold for the development of a new Pod named `NAME`
|
14
|
+
according to the CocoaPods best practices.
|
15
|
+
If a `TEMPLATE_URL`, pointing to a git repo containing a compatible
|
16
|
+
template, is specified, it will be used in place of the default one.
|
15
17
|
DESC
|
16
18
|
|
17
19
|
self.arguments = [
|
18
|
-
|
19
|
-
|
20
|
+
CLAide::Argument.new('NAME', true),
|
21
|
+
CLAide::Argument.new('TEMPLATE_URL', false),
|
20
22
|
]
|
21
23
|
|
22
24
|
def initialize(argv)
|
@@ -27,8 +29,8 @@ module Pod
|
|
27
29
|
|
28
30
|
def validate!
|
29
31
|
super
|
30
|
-
help!
|
31
|
-
help!
|
32
|
+
help! 'A name for the Pod is required.' unless @name
|
33
|
+
help! 'The Pod name cannot contain spaces.' if @name.match(/\s/)
|
32
34
|
help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
|
33
35
|
end
|
34
36
|
|
@@ -48,9 +50,9 @@ module Pod
|
|
48
50
|
executable :git
|
49
51
|
executable :ruby
|
50
52
|
|
51
|
-
TEMPLATE_REPO =
|
52
|
-
TEMPLATE_INFO_URL =
|
53
|
-
CREATE_NEW_POD_INFO_URL =
|
53
|
+
TEMPLATE_REPO = 'https://github.com/CocoaPods/pod-template.git'
|
54
|
+
TEMPLATE_INFO_URL = 'https://github.com/CocoaPods/pod-template'
|
55
|
+
CREATE_NEW_POD_INFO_URL = 'http://guides.cocoapods.org/making/making-a-cocoapod'
|
54
56
|
|
55
57
|
# Clones the template from the remote in the working directory using
|
56
58
|
# the name of the Pod.
|
@@ -59,7 +61,7 @@ module Pod
|
|
59
61
|
#
|
60
62
|
def clone_template
|
61
63
|
UI.section("Cloning `#{template_repo_url}` into `#{@name}`.") do
|
62
|
-
git!"clone '#{template_repo_url}' #{@name}"
|
64
|
+
git! "clone '#{template_repo_url}' #{@name}"
|
63
65
|
end
|
64
66
|
end
|
65
67
|
|
@@ -70,10 +72,10 @@ module Pod
|
|
70
72
|
def configure_template
|
71
73
|
UI.section("Configuring #{@name} template.") do
|
72
74
|
Dir.chdir(@name) do
|
73
|
-
if File.
|
74
|
-
system
|
75
|
+
if File.exist?('configure')
|
76
|
+
system("./configure #{@name}")
|
75
77
|
else
|
76
|
-
UI.warn
|
78
|
+
UI.warn 'Template does not have a configure file.'
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
@@ -107,11 +109,11 @@ module Pod
|
|
107
109
|
DESC
|
108
110
|
|
109
111
|
def self.options
|
110
|
-
[
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
[['--quick', 'Lint skips checks that would require to download and build the spec'],
|
113
|
+
['--only-errors', 'Lint validates even if warnings are present'],
|
114
|
+
['--subspec=NAME', 'Lint validates only the given subspec'],
|
115
|
+
['--no-subspecs', 'Lint skips validation of subspecs'],
|
116
|
+
['--no-clean', 'Lint leaves the build directory intact for inspection']].concat(super)
|
115
117
|
end
|
116
118
|
|
117
119
|
def initialize(argv)
|
@@ -151,7 +153,7 @@ module Pod
|
|
151
153
|
message = "#{validator.spec.name} did not pass validation."
|
152
154
|
if @clean
|
153
155
|
message << "\nYou can use the `--no-clean` option to inspect " \
|
154
|
-
|
156
|
+
'any issue.'
|
155
157
|
end
|
156
158
|
raise Informative, message
|
157
159
|
end
|
@@ -171,19 +173,20 @@ module Pod
|
|
171
173
|
# @raise If multiple podspecs are found.
|
172
174
|
#
|
173
175
|
def podspecs_to_lint
|
174
|
-
if !@podspecs_paths.empty?
|
176
|
+
if !@podspecs_paths.empty?
|
175
177
|
Array(@podspecs_paths)
|
176
|
-
else
|
178
|
+
else
|
177
179
|
podspecs = Pathname.glob(Pathname.pwd + '*.podspec{.yaml,}')
|
178
|
-
|
180
|
+
if podspecs.count.zero?
|
181
|
+
raise Informative, 'Unable to find a podspec in the working ' \
|
182
|
+
'directory'
|
183
|
+
end
|
179
184
|
podspecs
|
180
185
|
end
|
181
186
|
end
|
182
|
-
|
183
187
|
end
|
184
188
|
|
185
189
|
#-----------------------------------------------------------------------#
|
186
|
-
|
187
190
|
end
|
188
191
|
end
|
189
192
|
end
|