Commit 51fbf151 authored by Cédric Boutillier's avatar Cédric Boutillier

New upstream version 2.0.6

parent ff6dee37
before_install: sudo apt-get install libzmq3-dev
script: bundle exec rspec
script: ./travis_build_script.sh
language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.4.0
- ruby-head
- jruby-19mode
- jruby
- jruby-head
- rbx-2.1.1
- rbx
matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
- rvm: rbx
== 2.0.6
* Fix for uncaught exception. Strange case... somehow calling
`zmq_ctx_term` was returning nil, so when checking the result code it
would fail. No overrides a nil value with 0 so check passes.
* Update some JRuby-specific code to fetch a file descriptor value. API
changed from earlier versions, so code is updated to use new API. All
specs pass.
== 2.0.5
* Fix issue #123. Bundled gems were a bit outdated so upgraded to latest
rspec gem.
* Fix issue #124. Newer releases of libzmq are not exporting all symbols
to the global namespace so some lazy loading performed by FFI was
failing. Now force all symbols into global namespace.
* Fix "::Fixnum has been deprecated" warnings from MRI 2.4.x+.
* Force ffi-rzmq-core 1.0.6 or later as dependency.
== 2.0.4
* Screwed up the release managment. Had wrong version in version.rb. Fixed.
......
......@@ -69,6 +69,14 @@ on that gem to load and run this code, then this project also no longer
supports MRI 1.8.x. I recommend JRuby for the best performance and
stability.
The `Socket` and `Context` classes have finalizers which will
be called by the garbage collector when there are no more references.
However, these finalizers should not be relied upon to orderly close
your sockets and then the context. Finalizers run in a non-determinant
order, so the `Context` finalizer may run first which will hang the
program. To avoid this, make sure to close all sockets before the
program exits.
All features are implemented.
== BUILD STATUS:
......@@ -193,7 +201,7 @@ that activity. That DLL also requires that you copy libstdc++-6.dll and libgcc_s
(The MIT License)
Copyright (c) 2013 Chuck Remes
Copyright (c) 2013-2017 Chuck Remes
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
......
......@@ -21,7 +21,7 @@ and run by any ruby runtime that supports FFI. That's all of the major ones - MR
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.add_runtime_dependency "ffi-rzmq-core", [">= 1.0.1"]
s.add_development_dependency "rspec", ["~> 2.14"]
s.add_runtime_dependency "ffi-rzmq-core", [">= 1.0.6"]
s.add_development_dependency "rspec", ["~> 3.7"]
s.add_development_dependency "rake"
end
......@@ -66,6 +66,7 @@ end # module ZMQ
require 'ffi-rzmq-core'
# the order of files is important
require ZMQ.libpath(['.', "io_extensions"])
%w(util exceptions context message socket poll_items poll_item poll device version).each do |file|
require ZMQ.libpath(['ffi-rzmq', file])
end
......@@ -82,9 +82,9 @@ module ZMQ
def terminate
unless @context.nil? || @context.null?
remove_finalizer
rc = LibZMQ.zmq_ctx_destroy(@context)
rc = LibZMQ.zmq_ctx_term(@context)
@context = nil
rc
rc || 0
else
0
end
......@@ -129,7 +129,7 @@ module ZMQ
end
def self.close context, pid
Proc.new { LibZMQ.zmq_term context if !context.null? && Process.pid == pid }
Proc.new { LibZMQ.zmq_ctx_term context if !context.null? && Process.pid == pid }
end
end
......
require 'forwardable'
require 'io_extensions'
module ZMQ
class PollItem
......
module ZMQ
VERSION = "2.0.4"
VERSION = "2.0.6"
end
......@@ -10,7 +10,7 @@ class IO
when STDERR, $stderr
2
else
JRuby.reference(self).getOpenFile.getMainStream.getDescriptor.getChannel.getFDVal
JRuby.reference(self).getOpenFile().getFileno
end
end
else
......
--- !ruby/object:Gem::Specification
name: ffi-rzmq
version: !ruby/object:Gem::Version
version: 2.0.4
platform: ruby
authors:
- Chuck Remes
autorequire:
bindir: bin
cert_chain: []
date: 2015-01-28 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: ffi-rzmq-core
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: 1.0.1
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: 1.0.1
- !ruby/object:Gem::Dependency
name: rspec
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '2.14'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '2.14'
- !ruby/object:Gem::Dependency
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
description: |-
This gem wraps the ZeroMQ networking library using the ruby FFI (foreign
function interface). It's a pure ruby wrapper so this gem can be loaded
and run by any ruby runtime that supports FFI. That's all of the major ones - MRI, Rubinius and JRuby.
email:
- git@chuckremes.com
executables: []
extensions: []
extra_rdoc_files: []
files:
- ".bnsignore"
- ".gitignore"
- ".travis.yml"
- AUTHORS.txt
- Gemfile
- History.txt
- README.rdoc
- Rakefile
- examples/README.rdoc
- examples/latency_measurement.rb
- examples/local_lat.rb
- examples/local_lat_poll.rb
- examples/local_throughput.rb
- examples/pub.rb
- examples/publish_subscribe.rb
- examples/remote_lat.rb
- examples/remote_throughput.rb
- examples/repreq_over_curve.rb
- examples/reqrep_poll.rb
- examples/request_response.rb
- examples/sub.rb
- examples/throughput_measurement.rb
- examples/xreqxrep_poll.rb
- ext/README
- ffi-rzmq.gemspec
- lib/ffi-rzmq.rb
- lib/ffi-rzmq/context.rb
- lib/ffi-rzmq/device.rb
- lib/ffi-rzmq/exceptions.rb
- lib/ffi-rzmq/message.rb
- lib/ffi-rzmq/poll.rb
- lib/ffi-rzmq/poll_item.rb
- lib/ffi-rzmq/poll_items.rb
- lib/ffi-rzmq/socket.rb
- lib/ffi-rzmq/util.rb
- lib/ffi-rzmq/version.rb
- lib/io_extensions.rb
- spec/context_spec.rb
- spec/device_spec.rb
- spec/message_spec.rb
- spec/multipart_spec.rb
- spec/nonblocking_recv_spec.rb
- spec/poll_spec.rb
- spec/pushpull_spec.rb
- spec/reqrep_spec.rb
- spec/socket_spec.rb
- spec/spec_helper.rb
- spec/support/test.crt
- spec/support/test.key
- spec/util_spec.rb
homepage: http://github.com/chuckremes/ffi-rzmq
licenses:
- MIT
metadata: {}
post_install_message:
rdoc_options: []
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
rubyforge_project: ffi-rzmq
rubygems_version: 2.2.2
signing_key:
specification_version: 4
summary: This gem wraps the ZeroMQ (0mq) networking library using Ruby FFI (foreign
function interface).
test_files:
- spec/context_spec.rb
- spec/device_spec.rb
- spec/message_spec.rb
- spec/multipart_spec.rb
- spec/nonblocking_recv_spec.rb
- spec/poll_spec.rb
- spec/pushpull_spec.rb
- spec/reqrep_spec.rb
- spec/socket_spec.rb
- spec/spec_helper.rb
- spec/support/test.crt
- spec/support/test.key
- spec/util_spec.rb
......@@ -85,7 +85,7 @@ module ZMQ
it "should call the correct library function to terminate the context" do
ctx = Context.new
expect(LibZMQ).to receive(:zmq_ctx_destroy).with(ctx.pointer).and_return(0)
expect(LibZMQ).to receive(:zmq_ctx_term).with(ctx.pointer).and_return(0)
ctx.terminate
end
end # context terminate
......
......@@ -26,9 +26,9 @@ module ZMQ
front = @ctx.socket(ZMQ::PUSH)
front.bind(@front_endpoint)
@mutex.synchronize { @device_thread = true }
puts "create streamer device and running..."
puts "create streamer device and running..." if $DEBUG
Device.new(back, front)
puts "device exited"
puts "device exited" if $DEBUG
back.close
front.close
end
......@@ -40,7 +40,7 @@ module ZMQ
break if can_break
end
puts "broke out of wait_for_device loop"
puts "broke out of wait_for_device loop" if $DEBUG
end
it "should create a device without error given valid opts" do
......
......@@ -451,11 +451,11 @@ module ZMQ
end # posix platform
context "using option ZMQ::EVENTS" do
it "should return a mask of events as a Fixnum" do
it "should return a mask of events as an Integer" do
array = []
rc = socket.getsockopt(ZMQ::EVENTS, array)
expect(rc).to eq(0)
expect(array[0]).to be_a(Fixnum)
expect(array[0]).to be_a(Integer)
end
end
......
#/bin/bash
set -ev
bundle install
sudo apt-get -qq update
sudo apt-get install libtool pkg-config build-essential autoconf automake wget
git clone https://github.com/jedisct1/libsodium --branch stable
cd libsodium
./autogen.sh
./configure && make check
sudo make install
cd ..
VERSION="4.2.2"
BASE="zeromq-${VERSION}"
TARBALL="${BASE}.tar.gz"
wget https://github.com/zeromq/libzmq/releases/download/v$VERSION/$TARBALL
tar -xvf $TARBALL
cd $BASE
./autogen.sh
./configure && make check
sudo make install
sudo ldconfig
bundle exec rake spec
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment