p4ruby 2017.1.1653916-x86-mingw32 → 2017.1.1699426-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9483c9f22e089e99558195c3acffdc6b2c8faa90
4
- data.tar.gz: 9e694b10718d84185d7562f82dc116750ebb1c36
3
+ metadata.gz: 6e8536aa85a9ab06b466490c8653b3b7d1c2b6fd
4
+ data.tar.gz: 255f8f5b4f7f2c6398a4b9cfcaa023f3f8b11e35
5
5
  SHA512:
6
- metadata.gz: 4ca0e8f841958ca4fe01a476a61bb8c234c70d089bd068e309f37230b211af186b287066833f98e6cb8dc533aa8e9c262506256fa8c827c7a6c29e25184b8307
7
- data.tar.gz: e9048b63b40d48c34104eb6a4327cda6a6eaa2732d50364a04e7c8b9e190e9708280785d31e18ace9551e3e44ec53b93179bb308bf055f19ac5538ecaccfd64e
6
+ metadata.gz: c26f85b05d76713d753a42ac7b94f66668944ca866b47fa500e60f277fd8bdba25dcda617b8b203d2e0156d390f1e48f1e5567ce4307145e3439e8544149260e
7
+ data.tar.gz: d6d33cca1eb271d22330c5c37b67b802307dd1cfb3f8e4bc98b21b90e998045db2a16ef300ca2c1778e0827ec7317793713d0a768695b9924f4e8f6bc27d3494
data/README.md CHANGED
@@ -290,6 +290,9 @@ release up to the bug fix change level.
290
290
 
291
291
  New functionality in 2017.1
292
292
 
293
+ - (SIR#96305/ P4RUBY-214)
294
+ Add get/set trust file location to api
295
+
293
296
  - (SIR#93993 / P4RUBY-206)
294
297
 
295
298
  Add a reset() method for resetting p4 client data (messages, output, etc.)
@@ -489,6 +489,21 @@ static VALUE p4_set_ticket_file( VALUE self, VALUE path )
489
489
  return Qtrue;
490
490
  }
491
491
 
492
+ static VALUE p4_get_trust_file( VALUE self )
493
+ {
494
+ P4ClientApi *p4;
495
+ Data_Get_Struct( self, P4ClientApi, p4 );
496
+ return P4Utils::ruby_string( p4->GetTrustFile().Text() );
497
+ }
498
+
499
+ static VALUE p4_set_trust_file( VALUE self, VALUE path )
500
+ {
501
+ P4ClientApi *p4;
502
+ Data_Get_Struct( self, P4ClientApi, p4 );
503
+ p4->SetTrustFile( StringValuePtr( path ) );
504
+ return Qtrue;
505
+ }
506
+
492
507
  static VALUE p4_get_user( VALUE self )
493
508
  {
494
509
  P4ClientApi *p4;
@@ -1188,6 +1203,14 @@ static VALUE p4msg_get_text( VALUE self )
1188
1203
  return e->GetText();
1189
1204
  }
1190
1205
 
1206
+ static VALUE p4msg_get_dict( VALUE self )
1207
+ {
1208
+ P4Error * e = 0;
1209
+
1210
+ Data_Get_Struct( self, P4Error, e );
1211
+ return e->GetDict();
1212
+ }
1213
+
1191
1214
  static VALUE p4msg_get_id( VALUE self )
1192
1215
  {
1193
1216
  P4Error * e = 0;
@@ -1263,6 +1286,8 @@ void Init_P4()
1263
1286
  rb_define_method( cP4, "protocol", RUBY_METHOD_FUNC(p4_set_protocol), 2 );
1264
1287
  rb_define_method( cP4, "ticket_file", RUBY_METHOD_FUNC(p4_get_ticket_file), 0 );
1265
1288
  rb_define_method( cP4, "ticket_file=", RUBY_METHOD_FUNC(p4_set_ticket_file), 1 );
1289
+ rb_define_method( cP4, "trust_file", RUBY_METHOD_FUNC(p4_get_trust_file), 0 );
1290
+ rb_define_method( cP4, "trust_file=", RUBY_METHOD_FUNC(p4_set_trust_file), 1 );
1266
1291
  rb_define_method( cP4, "user", RUBY_METHOD_FUNC(p4_get_user) , 0 );
1267
1292
  rb_define_method( cP4, "user=", RUBY_METHOD_FUNC(p4_set_user) , 1 );
1268
1293
  rb_define_method( cP4, "version", RUBY_METHOD_FUNC(p4_get_version) , 0 );
@@ -1363,6 +1388,7 @@ void Init_P4()
1363
1388
  rb_define_method( cP4Msg, "msgid", RUBY_METHOD_FUNC(p4msg_get_id), 0);
1364
1389
  rb_define_method( cP4Msg, "severity", RUBY_METHOD_FUNC(p4msg_get_severity), 0);
1365
1390
  rb_define_method( cP4Msg, "generic", RUBY_METHOD_FUNC(p4msg_get_generic), 0);
1391
+ rb_define_method( cP4Msg, "dictionary", RUBY_METHOD_FUNC(p4msg_get_dict), 0);
1366
1392
  rb_define_method( cP4Msg, "to_s", RUBY_METHOD_FUNC(p4msg_get_text), 0);
1367
1393
 
1368
1394
  // P4::Progress class.
@@ -94,7 +94,17 @@ P4ClientApi::P4ClientApi() : ui( &specMgr )
94
94
  henv.GetTicketFile( ticketFile );
95
95
 
96
96
  if( (t = enviro->Get("P4TICKETS")) )
97
- ticketFile = t;
97
+ ticketFile = t;
98
+
99
+ //
100
+ // Load the current trust file. Start with the default, and then
101
+ // override it if P4TRUST is set.
102
+ //
103
+
104
+ henv.GetTrustFile( trustFile );
105
+
106
+ if( (t = enviro->Get("P4TICKETS")) )
107
+ trustFile = t;
98
108
 
99
109
  //
100
110
  // Load the current P4CHARSET if set.
@@ -192,6 +202,13 @@ P4ClientApi::SetTicketFile( const char *p )
192
202
  ticketFile = p;
193
203
  }
194
204
 
205
+ void
206
+ P4ClientApi::SetTrustFile( const char *p )
207
+ {
208
+ client.SetTrustFile( p );
209
+ trustFile = p;
210
+ }
211
+
195
212
  void
196
213
  P4ClientApi::SetDebug( int d )
197
214
  {
@@ -85,6 +85,7 @@ public:
85
85
  void SetProg( const char *p ) { prog = p; }
86
86
  void SetProtocol( const char *var, const char *val );
87
87
  void SetTicketFile( const char *p );
88
+ void SetTrustFile( const char *p );
88
89
  void SetUser( const char *u ) { client.SetUser( u ); }
89
90
  void SetVersion( const char *v ) { version = v; }
90
91
 
@@ -102,6 +103,7 @@ public:
102
103
  const StrPtr &GetPort() { return client.GetPort(); }
103
104
  const StrPtr &GetProg() { return prog; }
104
105
  const StrPtr &GetTicketFile() { return ticketFile; }
106
+ const StrPtr &GetTrustFile() { return trustFile; }
105
107
  const StrPtr &GetUser() { return client.GetUser(); }
106
108
  const StrPtr &GetVersion() { return version; }
107
109
 
@@ -235,6 +237,7 @@ private:
235
237
  StrBuf prog;
236
238
  StrBuf version;
237
239
  StrBuf ticketFile;
240
+ StrBuf trustFile;
238
241
  int depth;
239
242
  int debug;
240
243
  int exceptionLevel;
@@ -88,6 +88,21 @@ P4Error::GetText()
88
88
  return P4Utils::ruby_string( t.Text(), t.Length() );
89
89
  }
90
90
 
91
+ VALUE
92
+ P4Error::GetDict()
93
+ {
94
+ VALUE dictHash = rb_hash_new();
95
+ StrDict* pDict = error.GetDict();
96
+ StrRef key, val;
97
+ // suppress -Wpointer-arith
98
+ for (int i=0;pDict->GetVar(i,key,val) != 0;i++) {
99
+ rb_hash_aset( dictHash,
100
+ P4Utils::ruby_string(key.Text(), key.Length()),
101
+ P4Utils::ruby_string(val.Text(), val.Length()));
102
+ }
103
+ return dictHash;
104
+ }
105
+
91
106
  VALUE
92
107
  P4Error::Inspect()
93
108
  {
@@ -46,6 +46,7 @@ class P4Error
46
46
  VALUE GetGeneric();
47
47
  VALUE GetSeverity();
48
48
  VALUE GetText();
49
+ VALUE GetDict();
49
50
  VALUE Inspect();
50
51
 
51
52
  // Wrap as Ruby object of class pClass
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  class P4
2
- Version = VERSION = '2017.1.1653916'
2
+ Version = VERSION = '2017.1.1699426'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2017.1.1653916
4
+ version: 2017.1.1699426
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Perforce Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-26 00:00:00.000000000 Z
11
+ date: 2018-09-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby extensions to the C++ Perforce API.
14
14
  email: support@perforce.com