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.
230 231 232 233 |
# File 'lib/pod/command/repo_svn.rb', line 230 def initialize(argv) @name = argv.shift_argument super end |
Instance Method Details
#run ⇒ Object
243 244 245 246 247 |
# File 'lib/pod/command/repo_svn.rb', line 243 def run UI.section("Removing spec repo `#{@name}`") do FileUtils.rm_rf(dir) end end |
#validate! ⇒ Object
235 236 237 238 239 240 241 |
# File 'lib/pod/command/repo_svn.rb', line 235 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 |