czmq-ffi-gen 1.1.2 → 1.2.0

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
  SHA256:
3
- metadata.gz: 169a0222735a985f3d160c632f4976f2646a35dec219f68e1fa1203aad71190a
4
- data.tar.gz: 7123c785640b03258142a3843403d860a1fa9759306b5327a430952a200fc738
3
+ metadata.gz: 04e448a60ffba2ec6f7dbd771dbea9f79c6cb197de3eb8b92c7db0ef8d1d68bf
4
+ data.tar.gz: d549f1c0e1b7345654f4fd0455bd6b228c91f718478baeed42028dc2df76c191
5
5
  SHA512:
6
- metadata.gz: 5d030dea047ce7ee74836c1fecacbaf7b9fea658279233fa8e9b45b82699e8ea4b7009068e89b79044d67c8968377f90e54bc1c66cb271dfbde60fc250b1b381
7
- data.tar.gz: '0296af9112729a82198bec7bf89712f2b968fcfdf89f2053c293e319e01430d07b34f176dcab7a9ca6bc3533d68205f52d65305a8efd70940a5907b72fe6d714'
6
+ metadata.gz: 3dd9ea49ae737388e8f5a41143962cbf491b3c2999209b0d6efff0379f29a2c664ba14091ab8b6a44f3a68e928c12c33c94c48f30a3523188e1a81f59711f2bf
7
+ data.tar.gz: 680e72df5160b092fecd83125b3eab0e4272e2c20b83b9c27507e4116202c8eb7412266a163f733d59ef893920445dfa3693d04772c5a5d01b661f52005079ec
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ 1.2.0 (01/3/2025)
2
+ -----
3
+ * updated CZMQ low-level binding
4
+ * find libczmq/libzmq in /usr/lib and respect LD_LIBRARY_PATH
5
+ * add gem mutex_m as dependency to fix specs on Ruby 3.4
6
+
1
7
  1.1.2 (01/10/2024)
2
8
  -----
3
9
  * avoid warnings from FFI
@@ -269,6 +269,28 @@ module CZMQ
269
269
  result
270
270
  end
271
271
 
272
+ # Set the request username
273
+ #
274
+ # @param username [String, #to_s, nil]
275
+ # @return [void]
276
+ def set_username(username)
277
+ raise DestroyedError unless @ptr
278
+ self_p = @ptr
279
+ result = ::CZMQ::FFI.zhttp_request_set_username(self_p, username)
280
+ result
281
+ end
282
+
283
+ # Set the request password
284
+ #
285
+ # @param password [String, #to_s, nil]
286
+ # @return [void]
287
+ def set_password(password)
288
+ raise DestroyedError unless @ptr
289
+ self_p = @ptr
290
+ result = ::CZMQ::FFI.zhttp_request_set_password(self_p, password)
291
+ result
292
+ end
293
+
272
294
  # Match the path of the request.
273
295
  # Support wildcards with '%s' symbol inside the match string.
274
296
  # Matching wildcards until the next '/', '?' or '\0'.
@@ -124,6 +124,15 @@ module CZMQ
124
124
  __new ptr
125
125
  end
126
126
 
127
+ # Create a new zosc message from a string. This the same syntax as
128
+ # zosc_create but written as a single line string.
129
+ # @param oscstring [String, #to_s, nil]
130
+ # @return [CZMQ::Zosc]
131
+ def self.fromstring(oscstring)
132
+ ptr = ::CZMQ::FFI.zosc_fromstring(oscstring)
133
+ __new ptr
134
+ end
135
+
127
136
  # Create a new zosc message from the given format and arguments.
128
137
  # The format type tags are as follows:
129
138
  # i - 32bit integer
@@ -307,6 +316,17 @@ module CZMQ
307
316
  result
308
317
  end
309
318
 
319
+ # Return a string describing the the OSC message. The returned string must be freed by the caller.
320
+ #
321
+ # @return [::FFI::AutoPointer]
322
+ def dump()
323
+ raise DestroyedError unless @ptr
324
+ self_p = @ptr
325
+ result = ::CZMQ::FFI.zosc_dump(self_p)
326
+ result = ::FFI::AutoPointer.new(result, LibC.method(:free))
327
+ result
328
+ end
329
+
310
330
  # Dump OSC message to stdout, for debugging and tracing.
311
331
  #
312
332
  # @return [void]
@@ -145,7 +145,7 @@ module CZMQ
145
145
 
146
146
  # Connects process stdin with a readable ('>', connect) zeromq socket. If
147
147
  # socket argument is NULL, zproc creates own managed pair of inproc
148
- # sockets. The writable one is then accessbile via zproc_stdin method.
148
+ # sockets. The writable one is then accessible via zproc_stdin method.
149
149
  #
150
150
  # @param socket [::FFI::Pointer, #to_ptr]
151
151
  # @return [void]
@@ -158,7 +158,7 @@ module CZMQ
158
158
 
159
159
  # Connects process stdout with a writable ('@', bind) zeromq socket. If
160
160
  # socket argument is NULL, zproc creates own managed pair of inproc
161
- # sockets. The readable one is then accessbile via zproc_stdout method.
161
+ # sockets. The readable one is then accessible via zproc_stdout method.
162
162
  #
163
163
  # @param socket [::FFI::Pointer, #to_ptr]
164
164
  # @return [void]
@@ -171,7 +171,7 @@ module CZMQ
171
171
 
172
172
  # Connects process stderr with a writable ('@', bind) zeromq socket. If
173
173
  # socket argument is NULL, zproc creates own managed pair of inproc
174
- # sockets. The readable one is then accessbile via zproc_stderr method.
174
+ # sockets. The readable one is then accessible via zproc_stderr method.
175
175
  #
176
176
  # @param socket [::FFI::Pointer, #to_ptr]
177
177
  # @return [void]
@@ -21,12 +21,21 @@ module CZMQ
21
21
  end
22
22
 
23
23
  begin
24
- lib_name = 'libczmq'
25
- lib_dirs = ['/usr/local/lib', '/opt/local/lib', '/usr/lib64']
26
- env_name = "#{lib_name.upcase}_PATH"
27
- lib_dirs = [*ENV[env_name].split(':'), *lib_dirs] if ENV[env_name]
28
- lib_paths = lib_dirs.map { |path| "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}" }
29
- ffi_lib lib_paths + [lib_name]
24
+ lib_name = 'libczmq'
25
+ major_version = '4'
26
+ lib_dirs = ['/usr/local/lib', '/opt/local/lib', '/usr/lib64', '/usr/lib']
27
+ lib_dirs = [*ENV['LD_LIBRARY_PATH'].split(':'), *lib_dirs] if ENV['LD_LIBRARY_PATH']
28
+ lib_dirs = [*ENV["#{lib_name.upcase}_PATH"].split(':'), *lib_dirs] if ENV["#{lib_name.upcase}_PATH"]
29
+ lib_paths = lib_dirs.map do |path|
30
+ [
31
+ "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}",
32
+ "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}.#{major_version}"
33
+ ]
34
+ end.flatten
35
+
36
+ lib_paths.concat [lib_name, "#{lib_name}.#{::FFI::Platform::LIBSUFFIX}.#{major_version}"]
37
+
38
+ ffi_lib lib_paths
30
39
  @available = true
31
40
  rescue LoadError
32
41
  warn ""
@@ -962,6 +971,8 @@ module CZMQ
962
971
  attach_function :zhttp_request_set_content, [:pointer, :pointer], :void, **opts
963
972
  attach_function :zhttp_request_set_content_const, [:pointer, :string], :void, **opts
964
973
  attach_function :zhttp_request_reset_content, [:pointer], :void, **opts
974
+ attach_function :zhttp_request_set_username, [:pointer, :string], :void, **opts
975
+ attach_function :zhttp_request_set_password, [:pointer, :string], :void, **opts
965
976
  attach_function :zhttp_request_match, [:pointer, :string, :string, :varargs], :bool, **opts
966
977
  attach_function :zhttp_request_test, [:bool], :void, **opts
967
978
 
@@ -989,6 +1000,7 @@ module CZMQ
989
1000
  attach_function :zosc_new, [:string], :pointer, **opts
990
1001
  attach_function :zosc_fromframe, [:pointer], :pointer, **opts
991
1002
  attach_function :zosc_frommem, [:pointer, :size_t], :pointer, **opts
1003
+ attach_function :zosc_fromstring, [:string], :pointer, **opts
992
1004
  attach_function :zosc_create, [:string, :string, :varargs], :pointer, **opts
993
1005
  attach_function :zosc_destroy, [:pointer], :void, **opts
994
1006
  attach_function :zosc_size, [:pointer], :size_t, **opts
@@ -1001,6 +1013,7 @@ module CZMQ
1001
1013
  attach_function :zosc_pack, [:pointer], :pointer, **opts
1002
1014
  attach_function :zosc_packx, [:pointer], :pointer, **opts
1003
1015
  attach_function :zosc_unpack, [:pointer], :pointer, **opts
1016
+ attach_function :zosc_dump, [:pointer], :pointer, **opts
1004
1017
  attach_function :zosc_print, [:pointer], :void, **opts
1005
1018
  attach_function :zosc_is, [:pointer], :bool, **opts
1006
1019
  attach_function :zosc_first, [:pointer, :pointer], :pointer, **opts
@@ -1,5 +1,5 @@
1
1
  module CZMQ
2
2
  module FFI
3
- GEM_VERSION = "1.1.2"
3
+ GEM_VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -3,11 +3,21 @@
3
3
  module CZMQ::FFI::LibZMQ
4
4
  extend ::FFI::Library
5
5
 
6
- lib_name = 'libzmq'
7
- lib_dirs = ['/usr/local/lib', '/opt/local/lib', '/usr/lib64']
8
- lib_dirs = [*ENV['LIBZMQ_PATH'].split(':'), *lib_dirs] if ENV['LIBZMQ_PATH']
9
- lib_paths = lib_dirs.map { |path| "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}" }
10
- ffi_lib lib_paths + [lib_name]
6
+ lib_name = 'libzmq'
7
+ major_version = '5'
8
+ lib_dirs = ['/usr/local/lib', '/opt/local/lib', '/usr/lib64', '/usr/lib']
9
+ lib_dirs = [*ENV['LD_LIBRARY_PATH'].split(':'), *lib_dirs] if ENV['LD_LIBRARY_PATH']
10
+ lib_dirs = [*ENV["#{lib_name.upcase}_PATH"].split(':'), *lib_dirs] if ENV["#{lib_name.upcase}_PATH"]
11
+ lib_paths = lib_dirs.map do |path|
12
+ [
13
+ "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}",
14
+ "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}.#{major_version}"
15
+ ]
16
+ end.flatten
17
+
18
+ lib_paths.concat [lib_name, "#{lib_name}.#{::FFI::Platform::LIBSUFFIX}.#{major_version}"]
19
+
20
+ ffi_lib lib_paths
11
21
 
12
22
  opts = {
13
23
  blocking: true # only necessary on MRI to deal with the GIL.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: czmq-ffi-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
10
+ date: 2025-01-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ffi
@@ -66,7 +65,20 @@ dependencies:
66
65
  - - ">="
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
69
- description:
68
+ - !ruby/object:Gem::Dependency
69
+ name: mutex_m
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
70
82
  email:
71
83
  - paddor@gmail.com
72
84
  executables: []
@@ -131,7 +143,6 @@ metadata:
131
143
  source_code_uri: https://github.com/paddor/czmq-ffi-gen
132
144
  changelog_uri: https://github.com/paddor/czmq-ffi-gen/blob/master/CHANGES.md
133
145
  msys2_mingw_dependencies: czmq
134
- post_install_message:
135
146
  rdoc_options: []
136
147
  require_paths:
137
148
  - lib
@@ -146,8 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
157
  - !ruby/object:Gem::Version
147
158
  version: '0'
148
159
  requirements: []
149
- rubygems_version: 3.4.17
150
- signing_key:
160
+ rubygems_version: 3.6.2
151
161
  specification_version: 4
152
162
  summary: Generated low-level Ruby binding for CZMQ
153
163
  test_files: []