P4Global (Class)

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

Connect both tagged and untagged clients to the server

[Source]

     # File p4table.rb, line 162
162:     def P4Global.connect
163:         @@p4t.connect
164:         @@p4u.connect
165:     end

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

[Source]

     # File p4table.rb, line 184
184:     def P4Global.debug=( level )
185:         @@p4t.debug = level
186:         @@p4u.debug = level
187:     end

Disconnect both tagged and untagged mode clients

[Source]

     # File p4table.rb, line 168
168:     def P4Global.disconnect
169:         @@p4t.disconnect
170:         @@p4u.disconnect
171:     end

Set the clientspec for both tagged and untagged mode

[Source]

     # File p4table.rb, line 156
156:     def P4Global.p4client=( client )
157:         @@p4t.client = client
158:         @@p4u.client = client
159:     end

Set the password for both tagged and untagged mode

[Source]

     # File p4table.rb, line 150
150:     def P4Global.p4passwd=( password )
151:         @@p4t.password = password
152:         @@p4u.password = password
153:     end

Set the port for both tagged and untagged mode

[Source]

     # File p4table.rb, line 144
144:     def P4Global.p4port=( port )
145:         @@p4t.port = port
146:         @@p4u.port = port
147:     end

Set the username for both tagged and untagged mode

[Source]

     # File p4table.rb, line 138
138:     def P4Global.p4user=( user )
139:         @@p4t.user = user
140:         @@p4u.user = user
141:     end

Returns the untagged mode client

[Source]

     # File p4table.rb, line 179
179:     def P4Global.plain
180:         @@p4u
181:     end

Returns the tagged mode client

[Source]

     # File p4table.rb, line 174
174:     def P4Global.tagged
175:         @@p4t
176:     end

[Validate]