protobuf-cucumber 3.10.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rubocop.yml +70 -0
  4. data/.rubocop_todo.yml +145 -0
  5. data/.travis.yml +40 -0
  6. data/.yardopts +5 -0
  7. data/CHANGES.md +344 -0
  8. data/CONTRIBUTING.md +16 -0
  9. data/Gemfile +3 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +33 -0
  12. data/Rakefile +64 -0
  13. data/bin/protoc-gen-ruby +22 -0
  14. data/bin/rpc_server +5 -0
  15. data/install-protobuf.sh +28 -0
  16. data/lib/protobuf.rb +129 -0
  17. data/lib/protobuf/cli.rb +257 -0
  18. data/lib/protobuf/code_generator.rb +120 -0
  19. data/lib/protobuf/decoder.rb +28 -0
  20. data/lib/protobuf/deprecation.rb +117 -0
  21. data/lib/protobuf/descriptors.rb +3 -0
  22. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +62 -0
  23. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +301 -0
  24. data/lib/protobuf/encoder.rb +11 -0
  25. data/lib/protobuf/enum.rb +365 -0
  26. data/lib/protobuf/exceptions.rb +9 -0
  27. data/lib/protobuf/field.rb +74 -0
  28. data/lib/protobuf/field/base_field.rb +380 -0
  29. data/lib/protobuf/field/base_field_object_definitions.rb +504 -0
  30. data/lib/protobuf/field/bool_field.rb +64 -0
  31. data/lib/protobuf/field/bytes_field.rb +78 -0
  32. data/lib/protobuf/field/double_field.rb +25 -0
  33. data/lib/protobuf/field/enum_field.rb +61 -0
  34. data/lib/protobuf/field/field_array.rb +104 -0
  35. data/lib/protobuf/field/field_hash.rb +122 -0
  36. data/lib/protobuf/field/fixed32_field.rb +25 -0
  37. data/lib/protobuf/field/fixed64_field.rb +28 -0
  38. data/lib/protobuf/field/float_field.rb +43 -0
  39. data/lib/protobuf/field/int32_field.rb +21 -0
  40. data/lib/protobuf/field/int64_field.rb +34 -0
  41. data/lib/protobuf/field/integer_field.rb +23 -0
  42. data/lib/protobuf/field/message_field.rb +51 -0
  43. data/lib/protobuf/field/sfixed32_field.rb +27 -0
  44. data/lib/protobuf/field/sfixed64_field.rb +28 -0
  45. data/lib/protobuf/field/signed_integer_field.rb +29 -0
  46. data/lib/protobuf/field/sint32_field.rb +21 -0
  47. data/lib/protobuf/field/sint64_field.rb +21 -0
  48. data/lib/protobuf/field/string_field.rb +51 -0
  49. data/lib/protobuf/field/uint32_field.rb +21 -0
  50. data/lib/protobuf/field/uint64_field.rb +21 -0
  51. data/lib/protobuf/field/varint_field.rb +77 -0
  52. data/lib/protobuf/generators/base.rb +85 -0
  53. data/lib/protobuf/generators/enum_generator.rb +39 -0
  54. data/lib/protobuf/generators/extension_generator.rb +27 -0
  55. data/lib/protobuf/generators/field_generator.rb +193 -0
  56. data/lib/protobuf/generators/file_generator.rb +262 -0
  57. data/lib/protobuf/generators/group_generator.rb +122 -0
  58. data/lib/protobuf/generators/message_generator.rb +104 -0
  59. data/lib/protobuf/generators/option_generator.rb +17 -0
  60. data/lib/protobuf/generators/printable.rb +160 -0
  61. data/lib/protobuf/generators/service_generator.rb +50 -0
  62. data/lib/protobuf/lifecycle.rb +33 -0
  63. data/lib/protobuf/logging.rb +39 -0
  64. data/lib/protobuf/message.rb +260 -0
  65. data/lib/protobuf/message/fields.rb +233 -0
  66. data/lib/protobuf/message/serialization.rb +85 -0
  67. data/lib/protobuf/optionable.rb +70 -0
  68. data/lib/protobuf/rpc/buffer.rb +78 -0
  69. data/lib/protobuf/rpc/client.rb +140 -0
  70. data/lib/protobuf/rpc/connectors/base.rb +221 -0
  71. data/lib/protobuf/rpc/connectors/ping.rb +89 -0
  72. data/lib/protobuf/rpc/connectors/socket.rb +78 -0
  73. data/lib/protobuf/rpc/connectors/zmq.rb +319 -0
  74. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +50 -0
  75. data/lib/protobuf/rpc/env.rb +60 -0
  76. data/lib/protobuf/rpc/error.rb +28 -0
  77. data/lib/protobuf/rpc/error/client_error.rb +31 -0
  78. data/lib/protobuf/rpc/error/server_error.rb +43 -0
  79. data/lib/protobuf/rpc/middleware.rb +25 -0
  80. data/lib/protobuf/rpc/middleware/exception_handler.rb +40 -0
  81. data/lib/protobuf/rpc/middleware/logger.rb +95 -0
  82. data/lib/protobuf/rpc/middleware/request_decoder.rb +79 -0
  83. data/lib/protobuf/rpc/middleware/response_encoder.rb +83 -0
  84. data/lib/protobuf/rpc/middleware/runner.rb +18 -0
  85. data/lib/protobuf/rpc/rpc.pb.rb +64 -0
  86. data/lib/protobuf/rpc/rpc_method.rb +16 -0
  87. data/lib/protobuf/rpc/server.rb +39 -0
  88. data/lib/protobuf/rpc/servers/socket/server.rb +121 -0
  89. data/lib/protobuf/rpc/servers/socket/worker.rb +56 -0
  90. data/lib/protobuf/rpc/servers/socket_runner.rb +46 -0
  91. data/lib/protobuf/rpc/servers/zmq/broker.rb +194 -0
  92. data/lib/protobuf/rpc/servers/zmq/server.rb +321 -0
  93. data/lib/protobuf/rpc/servers/zmq/util.rb +48 -0
  94. data/lib/protobuf/rpc/servers/zmq/worker.rb +105 -0
  95. data/lib/protobuf/rpc/servers/zmq_runner.rb +70 -0
  96. data/lib/protobuf/rpc/service.rb +172 -0
  97. data/lib/protobuf/rpc/service_directory.rb +261 -0
  98. data/lib/protobuf/rpc/service_dispatcher.rb +45 -0
  99. data/lib/protobuf/rpc/service_filters.rb +250 -0
  100. data/lib/protobuf/rpc/stat.rb +119 -0
  101. data/lib/protobuf/socket.rb +21 -0
  102. data/lib/protobuf/tasks.rb +1 -0
  103. data/lib/protobuf/tasks/compile.rake +80 -0
  104. data/lib/protobuf/varint.rb +20 -0
  105. data/lib/protobuf/varint_pure.rb +31 -0
  106. data/lib/protobuf/version.rb +3 -0
  107. data/lib/protobuf/wire_type.rb +10 -0
  108. data/lib/protobuf/zmq.rb +21 -0
  109. data/profile.html +5103 -0
  110. data/proto/dynamic_discovery.proto +44 -0
  111. data/proto/google/protobuf/compiler/plugin.proto +147 -0
  112. data/proto/google/protobuf/descriptor.proto +779 -0
  113. data/proto/rpc.proto +69 -0
  114. data/protobuf-cucumber.gemspec +57 -0
  115. data/spec/benchmark/tasks.rb +143 -0
  116. data/spec/bin/protoc-gen-ruby_spec.rb +23 -0
  117. data/spec/encoding/all_types_spec.rb +103 -0
  118. data/spec/encoding/extreme_values_spec.rb +0 -0
  119. data/spec/functional/class_inheritance_spec.rb +52 -0
  120. data/spec/functional/code_generator_spec.rb +58 -0
  121. data/spec/functional/socket_server_spec.rb +59 -0
  122. data/spec/functional/zmq_server_spec.rb +105 -0
  123. data/spec/lib/protobuf/cli_spec.rb +317 -0
  124. data/spec/lib/protobuf/code_generator_spec.rb +87 -0
  125. data/spec/lib/protobuf/enum_spec.rb +307 -0
  126. data/spec/lib/protobuf/field/bool_field_spec.rb +91 -0
  127. data/spec/lib/protobuf/field/double_field_spec.rb +9 -0
  128. data/spec/lib/protobuf/field/enum_field_spec.rb +44 -0
  129. data/spec/lib/protobuf/field/field_array_spec.rb +105 -0
  130. data/spec/lib/protobuf/field/field_hash_spec.rb +168 -0
  131. data/spec/lib/protobuf/field/fixed32_field_spec.rb +7 -0
  132. data/spec/lib/protobuf/field/fixed64_field_spec.rb +7 -0
  133. data/spec/lib/protobuf/field/float_field_spec.rb +90 -0
  134. data/spec/lib/protobuf/field/int32_field_spec.rb +120 -0
  135. data/spec/lib/protobuf/field/int64_field_spec.rb +7 -0
  136. data/spec/lib/protobuf/field/message_field_spec.rb +132 -0
  137. data/spec/lib/protobuf/field/sfixed32_field_spec.rb +9 -0
  138. data/spec/lib/protobuf/field/sfixed64_field_spec.rb +9 -0
  139. data/spec/lib/protobuf/field/sint32_field_spec.rb +9 -0
  140. data/spec/lib/protobuf/field/sint64_field_spec.rb +9 -0
  141. data/spec/lib/protobuf/field/string_field_spec.rb +79 -0
  142. data/spec/lib/protobuf/field/uint32_field_spec.rb +7 -0
  143. data/spec/lib/protobuf/field/uint64_field_spec.rb +7 -0
  144. data/spec/lib/protobuf/field_spec.rb +192 -0
  145. data/spec/lib/protobuf/generators/base_spec.rb +154 -0
  146. data/spec/lib/protobuf/generators/enum_generator_spec.rb +82 -0
  147. data/spec/lib/protobuf/generators/extension_generator_spec.rb +42 -0
  148. data/spec/lib/protobuf/generators/field_generator_spec.rb +197 -0
  149. data/spec/lib/protobuf/generators/file_generator_spec.rb +119 -0
  150. data/spec/lib/protobuf/generators/message_generator_spec.rb +0 -0
  151. data/spec/lib/protobuf/generators/service_generator_spec.rb +99 -0
  152. data/spec/lib/protobuf/lifecycle_spec.rb +94 -0
  153. data/spec/lib/protobuf/message_spec.rb +944 -0
  154. data/spec/lib/protobuf/optionable_spec.rb +265 -0
  155. data/spec/lib/protobuf/rpc/client_spec.rb +66 -0
  156. data/spec/lib/protobuf/rpc/connectors/base_spec.rb +226 -0
  157. data/spec/lib/protobuf/rpc/connectors/ping_spec.rb +69 -0
  158. data/spec/lib/protobuf/rpc/connectors/socket_spec.rb +34 -0
  159. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +110 -0
  160. data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +62 -0
  161. data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +49 -0
  162. data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +115 -0
  163. data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +91 -0
  164. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +38 -0
  165. data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +43 -0
  166. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +55 -0
  167. data/spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb +35 -0
  168. data/spec/lib/protobuf/rpc/service_directory_spec.rb +293 -0
  169. data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +35 -0
  170. data/spec/lib/protobuf/rpc/service_filters_spec.rb +517 -0
  171. data/spec/lib/protobuf/rpc/service_spec.rb +162 -0
  172. data/spec/lib/protobuf/rpc/stat_spec.rb +101 -0
  173. data/spec/lib/protobuf/varint_spec.rb +29 -0
  174. data/spec/lib/protobuf_spec.rb +105 -0
  175. data/spec/spec_helper.rb +42 -0
  176. data/spec/support/all.rb +6 -0
  177. data/spec/support/packed_field.rb +23 -0
  178. data/spec/support/protos/all_types.data.bin +0 -0
  179. data/spec/support/protos/all_types.data.txt +119 -0
  180. data/spec/support/protos/enum.pb.rb +63 -0
  181. data/spec/support/protos/enum.proto +37 -0
  182. data/spec/support/protos/extreme_values.data.bin +0 -0
  183. data/spec/support/protos/google_unittest.bin +0 -0
  184. data/spec/support/protos/google_unittest.pb.rb +798 -0
  185. data/spec/support/protos/google_unittest.proto +884 -0
  186. data/spec/support/protos/google_unittest_custom_options.bin +0 -0
  187. data/spec/support/protos/google_unittest_custom_options.pb.rb +361 -0
  188. data/spec/support/protos/google_unittest_custom_options.proto +424 -0
  189. data/spec/support/protos/google_unittest_import.pb.rb +55 -0
  190. data/spec/support/protos/google_unittest_import.proto +73 -0
  191. data/spec/support/protos/google_unittest_import_public.pb.rb +31 -0
  192. data/spec/support/protos/google_unittest_import_public.proto +41 -0
  193. data/spec/support/protos/map-test.bin +157 -0
  194. data/spec/support/protos/map-test.pb.rb +85 -0
  195. data/spec/support/protos/map-test.proto +68 -0
  196. data/spec/support/protos/multi_field_extensions.pb.rb +59 -0
  197. data/spec/support/protos/multi_field_extensions.proto +35 -0
  198. data/spec/support/protos/resource.pb.rb +172 -0
  199. data/spec/support/protos/resource.proto +137 -0
  200. data/spec/support/resource_service.rb +23 -0
  201. data/spec/support/server.rb +65 -0
  202. data/spec/support/test_app_file.rb +2 -0
  203. data/varint_prof.rb +82 -0
  204. metadata +579 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8d5f47cc32a8f84f7c2a2cd64f483ef150aea5a981ffc7cdca01481a8b94c75d
4
+ data.tar.gz: 866f9b48ff06138d972914353fb94ee7d29a0a08e2318d204d79ae1f6be3d994
5
+ SHA512:
6
+ metadata.gz: f01a5f01d801feb5dfefc5ab246e8bca0c75b0a12780de746f7a76b8b8a8bc5bad0298d32946a79c4311adacce9cdc7293024a4582ffd0c3a1eecdd70153c2ec
7
+ data.tar.gz: 6eddd168836a9e1f21658d75fe094868872fce43702e6254aee044e9fa2eb8fe0cf47e6222255ff18bdc6e687a19c6456c51ed5d7f96256cfdb2312f2b324a50
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.swp
3
+ pkg/*
4
+ .bundle
5
+ .rvmrc
6
+ .rspec
7
+ *.log
8
+ coverage
9
+ doc
10
+ .yardoc
11
+ .DS_Store
12
+ *.so
13
+ Gemfile.lock
14
+ tmp/*
15
+ ext/defs
16
+ ext/out
17
+ ext/ruby_generator/protoc-ruby
18
+ .ruby-gemset
19
+ .ruby-version
20
+ ext/ruby_generator/gdb.run
21
+ ext/ruby_generator/protoc-ruby.dSYM
@@ -0,0 +1,70 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ DisplayCopNames: true
5
+ Exclude:
6
+ - 'spec/support/protos/*.pb.rb'
7
+ - 'varint_prof.rb'
8
+
9
+ Lint/EndAlignment:
10
+ AlignWith: keyword
11
+
12
+ Lint/Loop:
13
+ Enabled: false
14
+
15
+ Metrics/ClassLength:
16
+ Enabled: false
17
+
18
+ Metrics/ModuleLength:
19
+ Enabled: false
20
+
21
+ Style/CaseIndentation:
22
+ IndentWhenRelativeTo: end
23
+
24
+ Style/ClassAndModuleChildren:
25
+ Exclude:
26
+ - '**/*.pb.rb'
27
+
28
+ Style/ClassAndModuleCamelCase:
29
+ Exclude:
30
+ - '**/*.pb.rb'
31
+
32
+ Style/EmptyLineBetweenDefs:
33
+ AllowAdjacentOneLineDefs: true
34
+
35
+ Style/EmptyLines:
36
+ Exclude:
37
+ - '**/*.pb.rb'
38
+
39
+ Style/FileName:
40
+ Exclude:
41
+ - '**/protoc-gen-ruby*'
42
+
43
+ Style/GuardClause:
44
+ MinBodyLength: 4
45
+
46
+ Style/HashSyntax:
47
+ EnforcedStyle: hash_rockets
48
+
49
+ Style/IndentHash:
50
+ EnforcedStyle: consistent
51
+
52
+ Style/Semicolon:
53
+ AllowAsExpressionSeparator: true
54
+
55
+ Style/SingleLineBlockParams:
56
+ Enabled: false
57
+
58
+ Style/TrailingBlankLines:
59
+ Exclude:
60
+ - '**/*.pb.rb'
61
+
62
+ Style/TrailingCommaInArguments:
63
+ EnforcedStyleForMultiline: comma
64
+
65
+ Style/TrailingCommaInLiteral:
66
+ EnforcedStyleForMultiline: comma
67
+
68
+ Style/TrivialAccessors:
69
+ AllowDSLWriters: true
70
+ AllowPredicates: true
@@ -0,0 +1,145 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2015-09-25 12:31:31 -0700 using RuboCop version 0.34.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 31
10
+ Metrics/AbcSize:
11
+ Max: 59
12
+
13
+ # Offense count: 1
14
+ Metrics/BlockNesting:
15
+ Max: 5
16
+
17
+ # Offense count: 6
18
+ Metrics/CyclomaticComplexity:
19
+ Max: 12
20
+
21
+ # Offense count: 493
22
+ # Configuration parameters: AllowURI, URISchemes.
23
+ Metrics/LineLength:
24
+ Max: 199
25
+
26
+ # Offense count: 44
27
+ # Configuration parameters: CountComments.
28
+ Metrics/MethodLength:
29
+ Max: 38
30
+
31
+ # Offense count: 2
32
+ # Configuration parameters: CountKeywordArgs.
33
+ Metrics/ParameterLists:
34
+ Max: 7
35
+
36
+ # Offense count: 6
37
+ Metrics/PerceivedComplexity:
38
+ Max: 17
39
+
40
+ # Offense count: 1
41
+ # Cop supports --auto-correct.
42
+ Performance/StringReplacement:
43
+ Exclude:
44
+ - 'lib/protobuf/rpc/buffer.rb'
45
+
46
+ Performance/TimesMap:
47
+ Enabled: false
48
+
49
+ # Offense count: 127
50
+ # Configuration parameters: Exclude.
51
+ Style/Documentation:
52
+ Enabled: false
53
+
54
+ # Offense count: 12
55
+ Style/DoubleNegation:
56
+ Exclude:
57
+ - 'lib/protobuf.rb'
58
+ - 'lib/protobuf/cli.rb'
59
+ - 'lib/protobuf/rpc/connectors/zmq.rb'
60
+ - 'lib/protobuf/rpc/servers/zmq/broker.rb'
61
+ - 'lib/protobuf/rpc/servers/zmq/server.rb'
62
+ - 'lib/protobuf/rpc/servers/zmq/worker.rb'
63
+ - 'lib/protobuf/rpc/service_directory.rb'
64
+
65
+ # Offense count: 2
66
+ # Cop supports --auto-correct.
67
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
68
+ Style/EmptyElse:
69
+ Exclude:
70
+ - 'lib/protobuf/enum.rb'
71
+ - 'lib/protobuf/message/fields.rb'
72
+
73
+ # Offense count: 77
74
+ # Cop supports --auto-correct.
75
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
76
+ Style/EmptyLinesAroundBlockBody:
77
+ Enabled: false
78
+
79
+ # Offense count: 90
80
+ # Cop supports --auto-correct.
81
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
82
+ Style/EmptyLinesAroundClassBody:
83
+ Enabled: false
84
+
85
+ # Offense count: 50
86
+ # Cop supports --auto-correct.
87
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
88
+ Style/EmptyLinesAroundModuleBody:
89
+ Enabled: false
90
+
91
+ # Offense count: 2
92
+ Style/IndentationWidth:
93
+ Exclude:
94
+ - 'protobuf.gemspec'
95
+ - 'lib/protobuf/cli.rb'
96
+
97
+ # Offense count: 3
98
+ Style/ElseAlignment:
99
+ Exclude:
100
+ - 'protobuf.gemspec'
101
+ - 'lib/protobuf/cli.rb'
102
+
103
+ # Offense count: 8
104
+ # Cop supports --auto-correct.
105
+ # Configuration parameters: AllowForAlignment.
106
+ Style/ExtraSpacing:
107
+ Exclude:
108
+ - 'lib/protobuf/rpc/connectors/common.rb'
109
+ - 'lib/protobuf/rpc/connectors/socket.rb'
110
+ - 'lib/protobuf/rpc/connectors/zmq.rb'
111
+ - 'lib/protobuf/rpc/servers/socket/server.rb'
112
+ - 'spec/lib/protobuf/rpc/service_directory_spec.rb'
113
+
114
+ # Offense count: 46
115
+ # Cop supports --auto-correct.
116
+ Style/NumericLiterals:
117
+ MinDigits: 21
118
+
119
+ Style/SignalException:
120
+ Enabled: false
121
+
122
+ # Offense count: 473
123
+ # Cop supports --auto-correct.
124
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
125
+ Style/StringLiterals:
126
+ Enabled: false
127
+
128
+ # Offense count: 7
129
+ # Cop supports --auto-correct.
130
+ # Configuration parameters: IgnoredMethods.
131
+ Style/SymbolProc:
132
+ Exclude:
133
+ - 'lib/protobuf/generators/printable.rb'
134
+ - 'lib/protobuf/rpc/servers/socket/server.rb'
135
+ - 'spec/encoding/all_types_spec.rb'
136
+ - 'spec/encoding/extreme_values_spec.rb'
137
+ - 'spec/functional/socket_server_spec.rb'
138
+ - 'spec/functional/zmq_server_spec.rb'
139
+ - 'spec/lib/protobuf/rpc/servers/socket_server_spec.rb'
140
+
141
+ # Offense count: 4
142
+ # Cop supports --auto-correct.
143
+ # Configuration parameters: WordRegex.
144
+ Style/WordArray:
145
+ MinSize: 4
@@ -0,0 +1,40 @@
1
+ before_install:
2
+ - wget https://github.com/zeromq/libzmq/releases/download/v4.2.1/zeromq-4.2.1.tar.gz
3
+ - tar xvf zeromq-4.2.1.tar.gz
4
+ - cd zeromq-4.2.1
5
+ - ./configure
6
+ - make -j4
7
+ - sudo make install
8
+ # Retrun to project directory
9
+ - cd ..
10
+ - sudo -E ./install-protobuf.sh
11
+ - java -Xmx1g -version
12
+ - javac -J-Xmx1g -version
13
+ - export JRUBY_OPTS=-J-Xmx1g
14
+ - gem update bundler
15
+ language: ruby
16
+ rvm:
17
+ - 1.9.3
18
+ - 2.0.0
19
+ - 2.1
20
+ - 2.2
21
+ - 2.3
22
+ - 2.4
23
+ - 2.5
24
+ - jruby-9.1.17.0
25
+ - jruby-9.2.5.0
26
+ - rbx-2
27
+ env:
28
+ - PROTOBUF_VERSION=2.6.1
29
+ - PROTOBUF_VERSION=3.0.0-alpha-2
30
+ matrix:
31
+ allow_failures:
32
+ - rvm: rbx-2
33
+ - env: PROTOBUF_VERSION=3.0.0-alpha-2
34
+ notifications:
35
+ webhooks:
36
+ urls:
37
+ - https://webhooks.gitter.im/e/51a956bcd2b1854d6756
38
+ on_success: change # options: [always|never|change] default: always
39
+ on_failure: always # options: [always|never|change] default: always
40
+ on_start: false # default: false
@@ -0,0 +1,5 @@
1
+ --no-private
2
+ --hide-void-return
3
+
4
+ --markup-provider=redcarpet
5
+ --markup=markdown
@@ -0,0 +1,344 @@
1
+ # Stable (3.8.x)
2
+
3
+
4
+ 3.10.0
5
+ ------
6
+ - Add headers to request proto
7
+
8
+ 3.9.0
9
+ -----
10
+ - Performance improvements
11
+
12
+ 3.8.0
13
+ -----
14
+ - Map types now supported (#367)
15
+
16
+ 3.7.0 (pre3)
17
+ -----------
18
+ - Evaluate extension fields in code generation (#329)
19
+ - Change the ping port to use ms timeout and make the default 200ms (#332)
20
+ - Fix build failures caused by Rails 5 requirement of Ruby 2.2.2 (#343)
21
+ - Add functional tests (#346)
22
+ - Extract client and server (#347) (#348)
23
+ - BUG: Fix decoding of packed fields (#349)
24
+ - Add support for custom file options (#350)
25
+ - BUG: enum_for_tags returns nil if tag nil (#352)
26
+ - Update rubocop and fix cops (#353)
27
+ - Optimization for varint (#356)
28
+ - Add support for custom field options (#357)
29
+ - Add support for custom enum options (#359)
30
+ - Add support for custom message options (#360)
31
+ - Acceptable check is not needed most places as coerce runs the same logic (#361)
32
+ - Encode straight to stream without intermediary copies (#362)
33
+ - Move dynamic rule checks to the initialize method (#363)
34
+ - Add support for custom service options (#364)
35
+ - Add support for custom method options (#365)
36
+ - Upcase enum default (#366)
37
+
38
+ 3.7.0 (pre2)
39
+ -----------
40
+ - BUG: Track if a repeated field has been deliberately set (#325)
41
+
42
+ 3.7.0 (pre1)
43
+ -----------
44
+ - BUG: Revert to old behavior for setting repeated fields to nil
45
+ - BUG: Set binmode for protoc-gen-ruby STDIN and STDOUT to compile proto files on Windows
46
+ - Make all things Optionable and fix requires
47
+
48
+ 3.7.0 (pre0)
49
+ -----------
50
+ - Add `PB_USE_RAW_RPC_NAMES` option to preserve raw RPC name (since #underscore can be lossy).
51
+ - Add `PB_ENUM_UPCASE` option to generate enum values as upcased.
52
+ - Clean up dynamic code generation in prep for extension namespacing.
53
+ - Namespace extension fields.
54
+ - Field values should be stored via their fully qualified names
55
+ - Refresh google/protobuf/descriptor.{proto,pb.rb}
56
+ - Properly encode and decode negative enum values.
57
+
58
+ # Stable (3.6.x)
59
+
60
+ 3.6.9
61
+ --------
62
+ - Make protobuf serivce directory pluggable.
63
+
64
+ 3.6.7
65
+ -----
66
+ - An issue was reported with the encode memoization added in #293 with using any array modification
67
+ method on repeated fields. Remove memoization on encode (#305) until we can find a better solution.
68
+
69
+ 3.5.5
70
+ --------
71
+ - Add native Varint for MRI.
72
+
73
+ 3.5.4
74
+ --------
75
+ - Ensures ActiveSupport::Deprecation does not get a stack trace when deprecations are disabled.
76
+
77
+ 3.5.3
78
+ --------
79
+ - Optimized get_extension_field and get_field calls.
80
+
81
+ 3.5.2
82
+ --------
83
+ - Optimized valid_tag?, enums_for_tag and enums_for_tags
84
+
85
+ 3.5.1
86
+ --------
87
+ - Adds compatibility for Rails 4.2+ as CLI options were broken
88
+ - Fixes bug with MRI and "dead" thread in zmq broker
89
+ - Fixes Rubocop compatability with new version
90
+
91
+ 3.0.4
92
+ --------
93
+
94
+ - Raise specific MethodNotFound when service class doesn't respond to (publicly implement)
95
+ the rpc method called from the client. Stop rescuing all NoMethodError's thrown
96
+ by service implementations. [#193, @liveh2o]
97
+
98
+ 3.0.3
99
+ ---------
100
+
101
+ - Fix recursive memory/cpu growth issue when calling class-level `Message.to_json`. [#190]
102
+
103
+ 3.0.2
104
+ ---------
105
+
106
+ - Queue requests at the broker when concurrent requests hit the ZMQ server, distribute to
107
+ worker threads on each turn of the read poll loop. [#189, @abrandoned, @liveh2o]
108
+
109
+ 3.0.1
110
+ ---------
111
+
112
+ - Fix NoMethodError that can occur when serializing a message with a missing required field. [#187, @abrandoned]
113
+
114
+ 3.0.0
115
+ ---------
116
+
117
+ A lot has changed since the last stable v2.8.12. For all the relevant changes,
118
+ see the closed [pull requests and issues list in github](https://github.com/localshred/protobuf/issues?milestone=1&state=closed).
119
+ Below is a high-level list of fixes, deprecations, breaking changes, and new APIs.
120
+
121
+ ### EventMachine is dead, Long live EventMachine
122
+
123
+ The EventMachine client and server have been removed from this gem. They code was far
124
+ too error prone and flawed to feasibly support going forward. It's recommended
125
+ to switch to the socket implementation (using `PB_CLIENT_TYPE` and `PB_SERVER_TYPE` of `socket`)
126
+ for a painless switchover. The ZMQ implementation is much more performant but
127
+ does have a dependency on libzmq.
128
+
129
+ ### Server Middlewares
130
+
131
+ The server/dispatcher stack has been converted to the Middleware pattern!
132
+ Exception handling (#162, #164), Request decoding (#160, #166), Response encoding (#161, #167),
133
+ Logging and stats (#163), and Method dispatch (#159) have all been extracted into their
134
+ own Middlewares to greatly simplify testing and further development of the server
135
+ stack, furthering our preparations for removing the socket implementations (zmq, socket)
136
+ into their own gems in version 4.0. Major props to @liveh2o for [tackling this beast](https://github.com/localshred/protobuf/tree/master/lib/protobuf/rpc/middleware).
137
+
138
+ #### Bug Fixes
139
+
140
+ - Resolve DNS names (e.g. localhost) when using ZMQ server. [#46, reported by @reddshack]
141
+ - Switched to hash based value storage for messages to fix large field tag memory issues. [#118, #165]
142
+ - `Enum.fetch` used to return an enum of any type if that is the value passed in. [#168]
143
+
144
+ #### Deprecations
145
+
146
+ __!! NOTE: These deprecated methods will be removed in v3.1. !!__
147
+
148
+ - Deprecated `BaseField#type` in favor of `#type_class`.
149
+ - Deprecated `Message.get_ext_field_by_name` in favor of `.get_extension_field` or `.get_field(name_or_tag, true)`.
150
+ - Deprecated `Message.get_ext_field_by_tag,` in favor of `.get_extension_field` or `.get_field(name_or_tag, true)`.
151
+ - Deprecated `Message.get_field_by_name,` in favor of `.get_field`.
152
+ - Deprecated `Message.get_field_by_tag,` in favor of `.get_field`.
153
+ - Deprecated `Enum.enum_by_value` in favor of `.enum_for_tag`.
154
+ - Deprecated `Enum.name_by_value` in favor of `.name_for_tag`.
155
+ - Deprecated `Enum.get_name_by_tag` in favor of `.name_for_tag`.
156
+ - Deprecated `Enum.value_by_name` in favor of `.enum_for_name`.
157
+ - Deprecated `Enum.values` in favor of `.enums`. Beware that `.enums` returns an array where `.values` returns a hash.
158
+ Use `.all_tags` if you just need all the valid tag numbers. In other words, don't do this anymore: `MyEnum.values.values.map(&:to_i).uniq`.
159
+
160
+ #### Breaking Changes
161
+
162
+ - Require Active Support 3.2+. [#177]
163
+ - All files/classes relating to the EventMachine client and server are gone. Use `PB_CLIENT_TYPE` and `PB_SERVER_TYPE` of `socket` instead. [#116]
164
+ - Cleaned up the `Enum` class, deprecating/renaming most methods. tl;dr, just use `MyEnum.fetch`.
165
+ See #134 for more comprehensive documentation about which methods are going and away and which are being renamed. [#134]
166
+ - Pulled `EnumValue` into `Enum`. The `EnumValue` class no longer exists. Use `Enum` for type-checking instead. [#168].
167
+ - Removed previously deprecated `bin/rprotoc` executable. Use `protoc --ruby_out=...` instead. [13fbdb9]
168
+ - Removed previously deprecated `Service#rpc` method. Use `Service#env#method_name` instead. [f391294]
169
+ - Changed the `Service#initialize` to take an `Env` object instead of separate request, method, and client parameters. [6c61bf72]
170
+ - Removed attribute readers for `Service#method_name` and `Service#client_host`. Use `Service#env` to get them instead.
171
+ - Removed `lib/protobuf/message/message.rb`. Use `lib/protobuf/message.rb` instead.
172
+ - Removed field getters from Message instances (e.g. `Message#get_field_by_name`).
173
+ Use class-level getters instead (see Deprecations section).
174
+ - Moved `lib/protobuf/message/decoder.rb` to `lib/protobuf/decoder.rb`. The module is still named `Protobuf::Decoder`.
175
+ - Removed `Protobuf::Field::ExtensionFields` class.
176
+ - Removed instance-level `max` and `min` methods from all relevant Field classes (e.g. Int32Field, Uint64Field, etc).
177
+ Use class-level methods of the same names instead. [#176, 992eb051]
178
+ - `PbError#to_response` no longer receives an argument, instead returning a new `Socketrpc::Response` object. [#147, @liveh2o]
179
+ - The Server module has been stripped of almost all methods, now simply invokes the Middleware stack for each request. [#159, @liveh2o]
180
+ - Removed `Protobuf::PROTOC_VERSION` constant now that the compiler supports any protoc version.
181
+
182
+ #### New APIs
183
+
184
+ - Added support for [enum `allow_alias` option](https://developers.google.com/protocol-buffers/docs/proto#enum). [#134]
185
+ - `Enum.all_tags` returns an array of unique tags. Use it to replace `Enum.values.values.map(&:to_i)` (`Enum.values` is deprecated).
186
+ - `Enum.enums` returns an array of all defined enums for that class (including any aliased Enums).
187
+ - Reinstated support for symbol primitive field types in generated Message code. [#170]
188
+ - `Message.get_field` accepts a second boolean parameter (default false) to return an extension field if found. [#169]
189
+ - Mirror existing `Decoder#decode_from(stream)` with `Encoder#encode_to(stream)`. [#169]
190
+ - `Server` now invokes the [middleware stack](https://github.com/localshred/protobuf/tree/master/lib/protobuf/rpc/middleware) for request handling. [#159, @liveh2o]
191
+ - Added `protobuf:compile` and `protobuf:clean` rake tasks. Simply `load 'protobuf/tasks/compile.rake'` in your Rakefile (see `compile.rake` for arguments and usage). [#142, #143]
192
+ - Add `Protobuf::Deprecator` module to alias deprecated methods. [#165]
193
+ - Add support for assigning a symbol to a string or bytes field. [#181, @abrandoned]
194
+ - Add `first_alive_load_balance` option to rpc server. Pass `PB_FIRST_ALIVE_LOAD_BALANCE`
195
+ as an env variable to the client process to ensure the client asks the server
196
+ if it is alive (able to server requests to clients). [#183, @abrandoned]
197
+
198
+ 2.8.13
199
+ ---------
200
+
201
+ - Backport #190 to 2.8 stable series. [#192]
202
+
203
+ 2.8.12
204
+ ---------
205
+
206
+ - Fix thread busy access in zmq server/worker. [#151, @abrandoned]
207
+
208
+ 2.8.11
209
+ ---------
210
+
211
+ - Default ZMQ server to use inproc protocol instead of tcp (zero-copy between server-broker-worker). [#145, @brianstien]
212
+ - Add `broadcast_busy` functionality that removes server from cluster if the workers are full. [#149, @abrandoned]
213
+ - Add cli option for `--no-zmq_inproc`. [#149, @abrandoned]
214
+ - Add cli option for `--broadcast_busy`. [#149, @abrandoned]
215
+
216
+ 2.8.10
217
+ ---------
218
+
219
+ - Allow passing a file extension to compile/clean rake tasks. [#143]
220
+
221
+ 2.8.9
222
+ ---------
223
+
224
+ - Deprecated Protobuf::Lifecycle module in favor of using ActiveSupport::Notifications. [#139, @devin-c]
225
+ - Modify `$LOAD_PATH` inside descriptors.rb to make it easier for other libraries to write their own compiler plugins using our pre-compiled descriptors. [#141]
226
+ - Add protobuf:clean and protobuf:compile rake tasks for use in external libraries to compile source definitions to a destination. [#142]
227
+
228
+ 2.8.8
229
+ ---------
230
+
231
+ - ServiceDirectory beacons broadcast on same ip as listening clients. [#133, @devin-c]
232
+
233
+ 2.8.7
234
+ ---------
235
+
236
+ - Fire ActiveSupport load hooks when RPC Server and Client classes are loaded. [#126, @liveh2o]
237
+ - Prevent infinite loop when doing service lookup from directory. [#125, @brianstien]
238
+
239
+ 2.8.6
240
+ ---------
241
+
242
+ - Fix string/byte encoding issue when unicode characters present. Reported by @foxban. This was also backported to v2.7.12. [#120]
243
+
244
+ 2.8.5
245
+ ----------
246
+
247
+ - Fix issue where ServiceDirectory lookups were failing when given a class name, breaking the directory load balancing. (#119)
248
+
249
+ 2.8.4
250
+ ----------
251
+
252
+ - Fix issue where frozen strings assigned in a repeated field would cause encoding runtime errors. (#117)
253
+
254
+ 2.8.3
255
+ ----------
256
+
257
+ - Add Deprecation warning when requiring `protobuf/evented`. Version 3.x will not support the eventmachine transport layer for client or server.
258
+
259
+ 2.8.2
260
+ ----------
261
+
262
+ - Remove the <4.0 version constraint on ActiveSupport.
263
+
264
+ 2.8.1
265
+ ----------
266
+
267
+ - Improve `ServiceDirectory` lookup speed ~10x, lookups now done in constant time (devin-c).
268
+ - Add Timestamp to end of rpc stat log (represents ending time of request processing).
269
+ - Set `request_size` in the rpc stat within ZMQ Worker (previously missing).
270
+ - Ensure `request_size` and `response_size` are set on rpc stat for client requests.
271
+
272
+ 2.8.0
273
+ -----------
274
+
275
+ - New compiler supports protobuf compilation/runtime with protoc <= v2.5.0 (c++ compiler removed). [#109]
276
+ - Deprecated rprotoc in favor of protoc. [0bc9674]
277
+ - Added service dynamic discovery to the ZMQ connector and server. [#91, @devin-c]
278
+ - No longer creating `-java` platform gem due to removal of c++ compiler.
279
+ - Added WTFPL license.
280
+
281
+ 2.7.12
282
+ -----------
283
+
284
+ - Backport string/byte encoding issue when unicode characters present. [code: #122, original issue: #120]
285
+
286
+ 2.0.0
287
+ -----------
288
+
289
+ #### `rprotoc` changes
290
+
291
+ * New option `--ruby_out` to specify the output directory to place generated ruby files. If not provided, ruby code will not be generated.
292
+ * Extends `libprotoc` to hook in directly to google's provided compiler mechanism.
293
+ * Removed all previous compiler code including the racc parser, node visitors, etc.
294
+ * See `protoc --help` for default options.
295
+
296
+ #### `rprotoc` generated files changes
297
+
298
+ * Import `require`s now occur outside of any module or class declaration which solves ruby vm warnings previously seen.
299
+ * Empty inherited Message and Enum classes are pre-defined in the file, then reopened and their fields applied. This solves the issue of recursive field dependencies of two or more types in the same file.
300
+ * Generated DSL lines for message fields include the fully qualified name of the type (e.g. `optional ::Protobuf::Field::StringField, :name, 1`)
301
+ * Support for any combination of `packed`, `deprecated`, and `default` as options to pass to a field definition.
302
+ * Services are now generated in the corresponding `.pb.rb` file instead of their own `*_service.rb` files as before.
303
+
304
+ #### `rpc_server` changes
305
+
306
+ * Removed `--env` option. The running application or program is solely in charge of ensuring it's environment is properly loaded.
307
+ * Removed reading of `PB_CLIENT_TYPE`, `PB_SERVER_TYPE` environment variables. Should use mode switches or custom requires (see below) instead.
308
+ * Removed `--client_socket` in favor of using mode switches. This also means client calls made by the `rpc_server` will run as the same connector type as the given mode (socket, zmq, or evented).
309
+ * Removed `--pre-cache-definitions` switch in favor of always pre-caching for performance.
310
+ * Removed `--gc-pause-serialization` since using `--gc-pause-request` in conjunction was redundant.
311
+ * Removed `--client-type` in favor of mode switches.
312
+ * Removed `--server-type` in favor of mode switches.
313
+ * Added mode switch `--evented`.
314
+ * Added `--threads` to specify number of ZMQ Worker threads to use. Ignored if mode is not zmq.
315
+ * Added `--print-deprecation-warnings` switch to tell the server whether or not to print deprecation warnings on field usage. Enabled by default.
316
+ * See `rpc_server help start` for all options and usage. Note: the `start` task is the default and not necessary when running the `rpc_server`.
317
+
318
+ #### Message changes
319
+
320
+ * `Message#get_field` usage should now specify either `Message#get_field_by_name` or `Message#get_field_by_tag`, depending on your lookup criteria.
321
+ * Support for STDERR output when accessing a message field which has been defined as `[deprecated=true]`. Deprecated warnings can be skipped by running your application or program with `PB_IGNORE_DEPRECATIONS=1`.
322
+ * Significant internal refactoring which provides huge boosts in speed and efficiency both in accessing/writing Message field values, as well as serialization and deserialization routines.
323
+ * Refactor `Message#to_hash` to delegate hash representations to the field values, simply collecting the display values and returning a hash of fields that are set. This also affects `to_json` output.
324
+
325
+ #### Enum changes
326
+
327
+ * Add `Enum.fetch` class method to polymorphically retrieve an `EnumValue` object.
328
+ * Add `Enum.value_by_name` to retrieve the corresponding `EnumValue` to the given symbol name.
329
+ * Add `Enum.enum_by_value` to retrieve the corresponding `EnumValue` to the given integer value.
330
+
331
+ #### RPC Service changes
332
+
333
+ * `async_responder` paradigm is no longer supported.
334
+ * `self.response=` paradigm should be converted to using `respond_with(object)`.
335
+ * Significant internal changes that should not bleed beyond the API but which make maintaining the code much easier.
336
+
337
+ #### RPC Client changes
338
+
339
+ * In the absence of `PB_CLIENT_TYPE` environment var, you should be requiring the specific connector type specifically. For instance, if you wish to run in zmq mode for client requests, update your Gemfile: `gem 'protobuf', :require => 'protobuf/zmq'`.
340
+ * `:async` option on client calls is no longer recognized.
341
+
342
+ #### Other changes
343
+
344
+ * Moved files out of `lib/protobuf/common` folder into `lib/protobuf`. Files affected are logger, wire\_type, util. The only update would need to be the require path to these files since the modules were always `Protobuf::{TYPE}`.