Class: Basketcase::LsCoCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/basketcase.rb

Instance Attribute Summary

Attributes inherited from Command

#comment, #listener, #targets

Instance Method Summary collapse

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



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/basketcase.rb', line 382

def execute
  args = ''
  args += ' -recurse' if @recursive
  args += ' -directory' if @directory_only
  cleartool("lsco #{args} #{effective_targets}") do |line|
    case line
    when /^.*\s(\S+)\s+checkout.*version "(\S+)" from (\S+)/
      report($1, mkpath($2), $3)
    when /^Added /
      # ignore
    when /^  /
      # ignore
    else
      cannot_deal_with line
    end
  end
end

#helpObject



372
373
374
# File 'lib/basketcase.rb', line 372

def help
  "List checkouts by ALL users"
end

#option_directoryObject Also known as: option_d



376
377
378
# File 'lib/basketcase.rb', line 376

def option_directory
  @directory_only = true
end

#synopsisObject



368
369
370
# File 'lib/basketcase.rb', line 368

def synopsis
  "[-r] [-d] [<element> ...]"
end