gruf 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.md +6 -0
  4. data/lib/gruf.rb +0 -1
  5. data/lib/gruf/client.rb +1 -2
  6. data/lib/gruf/configuration.rb +1 -2
  7. data/lib/gruf/controllers/base.rb +1 -2
  8. data/lib/gruf/controllers/request.rb +0 -1
  9. data/lib/gruf/controllers/service_binder.rb +0 -1
  10. data/lib/gruf/error.rb +1 -2
  11. data/lib/gruf/errors/debug_info.rb +0 -1
  12. data/lib/gruf/errors/field.rb +0 -1
  13. data/lib/gruf/errors/helpers.rb +0 -1
  14. data/lib/gruf/interceptors/active_record/connection_reset.rb +0 -1
  15. data/lib/gruf/interceptors/authentication/basic.rb +0 -1
  16. data/lib/gruf/interceptors/base.rb +0 -1
  17. data/lib/gruf/interceptors/context.rb +0 -1
  18. data/lib/gruf/interceptors/instrumentation/output_metadata_timer.rb +0 -1
  19. data/lib/gruf/interceptors/instrumentation/request_logging/formatters/base.rb +0 -1
  20. data/lib/gruf/interceptors/instrumentation/request_logging/formatters/logstash.rb +0 -1
  21. data/lib/gruf/interceptors/instrumentation/request_logging/formatters/plain.rb +0 -1
  22. data/lib/gruf/interceptors/instrumentation/request_logging/interceptor.rb +1 -2
  23. data/lib/gruf/interceptors/instrumentation/statsd.rb +0 -1
  24. data/lib/gruf/interceptors/server_interceptor.rb +0 -1
  25. data/lib/gruf/interceptors/timer.rb +0 -1
  26. data/lib/gruf/loggable.rb +0 -1
  27. data/lib/gruf/logging.rb +0 -1
  28. data/lib/gruf/response.rb +0 -1
  29. data/lib/gruf/serializers/errors/base.rb +0 -1
  30. data/lib/gruf/serializers/errors/json.rb +0 -1
  31. data/lib/gruf/server.rb +4 -3
  32. data/lib/gruf/timer.rb +0 -1
  33. data/lib/gruf/version.rb +1 -2
  34. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 355dcc90e5af826c230fed08326ade8b56b57728
4
- data.tar.gz: 6c0e2780048afff13c754c23aace69bfbd0c3463
3
+ metadata.gz: cf915e7758e81685a101b9e72aa09fed1e10f321
4
+ data.tar.gz: b554de229c8dc82eb178d097832fe73563217a91
5
5
  SHA512:
6
- metadata.gz: e69f8aa9f733f528be6adf971d21c38fbcacbaf18ee9f610bf970a44066f0e6d350858a90f4852006b39277ec2ba4ce63f428fa19d969c327e01850fb17037d7
7
- data.tar.gz: 1be4c4efc4bc0af3af2f3bd9516409739a207780f0a6c26009fa5336fa4b46711e602f5565dac65d6929664aed735ab20e9494d7c3f3708b24ec8d6134b9096a
6
+ metadata.gz: e6d41632033e9fef86546a98c7c15bd24e2814291f88ae4591f9a132291e09239152caf4e186818e08f919f77f13f1c730e38e705a0855864016139d0f5742db
7
+ data.tar.gz: 7a5e379562c72fca6bc9556ca613c98a71397f9b164e0253d81c0f9d4cc7b09bef65911d396b7da4fdd6f57e543aef7b9571f38b301df3ecf0e7b5e651adc4fc
@@ -2,6 +2,11 @@ Changelog for the gruf gem. This includes internal history before the gem was ma
2
2
 
3
3
  ### Pending release
4
4
 
5
+ ### 2.0.2
6
+
7
+ - Update Rubocop to 0.51
8
+ - Fix issue [#32] where server was not handling signals (\ht @Parad0X)
9
+
5
10
  ### 2.0.1
6
11
 
7
12
  - Handle ActiveRecord connection management more gracefully (Fixes #30)
@@ -45,7 +50,7 @@ Gruf 2.0 is a major shift from Gruf 1.0. See [UPGRADING.md](UPGRADING.md) for de
45
50
  ### 1.2.1
46
51
 
47
52
  - Added ability to pass in server options via new `server_options` configuration
48
- attribute.
53
+ attribute. (\ht @kruczjak)
49
54
 
50
55
  ### 1.2.0
51
56
 
data/README.md CHANGED
@@ -328,6 +328,12 @@ view and clone that shows how to integrate Gruf into an existing Rails applicati
328
328
  * Redo server configuration to be fully injectable
329
329
  * Move client calls to their native method implementation
330
330
 
331
+ ## Companies Using Gruf
332
+
333
+ Using gruf and want to show your support? Let us know and we'll add your name here.
334
+
335
+ * [BigCommerce](https://www.bigcommerce.com/)
336
+
331
337
  ## License
332
338
 
333
339
  Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -104,7 +103,7 @@ module Gruf
104
103
  emk = Gruf.error_metadata_key.to_s
105
104
  raise Gruf::Client::Error, error_deserializer_class.new(e.metadata[emk]).deserialize if e.respond_to?(:metadata) && e.metadata.key?(emk)
106
105
  raise # passthrough
107
- rescue => e
106
+ rescue StandardError => e
108
107
  Gruf.logger.error e.message
109
108
  raise
110
109
  end
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -67,7 +66,7 @@ module Gruf
67
66
  #
68
67
  def options
69
68
  opts = {}
70
- VALID_CONFIG_KEYS.each do |k, _v|
69
+ VALID_CONFIG_KEYS.each_key do |k|
71
70
  opts.merge!(k => send(k))
72
71
  end
73
72
  opts
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -72,7 +71,7 @@ module Gruf
72
71
  end
73
72
  rescue GRPC::BadStatus
74
73
  raise # passthrough
75
- rescue => e
74
+ rescue StandardError => e
76
75
  set_debug_info(e.message, e.backtrace) if Gruf.backtrace_on_error
77
76
  error_message = Gruf.use_exception_message ? e.message : Gruf.internal_error_message
78
77
  fail!(:internal, :unknown, error_message)
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -63,7 +62,7 @@ module Gruf
63
62
  # debug an given error response. This is sent by the server over the trailing metadata.
64
63
  attr_accessor :debug_info
65
64
  # @return [GRPC::BadStatus] The gRPC BadStatus error object that was generated
66
- attr_accessor :grpc_error
65
+ attr_writer :grpc_error
67
66
  # @return [Hash] The trailing metadata that was attached to the error
68
67
  attr_reader :metadata
69
68
 
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -176,7 +175,7 @@ module Gruf
176
175
  # @param [String] redacted_string The custom redact string
177
176
  #
178
177
  def hash_deep_redact!(hash, redacted_string)
179
- hash.keys.each do |key|
178
+ hash.each_key do |key|
180
179
  if hash[key].is_a? Hash
181
180
  hash_deep_redact!(hash[key], redacted_string)
182
181
  else
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -22,8 +21,6 @@ module Gruf
22
21
  class Server
23
22
  include Gruf::Loggable
24
23
 
25
- # @return [GRPC::RpcServer] The underlying GRPC server instance
26
- attr_reader :server
27
24
  # @return [Integer] The port the server is bound to
28
25
  attr_reader :port
29
26
  # @return [Hash] Hash of options passed into the server
@@ -58,12 +55,16 @@ module Gruf
58
55
  # Start the gRPC server
59
56
  #
60
57
  # :nocov:
58
+ # rubocop:disable Lint/ShadowedException
61
59
  def start!
62
60
  logger.info { 'Booting gRPC Server...' }
63
61
  server.run_till_terminated
62
+ rescue Interrupt, SignalException, SystemExit
64
63
  logger.info { 'Shutting down gRPC server...' }
64
+ server.stop
65
65
  end
66
66
  # :nocov:
67
+ # rubocop:enable Lint/ShadowedException
67
68
 
68
69
  ##
69
70
  # @param [Class] klass
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3
2
  #
4
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -15,5 +14,5 @@
15
14
  # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
15
  #
17
16
  module Gruf
18
- VERSION = '2.0.1'.freeze
17
+ VERSION = '2.0.2'.freeze
19
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-10 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler