p4table.rb

Path: p4table.rb
Last Update: Tue Dec 07 12:33:06 GMT 2004

root is relative.

Required files

P4  

Methods

Constants

SEP = "\\"
NL = "\r\n"
SEP = "/"
NL = "\n"
DEPOT_ROOT_PATH = "//depot"
P4ROOT = "p4table-test"
CLIENT_ROOT = "test-client"

Classes and Modules

Class P4RecFile
Class P4RecId
Class P4Record
Class P4Table

Public Instance methods

[Source]

     # File p4table.rb, line 612
612: def create_client( p4, root )
613:     # root is relative.
614:     root = Dir.getwd + SEP + root
615:     spec = p4.fetch_client( p4.client? )
616:     spec[ "Root" ] = root
617:     p4.save_client( spec )
618: end

[Source]

     # File p4table.rb, line 621
621: def deltree( p )
622:     if( File.directory?( p ) )
623:         Dir.entries( p ).each do
624:             |ent|
625:             next if ( ent == "." )
626:             next if ( ent == ".." )
627:             path = p + SEP + ent
628:             deltree( path )
629:         end
630:         Dir.delete( p )
631:     else
632:         File.unlink( p )
633:     end
634: end

[Source]

     # File p4table.rb, line 576
576: def init_jobspec( p4 )
577:     js = "\n    Fields:\n        101 Job word 32 required\n        102 status select 10 required\n        103 owner word 32 required\n        104 modified_date date 20 always\n        105 note text 0 optional\n        106 sender line 32 optional\n        107 fax_number line 32 optional\n        108 files text 80 optional\n        109 date_received date 20 once\n        110 date_closed date 20 optional\n\nValues:\n        status open/closed\n\nPresets:\n        status open\n        owner $user\n        modified_date $now\n        date_received $now\n"
578: 
579:     p4.save_jobspec( js )
580: 
581: end

[Source]

     # File p4table.rb, line 607
607: def prepare( root )
608:     deltree( root ) if File.exists?( root )
609:     Dir.mkdir( root )
610: end

[Validate]