Hello community,

here is the log from the commit of package rubygem-nio4r for openSUSE:Factory 
checked in at 2018-05-03 12:34:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-nio4r (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-nio4r.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-nio4r"

Thu May  3 12:34:58 2018 rev:5 rq:603564 version:2.3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-nio4r/rubygem-nio4r.changes      
2018-02-12 10:13:35.513014684 +0100
+++ /work/SRC/openSUSE:Factory/.rubygem-nio4r.new/rubygem-nio4r.changes 
2018-05-03 12:35:08.954366382 +0200
@@ -1,0 +2,29 @@
+Thu May  3 00:11:59 UTC 2018 - [email protected]
+
+- updated to version 2.3.1
+ see installed CHANGES.md
+
+  ## 2.3.1 (2018-05-03)
+  
+  * [#188](https://github.com/socketry/nio4r/pull/188)
+    Fix remove interests
+    ([@ioquatix])
+
+-------------------------------------------------------------------
+Mon Apr 16 16:36:55 UTC 2018 - [email protected]
+
+- Only build against ruby versions 2.3.x, 2.4.x, and 2.5.x
+
+-------------------------------------------------------------------
+Tue Mar 20 10:12:05 UTC 2018 - [email protected]
+
+- updated to version 2.3.0
+ see installed CHANGES.md
+
+  ## 2.3.0 (2018-03-15)
+  
+  * [#183](https://github.com/socketry/nio4r/pull/183)
+    Allow `Monitor#interests` to be nil
+    ([@ioquatix])
+
+-------------------------------------------------------------------

Old:
----
  nio4r-2.2.0.gem

New:
----
  nio4r-2.3.1.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-nio4r.spec ++++++
--- /var/tmp/diff_new_pack.BSo77X/_old  2018-05-03 12:35:09.902332606 +0200
+++ /var/tmp/diff_new_pack.BSo77X/_new  2018-05-03 12:35:09.902332606 +0200
@@ -24,10 +24,16 @@
 #
 
 Name:           rubygem-nio4r
-Version:        2.2.0
+Version:        2.3.1
 Release:        0
 %define mod_name nio4r
 %define mod_full_name %{mod_name}-%{version}
+# MANUAL
+%if 0%{?suse_version} && 0%{?suse_version} < 1330
+%define rb_build_versions ruby23 ruby24 ruby25
+%define rb_build_ruby_abi ruby:2.3.0 ruby:2.4.0 ruby:2.5.0
+%endif
+# /MANUAL
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  %{rubydevel >= 2.2.2}
 BuildRequires:  %{rubygem gem2rpm}

++++++ gem2rpm.yml ++++++
--- /var/tmp/diff_new_pack.BSo77X/_old  2018-05-03 12:35:09.938331323 +0200
+++ /var/tmp/diff_new_pack.BSo77X/_new  2018-05-03 12:35:09.938331323 +0200
@@ -71,3 +71,9 @@
 ---
 :sources:
   - rubygem-nio4r-rpmlintrc 
+
+:preamble: |-
+    %if 0%{?suse_version} && 0%{?suse_version} < 1330
+    %define rb_build_versions ruby23 ruby24 ruby25
+    %define rb_build_ruby_abi ruby:2.3.0 ruby:2.4.0 ruby:2.5.0
+    %endif

++++++ nio4r-2.2.0.gem -> nio4r-2.3.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.travis.yml new/.travis.yml
--- old/.travis.yml     2017-12-27 17:33:22.000000000 +0100
+++ new/.travis.yml     2018-05-03 01:15:13.000000000 +0200
@@ -13,7 +13,7 @@
     - master
 
 rvm:
-  - jruby-9.1.15.0 # latest stable
+  - jruby-9.1.17.0 # latest stable
   - 2.2.7
   - 2.3.4
   - 2.4.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGES.md new/CHANGES.md
--- old/CHANGES.md      2017-12-27 17:33:22.000000000 +0100
+++ new/CHANGES.md      2018-05-03 01:15:13.000000000 +0200
@@ -1,3 +1,15 @@
+## 2.3.1 (2018-05-03)
+
+* [#188](https://github.com/socketry/nio4r/pull/188)
+  Fix remove interests
+  ([@ioquatix])
+
+## 2.3.0 (2018-03-15)
+
+* [#183](https://github.com/socketry/nio4r/pull/183)
+  Allow `Monitor#interests` to be nil
+  ([@ioquatix])
+
 ## 2.2.0 (2017-12-27)
 
 * [#151](https://github.com/socketry/nio4r/pull/151)
@@ -206,3 +218,4 @@
 [@larskanis]: https://github.com/larskanis
 [@HoneyryderChuck]: https://github.com/HoneyryderChuck
 [@tompng]: https://github.com/tompng
+[@ioquatix]: https://github.com/ioquatix
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/LICENSE.txt new/LICENSE.txt
--- old/LICENSE.txt     2017-12-27 17:33:22.000000000 +0100
+++ new/LICENSE.txt     2018-05-03 01:15:13.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright (c) 2011-2017 Tony Arcieri
+Copyright (c) 2011-2018 Tony Arcieri
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2017-12-27 17:33:22.000000000 +0100
+++ new/README.md       2018-05-03 01:15:13.000000000 +0200
@@ -95,7 +95,7 @@
 
 ## License
 
-Copyright (c) 2011-2017 Tony Arcieri. Distributed under the MIT License.
+Copyright (c) 2011-2018 Tony Arcieri. Distributed under the MIT License.
 See [LICENSE.txt] for further details.
 
 Includes libev 4.24. Copyright (c) 2007-2016 Marc Alexander Lehmann.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ext/nio4r/monitor.c new/ext/nio4r/monitor.c
--- old/ext/nio4r/monitor.c     2017-12-27 17:33:22.000000000 +0100
+++ new/ext/nio4r/monitor.c     2018-05-03 01:15:13.000000000 +0200
@@ -111,7 +111,9 @@
        object where it originally came from */
     monitor->selector = selector;
 
-    ev_io_start(selector->ev_loop, &monitor->ev_io);
+    if (monitor->interests) {
+      ev_io_start(selector->ev_loop, &monitor->ev_io);
+    }
 
     return Qnil;
 }
@@ -127,7 +129,7 @@
 
     if(selector != Qnil) {
         /* if ev_loop is 0, it means that the loop has been stopped already 
(see NIO_Selector_shutdown) */
-        if(monitor->selector->ev_loop != 0) {
+        if(monitor->interests && monitor->selector->ev_loop) {
           ev_io_stop(monitor->selector->ev_loop, &monitor->ev_io);
         }
 
@@ -163,7 +165,11 @@
 
 static VALUE NIO_Monitor_set_interests(VALUE self, VALUE interests)
 {
-    NIO_Monitor_update_interests(self, NIO_Monitor_symbol2interest(interests));
+    if(NIL_P(interests)) {
+        NIO_Monitor_update_interests(self, 0);
+    } else {
+        NIO_Monitor_update_interests(self, 
NIO_Monitor_symbol2interest(interests));
+    }
 
     return rb_ivar_get(self, rb_intern("interests"));
 }
@@ -172,8 +178,8 @@
     struct NIO_Monitor *monitor;
     Data_Get_Struct(self, struct NIO_Monitor, monitor);
 
-    monitor->interests |= NIO_Monitor_symbol2interest(interest);
-    NIO_Monitor_update_interests(self, monitor->interests);
+    interest = monitor->interests | NIO_Monitor_symbol2interest(interest);
+    NIO_Monitor_update_interests(self, interest);
 
     return rb_ivar_get(self, rb_intern("interests"));
 }
@@ -182,8 +188,8 @@
     struct NIO_Monitor *monitor;
     Data_Get_Struct(self, struct NIO_Monitor, monitor);
 
-    monitor->interests &= ~NIO_Monitor_symbol2interest(interest);
-    NIO_Monitor_update_interests(self, monitor->interests);
+    interest = monitor->interests & ~NIO_Monitor_symbol2interest(interest);
+    NIO_Monitor_update_interests(self, interest);
 
     return rb_ivar_get(self, rb_intern("interests"));
 }
@@ -292,9 +298,19 @@
         rb_ivar_set(self, rb_intern("interests"), Qnil);
     }
 
-    monitor->interests = interests;
+    if(monitor->interests != interests) {
+        // If the monitor currently has interests, we should stop it.
+        if(monitor->interests) {
+            ev_io_stop(monitor->selector->ev_loop, &monitor->ev_io);
+        }
 
-    ev_io_stop(monitor->selector->ev_loop, &monitor->ev_io);
-    ev_io_set(&monitor->ev_io, monitor->ev_io.fd, monitor->interests);
-    ev_io_start(monitor->selector->ev_loop, &monitor->ev_io);
+        // Assign the interests we are now monitoring for:
+        monitor->interests = interests;
+        ev_io_set(&monitor->ev_io, monitor->ev_io.fd, monitor->interests);
+
+        // If we are interested in events, schedule the monitor back into the 
event loop:
+        if(monitor->interests) {
+            ev_io_start(monitor->selector->ev_loop, &monitor->ev_io);
+        }
+    }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ext/nio4r/org/nio4r/Monitor.java 
new/ext/nio4r/org/nio4r/Monitor.java
--- old/ext/nio4r/org/nio4r/Monitor.java        2017-12-27 17:33:22.000000000 
+0100
+++ new/ext/nio4r/org/nio4r/Monitor.java        2018-05-03 01:15:13.000000000 
+0200
@@ -62,7 +62,12 @@
         Ruby ruby = context.getRuntime();
         SelectableChannel channel = (SelectableChannel)io.getChannel();
 
-        key.interestOps(Nio4r.symbolToInterestOps(ruby, channel, interests));
+        if(interests != context.nil) {
+            key.interestOps(Nio4r.symbolToInterestOps(ruby, channel, 
interests));
+        } else {
+            key.interestOps(0);
+        }
+        
         this.interests = interests;
 
         return this.interests;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ext/nio4r/selector.c new/ext/nio4r/selector.c
--- old/ext/nio4r/selector.c    2017-12-27 17:33:22.000000000 +0100
+++ new/ext/nio4r/selector.c    2018-05-03 01:15:13.000000000 +0200
@@ -552,6 +552,8 @@
     struct NIO_Selector *selector = monitor_data->selector;
     VALUE monitor = monitor_data->self;
 
+    assert(monitor_data->interests != 0);
+
     assert(selector != 0);
     selector->ready_count++;
     monitor_data->revents = revents;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/nio/monitor.rb new/lib/nio/monitor.rb
--- old/lib/nio/monitor.rb      2017-12-27 17:33:22.000000000 +0100
+++ new/lib/nio/monitor.rb      2018-05-03 01:15:13.000000000 +0200
@@ -26,12 +26,12 @@
 
     # Replace the existing interest set with a new one
     #
-    # @param interests [:r, :w, :rw] I/O readiness we're interested in 
(read/write/readwrite)
+    # @param interests [:r, :w, :rw, nil] I/O readiness we're interested in 
(read/write/readwrite)
     #
     # @return [Symbol] new interests
     def interests=(interests)
       raise EOFError, "monitor is closed" if closed?
-      raise ArgumentError, "bad interests: #{interests}" unless %i[r w 
rw].include?(interests)
+      raise ArgumentError, "bad interests: #{interests}" unless [:r, :w, :rw, 
nil].include?(interests)
 
       @interests = interests
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/nio/version.rb new/lib/nio/version.rb
--- old/lib/nio/version.rb      2017-12-27 17:33:22.000000000 +0100
+++ new/lib/nio/version.rb      2018-05-03 01:15:13.000000000 +0200
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NIO
-  VERSION = "2.2.0".freeze
+  VERSION = "2.3.1".freeze
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2017-12-27 17:33:22.000000000 +0100
+++ new/metadata        2018-05-03 01:15:13.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: nio4r
 version: !ruby/object:Gem::Version
-  version: 2.2.0
+  version: 2.3.1
 platform: ruby
 authors:
 - Tony Arcieri
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2017-12-27 00:00:00.000000000 Z
+date: 2018-05-02 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: bundler
@@ -125,7 +125,7 @@
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 2.7.3
+rubygems_version: 2.7.4
 signing_key: 
 specification_version: 4
 summary: New IO for Ruby
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/nio/monitor_spec.rb new/spec/nio/monitor_spec.rb
--- old/spec/nio/monitor_spec.rb        2017-12-27 17:33:22.000000000 +0100
+++ new/spec/nio/monitor_spec.rb        2018-05-03 01:15:13.000000000 +0200
@@ -29,6 +29,12 @@
   end
 
   describe "#interests=" do
+    it "can set interests to nil" do
+      expect(monitor.interests).not_to eq(nil)
+      monitor.interests = nil
+      expect(monitor.interests).to eq(nil)
+    end
+
     it "changes the interest set" do
       expect(monitor.interests).not_to eq(:w)
       monitor.interests = :w


Reply via email to