Class: Basketcase::MoveCommand
- Inherits:
-
DirectoryModificationCommand
- Object
- Command
- DirectoryModificationCommand
- Basketcase::MoveCommand
- Defined in:
- lib/basketcase.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from DirectoryModificationCommand
#checkout, #find_locked_elements, #unlock_parent_directories
Methods inherited from Command
#accept_args, #effective_targets, #initialize, #option_comment, #option_graphical, #option_recurse, #report, #specified_targets
Methods included from Utils
Constructor Details
This class inherits a constructor from Basketcase::Command
Instance Method Details
#execute ⇒ Object
437 438 439 440 441 442 443 444 445 446 447 448 449 |
# File 'lib/basketcase.rb', line 437 def execute raise UsageException, "expected two arguments" unless (specified_targets.size == 2) unlock_parent_directories(specified_targets) cleartool_unsafe("move -ncomment #{specified_targets}") do |line| case line when /^Moved "(.+)" to "(.+)"\./ report(:REMOVED, mkpath($1)) report(:ADDED, mkpath($2)) else cannot_deal_with line end end end |
#help ⇒ Object
430 431 432 433 434 435 |
# File 'lib/basketcase.rb', line 430 def help <<EOF Move/rename an element. (Parent directories are checked-out automatically) EOF end |
#synopsis ⇒ Object
426 427 428 |
# File 'lib/basketcase.rb', line 426 def synopsis "<from> <to>" end |