protobuf 3.7.1 → 3.7.2.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebd9330f958ccb823cf88c9ba76fc38703904a62
4
- data.tar.gz: 6e96d29c2031242e948ecc8390948efe929ee72b
3
+ metadata.gz: 5f4f0794925c7662d3fce4dc28345e914f33115b
4
+ data.tar.gz: 626caedcbe40e19f74a4d5a8a2a5f22814e03e9d
5
5
  SHA512:
6
- metadata.gz: 5fbe2f1e8c33222b7e80a84a95c2835bf275cce386984753213437e77c0a7c19da148003b46c7839ab98fa1cf55c7f8d990cb99e4068d2f2413b6de7d9e7d6f7
7
- data.tar.gz: bb1f32d73bda450988b2b4323025000ac2ffeb2e5c9eec7784d29362af5e31ddc9ebdd760a6b3c56bf4896eb5c044475de4466cb1ad84372d7def3495c13969f
6
+ metadata.gz: 96f02a0023e1229c1201523c5cc857ca4a4e6ab88008addc5283e633d497009b3c48e1374b868740e89cdc9b6a544e0a6130405704f37a02560463614d5cbd74
7
+ data.tar.gz: da8b4e50a0420a0182c5f7ae2f09baebd1c4e800beb69e7b915b06201fd447b7893641c4b0bbdd6e0cdbd751853b79e017a415c5390c81b3d52d89829f7d55c3
@@ -37,6 +37,13 @@ module Protobuf
37
37
  #
38
38
  # The name or address of the host to use during client RPC calls.
39
39
  attr_writer :client_host
40
+
41
+ # Server Host
42
+ #
43
+ # Default: first ipv4 address of the system
44
+ #
45
+ # The name or address of the host to use during client RPC calls.
46
+ attr_writer :server_host
40
47
  end
41
48
 
42
49
  def self.client_host
@@ -81,6 +88,10 @@ module Protobuf
81
88
  def self.ignore_unknown_fields=(value)
82
89
  @ignore_unknown_fields = !!value
83
90
  end
91
+
92
+ def self.server_host
93
+ @server_host ||= Socket.gethostname
94
+ end
84
95
  end
85
96
 
86
97
  unless ENV.key?('PB_NO_NETWORKING')
@@ -18,7 +18,7 @@ module Protobuf
18
18
  end
19
19
 
20
20
  def to_response
21
- ::Protobuf::Socketrpc::Response.new(:error => message, :error_reason => error_type)
21
+ ::Protobuf::Socketrpc::Response.new(:error => message, :error_reason => error_type, :server => ::Protobuf.server_host)
22
22
  end
23
23
  end
24
24
  end
@@ -72,9 +72,9 @@ module Protobuf
72
72
  #
73
73
  def wrapped_response
74
74
  if response.is_a?(::Protobuf::Rpc::PbError)
75
- ::Protobuf::Socketrpc::Response.new(:error => response.message, :error_reason => response.error_type)
75
+ ::Protobuf::Socketrpc::Response.new(:error => response.message, :error_reason => response.error_type, :server => ::Protobuf.server_host)
76
76
  else
77
- ::Protobuf::Socketrpc::Response.new(:response_proto => response.encode)
77
+ ::Protobuf::Socketrpc::Response.new(:response_proto => response.encode, :server => ::Protobuf.server_host)
78
78
  end
79
79
  end
80
80
  end
@@ -48,6 +48,7 @@ module Protobuf
48
48
  optional :string, :error, 2
49
49
  optional :bool, :callback, 3, :default => false
50
50
  optional ::Protobuf::Socketrpc::ErrorReason, :error_reason, 4
51
+ optional :string, :server, 5
51
52
  end
52
53
 
53
54
  end
@@ -1,3 +1,3 @@
1
1
  module Protobuf
2
- VERSION = '3.7.1' # rubocop:disable Style/MutableConstant
2
+ VERSION = '3.7.2.pre1' # rubocop:disable Style/MutableConstant
3
3
  end
@@ -38,6 +38,7 @@ message Response
38
38
  optional string error = 2; // Error message, if any
39
39
  optional bool callback = 3 [default = false]; // Was callback invoked (not sure what this is for)
40
40
  optional ErrorReason error_reason = 4; // Error Reason
41
+ optional string server = 5; // Server hostname or address
41
42
  }
42
43
 
43
44
  // Possible error reasons
@@ -10,10 +10,13 @@ RSpec.describe Protobuf::Rpc::Middleware::ResponseEncoder do
10
10
  end
11
11
  let(:encoded_response) { response_wrapper.encode }
12
12
  let(:response) { Test::Resource.new(:name => 'required') }
13
- let(:response_wrapper) { ::Protobuf::Socketrpc::Response.new(:response_proto => response) }
13
+ let(:response_wrapper) { ::Protobuf::Socketrpc::Response.new(:response_proto => response, :server => server_host) }
14
+ let(:server_host) { 'beepboopbop' }
14
15
 
15
16
  subject { described_class.new(app) }
16
17
 
18
+ before { ::Protobuf.server_host = server_host }
19
+
17
20
  describe "#call" do
18
21
  it "encodes the response" do
19
22
  stack_env = subject.call(env)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.2.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BJ Neilsen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-04-28 00:00:00.000000000 Z
14
+ date: 2017-05-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -458,9 +458,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
458
458
  version: '0'
459
459
  required_rubygems_version: !ruby/object:Gem::Requirement
460
460
  requirements:
461
- - - ">="
461
+ - - ">"
462
462
  - !ruby/object:Gem::Version
463
- version: '0'
463
+ version: 1.3.1
464
464
  requirements: []
465
465
  rubyforge_project:
466
466
  rubygems_version: 2.5.2