emdrb 0.4.1 → 0.4.2
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/History.txt +3 -0
- data/lib/emdrb/emdrb.rb +12 -12
- data/lib/emdrb/version.rb +2 -2
- data/spec/emdrb_spec.rb +7 -1
- metadata +2 -2
data/History.txt
CHANGED
data/lib/emdrb/emdrb.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Homepage:: http://emdrb.rubyforge.org/
|
6
6
|
# License:: GNU General Public License / Ruby License
|
7
7
|
#
|
8
|
-
# $Id: emdrb.rb
|
8
|
+
# $Id: emdrb.rb 135 2009-04-22 03:51:32Z dido $
|
9
9
|
#
|
10
10
|
#----------------------------------------------------------------------------
|
11
11
|
#
|
@@ -843,19 +843,19 @@ module DRb
|
|
843
843
|
def send_async(msg_id, *a, &b)
|
844
844
|
df = EventMachine::DefaultDeferrable.new
|
845
845
|
if DRb.here?(@uri)
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
846
|
+
obj = DRb.to_obj(@ref)
|
847
|
+
DRb.current_server.check_insecure_method(obj, msg_id)
|
848
|
+
begin
|
849
|
+
if obj.kind_of?(DRbEMSafe) && obj.class.deferrable_method?(msg_id)
|
850
|
+
# If the method is a deferrable, calling the method will itself
|
851
|
+
# return a deferrable by definition, and we should be using this
|
852
|
+
# deferrable to determine whether the call succeeded or failed.
|
853
|
+
df = obj.__send__(msg_id, *a, &b)
|
854
|
+
else
|
855
855
|
df.succeed(obj.__send__(msg_id, *a, &b))
|
856
|
-
rescue
|
857
|
-
df.fail($!)
|
858
856
|
end
|
857
|
+
rescue
|
858
|
+
df.fail($!)
|
859
859
|
end
|
860
860
|
return(df)
|
861
861
|
end
|
data/lib/emdrb/version.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Homepage:: http://emdrb.rubyforge.org/
|
5
5
|
# License:: GNU Lesser General Public License / Ruby License
|
6
6
|
#
|
7
|
-
# $Id: version.rb
|
7
|
+
# $Id: version.rb 137 2009-04-22 03:53:11Z dido $
|
8
8
|
#
|
9
9
|
#----------------------------------------------------------------------------
|
10
10
|
#
|
@@ -22,5 +22,5 @@
|
|
22
22
|
# EMDRb version code
|
23
23
|
#
|
24
24
|
module EMDRb
|
25
|
-
VERSION = "0.4.
|
25
|
+
VERSION = "0.4.2"
|
26
26
|
end
|
data/spec/emdrb_spec.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Homepage:: http://emdrb.rubyforge.org/
|
6
6
|
# License:: GNU General Public License / Ruby License
|
7
7
|
#
|
8
|
-
# $Id: emdrb_spec.rb
|
8
|
+
# $Id: emdrb_spec.rb 136 2009-04-22 03:52:14Z dido $
|
9
9
|
#
|
10
10
|
#----------------------------------------------------------------------------
|
11
11
|
#
|
@@ -33,6 +33,10 @@ class LocalDeferrable
|
|
33
33
|
return(df)
|
34
34
|
end
|
35
35
|
|
36
|
+
def df_tester_exception
|
37
|
+
raise "test exception"
|
38
|
+
end
|
39
|
+
|
36
40
|
deferrable_method :df_tester
|
37
41
|
end
|
38
42
|
|
@@ -110,6 +114,8 @@ describe EMDRb do
|
|
110
114
|
|
111
115
|
it "should call local deferrables correctly" do
|
112
116
|
@obj2.df_tester(1).should == 2
|
117
|
+
lambda { @obj2.df_tester_exception }.should raise_error(RuntimeError,
|
118
|
+
"test exception")
|
113
119
|
end
|
114
120
|
end
|
115
121
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emdrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dido@imperium.ph
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-22 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|