czmq-ffi-gen 0.8.0 → 0.8.1

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: 40d4556bb0a5a5c7ba0aafa6d6bc34ec4eb4487f
4
- data.tar.gz: b58af5fa24fce796084d8657c5fab6ebb1532f3f
3
+ metadata.gz: cc384e8c7226d8c4ac3fff21ed42d85c7ae4bc8a
4
+ data.tar.gz: 6e01c0d2750f9e0182687abd20c7653500694447
5
5
  SHA512:
6
- metadata.gz: 2035e8506a6f87e614c2cf97ccf8df9e84ae7645d6df8e1c750130889cc6ff2ee082df24dbb5e635493b3252e09a313a765010e33f6832f7612b02f861ed1b70
7
- data.tar.gz: bde5b181e74601897dd2f200c745ce23ce57a1fecda7d31b3c524772de8cca3c87cb34ddb62966781cf4fb175c9ab812fc01d93f6bd2c2b26406164cc1608c13
6
+ metadata.gz: c9d1c8a296b36d67b4e6569e45cb1372f57a60d49a9f8c46be14cdb8182755f3c11ebcbdb67c5d36248c82feab53cab6e633d38a2924144a288261d2bb12f65d
7
+ data.tar.gz: 09a8772b377504f00d0a6f2a7f9553ccef076e5dbbb02dd94c07591a10547e6f40b1d9221aebe06be86fe04177488f8b37fba8085bd5df65ef1accad93e87ff9
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
1
+ 0.8.1 (03/29/2016)
2
+ -----
3
+ * provide CZMQ::FFI::ZMQ_VERSION
4
+ * rename CZMQ::FFI::LIBRARY_VERSION to CZMQ::FFI::CZMQ_VERSION
5
+ * new module CZMQ::FFI::LibZMQ which is the sole place to interact directly
6
+ with the ZMQ library
7
+
1
8
  0.8.0 (03/27/2016)
2
9
  -----
3
10
  * upgrade CZMQ low-level binding to
@@ -1,26 +1,12 @@
1
1
  # This is only used to be able to read get the last ZMQ error.
2
2
  module CZMQ::FFI::Errors
3
- extend ::FFI::Library
4
-
5
- lib_name = 'libzmq'
6
- lib_paths = ['/usr/local/lib', '/opt/local/lib', '/usr/lib64']
7
- .map { |path| "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}" }
8
- ffi_lib lib_paths + [lib_name]
9
-
10
- opts = {
11
- blocking: true # only necessary on MRI to deal with the GIL.
12
- }
13
-
14
- attach_function :zmq_strerror, [:int], :string, **opts
15
- attach_function :zmq_errno, [], :int, **opts
16
-
17
3
  # @return [String] error code of the last (ZMQ) error
18
4
  def self.errno
19
- zmq_errno
5
+ CZMQ::FFI::LibZMQ.zmq_errno
20
6
  end
21
7
 
22
8
  # @return [String] the string representation of the last (ZMQ) error
23
9
  def self.strerror
24
- zmq_strerror(zmq_errno)
10
+ CZMQ::FFI::LibZMQ.zmq_strerror(zmq_errno)
25
11
  end
26
12
  end
@@ -1,5 +1,5 @@
1
1
  module CZMQ
2
2
  module FFI
3
- GEM_VERSION = "0.8.0"
3
+ GEM_VERSION = "0.8.1"
4
4
  end
5
5
  end
@@ -0,0 +1,18 @@
1
+ # Bare minimum to get some things directly from the ZMQ library itself
2
+ # (without the CZMQ wrapper).
3
+ module CZMQ::FFI::LibZMQ
4
+ extend ::FFI::Library
5
+
6
+ lib_name = 'libzmq'
7
+ lib_paths = ['/usr/local/lib', '/opt/local/lib', '/usr/lib64']
8
+ .map { |path| "#{path}/#{lib_name}.#{::FFI::Platform::LIBSUFFIX}" }
9
+ ffi_lib lib_paths + [lib_name]
10
+
11
+ opts = {
12
+ blocking: true # only necessary on MRI to deal with the GIL.
13
+ }
14
+
15
+ attach_function :zmq_strerror, [:int], :string, **opts
16
+ attach_function :zmq_errno, [], :int, **opts
17
+ attach_function :zmq_version, [:pointer, :pointer, :pointer], :void, **opts
18
+ end
@@ -0,0 +1,19 @@
1
+ require_relative "gem_version"
2
+ require_relative "libzmq"
3
+
4
+ module CZMQ
5
+ module FFI
6
+ # CZMQ library version
7
+ CZMQ_VERSION = VERSION
8
+
9
+ # @deprecated Use {CZMQ_VERSION} instead.
10
+ LIBRARY_VERSION = CZMQ_VERSION
11
+
12
+ # ZMQ library version
13
+ ZMQ_VERSION = begin
14
+ version = Array.new(3) { ::FFI::MemoryPointer.new(:int) }
15
+ LibZMQ.zmq_version(*version)
16
+ version.map { |n| n.get_int(0) }.join(".")
17
+ end
18
+ end
19
+ end
data/lib/czmq-ffi-gen.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require_relative "czmq-ffi-gen/czmq/ffi"
2
- require_relative "czmq-ffi-gen/gem_version"
3
- require_relative "czmq-ffi-gen/library_version"
2
+ require_relative "czmq-ffi-gen/versions"
4
3
  require_relative "czmq-ffi-gen/errors"
5
4
  require_relative "czmq-ffi-gen/signals"
6
5
  require_relative "czmq-ffi-gen/legacy"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: czmq-ffi-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-27 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -123,8 +123,9 @@ files:
123
123
  - lib/czmq-ffi-gen/errors.rb
124
124
  - lib/czmq-ffi-gen/gem_version.rb
125
125
  - lib/czmq-ffi-gen/legacy.rb
126
- - lib/czmq-ffi-gen/library_version.rb
126
+ - lib/czmq-ffi-gen/libzmq.rb
127
127
  - lib/czmq-ffi-gen/signals.rb
128
+ - lib/czmq-ffi-gen/versions.rb
128
129
  homepage: https://github.com/paddor/czmq-ffi-gen
129
130
  licenses:
130
131
  - ISC
@@ -1,5 +0,0 @@
1
- module CZMQ
2
- module FFI
3
- LIBRARY_VERSION = VERSION
4
- end
5
- end