Class: Pod::Command::Repo::Remove
- Inherits:
-
Pod::Command::Repo
- Object
- CLAide::Command
- Pod::Command
- Pod::Command::Repo
- Pod::Command::Repo::Remove
- Defined in:
- lib/cocoapods/command/repo.rb
Overview
———————————————————————–#
Instance Method Summary collapse
-
#initialize(argv) ⇒ Remove
constructor
A new instance of Remove.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command::Repo
#branch_name, #branch_remote_name, #dir, #url_of_git_repo
Methods included from Executable
Methods inherited from Pod::Command
options, parse, report_error, run, verify_git_version!
Methods included from Pod::Config::Mixin
Constructor Details
#initialize(argv) ⇒ Remove
Returns a new instance of Remove.
169 170 171 172 |
# File 'lib/cocoapods/command/repo.rb', line 169 def initialize(argv) @name = argv.shift_argument super end |
Instance Method Details
#run ⇒ Object
182 183 184 185 186 |
# File 'lib/cocoapods/command/repo.rb', line 182 def run UI.section("Removing spec repo `#{@name}`") do FileUtils.rm_rf(dir) end end |
#validate! ⇒ Object
174 175 176 177 178 179 180 |
# File 'lib/cocoapods/command/repo.rb', line 174 def validate! super help! 'Deleting a repo needs a `NAME`.' unless @name help! "repo #{@name} does not exist" unless File.directory?(dir) help! "You do not have permission to delete the #{@name} repository." \ 'Perhaps try prefixing this command with sudo.' unless File.writable?(dir) end |