ffi-rzmq-core 1.0.6 → 1.0.7

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
- SHA1:
3
- metadata.gz: 96d011bc8e933b61a4c64eaac4220eccc8adf85d
4
- data.tar.gz: 31c4e376ca5400c5fb44af9331328e405d0fc2b1
2
+ SHA256:
3
+ metadata.gz: dfb36c8fd3ba8ea7889a686282a1eea04fd42b6b418fb627a59136ebca5e9c60
4
+ data.tar.gz: 6351eccd6e2ca3e0c91a49e02672bbec65d4d33abd728e368a98abf3d975c9ca
5
5
  SHA512:
6
- metadata.gz: 91f118d04d3507fa041c60599d5a0d2e25b02f1464ab3765b9bb94102df4118c99ef442f58b8d809596e98b6db3efa9d24a6052e9543eeaa817f831bf4fd8474
7
- data.tar.gz: cfb7aaae1e8efd9776b6703e3750c605fbd6857f974e53afc24825828363698ee6f2d7f06786b43ae831bb750e0f72af0af7896ef92827897fba13890900f971
6
+ metadata.gz: 61f7bd2e38fe8025d8dd37e81e9872770c8ae367ec03305a5b155c4397503996f696af1f33987329ad2019041ddf17a4a1979df2cb0cb64e5c8bbb3852b8255c
7
+ data.tar.gz: 48c45585ef08d5a03cf76b3eb0e47cace36aacb686626bee1e2a55173b52c56ae858d5356736253d45b70b0702f69dd18e643dd5fb637e190121e78dbe652b1d
@@ -2,12 +2,10 @@ before_install: sudo apt-get install libzmq3-dev
2
2
  script: bundle exec rspec
3
3
  language: ruby
4
4
  rvm:
5
- - 1.9.3
6
- - 2.0.0
5
+ - 2.6.0
7
6
  - ruby-head
8
- - jruby-19mode
9
7
  - jruby-head
10
- - rbx-2.1.1
8
+ - rbx
11
9
 
12
10
  matrix:
13
11
  allow_failures:
@@ -0,0 +1,8 @@
1
+ == 1.0.7
2
+ * Provide a wrapper function for calling context termination. Zeromq 3.x
3
+ uses zmq_ctx_destroy to terminate a context. While this function exists
4
+ in Zeromq 4.x, it is deprecated. For 4.x, we prefer to use zmq_ctx_term.
5
+ When loading the library, we define a `terminate_context` method on the
6
+ module which defaults to using the 3.x function call. If the 4.x support
7
+ loads, then this method is overwritten to use the 4.x function call.
8
+
@@ -44,12 +44,18 @@ module LibZMQ
44
44
  ffi_lib(ZMQ_LIB_PATHS + %w{libzmq})
45
45
 
46
46
  rescue LoadError
47
- if ZMQ_LIB_PATHS.any? {|path|
48
- File.file? File.join(path, "libzmq.#{FFI::Platform::LIBSUFFIX}")}
47
+ # Failed to load the zmq library
48
+
49
+ found_libs = ZMQ_LIB_PATHS.find_all {|path| File.file? path }
50
+ if found_libs.any?
49
51
  warn "Unable to load this gem. The libzmq library exists, but cannot be loaded."
50
- warn "If this is Windows:"
51
- warn "- Check that you have MSVC runtime installed or statically linked"
52
- warn "- Check that your DLL is compiled for #{FFI::Platform::ADDRESS_SIZE} bit"
52
+ warn "libzmq library was found at:"
53
+ warn found_libs.inspect
54
+ if FFI::Platform::IS_WINDOWS
55
+ warn "On Windows:"
56
+ warn "- Check that you have MSVC runtime installed or statically linked"
57
+ warn "- Check that your DLL is compiled for #{FFI::Platform::ADDRESS_SIZE} bit"
58
+ end
53
59
  else
54
60
  warn "Unable to load this gem. The libzmq library (or DLL) could not be found."
55
61
  warn "If this is a Windows platform, make sure libzmq.dll is on the PATH."
@@ -123,4 +129,8 @@ module LibZMQ
123
129
  # Monitoring API
124
130
  attach_function :zmq_socket_monitor, [:pointer, :pointer, :int], :int, :blocking => true
125
131
 
132
+ # Wrapper function for context termination
133
+ def self.terminate_context(context)
134
+ zmq_ctx_destroy(context)
135
+ end
126
136
  end
@@ -14,4 +14,9 @@ module LibZMQ
14
14
  # Will return -1 with errno set to ENOSUP otherwise
15
15
  attach_function :zmq_curve_keypair, [:pointer, :pointer], :int, :blocking => true
16
16
 
17
+ # Wrapper function for context termination
18
+ def self.terminate_context(context)
19
+ zmq_ctx_term(context)
20
+ end
21
+
17
22
  end
@@ -1,3 +1,3 @@
1
1
  module LibZMQ
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
@@ -45,4 +45,27 @@ describe LibZMQ do
45
45
  expect(LibZMQ).to respond_to(:zmq_socket_monitor)
46
46
  end
47
47
 
48
+ if LibZMQ.version3?
49
+
50
+ describe '.terminate_context' do
51
+ it 'calls the 3.x zmq_ctx_destroy function' do
52
+ context_dbl = double('context')
53
+
54
+ expect(LibZMQ).to receive(:zmq_ctx_destroy).with(context_dbl)
55
+ LibZMQ.terminate_context(context_dbl)
56
+ end
57
+ end
58
+
59
+ elsif LibZMQ.version4?
60
+
61
+ describe '.terminate_context' do
62
+ it 'calls the 4.x zmq_ctx_destroy function' do
63
+ context_dbl = double('context')
64
+
65
+ expect(LibZMQ).to receive(:zmq_ctx_term).with(context_dbl)
66
+ LibZMQ.terminate_context(context_dbl)
67
+ end
68
+ end
69
+
70
+ end
48
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-rzmq-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Remes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2019-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -64,6 +64,7 @@ files:
64
64
  - ".gitignore"
65
65
  - ".travis.yml"
66
66
  - Gemfile
67
+ - History.txt
67
68
  - LICENSE
68
69
  - README.md
69
70
  - Rakefile
@@ -102,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
103
  version: '0'
103
104
  requirements: []
104
105
  rubyforge_project:
105
- rubygems_version: 2.6.8
106
+ rubygems_version: 2.7.3
106
107
  signing_key:
107
108
  specification_version: 4
108
109
  summary: This gem provides only the FFI wrapper for the ZeroMQ (0mq) networking library.