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
aa887ea0
Commit
aa887ea0
authored
May 29, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command] Output cosmetics.
parent
a30fcb67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
6 deletions
+25
-6
command.rb
lib/cocoapods/command.rb
+18
-0
install.rb
lib/cocoapods/command/install.rb
+1
-1
repo.rb
lib/cocoapods/command/repo.rb
+2
-2
setup.rb
lib/cocoapods/command/setup.rb
+4
-3
No files found.
lib/cocoapods/command.rb
View file @
aa887ea0
...
@@ -114,6 +114,24 @@ module Pod
...
@@ -114,6 +114,24 @@ module Pod
def
initialize
(
argv
)
def
initialize
(
argv
)
raise
Help
.
new
(
self
.
class
,
argv
)
raise
Help
.
new
(
self
.
class
,
argv
)
end
end
private
def
print_title
(
title
,
only_verbose
=
true
)
if
config
.
verbose?
puts
"
\n
"
+
title
.
yellow
elsif
!
config
.
silent?
&&
!
only_verbose
puts
title
end
end
def
print_subtitle
(
title
,
only_verbose
=
false
)
if
config
.
verbose?
puts
"
\n
"
+
title
.
green
elsif
!
config
.
silent?
&&
!
only_verbose
puts
title
end
end
end
end
end
end
lib/cocoapods/command/install.rb
View file @
aa887ea0
...
@@ -46,7 +46,7 @@ module Pod
...
@@ -46,7 +46,7 @@ module Pod
end
end
if
@update_repo
if
@update_repo
p
uts
"
\n
Updating Spec Repositories
\n
"
.
yellow
if
config
.
verbose?
p
rint_title
'Updating Spec Repositories'
,
true
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
end
end
...
...
lib/cocoapods/command/repo.rb
View file @
aa887ea0
...
@@ -43,7 +43,7 @@ module Pod
...
@@ -43,7 +43,7 @@ module Pod
end
end
def
add
def
add
p
uts
"Cloning spec repo `
#{
@name
}
' from `
#{
@url
}
'"
unless
config
.
silent?
p
rint_subtitle
"Cloning spec repo `
#{
@name
}
' from `
#{
@url
}
'
#{
" (branch `
#{
@branch
}
')"
if
@branch
}
"
config
.
repos_dir
.
mkpath
config
.
repos_dir
.
mkpath
Dir
.
chdir
(
config
.
repos_dir
)
{
git
(
"clone '
#{
@url
}
'
#{
@name
}
"
)
}
Dir
.
chdir
(
config
.
repos_dir
)
{
git
(
"clone '
#{
@url
}
'
#{
@name
}
"
)
}
Dir
.
chdir
(
dir
)
{
git
(
"checkout
#{
@branch
}
"
)
}
if
@branch
Dir
.
chdir
(
dir
)
{
git
(
"checkout
#{
@branch
}
"
)
}
if
@branch
...
@@ -53,7 +53,7 @@ module Pod
...
@@ -53,7 +53,7 @@ module Pod
def
update
def
update
dirs
=
@name
?
[
dir
]
:
config
.
repos_dir
.
children
.
select
{
|
c
|
c
.
directory?
}
dirs
=
@name
?
[
dir
]
:
config
.
repos_dir
.
children
.
select
{
|
c
|
c
.
directory?
}
dirs
.
each
do
|
dir
|
dirs
.
each
do
|
dir
|
p
uts
"Updating spec repo `
#{
dir
.
basename
}
'"
unless
config
.
silent?
p
rint_subtitle
"Updating spec repo `
#{
dir
.
basename
}
'"
Dir
.
chdir
(
dir
)
{
git
(
"pull"
)
}
Dir
.
chdir
(
dir
)
{
git
(
"pull"
)
}
check_versions
(
dir
)
check_versions
(
dir
)
end
end
...
...
lib/cocoapods/command/setup.rb
View file @
aa887ea0
...
@@ -2,7 +2,7 @@ module Pod
...
@@ -2,7 +2,7 @@ module Pod
class
Command
class
Command
class
Setup
<
Command
class
Setup
<
Command
def
self
.
banner
def
self
.
banner
%{Setup CocoaPods environment:
%{Setup CocoaPods environment:
$ pod setup
$ pod setup
...
@@ -55,7 +55,7 @@ module Pod
...
@@ -55,7 +55,7 @@ module Pod
end
end
def
push?
def
push?
@push_option
||
(
dir
.
exist?
&&
origin_url_push?
)
@push_option
||
(
dir
.
exist?
&&
origin_url_push?
)
end
end
def
read_master_repo_url
def
read_master_repo_url
...
@@ -90,6 +90,7 @@ module Pod
...
@@ -90,6 +90,7 @@ module Pod
end
end
def
run
def
run
print_title
"Setting up CocoaPods master repo"
if
dir
.
exist?
if
dir
.
exist?
set_master_repo_url
set_master_repo_url
set_master_repo_branch
set_master_repo_branch
...
@@ -103,7 +104,7 @@ module Pod
...
@@ -103,7 +104,7 @@ module Pod
hook
.
open
(
'w'
)
{
|
f
|
f
<<
"#!/bin/sh
\n
rake lint"
}
hook
.
open
(
'w'
)
{
|
f
|
f
<<
"#!/bin/sh
\n
rake lint"
}
`chmod +x '
#{
hook
}
'`
`chmod +x '
#{
hook
}
'`
end
end
p
uts
"
\n
Setup completed (
#{
push?
?
"push"
:
"read-only"
}
access)"
unless
config
.
silent
p
rint_subtitle
"Setup completed (
#{
push?
?
"push"
:
"read-only"
}
access)"
end
end
end
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