protobuf 3.3.6 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +48 -0
  3. data/.rubocop_todo.yml +79 -0
  4. data/.travis.yml +12 -4
  5. data/Rakefile +14 -11
  6. data/bin/protoc-gen-ruby +0 -1
  7. data/bin/rpc_server +1 -0
  8. data/install-protobuf.sh +8 -0
  9. data/lib/protobuf.rb +30 -24
  10. data/lib/protobuf/cli.rb +35 -35
  11. data/lib/protobuf/code_generator.rb +11 -8
  12. data/lib/protobuf/decoder.rb +4 -5
  13. data/lib/protobuf/deprecation.rb +20 -0
  14. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +2 -0
  15. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +2 -0
  16. data/lib/protobuf/encoder.rb +9 -4
  17. data/lib/protobuf/enum.rb +38 -54
  18. data/lib/protobuf/field.rb +2 -2
  19. data/lib/protobuf/field/base_field.rb +28 -32
  20. data/lib/protobuf/field/bool_field.rb +4 -4
  21. data/lib/protobuf/field/bytes_field.rb +5 -4
  22. data/lib/protobuf/field/double_field.rb +0 -1
  23. data/lib/protobuf/field/enum_field.rb +4 -7
  24. data/lib/protobuf/field/field_array.rb +3 -4
  25. data/lib/protobuf/field/fixed32_field.rb +1 -1
  26. data/lib/protobuf/field/fixed64_field.rb +0 -1
  27. data/lib/protobuf/field/float_field.rb +0 -1
  28. data/lib/protobuf/field/int32_field.rb +0 -1
  29. data/lib/protobuf/field/int64_field.rb +0 -1
  30. data/lib/protobuf/field/integer_field.rb +0 -1
  31. data/lib/protobuf/field/message_field.rb +2 -3
  32. data/lib/protobuf/field/sfixed32_field.rb +0 -1
  33. data/lib/protobuf/field/sfixed64_field.rb +0 -1
  34. data/lib/protobuf/field/signed_integer_field.rb +0 -1
  35. data/lib/protobuf/field/sint32_field.rb +0 -1
  36. data/lib/protobuf/field/sint64_field.rb +0 -1
  37. data/lib/protobuf/field/string_field.rb +0 -1
  38. data/lib/protobuf/field/uint32_field.rb +0 -1
  39. data/lib/protobuf/field/uint64_field.rb +0 -1
  40. data/lib/protobuf/field/varint_field.rb +0 -1
  41. data/lib/protobuf/generators/base.rb +1 -2
  42. data/lib/protobuf/generators/enum_generator.rb +1 -2
  43. data/lib/protobuf/generators/extension_generator.rb +1 -2
  44. data/lib/protobuf/generators/field_generator.rb +4 -5
  45. data/lib/protobuf/generators/file_generator.rb +22 -27
  46. data/lib/protobuf/generators/group_generator.rb +15 -16
  47. data/lib/protobuf/generators/message_generator.rb +13 -14
  48. data/lib/protobuf/generators/printable.rb +9 -10
  49. data/lib/protobuf/generators/service_generator.rb +1 -2
  50. data/lib/protobuf/lifecycle.rb +20 -33
  51. data/lib/protobuf/logging.rb +4 -6
  52. data/lib/protobuf/message.rb +22 -16
  53. data/lib/protobuf/message/fields.rb +14 -17
  54. data/lib/protobuf/message/serialization.rb +6 -5
  55. data/lib/protobuf/rpc/buffer.rb +10 -12
  56. data/lib/protobuf/rpc/client.rb +12 -12
  57. data/lib/protobuf/rpc/connectors/base.rb +4 -3
  58. data/lib/protobuf/rpc/connectors/common.rb +15 -17
  59. data/lib/protobuf/rpc/connectors/socket.rb +2 -2
  60. data/lib/protobuf/rpc/connectors/zmq.rb +118 -108
  61. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +2 -0
  62. data/lib/protobuf/rpc/env.rb +12 -12
  63. data/lib/protobuf/rpc/error.rb +1 -1
  64. data/lib/protobuf/rpc/error/client_error.rb +4 -4
  65. data/lib/protobuf/rpc/error/server_error.rb +6 -6
  66. data/lib/protobuf/rpc/middleware/exception_handler.rb +1 -1
  67. data/lib/protobuf/rpc/middleware/logger.rb +3 -3
  68. data/lib/protobuf/rpc/middleware/request_decoder.rb +5 -5
  69. data/lib/protobuf/rpc/middleware/response_encoder.rb +3 -3
  70. data/lib/protobuf/rpc/rpc.pb.rb +2 -0
  71. data/lib/protobuf/rpc/servers/socket/server.rb +75 -65
  72. data/lib/protobuf/rpc/servers/socket/worker.rb +2 -2
  73. data/lib/protobuf/rpc/servers/socket_runner.rb +12 -6
  74. data/lib/protobuf/rpc/servers/zmq/broker.rb +10 -6
  75. data/lib/protobuf/rpc/servers/zmq/server.rb +20 -26
  76. data/lib/protobuf/rpc/servers/zmq/util.rb +7 -7
  77. data/lib/protobuf/rpc/servers/zmq/worker.rb +5 -7
  78. data/lib/protobuf/rpc/servers/zmq_runner.rb +14 -3
  79. data/lib/protobuf/rpc/service.rb +15 -15
  80. data/lib/protobuf/rpc/service_directory.rb +7 -11
  81. data/lib/protobuf/rpc/service_dispatcher.rb +3 -3
  82. data/lib/protobuf/rpc/service_filters.rb +27 -28
  83. data/lib/protobuf/rpc/stat.rb +4 -7
  84. data/lib/protobuf/socket.rb +0 -1
  85. data/lib/protobuf/tasks/compile.rake +2 -2
  86. data/lib/protobuf/version.rb +1 -1
  87. data/protobuf.gemspec +20 -4
  88. data/spec/benchmark/tasks.rb +49 -23
  89. data/spec/bin/protoc-gen-ruby_spec.rb +11 -6
  90. data/spec/encoding/all_types_spec.rb +91 -77
  91. data/spec/encoding/extreme_values_spec.rb +0 -0
  92. data/spec/functional/socket_server_spec.rb +9 -10
  93. data/spec/functional/zmq_server_spec.rb +21 -19
  94. data/spec/lib/protobuf/cli_spec.rb +20 -20
  95. data/spec/lib/protobuf/code_generator_spec.rb +6 -6
  96. data/spec/lib/protobuf/enum_spec.rb +57 -31
  97. data/spec/lib/protobuf/field/float_field_spec.rb +2 -2
  98. data/spec/lib/protobuf/field/int32_field_spec.rb +1 -1
  99. data/spec/lib/protobuf/field/string_field_spec.rb +7 -8
  100. data/spec/lib/protobuf/field_spec.rb +3 -6
  101. data/spec/lib/protobuf/generators/base_spec.rb +6 -6
  102. data/spec/lib/protobuf/generators/enum_generator_spec.rb +22 -17
  103. data/spec/lib/protobuf/generators/extension_generator_spec.rb +8 -9
  104. data/spec/lib/protobuf/generators/field_generator_spec.rb +14 -11
  105. data/spec/lib/protobuf/generators/file_generator_spec.rb +7 -4
  106. data/spec/lib/protobuf/generators/service_generator_spec.rb +14 -11
  107. data/spec/lib/protobuf/lifecycle_spec.rb +9 -4
  108. data/spec/lib/protobuf/message_spec.rb +63 -35
  109. data/spec/lib/protobuf/optionable_spec.rb +3 -3
  110. data/spec/lib/protobuf/rpc/client_spec.rb +2 -2
  111. data/spec/lib/protobuf/rpc/connector_spec.rb +1 -1
  112. data/spec/lib/protobuf/rpc/connectors/base_spec.rb +6 -6
  113. data/spec/lib/protobuf/rpc/connectors/common_spec.rb +26 -18
  114. data/spec/lib/protobuf/rpc/connectors/socket_spec.rb +4 -4
  115. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +11 -9
  116. data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +2 -2
  117. data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +7 -7
  118. data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +14 -14
  119. data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +5 -5
  120. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +1 -1
  121. data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +9 -7
  122. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +9 -9
  123. data/spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb +2 -2
  124. data/spec/lib/protobuf/rpc/service_directory_spec.rb +24 -23
  125. data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +4 -4
  126. data/spec/lib/protobuf/rpc/service_filters_spec.rb +84 -51
  127. data/spec/lib/protobuf/rpc/service_spec.rb +15 -14
  128. data/spec/lib/protobuf/rpc/stat_spec.rb +1 -1
  129. data/spec/lib/protobuf_spec.rb +9 -9
  130. data/spec/spec_helper.rb +7 -19
  131. data/spec/support/server.rb +29 -59
  132. data/spec/support/test/defaults.pb.rb +2 -0
  133. data/spec/support/test/enum.pb.rb +2 -0
  134. data/spec/support/test/extended.pb.rb +2 -0
  135. data/spec/support/test/google_unittest_import.pb.rb +2 -0
  136. data/spec/support/test/google_unittest_import_public.pb.rb +2 -0
  137. data/spec/support/test/multi_field_extensions.pb.rb +2 -0
  138. data/spec/support/test/resource.pb.rb +2 -0
  139. data/spec/support/test/resource_service.rb +17 -20
  140. metadata +153 -112
  141. data/lib/protobuf/deprecator.rb +0 -42
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'spec/support/test/resource_service'
3
3
 
4
- describe Protobuf::Rpc::Service do
4
+ RSpec.describe Protobuf::Rpc::Service do
5
5
 
6
6
  context 'class methods' do
7
7
  subject { Test::ResourceService }
@@ -64,10 +64,11 @@ describe Protobuf::Rpc::Service do
64
64
  it 'initializes a client object for this service' do
65
65
  client = double('client')
66
66
  expect(::Protobuf::Rpc::Client).to receive(:new)
67
- .with(hash_including({ :service => subject,
68
- :host => subject.host,
69
- :port => subject.port }))
70
- .and_return(client)
67
+ .with(hash_including(
68
+ :service => subject,
69
+ :host => subject.host,
70
+ :port => subject.port,
71
+ )).and_return(client)
71
72
  expect(subject.client).to eq client
72
73
  end
73
74
  end
@@ -99,8 +100,8 @@ describe Protobuf::Rpc::Service do
99
100
 
100
101
  context 'instance methods' do
101
102
  context 'when invoking a service call' do
102
- before(:all) do
103
- class ::NewTestService < Protobuf::Rpc::Service
103
+ before do
104
+ stub_const('NewTestService', Class.new(Protobuf::Rpc::Service) do
104
105
  rpc :find_with_implied_response, Test::ResourceFindRequest, Test::Resource
105
106
  def find_with_implied_response
106
107
  response.name = 'Implicit response'
@@ -117,7 +118,7 @@ describe Protobuf::Rpc::Service do
117
118
  rpc_failed('This is a failed endpoint')
118
119
  response.name = 'Name will still be set'
119
120
  end
120
- end
121
+ end)
121
122
  end
122
123
 
123
124
  let(:request) { Test::ResourceFindRequest.new(:name => 'resource') }
@@ -125,12 +126,12 @@ describe Protobuf::Rpc::Service do
125
126
 
126
127
  context 'when calling the rpc method' do
127
128
  context 'when response is implied' do
128
- let(:env) {
129
+ let(:env) do
129
130
  Protobuf::Rpc::Env.new(
130
131
  'request' => request,
131
- 'response_type' => response_type
132
+ 'response_type' => response_type,
132
133
  )
133
- }
134
+ end
134
135
  let(:response_type) { service.rpcs[:find_with_implied_response].response_type }
135
136
  let(:service) { NewTestService }
136
137
 
@@ -142,12 +143,12 @@ describe Protobuf::Rpc::Service do
142
143
  end
143
144
 
144
145
  context 'when using respond_with paradigm' do
145
- let(:env) {
146
+ let(:env) do
146
147
  Protobuf::Rpc::Env.new(
147
148
  'method_name' => :find_with_respond_with,
148
- 'request' => request
149
+ 'request' => request,
149
150
  )
150
- }
151
+ end
151
152
 
152
153
  subject { NewTestService.new(env) }
153
154
 
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'timecop'
3
3
  require 'active_support/core_ext/numeric/time'
4
4
 
5
- describe ::Protobuf::Rpc::Stat do
5
+ RSpec.describe ::Protobuf::Rpc::Stat do
6
6
 
7
7
  before(:all) do
8
8
  unless defined?(BarService)
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'protobuf'
3
3
 
4
- describe ::Protobuf do
4
+ RSpec.describe ::Protobuf do
5
5
 
6
6
  describe '.client_host' do
7
- after { ::Protobuf.instance_variable_set(:@_client_host, nil) }
7
+ after { ::Protobuf.client_host = nil }
8
8
 
9
9
  subject { ::Protobuf.client_host }
10
10
 
@@ -20,7 +20,7 @@ describe ::Protobuf do
20
20
  end
21
21
 
22
22
  describe '.connector_type' do
23
- before { described_class.instance_variable_set(:@_connector_type, nil) }
23
+ before { described_class.instance_variable_set(:@connector_type, nil) }
24
24
 
25
25
  it 'defaults to socket' do
26
26
  expect(described_class.connector_type).to eq :socket
@@ -35,15 +35,15 @@ describe ::Protobuf do
35
35
 
36
36
  it 'does not accept other types' do
37
37
  [:hello, :world, :evented].each do |type|
38
- expect {
38
+ expect do
39
39
  described_class.connector_type = type
40
- }.to raise_error(ArgumentError)
40
+ end.to raise_error(ArgumentError)
41
41
  end
42
42
  end
43
43
  end
44
44
 
45
45
  describe '.gc_pause_server_request?' do
46
- before { described_class.instance_variable_set(:@_gc_pause_server_request, nil) }
46
+ before { described_class.instance_variable_set(:@gc_pause_server_request, nil) }
47
47
 
48
48
  it 'defaults to a false value' do
49
49
  expect(described_class.gc_pause_server_request?).to be false
@@ -56,7 +56,7 @@ describe ::Protobuf do
56
56
  end
57
57
 
58
58
  describe '.print_deprecation_warnings?' do
59
- before { described_class.instance_variable_set(:@_print_deprecation_warnings, nil) }
59
+ before { described_class.instance_variable_set(:@print_deprecation_warnings, nil) }
60
60
 
61
61
  it 'defaults to a true value' do
62
62
  expect(described_class.print_deprecation_warnings?).to be true
@@ -87,9 +87,9 @@ describe ::Protobuf do
87
87
  end
88
88
 
89
89
  it 'is settable' do
90
- expect {
90
+ expect do
91
91
  described_class.ignore_unknown_fields = false
92
- }.to change {
92
+ end.to change {
93
93
  described_class.ignore_unknown_fields?
94
94
  }.from(true).to(false)
95
95
  end
@@ -3,21 +3,20 @@ require 'rubygems'
3
3
  require 'bundler'
4
4
  Bundler.setup :default, :development, :test
5
5
  require 'pry'
6
- # require 'rspec/its'
7
6
 
8
- $: << ::File.expand_path('../..', __FILE__)
9
- $: << ::File.expand_path('../support', __FILE__)
7
+ $LOAD_PATH << ::File.expand_path('../..', __FILE__)
8
+ $LOAD_PATH << ::File.expand_path('../support', __FILE__)
10
9
 
11
10
  require 'protobuf'
12
11
  require 'protobuf/rpc/server'
13
12
  require ::File.expand_path('../support/all', __FILE__)
14
13
 
15
- $: << ::File.expand_path("../../lib/protobuf/descriptors", __FILE__)
14
+ $LOAD_PATH << ::File.expand_path("../../lib/protobuf/descriptors", __FILE__)
16
15
  require 'google/protobuf/compiler/plugin.pb'
17
16
 
18
17
  # Including a way to turn on debug logger for spec runs
19
18
  if ENV.key?('DEBUG')
20
- debug_log = ::File.expand_path('../../debug_specs.log', __FILE__ )
19
+ debug_log = ::File.expand_path('../../debug_specs.log', __FILE__)
21
20
  ::Protobuf::Logging.initialize_logger(debug_log, ::Logger::DEBUG)
22
21
  else
23
22
  ::Protobuf::Logging.initialize_logger('/dev/null')
@@ -26,23 +25,12 @@ end
26
25
  # Get rid of the deprecation env var if present (messes with specs).
27
26
  ENV.delete("PB_IGNORE_DEPRECATIONS")
28
27
 
29
- ::RSpec.configure do |c|
30
- c.mock_with :rspec
31
-
32
- c.before(:suite) do
33
- unless ENV['NO_COMPILE_TEST_PROTOS']
34
- require 'rake'
35
- load ::File.expand_path('../../Rakefile', __FILE__)
36
- $stdout.puts 'Compiling test protos (use NO_COMPILE_TEST_PROTOS=1 to skip)'
37
- ::Rake::Task['compile:spec']
38
- end
39
- end
40
- end
41
-
42
28
  support_proto_glob = File.expand_path('../support/**/*.pb.rb', __FILE__)
43
29
  Dir[support_proto_glob].each { |proto_file| require proto_file }
44
30
 
45
- class ::Protobuf::Rpc::Client
31
+ RSpec.configure(&:disable_monkey_patching!)
32
+
33
+ ::Protobuf::Rpc::Client.class_eval do
46
34
  def ==(other)
47
35
  connector.options == other.options && \
48
36
  success_cb == other.success_cb && \
@@ -1,4 +1,7 @@
1
1
  require 'ostruct'
2
+
3
+ require 'active_support/core_ext/hash/reverse_merge'
4
+
2
5
  require 'protobuf/logging'
3
6
  require 'protobuf/rpc/server'
4
7
  require 'protobuf/rpc/servers/socket/server'
@@ -10,82 +13,49 @@ require 'spec/support/test/resource_service'
10
13
  # Want to abort if server dies?
11
14
  Thread.abort_on_exception = true
12
15
 
13
- module StubProtobufServerFactory
14
- def self.build(delay)
15
- new_server = Class.new(Protobuf::Rpc::Socket::Server) do
16
- def self.sleep_interval
17
- @sleep_interval
18
- end
19
-
20
- def self.sleep_interval=(si)
21
- @sleep_interval = si
22
- end
23
-
24
- def post_init
25
- sleep self.class.sleep_interval
26
- super
27
- end
28
- end
29
-
30
- new_server.sleep_interval = delay
31
- return new_server
32
- end
33
- end
34
-
35
16
  class StubServer
36
17
  include Protobuf::Logging
37
18
 
38
- attr_accessor :options
19
+ private
20
+
21
+ attr_accessor :options, :runner, :runner_thread
22
+
23
+ public
39
24
 
40
25
  def initialize(options = {})
41
- @running = true
42
- @options = OpenStruct.new({ :host => "127.0.0.1",
43
- :port => 9399,
44
- :worker_port => 9400,
45
- :delay => 0,
46
- :server => Protobuf::Rpc::Socket::Server }.merge(options))
26
+ self.options = OpenStruct.new(
27
+ options.reverse_merge(
28
+ :host => '127.0.0.1',
29
+ :port => 9399,
30
+ :worker_port => 9400,
31
+ :delay => 0,
32
+ :server => Protobuf::Rpc::Socket::Server,
33
+ ),
34
+ )
47
35
 
48
36
  start
49
37
  yield self
50
38
  ensure
51
- stop if @running
39
+ stop
52
40
  end
53
41
 
54
42
  def start
55
- case
56
- when @options.server == Protobuf::Rpc::Zmq::Server
57
- start_zmq_server
58
- else
59
- start_socket_server
60
- end
61
- logger.debug { sign_message("Server started #{@options.host}:#{@options.port}") }
62
- end
43
+ runner_class = {
44
+ ::Protobuf::Rpc::Zmq::Server => ::Protobuf::Rpc::ZmqRunner,
45
+ ::Protobuf::Rpc::Socket::Server => ::Protobuf::Rpc::SocketRunner,
46
+ }.fetch(options.server)
63
47
 
64
- def start_socket_server
65
- @sock_runner = ::Protobuf::Rpc::SocketRunner.new(options)
66
- @sock_thread = Thread.new(@sock_runner) { |runner| runner.run }
67
- @sock_thread.abort_on_exception = true # Set for testing purposes
68
- Thread.pass until @sock_runner.running?
69
- end
48
+ self.runner = runner_class.new(options)
49
+ self.runner_thread = Thread.new(runner, &:run)
50
+ runner_thread.abort_on_exception = true # Set for testing purposes
51
+ Thread.pass until runner.running?
70
52
 
71
- def start_zmq_server
72
- @zmq_runner = ::Protobuf::Rpc::ZmqRunner.new(options)
73
- @zmq_thread = Thread.new(@zmq_runner) { |runner| runner.run }
74
- @zmq_thread.abort_on_exception = true # Set for testing purposes
75
- Thread.pass until @zmq_runner.running?
53
+ logger.debug { sign_message("Server started #{options.host}:#{options.port}") }
76
54
  end
77
55
 
78
56
  def stop
79
- case
80
- when @options.server == Protobuf::Rpc::Zmq::Server then
81
- @zmq_runner.try :stop
82
- @zmq_thread.join if @zmq_thread
83
- else
84
- @sock_runner.stop
85
- @sock_thread.join if @sock_thread
86
- end
87
-
88
- @running = false
57
+ runner.stop
58
+ runner_thread.join
89
59
  end
90
60
 
91
61
  def log_signature
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ##
2
4
  # This file is auto-generated. DO NOT EDIT!
3
5
  #
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ##
2
4
  # This file is auto-generated. DO NOT EDIT!
3
5
  #
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ##
2
4
  # This file is auto-generated. DO NOT EDIT!
3
5
  #
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ##
2
4
  # This file is auto-generated. DO NOT EDIT!
3
5
  #
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ##
2
4
  # This file is auto-generated. DO NOT EDIT!
3
5
  #
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ##
2
4
  # This file is auto-generated. DO NOT EDIT!
3
5
  #
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ##
2
4
  # This file is auto-generated. DO NOT EDIT!
3
5
  #
@@ -1,26 +1,23 @@
1
1
  require ::File.expand_path('../resource.pb', __FILE__)
2
2
 
3
- module Test
4
- class ResourceService
5
-
6
- # request -> Test::ResourceFindRequest
7
- # response -> Test::Resource
8
- def find
9
- response.name = request.name
10
- response.status = request.active ? 1 : 0
11
- end
3
+ Test::ResourceService.class_eval do
4
+ # request -> Test::ResourceFindRequest
5
+ # response -> Test::Resource
6
+ def find
7
+ response.name = request.name
8
+ response.status = request.active ? 1 : 0
9
+ end
12
10
 
13
- # request -> Test::ResourceSleepRequest
14
- # response -> Test::Resource
15
- def find_with_sleep
16
- sleep (request.sleep || 1)
17
- response.name = 'Request should have timed out'
18
- end
11
+ # request -> Test::ResourceSleepRequest
12
+ # response -> Test::Resource
13
+ def find_with_sleep
14
+ sleep(request.sleep || 1)
15
+ response.name = 'Request should have timed out'
16
+ end
19
17
 
20
- # request -> Test::ResourceFindRequest
21
- # response -> Test::Resource
22
- def find_with_rpc_failed
23
- rpc_failed('Find failed')
24
- end
18
+ # request -> Test::ResourceFindRequest
19
+ # response -> Test::Resource
20
+ def find_with_rpc_failed
21
+ rpc_failed('Find failed')
25
22
  end
26
23
  end
metadata CHANGED
@@ -1,211 +1,186 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.6
5
- prerelease:
4
+ version: 3.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - BJ Neilsen
9
8
  - Brandon Dewitt
10
9
  - Devin Christensen
11
10
  - Adam Hutchison
12
- autorequire:
11
+ autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2014-10-10 00:00:00.000000000 Z
14
+ date: 2014-12-04 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: activesupport
19
- requirement: !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ! '>='
23
- - !ruby/object:Gem::Version
24
- version: '3.2'
25
- type: :runtime
26
- prerelease: false
27
18
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
19
  requirements:
30
- - - ! '>='
20
+ - - '>='
31
21
  - !ruby/object:Gem::Version
32
22
  version: '3.2'
33
- - !ruby/object:Gem::Dependency
34
- name: middleware
35
23
  requirement: !ruby/object:Gem::Requirement
36
- none: false
37
24
  requirements:
38
- - - ! '>='
25
+ - - '>='
39
26
  - !ruby/object:Gem::Version
40
- version: '0'
41
- type: :runtime
27
+ version: '3.2'
42
28
  prerelease: false
29
+ type: :runtime
30
+ - !ruby/object:Gem::Dependency
31
+ name: middleware
43
32
  version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
33
  requirements:
46
- - - ! '>='
34
+ - - '>='
47
35
  - !ruby/object:Gem::Version
48
36
  version: '0'
49
- - !ruby/object:Gem::Dependency
50
- name: thor
51
37
  requirement: !ruby/object:Gem::Requirement
52
- none: false
53
38
  requirements:
54
- - - ! '>='
39
+ - - '>='
55
40
  - !ruby/object:Gem::Version
56
41
  version: '0'
57
- type: :runtime
58
42
  prerelease: false
43
+ type: :runtime
44
+ - !ruby/object:Gem::Dependency
45
+ name: thor
59
46
  version_requirements: !ruby/object:Gem::Requirement
60
- none: false
61
47
  requirements:
62
- - - ! '>='
48
+ - - '>='
63
49
  - !ruby/object:Gem::Version
64
50
  version: '0'
65
- - !ruby/object:Gem::Dependency
66
- name: thread_safe
67
51
  requirement: !ruby/object:Gem::Requirement
68
- none: false
69
52
  requirements:
70
- - - ! '>='
53
+ - - '>='
71
54
  - !ruby/object:Gem::Version
72
55
  version: '0'
73
- type: :runtime
74
56
  prerelease: false
57
+ type: :runtime
58
+ - !ruby/object:Gem::Dependency
59
+ name: thread_safe
75
60
  version_requirements: !ruby/object:Gem::Requirement
76
- none: false
77
61
  requirements:
78
- - - ! '>='
62
+ - - '>='
79
63
  - !ruby/object:Gem::Version
80
64
  version: '0'
81
- - !ruby/object:Gem::Dependency
82
- name: ffi-rzmq
83
65
  requirement: !ruby/object:Gem::Requirement
84
- none: false
85
66
  requirements:
86
- - - ! '>='
67
+ - - '>='
87
68
  - !ruby/object:Gem::Version
88
69
  version: '0'
89
- type: :development
90
70
  prerelease: false
71
+ type: :runtime
72
+ - !ruby/object:Gem::Dependency
73
+ name: ffi-rzmq
91
74
  version_requirements: !ruby/object:Gem::Requirement
92
- none: false
93
75
  requirements:
94
- - - ! '>='
76
+ - - '>='
95
77
  - !ruby/object:Gem::Version
96
78
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: pry-nav
99
79
  requirement: !ruby/object:Gem::Requirement
100
- none: false
101
80
  requirements:
102
- - - ! '>='
81
+ - - '>='
103
82
  - !ruby/object:Gem::Version
104
83
  version: '0'
105
- type: :development
106
84
  prerelease: false
85
+ type: :development
86
+ - !ruby/object:Gem::Dependency
87
+ name: rake
107
88
  version_requirements: !ruby/object:Gem::Requirement
108
- none: false
109
89
  requirements:
110
- - - ! '>='
90
+ - - '>='
111
91
  - !ruby/object:Gem::Version
112
92
  version: '0'
113
- - !ruby/object:Gem::Dependency
114
- name: rake
115
93
  requirement: !ruby/object:Gem::Requirement
116
- none: false
117
94
  requirements:
118
- - - ! '>='
95
+ - - '>='
119
96
  - !ruby/object:Gem::Version
120
97
  version: '0'
121
- type: :development
122
98
  prerelease: false
99
+ type: :development
100
+ - !ruby/object:Gem::Dependency
101
+ name: rspec
123
102
  version_requirements: !ruby/object:Gem::Requirement
124
- none: false
125
103
  requirements:
126
- - - ! '>='
104
+ - - '>='
127
105
  - !ruby/object:Gem::Version
128
- version: '0'
129
- - !ruby/object:Gem::Dependency
130
- name: rspec
106
+ version: '3.0'
131
107
  requirement: !ruby/object:Gem::Requirement
132
- none: false
133
108
  requirements:
134
- - - ! '>='
109
+ - - '>='
135
110
  - !ruby/object:Gem::Version
136
111
  version: '3.0'
137
- type: :development
138
112
  prerelease: false
113
+ type: :development
114
+ - !ruby/object:Gem::Dependency
115
+ name: rubocop
139
116
  version_requirements: !ruby/object:Gem::Requirement
140
- none: false
141
117
  requirements:
142
- - - ! '>='
118
+ - - '>='
143
119
  - !ruby/object:Gem::Version
144
- version: '3.0'
145
- - !ruby/object:Gem::Dependency
146
- name: simplecov
120
+ version: '0'
147
121
  requirement: !ruby/object:Gem::Requirement
148
- none: false
149
122
  requirements:
150
- - - ! '>='
123
+ - - '>='
151
124
  - !ruby/object:Gem::Version
152
125
  version: '0'
153
- type: :development
154
126
  prerelease: false
127
+ type: :development
128
+ - !ruby/object:Gem::Dependency
129
+ name: simplecov
155
130
  version_requirements: !ruby/object:Gem::Requirement
156
- none: false
157
131
  requirements:
158
- - - ! '>='
132
+ - - '>='
159
133
  - !ruby/object:Gem::Version
160
134
  version: '0'
161
- - !ruby/object:Gem::Dependency
162
- name: yard
163
135
  requirement: !ruby/object:Gem::Requirement
164
- none: false
165
136
  requirements:
166
- - - ! '>='
137
+ - - '>='
167
138
  - !ruby/object:Gem::Version
168
139
  version: '0'
169
- type: :development
170
140
  prerelease: false
141
+ type: :development
142
+ - !ruby/object:Gem::Dependency
143
+ name: timecop
171
144
  version_requirements: !ruby/object:Gem::Requirement
172
- none: false
173
145
  requirements:
174
- - - ! '>='
146
+ - - '>='
175
147
  - !ruby/object:Gem::Version
176
148
  version: '0'
177
- - !ruby/object:Gem::Dependency
178
- name: timecop
179
149
  requirement: !ruby/object:Gem::Requirement
180
- none: false
181
150
  requirements:
182
- - - ! '>='
151
+ - - '>='
183
152
  - !ruby/object:Gem::Version
184
153
  version: '0'
185
- type: :development
186
154
  prerelease: false
155
+ type: :development
156
+ - !ruby/object:Gem::Dependency
157
+ name: yard
187
158
  version_requirements: !ruby/object:Gem::Requirement
188
- none: false
189
159
  requirements:
190
- - - ! '>='
160
+ - - '>='
191
161
  - !ruby/object:Gem::Version
192
162
  version: '0'
193
- - !ruby/object:Gem::Dependency
194
- name: perftools.rb
195
163
  requirement: !ruby/object:Gem::Requirement
196
- none: false
197
164
  requirements:
198
- - - ! '>='
165
+ - - '>='
199
166
  - !ruby/object:Gem::Version
200
167
  version: '0'
201
- type: :development
202
168
  prerelease: false
169
+ type: :development
170
+ - !ruby/object:Gem::Dependency
171
+ name: pry
203
172
  version_requirements: !ruby/object:Gem::Requirement
204
- none: false
205
173
  requirements:
206
- - - ! '>='
174
+ - - '>='
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ requirement: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - '>='
207
180
  - !ruby/object:Gem::Version
208
181
  version: '0'
182
+ prerelease: false
183
+ type: :development
209
184
  description: Google Protocol Buffers serialization and RPC implementation for Ruby.
210
185
  email:
211
186
  - bj.neilsen+protobuf@gmail.com
@@ -219,6 +194,8 @@ extensions: []
219
194
  extra_rdoc_files: []
220
195
  files:
221
196
  - .gitignore
197
+ - .rubocop.yml
198
+ - .rubocop_todo.yml
222
199
  - .travis.yml
223
200
  - .yardopts
224
201
  - CHANGES.md
@@ -229,11 +206,12 @@ files:
229
206
  - Rakefile
230
207
  - bin/protoc-gen-ruby
231
208
  - bin/rpc_server
209
+ - install-protobuf.sh
232
210
  - lib/protobuf.rb
233
211
  - lib/protobuf/cli.rb
234
212
  - lib/protobuf/code_generator.rb
235
213
  - lib/protobuf/decoder.rb
236
- - lib/protobuf/deprecator.rb
214
+ - lib/protobuf/deprecation.rb
237
215
  - lib/protobuf/descriptors.rb
238
216
  - lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb
239
217
  - lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb
@@ -395,33 +373,96 @@ files:
395
373
  homepage: https://github.com/localshred/protobuf
396
374
  licenses:
397
375
  - MIT
398
- post_install_message:
376
+ metadata: {}
377
+ post_install_message:
399
378
  rdoc_options: []
400
379
  require_paths:
401
380
  - lib
402
381
  required_ruby_version: !ruby/object:Gem::Requirement
403
- none: false
404
382
  requirements:
405
- - - ! '>='
383
+ - - '>='
406
384
  - !ruby/object:Gem::Version
407
385
  version: '0'
408
- segments:
409
- - 0
410
- hash: 2790172649663274140
411
386
  required_rubygems_version: !ruby/object:Gem::Requirement
412
- none: false
413
387
  requirements:
414
- - - ! '>='
388
+ - - '>='
415
389
  - !ruby/object:Gem::Version
416
390
  version: '0'
417
- segments:
418
- - 0
419
- hash: 2790172649663274140
420
391
  requirements: []
421
- rubyforge_project:
422
- rubygems_version: 1.8.24
423
- signing_key:
424
- specification_version: 3
392
+ rubyforge_project:
393
+ rubygems_version: 2.1.9
394
+ signing_key:
395
+ specification_version: 4
425
396
  summary: Google Protocol Buffers serialization and RPC implementation for Ruby.
426
- test_files: []
427
- has_rdoc:
397
+ test_files:
398
+ - spec/benchmark/tasks.rb
399
+ - spec/bin/protoc-gen-ruby_spec.rb
400
+ - spec/data/data.bin
401
+ - spec/data/types.bin
402
+ - spec/encoding/all_types_spec.rb
403
+ - spec/encoding/extreme_values_spec.rb
404
+ - spec/functional/socket_server_spec.rb
405
+ - spec/functional/zmq_server_spec.rb
406
+ - spec/lib/protobuf/cli_spec.rb
407
+ - spec/lib/protobuf/code_generator_spec.rb
408
+ - spec/lib/protobuf/enum_spec.rb
409
+ - spec/lib/protobuf/field/float_field_spec.rb
410
+ - spec/lib/protobuf/field/int32_field_spec.rb
411
+ - spec/lib/protobuf/field/string_field_spec.rb
412
+ - spec/lib/protobuf/field_spec.rb
413
+ - spec/lib/protobuf/generators/base_spec.rb
414
+ - spec/lib/protobuf/generators/enum_generator_spec.rb
415
+ - spec/lib/protobuf/generators/extension_generator_spec.rb
416
+ - spec/lib/protobuf/generators/field_generator_spec.rb
417
+ - spec/lib/protobuf/generators/file_generator_spec.rb
418
+ - spec/lib/protobuf/generators/message_generator_spec.rb
419
+ - spec/lib/protobuf/generators/service_generator_spec.rb
420
+ - spec/lib/protobuf/lifecycle_spec.rb
421
+ - spec/lib/protobuf/message_spec.rb
422
+ - spec/lib/protobuf/optionable_spec.rb
423
+ - spec/lib/protobuf/rpc/client_spec.rb
424
+ - spec/lib/protobuf/rpc/connector_spec.rb
425
+ - spec/lib/protobuf/rpc/connectors/base_spec.rb
426
+ - spec/lib/protobuf/rpc/connectors/common_spec.rb
427
+ - spec/lib/protobuf/rpc/connectors/socket_spec.rb
428
+ - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
429
+ - spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb
430
+ - spec/lib/protobuf/rpc/middleware/logger_spec.rb
431
+ - spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb
432
+ - spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb
433
+ - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
434
+ - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
435
+ - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
436
+ - spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
437
+ - spec/lib/protobuf/rpc/service_directory_spec.rb
438
+ - spec/lib/protobuf/rpc/service_dispatcher_spec.rb
439
+ - spec/lib/protobuf/rpc/service_filters_spec.rb
440
+ - spec/lib/protobuf/rpc/service_spec.rb
441
+ - spec/lib/protobuf/rpc/stat_spec.rb
442
+ - spec/lib/protobuf_spec.rb
443
+ - spec/spec_helper.rb
444
+ - spec/support/all.rb
445
+ - spec/support/packed_field.rb
446
+ - spec/support/server.rb
447
+ - spec/support/test/all_types.data.bin
448
+ - spec/support/test/all_types.data.txt
449
+ - spec/support/test/defaults.pb.rb
450
+ - spec/support/test/defaults.proto
451
+ - spec/support/test/enum.pb.rb
452
+ - spec/support/test/enum.proto
453
+ - spec/support/test/extended.pb.rb
454
+ - spec/support/test/extended.proto
455
+ - spec/support/test/extreme_values.data.bin
456
+ - spec/support/test/google_unittest.pb.rb
457
+ - spec/support/test/google_unittest.proto
458
+ - spec/support/test/google_unittest_import.pb.rb
459
+ - spec/support/test/google_unittest_import.proto
460
+ - spec/support/test/google_unittest_import_public.pb.rb
461
+ - spec/support/test/google_unittest_import_public.proto
462
+ - spec/support/test/multi_field_extensions.pb.rb
463
+ - spec/support/test/multi_field_extensions.proto
464
+ - spec/support/test/resource.pb.rb
465
+ - spec/support/test/resource.proto
466
+ - spec/support/test/resource_service.rb
467
+ - spec/support/test_app_file.rb
468
+ has_rdoc: