SystemTimer 1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ === 1.2.1 / 2010-11-15
2
+
3
+ * Better Rubinious support (Contributed by
4
+ Evan Phoenix <http://blog.fallingsnow.net/>)
5
+
1
6
  === 1.2 / 2010-02-25
2
7
 
3
8
  * Changed from using Mutex to Monitor. Mutex causes thread join
data/README CHANGED
@@ -14,7 +14,7 @@ More background on:
14
14
  Usage
15
15
  =====
16
16
 
17
- require 'systemtimer'
17
+ require 'system_timer'
18
18
 
19
19
  SystemTimer.timeout_after(5) do
20
20
 
@@ -47,7 +47,7 @@ Usage
47
47
  You can also use a custom timeout exception to be raised on timeouts (to
48
48
  avoid interference with other libraries using `Timeout::Error` -- e.g. `Net::HTTP`)
49
49
 
50
- require 'systemtimer'
50
+ require 'system_timer'
51
51
 
52
52
  begin
53
53
 
@@ -73,8 +73,7 @@ a convenience shell wrapping a simple call to timeout.rb under the cover.
73
73
  Install
74
74
  =======
75
75
 
76
- sudo gem install systemtimer
77
-
76
+ sudo gem install SystemTimer
78
77
 
79
78
  Authors
80
79
  =======
@@ -82,8 +81,8 @@ Authors
82
81
  * David Vollbracht <http://davidvollbracht.com>
83
82
  * Philippe Hanrigou <http://ph7spot.com>
84
83
 
85
- Contributor
86
- ===========
84
+ Contributors
85
+ ============
87
86
 
88
87
  * Dmytro Shteflyuk <http://kpumuk.info/> :
89
88
  - Changed from using Mutex to Monitor. Evidently Mutex causes thread
@@ -16,6 +16,10 @@
16
16
  #define MINIMUM_TIMER_INTERVAL_IN_SECONDS 0.2
17
17
 
18
18
  VALUE rb_cSystemTimer;
19
+
20
+ // Ignore most of this for Rubinius
21
+ #ifndef RUBINIUS
22
+
19
23
  sigset_t original_mask;
20
24
  sigset_t sigalarm_mask;
21
25
  struct sigaction original_signal_handler;
@@ -297,6 +301,7 @@ static void set_itimerval(struct itimerval *value, double seconds) {
297
301
  return;
298
302
  }
299
303
 
304
+
300
305
  void Init_system_timer_native()
301
306
  {
302
307
  init_sigalarm_mask();
@@ -308,3 +313,13 @@ void Init_system_timer_native()
308
313
  rb_define_singleton_method(rb_cSystemTimer, "enable_debug", enable_debug, 0);
309
314
  rb_define_singleton_method(rb_cSystemTimer, "disable_debug", disable_debug, 0);
310
315
  }
316
+
317
+ #else
318
+
319
+ // Exists just to make things happy
320
+ void Init_system_timer_native()
321
+ {
322
+ rb_cSystemTimer = rb_define_module("SystemTimer");
323
+ }
324
+
325
+ #endif
@@ -1,5 +1,9 @@
1
1
  # Copyright 2008 David Vollbracht & Philippe Hanrigou
2
2
 
3
+ if defined?(RUBY_ENGINE) and RUBY_ENGINE == "rbx"
4
+ require File.dirname(__FILE__) + '/system_timer_stub'
5
+ else
6
+
3
7
  require 'rubygems'
4
8
  require 'timeout'
5
9
  require 'forwardable'
@@ -106,3 +110,6 @@ module SystemTimer
106
110
  end
107
111
 
108
112
  require 'system_timer_native'
113
+
114
+
115
+ end # stub guard
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SystemTimer
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.2"
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philippe Hanrigou
@@ -10,7 +10,7 @@ autorequire: system_timer
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-02-25 00:00:00 -08:00
13
+ date: 2010-11-15 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies: []
16
16