Class: Basketcase::CheckinCommand
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
Instance Method Details
#execute ⇒ Object
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
|
# File 'lib/basketcase.rb', line 489
def execute
= Pathname.new("basketcase-checkin-comment.tmp")
.open("w") do |out|
out.puts(@comment)
end
cleartool_unsafe("checkin -cfile #{} #{specified_targets}") do |line|
case line
when /^Loading /
when /^Making dir /
when /^Checked in "(.+)" version "(\S+)"\./
report(:COMMIT, mkpath($1), $2)
else
cannot_deal_with line
end
end
.unlink
end
|
#help ⇒ Object
485
486
487
|
# File 'lib/basketcase.rb', line 485
def help
"Check-in elements, prompting for a check-in message."
end
|
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
|
# File 'lib/basketcase.rb', line 510
def
return if @comment
= Pathname.new("basketcase-comment.tmp")
begin
.open('w') do |out|
out.puts <<EOF
# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
#
# Changes to be committed:
EOF
specified_targets.each do |target|
out.puts "#\t#{target}"
end
end
edit()
@comment = .read.gsub(/^#.*\n/, '')
ensure
.unlink
end
raise UsageException, "No check-in comment provided" if @comment.empty?
@comment
end
|
#synopsis ⇒ Object
481
482
483
|
# File 'lib/basketcase.rb', line 481
def synopsis
"<element> ..."
end
|