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
05698a86
Commit
05698a86
authored
Oct 19, 2013
by
Joshua Kalpin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pod repo remove [name] command
Deletes the repo named in the command.
parent
29697f42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletion
+35
-1
repo.rb
lib/cocoapods/command/repo.rb
+27
-0
repo_spec.rb
spec/functional/command/repo_spec.rb
+7
-0
command_spec.rb
spec/unit/command_spec.rb
+1
-1
No files found.
lib/cocoapods/command/repo.rb
View file @
05698a86
...
...
@@ -133,6 +133,33 @@ module Pod
#-----------------------------------------------------------------------#
class
Remove
<
Repo
self
.
summary
=
'Remove a spec repo'
self
.
description
=
<<-
DESC
Deletes the remote named `NAME` from the local spec-repos directory at `~/.cocoapods/repos/.`
DESC
self
.
arguments
=
'NAME'
def
initialize
(
argv
)
@name
=
argv
.
shift_argument
super
end
def
validate!
super
help!
'Deleting a repo needs a `NAME`.'
unless
@name
help!
"repo
#{
@name
}
does not exist"
unless
File
.
directory?
(
dir
)
end
def
run
UI
.
section
(
"Removing spec repo `
#{
@name
}
`"
)
do
FileUtils
.
rm_rf
(
dir
)
end
end
end
extend
Executable
executable
:git
...
...
spec/functional/command/repo_spec.rb
View file @
05698a86
...
...
@@ -54,6 +54,13 @@ module Pod
run_command
(
'repo'
,
'update'
,
'repo2'
)
(
repo2
+
'README'
).
read
.
should
.
include
'Updated'
end
it
"removes a spec-repo"
do
upstream
=
SpecHelper
.
temporary_directory
+
'upstream'
FileUtils
.
cp_r
(
test_repo_path
,
upstream
)
lambda
{
run_command
(
'repo'
,
'remove'
,
upstream
)
}.
should
.
not
.
raise
File
.
directory?
(
test_repo_path
+
upstream
).
should
.
be
.
false?
end
end
end
end
spec/unit/command_spec.rb
View file @
05698a86
...
...
@@ -16,7 +16,7 @@ module Pod
Command
.
parse
(
%w{ setup }
).
should
.
be
.
instance_of
Command
::
Setup
Command
.
parse
(
%w{ spec create }
).
should
.
be
.
instance_of
Command
::
Spec
::
Create
Command
.
parse
(
%w{ spec lint }
).
should
.
be
.
instance_of
Command
::
Spec
::
Lint
Command
.
parse
(
%w{ repo
update }
).
should
.
be
.
instance_of
Command
::
Repo
::
Updat
e
Command
.
parse
(
%w{ repo
remove }
).
should
.
be
.
instance_of
Command
::
Repo
::
Remov
e
Command
.
parse
(
%w{ init }
).
should
.
be
.
instance_of
Command
::
Init
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