Class: Pod::Command::RepoArt::Remove
- Inherits:
-
Pod::Command::RepoArt
- Object
- Pod::Command
- Pod::Command::RepoArt
- Pod::Command::RepoArt::Remove
- Defined in:
- lib/pod/command/repo_art/remove.rb
Constant Summary
Constants inherited from Pod::Command::RepoArt
Instance Method Summary collapse
-
#initialize(argv) ⇒ Remove
constructor
A new instance of Remove.
- #repo_dir_root ⇒ Object
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command::RepoArt
Constructor Details
#initialize(argv) ⇒ Remove
Returns a new instance of Remove.
15 16 17 18 19 |
# File 'lib/pod/command/repo_art/remove.rb', line 15 def initialize(argv) init @name = argv.shift_argument super end |
Instance Method Details
#repo_dir_root ⇒ Object
35 36 37 |
# File 'lib/pod/command/repo_art/remove.rb', line 35 def repo_dir_root "#{@repos_art_dir}/#{@name}" end |
#run ⇒ Object
29 30 31 32 33 |
# File 'lib/pod/command/repo_art/remove.rb', line 29 def run UI.section("Removing spec repo `#{@name}`") do FileUtils.rm_rf(repo_dir_root) end end |
#validate! ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/pod/command/repo_art/remove.rb', line 21 def validate! super help! 'Deleting a repo needs a `NAME`.' unless @name help! "repo #{@name} does not exist" unless File.directory?(repo_dir_root) help! "You do not have permission to delete the #{@name} repository." \ 'Perhaps try prefixing this command with sudo.' unless File.writable?(repo_dir_root) end |