Update modules and packages to allow for a single grpc import

- ensured tests only need to do 'require grpc'
- ensured that the example math_server and math_client only need to do 'require grpc'
- ensured that the other other client and servers only need to do one thing
	Change on 2014/12/11 by temiola <temiola@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81894613
pull/1/merge
temiola 10 years ago committed by Jan Tattermusch
parent 4eec017e8e
commit 4a3be1c996
  1. 2
      src/ruby/bin/interop/interop_client.rb
  2. 2
      src/ruby/bin/interop/interop_server.rb
  3. 2
      src/ruby/bin/math_client.rb
  4. 2
      src/ruby/bin/math_server.rb
  5. 2
      src/ruby/bin/noproto_client.rb
  6. 2
      src/ruby/bin/noproto_server.rb
  7. 4
      src/ruby/lib/grpc.rb
  8. 3
      src/ruby/lib/grpc/generic/active_call.rb
  9. 4
      src/ruby/lib/grpc/generic/bidi_call.rb
  10. 3
      src/ruby/lib/grpc/generic/client_stub.rb
  11. 6
      src/ruby/lib/grpc/generic/rpc_desc.rb
  12. 4
      src/ruby/lib/grpc/generic/rpc_server.rb
  13. 3
      src/ruby/lib/grpc/generic/service.rb
  14. 1
      src/ruby/spec/generic/active_call_spec.rb
  15. 2
      src/ruby/spec/generic/client_stub_spec.rb
  16. 1
      src/ruby/spec/generic/rpc_server_pool_spec.rb
  17. 4
      src/ruby/spec/generic/rpc_server_spec.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'

@ -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'

@ -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'

@ -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'

@ -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

@ -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

@ -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

@ -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

@ -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.

@ -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

@ -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}")

@ -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.

@ -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.
#

@ -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

@ -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'

@ -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

@ -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'

Loading…
Cancel
Save