ffi-rzmq 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,8 +1,10 @@
1
+ before_install: sudo apt-get install libzmq3-dev
1
2
  script: bundle exec rspec
2
3
  language: ruby
3
4
  rvm:
4
5
  - 1.9.2
5
6
  - 1.9.3
7
+ - 2.0.0
6
8
  - ruby-head
7
9
  - jruby-18mode
8
10
  - jruby-19mode
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ == 1.0.1 / 20130318
2
+ * Fix for issue #77 was not included in 1.0.0 release by mistake.
3
+
4
+ * Add MIR 2.0.0 to travis runs.
5
+
6
+ * Add support for LAST_ENDPOINT and MULTICAST_HOPS to Socket#getsockopt.
7
+
1
8
  == 1.0.0 / 20130109
2
9
  * Fix for issue #74 (send_multiple improperly handled single part messages).
3
10
 
data/README.rdoc CHANGED
@@ -9,7 +9,7 @@ function interface). It's a pure ruby wrapper so this gem can be loaded
9
9
  and run by any ruby runtime that supports FFI. That's all of them:
10
10
  MRI 1.9.x, Rubinius and JRuby.
11
11
 
12
- This single gem supports 0mq 2.x and 3.1.x 0mq APIs. The 0mq project started
12
+ This single gem supports 0mq 2.2.x and 3.2.x 0mq APIs. The 0mq project started
13
13
  making backward-incompatible changes to the API with the 3.1.x release.
14
14
  The gem auto-configures itself to expose the API conforming to the loaded
15
15
  C library. 0mq API 3.0 is *not* supported; the 0mq community voted to
data/lib/ffi-rzmq/poll.rb CHANGED
@@ -127,7 +127,7 @@ module ZMQ
127
127
  @poll_items.delete(pollable)
128
128
  end
129
129
 
130
- def to_s inspect; end
130
+ def to_s; inspect; end
131
131
 
132
132
  private
133
133
 
@@ -703,7 +703,7 @@ module ZMQ
703
703
  # Disconnect the socket from the given +endpoint+.
704
704
  #
705
705
  def disconnect(endpoint)
706
- LibZMQ.zmq_disconnect(endpoint)
706
+ LibZMQ.zmq_disconnect(socket, endpoint)
707
707
  end
708
708
 
709
709
  # Version3 only
@@ -711,7 +711,7 @@ module ZMQ
711
711
  # Unbind the socket from the given +endpoint+.
712
712
  #
713
713
  def unbind(endpoint)
714
- LibZMQ.zmq_unbind(endpoint)
714
+ LibZMQ.zmq_unbind(socket, endpoint)
715
715
  end
716
716
 
717
717
 
@@ -731,10 +731,14 @@ module ZMQ
731
731
  # integer options
732
732
  [RECONNECT_IVL_MAX, RCVHWM, SNDHWM, RATE, RECOVERY_IVL, SNDBUF, RCVBUF, IPV4ONLY,
733
733
  ROUTER_BEHAVIOR, TCP_KEEPALIVE, TCP_KEEPALIVE_CNT,
734
- TCP_KEEPALIVE_IDLE, TCP_KEEPALIVE_INTVL, TCP_ACCEPT_FILTER].each { |option| @option_lookup[option] = 0 }
735
-
734
+ TCP_KEEPALIVE_IDLE, TCP_KEEPALIVE_INTVL, TCP_ACCEPT_FILTER, MULTICAST_HOPS
735
+ ].each { |option| @option_lookup[option] = 0 }
736
+
736
737
  # long long options
737
738
  [MAXMSGSIZE].each { |option| @option_lookup[option] = 1 }
739
+
740
+ # string options
741
+ [LAST_ENDPOINT].each { |option| @option_lookup[option] = 2 }
738
742
  end
739
743
 
740
744
  # these finalizer-related methods cannot live in the CommonSocketBehavior
@@ -1,3 +1,3 @@
1
1
  module ZMQ
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/spec/socket_spec.rb CHANGED
@@ -268,7 +268,17 @@ module ZMQ
268
268
  end
269
269
  end # context using option ZMQ::IPV4ONLY
270
270
 
271
-
271
+ context "using option ZMQ::LAST_ENDPOINT" do
272
+ it "should return last enpoint" do
273
+ random_port = bind_to_random_tcp_port(socket, max_tries = 500)
274
+ array = []
275
+ rc = socket.getsockopt(ZMQ::LAST_ENDPOINT, array)
276
+ ZMQ::Util.resultcode_ok?(rc).should == true
277
+ endpoint_regex = %r{\Atcp://(.*):(\d+)\0\z}
278
+ array[0].should =~ endpoint_regex
279
+ Integer(array[0][endpoint_regex, 2]).should == random_port
280
+ end
281
+ end
272
282
  end # version2? if/else block
273
283
 
274
284
 
data/spec/spec_helper.rb CHANGED
@@ -23,14 +23,6 @@ def version3?
23
23
  end
24
24
 
25
25
 
26
- SLEEP_SHORT = 0.1
27
- SLEEP_LONG = 0.3
28
-
29
- def delivery_sleep() sleep(SLEEP_SHORT); end
30
- def connect_sleep() sleep(SLEEP_SHORT); end
31
- def bind_sleep() sleep(SLEEP_LONG); end
32
- def thread_startup_sleep() sleep(1.0); end
33
-
34
26
  def connect_to_inproc(socket, endpoint)
35
27
  begin
36
28
  rc = socket.connect(endpoint)
metadata CHANGED
@@ -1,64 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-rzmq
3
3
  version: !ruby/object:Gem::Version
4
+ version: 1.0.1
4
5
  prerelease:
5
- version: 1.0.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chuck Remes
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-24 00:00:00.000000000 Z
12
+ date: 2013-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- prerelease: false
16
- requirement: !ruby/object:Gem::Requirement
15
+ type: :runtime
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ none: false
17
18
  requirements:
18
19
  - - ! '>='
19
20
  - !ruby/object:Gem::Version
20
21
  version: '0'
22
+ name: ffi
23
+ prerelease: false
24
+ requirement: !ruby/object:Gem::Requirement
21
25
  none: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
- none: false
28
- name: ffi
29
- type: :runtime
30
30
  - !ruby/object:Gem::Dependency
31
- prerelease: false
32
- requirement: !ruby/object:Gem::Requirement
31
+ type: :development
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ none: false
33
34
  requirements:
34
35
  - - ~>
35
36
  - !ruby/object:Gem::Version
36
37
  version: '2.6'
38
+ name: rspec
39
+ prerelease: false
40
+ requirement: !ruby/object:Gem::Requirement
37
41
  none: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
42
  requirements:
40
43
  - - ~>
41
44
  - !ruby/object:Gem::Version
42
45
  version: '2.6'
43
- none: false
44
- name: rspec
45
- type: :development
46
46
  - !ruby/object:Gem::Dependency
47
- prerelease: false
48
- requirement: !ruby/object:Gem::Requirement
47
+ type: :development
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ none: false
49
50
  requirements:
50
51
  - - ! '>='
51
52
  - !ruby/object:Gem::Version
52
53
  version: '0'
54
+ name: rake
55
+ prerelease: false
56
+ requirement: !ruby/object:Gem::Requirement
53
57
  none: false
54
- version_requirements: !ruby/object:Gem::Requirement
55
58
  requirements:
56
59
  - - ! '>='
57
60
  - !ruby/object:Gem::Version
58
61
  version: '0'
59
- none: false
60
- name: rake
61
- type: :development
62
62
  description: ! 'This gem wraps the ZeroMQ networking library using the ruby FFI (foreign
63
63
 
64
64
  function interface). It''s a pure ruby wrapper so this gem can be loaded
@@ -207,20 +207,20 @@ rdoc_options: []
207
207
  require_paths:
208
208
  - lib
209
209
  required_ruby_version: !ruby/object:Gem::Requirement
210
+ none: false
210
211
  requirements:
211
212
  - - ! '>='
212
213
  - !ruby/object:Gem::Version
213
214
  version: '0'
214
- none: false
215
215
  required_rubygems_version: !ruby/object:Gem::Requirement
216
+ none: false
216
217
  requirements:
217
218
  - - ! '>='
218
219
  - !ruby/object:Gem::Version
219
220
  version: '0'
220
- none: false
221
221
  requirements: []
222
222
  rubyforge_project: ffi-rzmq
223
- rubygems_version: 1.8.24
223
+ rubygems_version: 1.8.25
224
224
  signing_key:
225
225
  specification_version: 3
226
226
  summary: This gem wraps the ZeroMQ (0mq) networking library using Ruby FFI (foreign