p4ruby 2024.2.2682777 → 2024.2.2736761
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +2 -2
- data/ext/P4/extconf.rb +4 -4
- data/ext/P4/p4.cpp +9 -0
- data/ext/P4/p4clientapi.cpp +8 -0
- data/ext/P4/p4clientapi.h +1 -0
- data/lib/P4/version.rb +1 -1
- data/lib/P4.rb +26 -0
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 910e5f4fc5bc61dab363293a7015cf5f1376892608a882330d460f4f57356241
|
4
|
+
data.tar.gz: af44131f64be90767cafa778fb5cd5d83d6fd95fd18d86fb8ca20bcfdc98039a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 464ebd340513b8404852b745ffe7c32e77e401b394de0cc714a88384cc64061464fd3806ea1f606957c5321fe15ba896de7a37e0bb9aa57b105456856f7d76f7
|
7
|
+
data.tar.gz: cc10d024bd6b63db5f3d93dfc723d217e88945fc412472bbe662998f906b44427b323f75e35d74eafb3306e7a5ec73e4315aaa6ae30fcf91a268d2f553422884
|
data/LICENSE.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2025, Perforce Software, Inc. All rights reserved.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without
|
4
4
|
modification, are permitted provided that the following conditions are met:
|
@@ -32,7 +32,7 @@ this program.
|
|
32
32
|
|
33
33
|
P4/P4API License
|
34
34
|
-----------------------
|
35
|
-
Copyright (c) 1995-
|
35
|
+
Copyright (c) 1995-2025, Perforce Software, Inc.
|
36
36
|
All rights reserved.
|
37
37
|
|
38
38
|
Redistribution and use in source and binary forms, with or without
|
data/ext/P4/extconf.rb
CHANGED
@@ -454,7 +454,7 @@ def p4_platform_label
|
|
454
454
|
# There are too many permutations of Windows p4api, to automate.
|
455
455
|
raise 'Automatic fetching of p4api from perforce FTP is not supported on Windows'
|
456
456
|
when /darwin19|darwin[2-9][0-9]/
|
457
|
-
"
|
457
|
+
"macosx12#{p4_cpu(:darwin)}"
|
458
458
|
when /darwin/
|
459
459
|
"darwin90#{p4_cpu(:darwin)}"
|
460
460
|
when /solaris/
|
@@ -484,7 +484,7 @@ def filename
|
|
484
484
|
filename = 'p4api-openssl1.1.1.zip'
|
485
485
|
when /1.0/
|
486
486
|
filename = 'p4api-openssl1.0.2.zip'
|
487
|
-
when /3
|
487
|
+
when /3.*/
|
488
488
|
filename = 'p4api-openssl3.zip'
|
489
489
|
end
|
490
490
|
end
|
@@ -493,7 +493,7 @@ def filename
|
|
493
493
|
case openssl_number.to_s
|
494
494
|
when /1.1/
|
495
495
|
filename = 'p4api-openssl1.1.1.tgz'
|
496
|
-
when /3
|
496
|
+
when /3.*/
|
497
497
|
filename = 'p4api-openssl3.tgz'
|
498
498
|
end
|
499
499
|
end
|
@@ -505,7 +505,7 @@ def filename
|
|
505
505
|
filename = 'p4api-glibc2.3-openssl1.1.1.tgz'
|
506
506
|
when /1.0/
|
507
507
|
filename = 'p4api-glibc2.3-openssl1.0.2.tgz'
|
508
|
-
when /3
|
508
|
+
when /3.*/
|
509
509
|
filename = 'p4api-glibc2.3-openssl3.tgz'
|
510
510
|
end
|
511
511
|
end
|
data/ext/P4/p4.cpp
CHANGED
@@ -333,6 +333,14 @@ static VALUE p4_set_evar( VALUE self, VALUE var, VALUE val )
|
|
333
333
|
return Qtrue;
|
334
334
|
}
|
335
335
|
|
336
|
+
static VALUE p4_set_var( VALUE self, VALUE var, VALUE val )
|
337
|
+
{
|
338
|
+
P4ClientApi *p4;
|
339
|
+
Data_Get_Struct( self, P4ClientApi, p4 );
|
340
|
+
p4->SetVar( StringValuePtr( var ), StringValuePtr( val ) );
|
341
|
+
return Qtrue;
|
342
|
+
}
|
343
|
+
|
336
344
|
static VALUE p4_get_host( VALUE self )
|
337
345
|
{
|
338
346
|
P4ClientApi *p4;
|
@@ -1366,6 +1374,7 @@ void Init_P4()
|
|
1366
1374
|
rb_define_method( cP4, "enviro_file=", RUBY_METHOD_FUNC(p4_set_enviro_file), 1);
|
1367
1375
|
rb_define_method( cP4, "evar", RUBY_METHOD_FUNC(p4_get_evar) , 1 );
|
1368
1376
|
rb_define_method( cP4, "set_evar", RUBY_METHOD_FUNC(p4_set_evar) , 2 );
|
1377
|
+
rb_define_method( cP4, "set_var", RUBY_METHOD_FUNC(p4_set_var) , 2 );
|
1369
1378
|
rb_define_method( cP4, "host", RUBY_METHOD_FUNC(p4_get_host) , 0 );
|
1370
1379
|
rb_define_method( cP4, "host=", RUBY_METHOD_FUNC(p4_set_host) , 1 );
|
1371
1380
|
rb_define_method( cP4, "ignore_file",RUBY_METHOD_FUNC(p4_get_ignore) , 0 );
|
data/ext/P4/p4clientapi.cpp
CHANGED
@@ -151,6 +151,14 @@ P4ClientApi::SetEVar( const char *var, const char *val )
|
|
151
151
|
client.SetEVar( sVar, sVal );
|
152
152
|
}
|
153
153
|
|
154
|
+
void
|
155
|
+
P4ClientApi::SetVar( const char *var, const char *val )
|
156
|
+
{
|
157
|
+
StrRef sVar( var );
|
158
|
+
StrRef sVal( val );
|
159
|
+
client.SetVar( sVar, sVal );
|
160
|
+
}
|
161
|
+
|
154
162
|
const StrPtr *
|
155
163
|
P4ClientApi::GetEVar( const char *var )
|
156
164
|
{
|
data/ext/P4/p4clientapi.h
CHANGED
@@ -74,6 +74,7 @@ public:
|
|
74
74
|
void SetCwd( const char *c );
|
75
75
|
void SetEnviroFile( const char *c );
|
76
76
|
void SetEVar( const char *var, const char *val );
|
77
|
+
void SetVar( const char *var, const char *val );
|
77
78
|
void SetHost( const char *h ) { client.SetHost( h ); }
|
78
79
|
void SetIgnoreFile( const char *f ) { client.SetIgnoreFile( f ); }
|
79
80
|
void SetMaxResults( int v ) { maxResults = v; }
|
data/lib/P4/version.rb
CHANGED
data/lib/P4.rb
CHANGED
@@ -33,6 +33,32 @@
|
|
33
33
|
#*******************************************************************************
|
34
34
|
|
35
35
|
require 'P4/version'
|
36
|
+
require 'fiddle'
|
37
|
+
|
38
|
+
#
|
39
|
+
# Ruby 3.4 introduced a change affecting DLL loading behavior, which impacts
|
40
|
+
# how dependent DLLs are resolved. Specifically, libwinpthread-1.dll is no
|
41
|
+
# longer automatically loaded from ruby_builtin_dlls, causing potential failures
|
42
|
+
# in extensions relying on it.
|
43
|
+
#
|
44
|
+
# To address this, we must explicitly define the DLL path for libwinpthread-1.dll
|
45
|
+
# before loading dependent libraries in windows.
|
46
|
+
#
|
47
|
+
if Gem.win_platform?
|
48
|
+
dll_path = File.join(RbConfig::CONFIG['bindir'], 'ruby_builtin_dlls', 'libwinpthread-1.dll')
|
49
|
+
|
50
|
+
if File.exist?(dll_path)
|
51
|
+
begin
|
52
|
+
Fiddle.dlopen(dll_path)
|
53
|
+
rescue Fiddle::DLError => e
|
54
|
+
puts "Failed to load #{dll_path}: #{e.message}"
|
55
|
+
exit 1
|
56
|
+
end
|
57
|
+
else
|
58
|
+
puts "Error: DLL not found at #{dll_path}"
|
59
|
+
exit 1
|
60
|
+
end
|
61
|
+
end
|
36
62
|
|
37
63
|
#
|
38
64
|
# Get the bulk of the definition of the P4 class from the API interface.
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: p4ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2024.2.
|
4
|
+
version: 2024.2.2736761
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perforce Software, Inc.
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-19 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Ruby extensions to the C++ Perforce API.
|
14
13
|
email: support@perforce.com
|
@@ -51,7 +50,6 @@ licenses:
|
|
51
50
|
- MIT
|
52
51
|
metadata:
|
53
52
|
documentation_uri: https://www.perforce.com/manuals/p4ruby/Content/P4Ruby/Home-p4ruby.html
|
54
|
-
post_install_message:
|
55
53
|
rdoc_options: []
|
56
54
|
require_paths:
|
57
55
|
- lib
|
@@ -66,8 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
64
|
- !ruby/object:Gem::Version
|
67
65
|
version: '0'
|
68
66
|
requirements: []
|
69
|
-
rubygems_version: 3.
|
70
|
-
signing_key:
|
67
|
+
rubygems_version: 3.6.6
|
71
68
|
specification_version: 4
|
72
69
|
summary: Ruby extensions to the C++ Perforce API
|
73
70
|
test_files: []
|