Class: Pod::Command::RepoSvn::Remove
- Inherits:
-
Pod::Command::RepoSvn
- Object
- Pod::Command
- Pod::Command::RepoSvn
- Pod::Command::RepoSvn::Remove
- Defined in:
- lib/pod/command/repo_svn.rb
Overview
Repo removal should probably be pulled out, also pretty generic
Instance Method Summary collapse
-
#initialize(argv) ⇒ Remove
constructor
A new instance of Remove.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command::RepoSvn
Constructor Details
#initialize(argv) ⇒ Remove
Returns a new instance of Remove.
261 262 263 264 |
# File 'lib/pod/command/repo_svn.rb', line 261 def initialize(argv) @name = argv.shift_argument super end |
Instance Method Details
#run ⇒ Object
274 275 276 277 278 |
# File 'lib/pod/command/repo_svn.rb', line 274 def run UI.section("Removing spec repo `#{@name}`") do FileUtils.rm_rf(dir) end end |
#validate! ⇒ Object
266 267 268 269 270 271 272 |
# File 'lib/pod/command/repo_svn.rb', line 266 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 |