io-event 1.6.2 → 1.6.3

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
  SHA256:
3
- metadata.gz: 45049c22b990de175e733bdcce4045d7c4028dd50fa8018ec03b76ec76bfe1f2
4
- data.tar.gz: 250555adf9d939804cc19f050e8cc42d9f2848e90f75cbcf46abc6543a67dbf1
3
+ metadata.gz: dbd1596a8aee7671e72fa97a26edea4613394765bb99723729228e6e6d5705cd
4
+ data.tar.gz: 42039ad9987d6e780e33091a812d9296527591cc7f187bf5c0a23fbf22d77981
5
5
  SHA512:
6
- metadata.gz: ed43ce7a15045fbad357e4e8b6eb176635ebd4148a2d3a5c229cc9af6c246f3d5bd0c8a80969f0a487fac468365b040888ef1e104275e0c82ef2397923bd24e3
7
- data.tar.gz: 7d36cf2bb3f8dbdddba94564057b767415ff8da2884c8810c2b88e5dae1162a5f17f7bc538a8f766e1be6c6fb14e0fd213f08182b8e8e29e1fea77292dc8f37d
6
+ metadata.gz: 49c7e7ea64f291f831e77b83fccc5ebd9cc610eb25032bd8c8d2bac5937190bcdaa68da6149831ed90b8a508b7a7ad68cf629663aa03c6f1892272db234ed3ba
7
+ data.tar.gz: 1c51c881b4746c819f0967041e3fb580ee5cc79163be5783831a5a72f16d64ad5ca592746d530ec78b77f70590ed81cdffbf34c46b4d46982d950e5ca46e1bfa
checksums.yaml.gz.sig CHANGED
Binary file
@@ -786,24 +786,21 @@ struct timespec * make_timeout(VALUE duration, struct timespec * storage) {
786
786
  return NULL;
787
787
  }
788
788
 
789
- if (RB_FLOAT_TYPE_P(duration)) {
790
- double value = RFLOAT_VALUE(duration);
791
- time_t seconds = value;
792
-
793
- storage->tv_sec = seconds;
794
- storage->tv_nsec = (value - seconds) * 1000000000L;
795
-
796
- return storage;
797
- }
798
-
799
- else if (RB_INTEGER_TYPE_P(duration)) {
789
+ if (RB_INTEGER_TYPE_P(duration)) {
800
790
  storage->tv_sec = NUM2TIMET(duration);
801
791
  storage->tv_nsec = 0;
802
792
 
803
793
  return storage;
804
794
  }
805
795
 
806
- rb_raise(rb_eArgError, "unable to convert timeout: %"PRIsVALUE, rb_inspect(duration));
796
+ duration = rb_to_float(duration);
797
+ double value = RFLOAT_VALUE(duration);
798
+ time_t seconds = value;
799
+
800
+ storage->tv_sec = seconds;
801
+ storage->tv_nsec = (value - seconds) * 1000000000L;
802
+
803
+ return storage;
807
804
  }
808
805
 
809
806
  static
@@ -799,24 +799,21 @@ struct timespec * make_timeout(VALUE duration, struct timespec * storage) {
799
799
  return NULL;
800
800
  }
801
801
 
802
- if (RB_FLOAT_TYPE_P(duration)) {
803
- double value = RFLOAT_VALUE(duration);
804
- time_t seconds = value;
805
-
806
- storage->tv_sec = seconds;
807
- storage->tv_nsec = (value - seconds) * 1000000000L;
808
-
809
- return storage;
810
- }
811
-
812
- else if (RB_INTEGER_TYPE_P(duration)) {
802
+ if (RB_INTEGER_TYPE_P(duration)) {
813
803
  storage->tv_sec = NUM2TIMET(duration);
814
804
  storage->tv_nsec = 0;
815
805
 
816
806
  return storage;
817
807
  }
818
808
 
819
- rb_raise(rb_eArgError, "unable to convert timeout: %"PRIsVALUE, rb_inspect(duration));
809
+ duration = rb_to_float(duration);
810
+ double value = RFLOAT_VALUE(duration);
811
+ time_t seconds = value;
812
+
813
+ storage->tv_sec = seconds;
814
+ storage->tv_nsec = (value - seconds) * 1000000000L;
815
+
816
+ return storage;
820
817
  }
821
818
 
822
819
  static
@@ -901,24 +901,21 @@ struct __kernel_timespec * make_timeout(VALUE duration, struct __kernel_timespec
901
901
  return NULL;
902
902
  }
903
903
 
904
- if (RB_FLOAT_TYPE_P(duration)) {
905
- double value = RFLOAT_VALUE(duration);
906
- time_t seconds = value;
907
-
908
- storage->tv_sec = seconds;
909
- storage->tv_nsec = (value - seconds) * 1000000000L;
910
-
911
- return storage;
912
- }
913
-
914
- else if (RB_INTEGER_TYPE_P(duration)) {
904
+ if (RB_INTEGER_TYPE_P(duration)) {
915
905
  storage->tv_sec = NUM2TIMET(duration);
916
906
  storage->tv_nsec = 0;
917
907
 
918
908
  return storage;
919
909
  }
920
910
 
921
- rb_raise(rb_eArgError, "unable to convert timeout: %"PRIsVALUE, rb_inspect(duration));
911
+ duration = rb_to_float(duration);
912
+ double value = RFLOAT_VALUE(duration);
913
+ time_t seconds = value;
914
+
915
+ storage->tv_sec = seconds;
916
+ storage->tv_nsec = (value - seconds) * 1000000000L;
917
+
918
+ return storage;
922
919
  }
923
920
 
924
921
  static
@@ -420,8 +420,11 @@ module IO::Event
420
420
  duration = 0 unless @ready.empty?
421
421
  error = nil
422
422
 
423
- if duration && duration > 0.0
424
- start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
423
+ if duration
424
+ duration = duration/1.0
425
+ if duration > 0
426
+ start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
427
+ end
425
428
  else
426
429
  @idle_duration = 0.0
427
430
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  class IO
7
7
  module Event
8
- VERSION = "1.6.2"
8
+ VERSION = "1.6.3"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file