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



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/basketcase.rb', line 180

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



170
171
172
# File 'lib/basketcase.rb', line 170

def help
  "List checkouts by ALL users"
end

#option_directoryObject Also known as: option_d



174
175
176
# File 'lib/basketcase.rb', line 174

def option_directory
  @directory_only = true
end

#synopsisObject



166
167
168
# File 'lib/basketcase.rb', line 166

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