diff --git a/src/ruby/bin/interop/interop_client.rb b/src/ruby/bin/interop/interop_client.rb index 309dd337ecdffa6f6d6cfef48345372fc7e43792..92203ce25292d1b6271ffebc6184acabbe91f051 100644 --- a/src/ruby/bin/interop/interop_client.rb +++ b/src/ruby/bin/interop/interop_client.rb @@ -47,8 +47,6 @@ require 'minitest' require 'minitest/assertions' require 'grpc' -require 'grpc/generic/client_stub' -require 'grpc/generic/service' require 'third_party/stubby/testing/proto/test.pb' require 'third_party/stubby/testing/proto/messages.pb' diff --git a/src/ruby/bin/interop/interop_server.rb b/src/ruby/bin/interop/interop_server.rb index 9e5c20d44388fa19589d29d33555fe0086f387b6..35d69f6fd383e71d3350ddfb6978dfe41b595675 100644 --- a/src/ruby/bin/interop/interop_server.rb +++ b/src/ruby/bin/interop/interop_server.rb @@ -46,8 +46,6 @@ require 'forwardable' require 'optparse' require 'grpc' -require 'grpc/generic/service' -require 'grpc/generic/rpc_server' require 'third_party/stubby/testing/proto/test.pb' require 'third_party/stubby/testing/proto/messages.pb' diff --git a/src/ruby/bin/math_client.rb b/src/ruby/bin/math_client.rb index 947e86adf9f706a3229f87776c5d189770321c18..8a62764c084bc34fb5b268e68f2638abe792cf1c 100644 --- a/src/ruby/bin/math_client.rb +++ b/src/ruby/bin/math_client.rb @@ -40,8 +40,6 @@ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'grpc' -require 'grpc/generic/client_stub' -require 'grpc/generic/service' require 'math.pb' require 'optparse' diff --git a/src/ruby/bin/math_server.rb b/src/ruby/bin/math_server.rb index d21ae7ee273dd528db9d8a6ec37c1138c925d20d..ed39144d7aa16b7eaa45a43234caf1ebdad3b5aa 100644 --- a/src/ruby/bin/math_server.rb +++ b/src/ruby/bin/math_server.rb @@ -41,8 +41,6 @@ $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'forwardable' require 'grpc' -require 'grpc/generic/service' -require 'grpc/generic/rpc_server' require 'math.pb' require 'optparse' diff --git a/src/ruby/bin/noproto_client.rb b/src/ruby/bin/noproto_client.rb index fbd10a06b53987ce6128c29fd93c2199713a4306..29ed6d9f7cca6c3f09ec811590a27f64070c8d8f 100644 --- a/src/ruby/bin/noproto_client.rb +++ b/src/ruby/bin/noproto_client.rb @@ -37,8 +37,6 @@ lib_dir = File.join(File.dirname(this_dir), 'lib') $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) require 'grpc' -require 'grpc/generic/client_stub' -require 'grpc/generic/service' class EchoMsg def marshal diff --git a/src/ruby/bin/noproto_server.rb b/src/ruby/bin/noproto_server.rb index c5b7c192eb41a3dff46e694e97c74592258b2869..7b74fa13ec26f7eea299a53d4c592dd94ed679f8 100644 --- a/src/ruby/bin/noproto_server.rb +++ b/src/ruby/bin/noproto_server.rb @@ -37,8 +37,6 @@ lib_dir = File.join(File.dirname(this_dir), 'lib') $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) require 'grpc' -require 'grpc/generic/rpc_server' -require 'grpc/generic/service' class EchoMsg def marshal diff --git a/src/ruby/lib/grpc.rb b/src/ruby/lib/grpc.rb index 1012a836b7b2b04f48297f63e0f57993b0553ba5..c7eec3388c8b62cd8beec03c66b17bc28961734a 100644 --- a/src/ruby/lib/grpc.rb +++ b/src/ruby/lib/grpc.rb @@ -34,6 +34,10 @@ require 'grpc/logconfig' require 'grpc/version' require 'grpc/core/event' require 'grpc/core/time_consts' +require 'grpc/generic/active_call' +require 'grpc/generic/client_stub' +require 'grpc/generic/service' +require 'grpc/generic/rpc_server' # alias GRPC GRPC = Google::RPC diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb index 95cc7fc7082f70573a7a79f90c96bc2fe0899c32..187c23843bfecef03290e648117394234dcbbc7c 100644 --- a/src/ruby/lib/grpc/generic/active_call.rb +++ b/src/ruby/lib/grpc/generic/active_call.rb @@ -28,7 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'forwardable' -require 'grpc' require 'grpc/generic/bidi_call' def assert_event_type(ev, want) @@ -37,7 +36,7 @@ def assert_event_type(ev, want) raise 'Unexpected rpc event: got %s, want %s' % [got, want] unless got == want end -module GRPC +module Google::RPC # The ActiveCall class provides simple methods for sending marshallable # data to a call diff --git a/src/ruby/lib/grpc/generic/bidi_call.rb b/src/ruby/lib/grpc/generic/bidi_call.rb index 91ceaa90e58a9ebad10f0c558ff30f0c81935768..74cc9db57e0b6bb97edf3a3ed7aeb62356a4ed53 100644 --- a/src/ruby/lib/grpc/generic/bidi_call.rb +++ b/src/ruby/lib/grpc/generic/bidi_call.rb @@ -28,9 +28,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'forwardable' -require 'grpc' +require 'grpc/grpc' -module GRPC +module Google::RPC # The BiDiCall class orchestrates exection of a BiDi stream on a client or # server. diff --git a/src/ruby/lib/grpc/generic/client_stub.rb b/src/ruby/lib/grpc/generic/client_stub.rb index b0e72262ffaeb565b3e2e6633a1c4e56d623e001..62628cb1f029fc485e1c38c1ffe3847e595ee8b8 100644 --- a/src/ruby/lib/grpc/generic/client_stub.rb +++ b/src/ruby/lib/grpc/generic/client_stub.rb @@ -27,11 +27,10 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -require 'grpc' require 'grpc/generic/active_call' require 'xray/thread_dump_signal_handler' -module GRPC +module Google::RPC # ClientStub represents an endpoint used to send requests to GRPC servers. class ClientStub diff --git a/src/ruby/lib/grpc/generic/rpc_desc.rb b/src/ruby/lib/grpc/generic/rpc_desc.rb index b41543e084ec9a985a06de49a5c4a50fd92e416a..10767c47dec49f10fd0a3045f9f5b7e7c9319e3d 100644 --- a/src/ruby/lib/grpc/generic/rpc_desc.rb +++ b/src/ruby/lib/grpc/generic/rpc_desc.rb @@ -27,9 +27,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -require 'grpc' +require 'grpc/grpc' -module GRPC +module Google::RPC # RpcDesc is a Descriptor of an RPC method. class RpcDesc < Struct.new(:name, :input, :output, :marshal_method, @@ -99,7 +99,7 @@ module GRPC # event. Send a status of deadline exceeded logger.warn("late call: #{active_call}") send_status(active_call, DEADLINE_EXCEEDED, 'late') - rescue Core::EventError => e + rescue EventError => e # This is raised by GRPC internals but should rarely, if ever happen. # Log it, but don't notify the other endpoint.. logger.warn("failed call: #{active_call}\n#{e}") diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb index 76e7838d0f2f2ae3b2d565dc18064401f668528f..7754b8d7df98bef4f883485f0de9829d94651302 100644 --- a/src/ruby/lib/grpc/generic/rpc_server.rb +++ b/src/ruby/lib/grpc/generic/rpc_server.rb @@ -27,13 +27,13 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -require 'grpc' +require 'grpc/grpc' require 'grpc/generic/active_call' require 'grpc/generic/service' require 'thread' require 'xray/thread_dump_signal_handler' -module GRPC +module Google::RPC # RpcServer hosts a number of services and makes them available on the # network. diff --git a/src/ruby/lib/grpc/generic/service.rb b/src/ruby/lib/grpc/generic/service.rb index 05bb0af8099d9d6d8acd5f6d6f93cbe8ea8ee2ff..6a4356fab9e94c6b41e24c638ca6070516dd0f5f 100644 --- a/src/ruby/lib/grpc/generic/service.rb +++ b/src/ruby/lib/grpc/generic/service.rb @@ -27,7 +27,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -require 'grpc' require 'grpc/generic/client_stub' require 'grpc/generic/rpc_desc' @@ -51,7 +50,7 @@ class String end -module GRPC +module Google::RPC # Provides behaviour used to implement schema-derived service classes. # diff --git a/src/ruby/spec/generic/active_call_spec.rb b/src/ruby/spec/generic/active_call_spec.rb index a8ee3c0da89fc8513759fc65682a175076456b57..0bebe5dc37526537af4b3b4fc4a5803adb046878 100644 --- a/src/ruby/spec/generic/active_call_spec.rb +++ b/src/ruby/spec/generic/active_call_spec.rb @@ -28,7 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/generic/active_call' require_relative '../port_picker' include GRPC::Core::StatusCodes diff --git a/src/ruby/spec/generic/client_stub_spec.rb b/src/ruby/spec/generic/client_stub_spec.rb index c76f3b291eadf678a4d771d0c0a385169b37939e..42da3f82ec94a07ea05cd4c8128069f6008c1835 100644 --- a/src/ruby/spec/generic/client_stub_spec.rb +++ b/src/ruby/spec/generic/client_stub_spec.rb @@ -28,8 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/generic/active_call' -require 'grpc/generic/client_stub' require 'xray/thread_dump_signal_handler' require_relative '../port_picker' diff --git a/src/ruby/spec/generic/rpc_server_pool_spec.rb b/src/ruby/spec/generic/rpc_server_pool_spec.rb index 8a185df9c7659761669cb1b9b66aea044ab0ceb0..83979ec1643e3694fa1a9b97ed739fe37d7b8b57 100644 --- a/src/ruby/spec/generic/rpc_server_pool_spec.rb +++ b/src/ruby/spec/generic/rpc_server_pool_spec.rb @@ -28,7 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/generic/rpc_server' require 'xray/thread_dump_signal_handler' Pool = GRPC::RpcServer::Pool diff --git a/src/ruby/spec/generic/rpc_server_spec.rb b/src/ruby/spec/generic/rpc_server_spec.rb index 7c9b074abfccfae2bfd379f32c8688efdb533cdb..5997fdb3637698bd4b4ed5e19fbe8da5a5ed8f49 100644 --- a/src/ruby/spec/generic/rpc_server_spec.rb +++ b/src/ruby/spec/generic/rpc_server_spec.rb @@ -28,10 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/generic/active_call' -require 'grpc/generic/client_stub' -require 'grpc/generic/rpc_server' -require 'grpc/generic/service' require 'xray/thread_dump_signal_handler' require_relative '../port_picker'