Class: Basketcase::CheckoutCommand

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, #option_comment, #option_graphical, #option_recurse, #report, #specified_targets

Methods included from Utils

#mkpath

Constructor Details

#initialize(*args) ⇒ CheckoutCommand

Returns a new instance of CheckoutCommand.



278
279
280
281
# File 'lib/basketcase.rb', line 278

def initialize(*args)
  super(*args)
  @keep_or_revert = '-nquery'
end

Instance Method Details

#executeObject



289
290
291
292
293
294
295
296
# File 'lib/basketcase.rb', line 289

def execute
  cleartool_unsafe("checkout -unreserved -ncomment #{@keep_or_revert} #{specified_targets}") do |line|
    case line
    when /^Checked out "(.+)" from version "(\S+)"\./
      report(:CO, mkpath($1), $2)
    end
  end
end

#helpObject



265
266
267
# File 'lib/basketcase.rb', line 265

def help
  ""
end

#option_hijackObject Also known as: option_h



283
284
285
# File 'lib/basketcase.rb', line 283

def option_hijack
  @keep_or_revert = '-usehijack'
end

#synopsisObject



261
262
263
# File 'lib/basketcase.rb', line 261

def synopsis
  "<element> ..."
end