Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
5b562bb3
Commit
5b562bb3
authored
Aug 23, 2012
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor and cleanup command source files.
parent
bff1e393
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
72 deletions
+50
-72
command.rb
lib/cocoapods/command.rb
+21
-3
install.rb
lib/cocoapods/command/install.rb
+10
-13
outdated.rb
lib/cocoapods/command/outdated.rb
+6
-14
push.rb
lib/cocoapods/command/push.rb
+6
-6
setup.rb
lib/cocoapods/command/setup.rb
+1
-1
spec.rb
lib/cocoapods/command/spec.rb
+1
-1
update.rb
lib/cocoapods/command/update.rb
+5
-34
No files found.
lib/cocoapods/command.rb
View file @
5b562bb3
...
...
@@ -54,9 +54,8 @@ module Pod
def
self
.
banner
commands
=
[
'install'
,
'update'
,
'outdated'
,
'list'
,
'push'
,
'repo'
,
'search'
,
'setup'
,
'spec'
].
sort
banner
=
"
\n
To see help for the available commands run:
\n\n
"
commands
.
each
{
|
cmd
|
banner
<<
" * $ pod
#{
cmd
.
green
}
--help
\n
"
}
banner
banner
=
"To see help for the available commands run:
\n\n
"
banner
+
commands
.
map
{
|
cmd
|
" * $ pod
#{
cmd
.
green
}
--help"
}.
join
(
"
\n
"
)
end
def
self
.
options
...
...
@@ -132,6 +131,25 @@ module Pod
private
def
verify_podfile_exists!
unless
config
.
podfile
raise
Informative
,
"No `Podfile' found in the current working directory."
end
end
def
verify_lockfile_exists!
unless
config
.
lockfile
raise
Informative
,
"No `Podfile.lock' found in the current working directory, run `pod install'."
end
end
def
update_spec_repos_if_necessary!
if
@update_repo
print_title
'Updating Spec Repositories'
,
true
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
end
end
def
print_title
(
title
,
only_verbose
=
true
)
if
config
.
verbose?
puts
"
\n
"
+
title
.
yellow
...
...
lib/cocoapods/command/install.rb
View file @
5b562bb3
...
...
@@ -19,8 +19,7 @@ module Pod
This will configure the project to reference the Pods static library,
add a build configuration file, and add a post build script to copy
Pod resources.
}
Pod resources.}
end
def
self
.
options
...
...
@@ -40,20 +39,18 @@ module Pod
super
unless
argv
.
empty?
end
def
run
unless
podfile
=
config
.
podfile
raise
Informative
,
"No `Podfile' found in the current working directory."
end
if
@update_repo
print_title
'Updating Spec Repositories'
,
true
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
end
def
run_install_with_update
(
update
)
sandbox
=
Sandbox
.
new
(
config
.
project_pods_root
)
resolver
=
Resolver
.
new
(
podfile
,
config
.
lockfile
,
sandbox
)
resolver
=
Resolver
.
new
(
config
.
podfile
,
config
.
lockfile
,
sandbox
)
resolver
.
update_mode
=
update
Installer
.
new
(
resolver
).
install!
end
def
run
verify_podfile_exists!
update_spec_repos_if_necessary!
run_install_with_update
(
false
)
end
end
end
end
lib/cocoapods/command/outdated.rb
View file @
5b562bb3
...
...
@@ -6,32 +6,24 @@ module Pod
$ pod outdated
Shows the outdated pods in the current Podfile.lock.
}
Shows the outdated pods in the current Podfile.lock.}
end
def
self
.
options
[
[
"--no-update"
,
"Skip running `pod repo update` before install"
],
[
"--no-update"
,
"Skip running `pod repo update` before install"
],
].
concat
(
super
)
end
def
initialize
(
argv
)
@update_repo
=
!
argv
.
option
(
'--no-update'
)
@update_repo
=
!
argv
.
option
(
'--no-update'
)
super
unless
argv
.
empty?
end
def
run
unless
podfile
=
config
.
podfile
raise
Informative
,
"No `Podfile' found in the current working directory."
end
unless
lockfile
=
config
.
lockfile
raise
Informative
,
"No `Podfile.lock' found in the current working directory, run `pod install'."
end
if
@update_repo
print_title
'Updating Spec Repositories'
,
true
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
end
verify_podfile_exists!
verify_lockfile_exists!
update_spec_repos_if_necessary!
sandbox
=
Sandbox
.
new
(
config
.
project_pods_root
)
resolver
=
Resolver
.
new
(
podfile
,
lockfile
,
sandbox
)
...
...
lib/cocoapods/command/push.rb
View file @
5b562bb3
...
...
@@ -4,14 +4,14 @@ module Pod
class
Command
class
Push
<
Command
def
self
.
banner
%{Pushing new specifications to a spec-repo:
%{Pushing new specifications to a spec-repo:
$ pod push REPO [NAME.podspec]
$ pod push REPO [NAME.podspec]
Validates NAME.podspec or `*.podspec' in the current working dir, creates
a directory and version folder for the pod in the local copy of
REPO (~/.cocoapods/[REPO]), copies the podspec file into the version directory,
and finally it pushes REPO to its remote.}
Validates NAME.podspec or `*.podspec' in the current working dir, creates
a directory and version folder for the pod in the local copy of
REPO (~/.cocoapods/[REPO]), copies the podspec file into the version directory,
and finally it pushes REPO to its remote.}
end
def
self
.
options
...
...
lib/cocoapods/command/setup.rb
View file @
5b562bb3
...
...
@@ -2,7 +2,7 @@ module Pod
class
Command
class
Setup
<
Command
def
self
.
banner
%{Setup CocoaPods environment:
%{Setup CocoaPods environment:
$ pod setup
...
...
lib/cocoapods/command/spec.rb
View file @
5b562bb3
...
...
@@ -4,7 +4,7 @@ module Pod
class
Command
class
Spec
<
Command
def
self
.
banner
%{Managing PodSpec files:
%{Managing PodSpec files:
$ pod spec create [ NAME | https://github.com/USER/REPO ]
...
...
lib/cocoapods/command/update.rb
View file @
5b562bb3
module
Pod
class
Command
class
Update
<
Command
class
Update
<
Install
def
self
.
banner
%{Updating dependencies of a project:
...
...
@@ -9,40 +9,11 @@ module Pod
Updates all dependencies.}
end
def
self
.
options
[
[
"--no-clean"
,
"Leave SCM dirs like `.git' and `.svn' intact after downloading"
],
[
"--no-doc"
,
"Skip documentation generation with appledoc"
],
[
"--no-integrate"
,
"Skip integration of the Pods libraries in the Xcode project(s)"
],
[
"--no-update"
,
"Skip running `pod repo update` before install"
],
].
concat
(
super
)
end
def
initialize
(
argv
)
config
.
clean
=
!
argv
.
option
(
'--no-clean'
)
config
.
generate_docs
=
!
argv
.
option
(
'--no-doc'
)
config
.
integrate_targets
=
!
argv
.
option
(
'--no-integrate'
)
@update_repo
=
!
argv
.
option
(
'--no-update'
)
super
unless
argv
.
empty?
end
def
run
unless
podfile
=
config
.
podfile
raise
Informative
,
"No `Podfile' found in the current working directory."
end
unless
lockfile
=
config
.
lockfile
raise
Informative
,
"No `Podfile.lock' found in the current working directory, run `pod install'."
end
if
@update_repo
print_title
'Updating Spec Repositories'
,
true
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
end
sandbox
=
Sandbox
.
new
(
config
.
project_pods_root
)
resolver
=
Resolver
.
new
(
podfile
,
lockfile
,
sandbox
)
resolver
.
update_mode
=
true
Installer
.
new
(
resolver
).
install!
verify_podfile_exists!
verify_lockfile_exists!
update_spec_repos_if_necessary!
run_install_with_update
(
true
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment