Class: Basketcase::AddCommand

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



686
687
688
689
690
691
692
693
694
695
696
697
698
# File 'lib/basketcase.rb', line 686

def execute
  unlock_parent_directories(specified_targets)
  cleartool_unsafe("mkelem -ncomment #{specified_targets}") do |line|
    case line
    when /^Created element /
      # ignore
    when /^Checked out "(.+)" from version "(\S+)"\./
      report(:ADDED, mkpath($1), $2)
    else
      cannot_deal_with line
    end
  end
end

#helpObject



679
680
681
682
683
684
# File 'lib/basketcase.rb', line 679

def help
  <<EOF
Add elements to the repository.
(Parent directories are checked-out automatically)
EOF
end

#synopsisObject



675
676
677
# File 'lib/basketcase.rb', line 675

def synopsis
  "<element> ..."
end