slave 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -39,6 +39,10 @@ URIS
39
39
 
40
40
  HISTORY
41
41
 
42
+ 1.2.0:
43
+ - cleaned up a bunch of warnings. thanks eric kolve <ekolve@gmail.com>
44
+ for reporting them.
45
+
42
46
  1.1.0:
43
47
  - replaced HeartBeat class with LifeLine.
44
48
 
@@ -155,7 +159,7 @@ SAMPLES
155
159
  ~ > ruby samples/b.rb
156
160
 
157
161
  :postgresql
158
- ./lib/slave.rb:460:in `initialize': undefined method `typo' for #<Server:0xb7565694> (NoMethodError)
162
+ ./lib/slave.rb:458:in `initialize': undefined method `typo' for #<Server:0xb7567fa4> (NoMethodError)
159
163
  from samples/b.rb:22:in `new'
160
164
  from samples/b.rb:22
161
165
 
@@ -188,9 +192,9 @@ SAMPLES
188
192
 
189
193
  ~ > ruby samples/c.rb
190
194
 
191
- 14387
192
- 14388
193
- ./lib/slave.rb:460:in `initialize': undefined local variable or method `fubar' for main:Object (NameError)
195
+ 30103
196
+ 30104
197
+ ./lib/slave.rb:458:in `initialize': undefined local variable or method `fubar' for main:Object (NameError)
194
198
  from samples/c.rb:21:in `new'
195
199
  from samples/c.rb:21
196
200
 
@@ -285,6 +289,6 @@ SAMPLES
285
289
 
286
290
  ~ > ruby samples/g.rb
287
291
 
288
- {"that"=>14406, "this"=>14405}
289
- {"that"=>[14407, Tue Nov 28 09:47:31 MST 2006], "this"=>[14405, Tue Nov 28 09:47:29 MST 2006]}
292
+ {"that"=>30122, "this"=>30121}
293
+ {"that"=>[30123, Fri Dec 08 08:32:37 MST 2006], "this"=>[30121, Fri Dec 08 08:32:35 MST 2006]}
290
294
 
data/README.tmpl CHANGED
@@ -39,6 +39,10 @@ URIS
39
39
 
40
40
  HISTORY
41
41
 
42
+ 1.2.0:
43
+ - cleaned up a bunch of warnings. thanks eric kolve <ekolve@gmail.com>
44
+ for reporting them.
45
+
42
46
  1.1.0:
43
47
  - replaced HeartBeat class with LifeLine.
44
48
 
@@ -40,7 +40,7 @@ require 'sync'
40
40
  #
41
41
  class Slave
42
42
  #--{{{
43
- VERSION = '1.1.0'
43
+ VERSION = '1.2.0'
44
44
  def self.version() VERSION end
45
45
  #
46
46
  # env config
@@ -95,12 +95,12 @@ require 'sync'
95
95
  end
96
96
 
97
97
  # just fork with out silly warnings
98
- def fork &block
98
+ def fork &b
99
99
  #--{{{
100
100
  v = $VERBOSE
101
101
  begin
102
102
  $VERBOSE = nil
103
- Process::fork &block
103
+ Process::fork(&b)
104
104
  ensure
105
105
  $VERBOSE = v
106
106
  end
@@ -240,8 +240,7 @@ require 'sync'
240
240
  DELEGATED.each do |m|
241
241
  code = <<-code
242
242
  def #{ m }(*a, &b)
243
- raise unless @socket
244
- @socket.#{ m } *a, &b
243
+ @socket ? @socket.#{ m }(*a, &b) : raise('no socket!')
245
244
  end
246
245
  code
247
246
  module_eval code, __FILE__, __LINE__
@@ -278,7 +277,6 @@ require 'sync'
278
277
  attr :at_exit
279
278
  attr :dumped
280
279
 
281
- attr :shutdown
282
280
  attr :status
283
281
  attr :object
284
282
  attr :pid
@@ -586,20 +584,6 @@ require 'sync'
586
584
  # object = thread.value
587
585
  #
588
586
  def self.object opts = {}, &b
589
- #--{{{
590
- l = lambda{ begin; b.call; ensure; exit; end }
591
-
592
- async = opts.delete('async') || opts.delete(:async)
593
-
594
- opts['object'] = opts[:object] = l
595
- opts['dumped'] = opts[:dumped] = true
596
-
597
- slave = Slave.new opts
598
-
599
- async ? Thread.new{ slave.object.call } : slave.object.call
600
- #--}}}
601
- end
602
- def self.object opts = {}, &b
603
587
  #--{{{
604
588
  async = opts.delete('async') || opts.delete(:async)
605
589
 
data/lib/slave.rb CHANGED
@@ -40,7 +40,7 @@ require 'sync'
40
40
  #
41
41
  class Slave
42
42
  #--{{{
43
- VERSION = '1.1.0'
43
+ VERSION = '1.2.0'
44
44
  def self.version() VERSION end
45
45
  #
46
46
  # env config
@@ -95,12 +95,12 @@ require 'sync'
95
95
  end
96
96
 
97
97
  # just fork with out silly warnings
98
- def fork &block
98
+ def fork &b
99
99
  #--{{{
100
100
  v = $VERBOSE
101
101
  begin
102
102
  $VERBOSE = nil
103
- Process::fork &block
103
+ Process::fork(&b)
104
104
  ensure
105
105
  $VERBOSE = v
106
106
  end
@@ -240,8 +240,7 @@ require 'sync'
240
240
  DELEGATED.each do |m|
241
241
  code = <<-code
242
242
  def #{ m }(*a, &b)
243
- raise unless @socket
244
- @socket.#{ m } *a, &b
243
+ @socket ? @socket.#{ m }(*a, &b) : raise('no socket!')
245
244
  end
246
245
  code
247
246
  module_eval code, __FILE__, __LINE__
@@ -278,7 +277,6 @@ require 'sync'
278
277
  attr :at_exit
279
278
  attr :dumped
280
279
 
281
- attr :shutdown
282
280
  attr :status
283
281
  attr :object
284
282
  attr :pid
@@ -586,20 +584,6 @@ require 'sync'
586
584
  # object = thread.value
587
585
  #
588
586
  def self.object opts = {}, &b
589
- #--{{{
590
- l = lambda{ begin; b.call; ensure; exit; end }
591
-
592
- async = opts.delete('async') || opts.delete(:async)
593
-
594
- opts['object'] = opts[:object] = l
595
- opts['dumped'] = opts[:dumped] = true
596
-
597
- slave = Slave.new opts
598
-
599
- async ? Thread.new{ slave.object.call } : slave.object.call
600
- #--}}}
601
- end
602
- def self.object opts = {}, &b
603
587
  #--{{{
604
588
  async = opts.delete('async') || opts.delete(:async)
605
589
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: slave
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.0
7
- date: 2006-11-28 00:00:00.000000 -07:00
6
+ version: 1.2.0
7
+ date: 2006-12-08 00:00:00.000000 -07:00
8
8
  summary: slave
9
9
  require_paths:
10
10
  - lib
@@ -41,7 +41,7 @@ files:
41
41
  - doc
42
42
  - test.old/slave.rb
43
43
  - lib/slave.rb
44
- - lib/slave-1.1.0.rb
44
+ - lib/slave-1.2.0.rb
45
45
  - samples/a.rb
46
46
  - samples/b.rb
47
47
  - samples/c.rb