Class: Basketcase::RemoveCommand

Inherits:
DirectoryModificationCommand show all
Defined in:
lib/basketcase.rb

Instance Attribute Summary

Attributes inherited from Command

#comment, #listener, #targets

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

#mkpath

Constructor Details

This class inherits a constructor from Basketcase::Command

Instance Method Details

#executeObject



657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/basketcase.rb', line 657

def execute
  unlock_parent_directories(specified_targets)
  cleartool_unsafe("rmname -ncomment #{specified_targets}") do |line|
    case line
    when /^Unloaded /
      # ignore
    when /^Removed "(.+)"\./
      report(:REMOVED, mkpath($1))
    else
      cannot_deal_with line
    end
  end
end

#helpObject



650
651
652
653
654
655
# File 'lib/basketcase.rb', line 650

def help
  <<EOF
Mark an element as deleted.
(Parent directories are checked-out automatically)
EOF
end

#synopsisObject



646
647
648
# File 'lib/basketcase.rb', line 646

def synopsis
  "<element> ..."
end