lib/uu/remote.rb in uu-0.1.0 vs lib/uu/remote.rb in uu-0.1.1
- old
+ new
@@ -16,12 +16,20 @@
def initialize(uri)
@remote = DRbObject.new_with_uri(uri)
end
- def run(klass = nil)
+ def eval_(code)
+ @remote.eval_(code)
+ end
+
+ def klass(klass_)
+ @remote.klass(klass_.to_s)
+ end
+
+ def run(&block)
@remote.disable
- yield (klass ? @remote.eval_(klass.to_s) : klass)
+ instance_eval(&block)
ensure
@remote.enable
end
end
end