Class P4Global
In: P4table.rb
Parent: Object

This class just provides two globally accessible Perforce client instances without the use of global variables. One P4 client runs in tagged mode and one in untagged mode. Most of the queries need tagged mode, but when we want to run a "p4 job -o" to archive the job, we need it in plain text.

This class is also the reason why P4Table is not thread safe as all of the other classes that execute commands use it directly. I wanted to avoid excessive passing of P4 objects but in the end I'll probably have to go that way.

Methods
connect    debug=    disconnect    p4client=    p4passwd=    p4port=    p4user=    plain    tagged   
Public Class methods
p4user=( user )

Set the username for both tagged and untagged mode

# File P4table.rb, line 138
    def P4Global.p4user=( user )
	@@p4t.user = user
	@@p4u.user = user
    end
p4port=( port )

Set the port for both tagged and untagged mode

# File P4table.rb, line 144
    def P4Global.p4port=( port )
	@@p4t.port = port
	@@p4u.port = port
    end
p4passwd=( password )

Set the password for both tagged and untagged mode

# File P4table.rb, line 150
    def P4Global.p4passwd=( password )
	@@p4t.password = password
	@@p4u.password = password
    end
p4client=( client )

Set the clientspec for both tagged and untagged mode

# File P4table.rb, line 156
    def P4Global.p4client=( client )
	@@p4t.client = client
	@@p4u.client = client
    end
connect()

Connect both tagged and untagged clients to the server

# File P4table.rb, line 162
    def P4Global.connect
	@@p4t.connect
	@@p4u.connect
    end
disconnect()

Disconnect both tagged and untagged mode clients

# File P4table.rb, line 168
    def P4Global.disconnect
	@@p4t.disconnect
	@@p4u.disconnect
    end
tagged()

Returns the tagged mode client

# File P4table.rb, line 174
    def P4Global.tagged
	@@p4t
    end
plain()

Returns the untagged mode client

# File P4table.rb, line 179
    def P4Global.plain
	@@p4u
    end
debug=( level )

Sets the debug level for both tagged and untagged mode (2 is good)

# File P4table.rb, line 184
    def P4Global.debug=( level )
	@@p4t.debug = level
	@@p4u.debug = level
    end