protobuffy 3.6.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +67 -0
  4. data/.rubocop_todo.yml +145 -0
  5. data/.travis.yml +25 -5
  6. data/CHANGES.md +55 -0
  7. data/CONTRIBUTING.md +1 -1
  8. data/LICENSE.txt +17 -9
  9. data/README.md +13 -12
  10. data/Rakefile +15 -11
  11. data/bin/protoc-gen-ruby +8 -3
  12. data/bin/rpc_server +1 -0
  13. data/examples/lib/example/reverse-client.rb +2 -2
  14. data/install-protobuf.sh +28 -0
  15. data/lib/protobuf.rb +57 -53
  16. data/lib/protobuf/cli.rb +94 -74
  17. data/lib/protobuf/code_generator.rb +60 -9
  18. data/lib/protobuf/decoder.rb +19 -65
  19. data/lib/protobuf/deprecation.rb +117 -0
  20. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +11 -1
  21. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +55 -3
  22. data/lib/protobuf/encoder.rb +13 -53
  23. data/lib/protobuf/enum.rb +58 -63
  24. data/lib/protobuf/field.rb +4 -4
  25. data/lib/protobuf/field/base_field.rb +101 -173
  26. data/lib/protobuf/field/bool_field.rb +17 -11
  27. data/lib/protobuf/field/bytes_field.rb +21 -35
  28. data/lib/protobuf/field/double_field.rb +0 -1
  29. data/lib/protobuf/field/enum_field.rb +23 -22
  30. data/lib/protobuf/field/field_array.rb +5 -4
  31. data/lib/protobuf/field/fixed32_field.rb +1 -1
  32. data/lib/protobuf/field/fixed64_field.rb +0 -1
  33. data/lib/protobuf/field/float_field.rb +4 -1
  34. data/lib/protobuf/field/int32_field.rb +0 -1
  35. data/lib/protobuf/field/int64_field.rb +0 -1
  36. data/lib/protobuf/field/integer_field.rb +0 -1
  37. data/lib/protobuf/field/message_field.rb +13 -28
  38. data/lib/protobuf/field/sfixed32_field.rb +0 -1
  39. data/lib/protobuf/field/sfixed64_field.rb +0 -1
  40. data/lib/protobuf/field/signed_integer_field.rb +0 -1
  41. data/lib/protobuf/field/sint32_field.rb +0 -1
  42. data/lib/protobuf/field/sint64_field.rb +0 -1
  43. data/lib/protobuf/field/string_field.rb +2 -4
  44. data/lib/protobuf/field/uint32_field.rb +0 -1
  45. data/lib/protobuf/field/uint64_field.rb +0 -1
  46. data/lib/protobuf/field/varint_field.rb +30 -13
  47. data/lib/protobuf/generators/base.rb +30 -16
  48. data/lib/protobuf/generators/enum_generator.rb +6 -9
  49. data/lib/protobuf/generators/extension_generator.rb +1 -2
  50. data/lib/protobuf/generators/field_generator.rb +25 -13
  51. data/lib/protobuf/generators/file_generator.rb +157 -35
  52. data/lib/protobuf/generators/group_generator.rb +22 -17
  53. data/lib/protobuf/generators/message_generator.rb +13 -14
  54. data/lib/protobuf/generators/option_generator.rb +17 -0
  55. data/lib/protobuf/generators/printable.rb +12 -13
  56. data/lib/protobuf/generators/service_generator.rb +2 -3
  57. data/lib/protobuf/http.rb +2 -2
  58. data/lib/protobuf/lifecycle.rb +20 -33
  59. data/lib/protobuf/logging.rb +39 -0
  60. data/lib/protobuf/message.rb +114 -47
  61. data/lib/protobuf/message/fields.rb +170 -88
  62. data/lib/protobuf/message/serialization.rb +19 -18
  63. data/lib/protobuf/optionable.rb +53 -6
  64. data/lib/protobuf/rpc/buffer.rb +18 -19
  65. data/lib/protobuf/rpc/client.rb +22 -50
  66. data/lib/protobuf/rpc/connectors/base.rb +177 -12
  67. data/lib/protobuf/rpc/connectors/http.rb +14 -9
  68. data/lib/protobuf/rpc/connectors/ping.rb +89 -0
  69. data/lib/protobuf/rpc/connectors/socket.rb +13 -8
  70. data/lib/protobuf/rpc/connectors/zmq.rb +178 -73
  71. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +4 -1
  72. data/lib/protobuf/rpc/env.rb +12 -12
  73. data/lib/protobuf/rpc/error.rb +3 -3
  74. data/lib/protobuf/rpc/error/client_error.rb +4 -4
  75. data/lib/protobuf/rpc/error/server_error.rb +9 -9
  76. data/lib/protobuf/rpc/middleware/exception_handler.rb +6 -2
  77. data/lib/protobuf/rpc/middleware/logger.rb +8 -4
  78. data/lib/protobuf/rpc/middleware/request_decoder.rb +17 -21
  79. data/lib/protobuf/rpc/middleware/response_encoder.rb +22 -27
  80. data/lib/protobuf/rpc/middleware/statsd.rb +3 -3
  81. data/lib/protobuf/rpc/rpc.pb.rb +4 -1
  82. data/lib/protobuf/rpc/server.rb +1 -1
  83. data/lib/protobuf/rpc/servers/http/server.rb +19 -17
  84. data/lib/protobuf/rpc/servers/socket/server.rb +78 -70
  85. data/lib/protobuf/rpc/servers/socket/worker.rb +4 -4
  86. data/lib/protobuf/rpc/servers/socket_runner.rb +27 -15
  87. data/lib/protobuf/rpc/servers/zmq/broker.rb +70 -31
  88. data/lib/protobuf/rpc/servers/zmq/server.rb +55 -47
  89. data/lib/protobuf/rpc/servers/zmq/util.rb +14 -13
  90. data/lib/protobuf/rpc/servers/zmq/worker.rb +16 -16
  91. data/lib/protobuf/rpc/servers/zmq_runner.rb +26 -7
  92. data/lib/protobuf/rpc/service.rb +21 -27
  93. data/lib/protobuf/rpc/service_directory.rb +43 -27
  94. data/lib/protobuf/rpc/service_dispatcher.rb +9 -10
  95. data/lib/protobuf/rpc/service_filters.rb +32 -55
  96. data/lib/protobuf/rpc/stat.rb +4 -8
  97. data/lib/protobuf/socket.rb +1 -2
  98. data/lib/protobuf/tasks/compile.rake +3 -4
  99. data/lib/protobuf/varint.rb +9 -0
  100. data/lib/protobuf/varint_pure.rb +13 -0
  101. data/lib/protobuf/version.rb +1 -1
  102. data/lib/protobuf/zmq.rb +2 -2
  103. data/proto/google/protobuf/descriptor.proto +190 -31
  104. data/protobuffy.gemspec +30 -17
  105. data/spec/benchmark/tasks.rb +27 -19
  106. data/spec/bin/protoc-gen-ruby_spec.rb +11 -6
  107. data/spec/encoding/all_types_spec.rb +96 -84
  108. data/spec/encoding/extreme_values_spec.rb +0 -0
  109. data/spec/functional/class_inheritance_spec.rb +52 -0
  110. data/spec/functional/code_generator_spec.rb +38 -0
  111. data/spec/functional/socket_server_spec.rb +15 -15
  112. data/spec/functional/zmq_server_spec.rb +29 -27
  113. data/spec/lib/protobuf/cli_spec.rb +82 -67
  114. data/spec/lib/protobuf/code_generator_spec.rb +37 -10
  115. data/spec/lib/protobuf/enum_spec.rb +77 -46
  116. data/spec/lib/protobuf/field/bool_field_spec.rb +91 -0
  117. data/spec/lib/protobuf/field/double_field_spec.rb +9 -0
  118. data/spec/lib/protobuf/field/enum_field_spec.rb +26 -0
  119. data/spec/lib/protobuf/field/field_array_spec.rb +69 -0
  120. data/spec/lib/protobuf/field/fixed32_field_spec.rb +7 -0
  121. data/spec/lib/protobuf/field/fixed64_field_spec.rb +7 -0
  122. data/spec/lib/protobuf/field/float_field_spec.rb +90 -0
  123. data/spec/lib/protobuf/field/int32_field_spec.rb +114 -1
  124. data/spec/lib/protobuf/field/int64_field_spec.rb +7 -0
  125. data/spec/lib/protobuf/field/message_field_spec.rb +132 -0
  126. data/spec/lib/protobuf/field/sfixed32_field_spec.rb +9 -0
  127. data/spec/lib/protobuf/field/sfixed64_field_spec.rb +9 -0
  128. data/spec/lib/protobuf/field/sint32_field_spec.rb +9 -0
  129. data/spec/lib/protobuf/field/sint64_field_spec.rb +9 -0
  130. data/spec/lib/protobuf/field/string_field_spec.rb +44 -11
  131. data/spec/lib/protobuf/field/uint32_field_spec.rb +7 -0
  132. data/spec/lib/protobuf/field/uint64_field_spec.rb +7 -0
  133. data/spec/lib/protobuf/field_spec.rb +4 -6
  134. data/spec/lib/protobuf/generators/base_spec.rb +80 -13
  135. data/spec/lib/protobuf/generators/enum_generator_spec.rb +35 -21
  136. data/spec/lib/protobuf/generators/extension_generator_spec.rb +12 -13
  137. data/spec/lib/protobuf/generators/field_generator_spec.rb +73 -21
  138. data/spec/lib/protobuf/generators/file_generator_spec.rb +89 -6
  139. data/spec/lib/protobuf/generators/service_generator_spec.rb +25 -13
  140. data/spec/lib/protobuf/lifecycle_spec.rb +25 -20
  141. data/spec/lib/protobuf/message_spec.rb +578 -79
  142. data/spec/lib/protobuf/optionable_spec.rb +202 -26
  143. data/spec/lib/protobuf/rpc/client_spec.rb +16 -16
  144. data/spec/lib/protobuf/rpc/connectors/base_spec.rb +167 -13
  145. data/spec/lib/protobuf/rpc/connectors/connector_spec.rb +4 -5
  146. data/spec/lib/protobuf/rpc/connectors/http_spec.rb +13 -11
  147. data/spec/lib/protobuf/rpc/connectors/ping_spec.rb +69 -0
  148. data/spec/lib/protobuf/rpc/connectors/socket_spec.rb +6 -7
  149. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +35 -52
  150. data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +10 -10
  151. data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +11 -11
  152. data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +23 -23
  153. data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +11 -11
  154. data/spec/lib/protobuf/rpc/middleware/statsd_spec.rb +6 -6
  155. data/spec/lib/protobuf/rpc/servers/http/server_spec.rb +47 -44
  156. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +6 -6
  157. data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +12 -10
  158. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +11 -11
  159. data/spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb +7 -7
  160. data/spec/lib/protobuf/rpc/service_directory_spec.rb +47 -49
  161. data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +8 -25
  162. data/spec/lib/protobuf/rpc/service_filters_spec.rb +102 -69
  163. data/spec/lib/protobuf/rpc/service_spec.rb +37 -36
  164. data/spec/lib/protobuf/rpc/stat_spec.rb +7 -9
  165. data/spec/lib/protobuf/varint_spec.rb +29 -0
  166. data/spec/lib/protobuf_spec.rb +55 -28
  167. data/spec/spec_helper.rb +12 -27
  168. data/spec/support/all.rb +0 -1
  169. data/spec/support/packed_field.rb +4 -3
  170. data/spec/support/{test → protos}/all_types.data.bin +0 -0
  171. data/spec/support/{test → protos}/all_types.data.txt +0 -0
  172. data/spec/support/{test → protos}/enum.pb.rb +8 -4
  173. data/spec/support/{test → protos}/enum.proto +4 -1
  174. data/spec/support/{test → protos}/extreme_values.data.bin +0 -0
  175. data/spec/support/protos/google_unittest.bin +0 -0
  176. data/spec/support/protos/google_unittest.pb.rb +798 -0
  177. data/spec/support/{test → protos}/google_unittest.proto +237 -66
  178. data/spec/support/protos/google_unittest_custom_options.bin +0 -0
  179. data/spec/support/protos/google_unittest_custom_options.pb.rb +268 -0
  180. data/spec/support/protos/google_unittest_custom_options.proto +424 -0
  181. data/spec/support/protos/google_unittest_import.pb.rb +55 -0
  182. data/spec/support/{test → protos}/google_unittest_import.proto +19 -10
  183. data/spec/support/protos/google_unittest_import_public.pb.rb +31 -0
  184. data/spec/support/{test → protos}/google_unittest_import_public.proto +8 -5
  185. data/spec/support/{test → protos}/multi_field_extensions.pb.rb +5 -2
  186. data/spec/support/{test → protos}/multi_field_extensions.proto +2 -0
  187. data/spec/support/{test → protos}/resource.pb.rb +47 -11
  188. data/spec/support/{test → protos}/resource.proto +24 -1
  189. data/spec/support/resource_service.rb +23 -0
  190. data/spec/support/server.rb +32 -61
  191. metadata +119 -59
  192. data/lib/protobuf/deprecator.rb +0 -42
  193. data/lib/protobuf/logger.rb +0 -93
  194. data/lib/protobuf/rpc/connector.rb +0 -21
  195. data/lib/protobuf/rpc/connectors/common.rb +0 -172
  196. data/spec/data/data.bin +0 -3
  197. data/spec/data/types.bin +0 -0
  198. data/spec/lib/protobuf/logger_spec.rb +0 -145
  199. data/spec/lib/protobuf/rpc/connector_spec.rb +0 -26
  200. data/spec/lib/protobuf/rpc/connectors/common_spec.rb +0 -170
  201. data/spec/support/test/defaults.pb.rb +0 -25
  202. data/spec/support/test/defaults.proto +0 -9
  203. data/spec/support/test/extended.pb.rb +0 -22
  204. data/spec/support/test/extended.proto +0 -10
  205. data/spec/support/test/google_unittest.pb.rb +0 -543
  206. data/spec/support/test/google_unittest_import.pb.rb +0 -37
  207. data/spec/support/test/google_unittest_import_public.pb.rb +0 -8
  208. data/spec/support/test/resource_service.rb +0 -26
  209. data/spec/support/tolerance_matcher.rb +0 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5bdff6c7c5855a0e038787f254471e5024deb0ed
4
- data.tar.gz: dfa56251758baed600cd8576c47012b7d7e8d698
3
+ metadata.gz: 9829f0fb4a57e594c74997ed046ca0e6335fe7a2
4
+ data.tar.gz: c16252c199d860b483ac96c8dff43eed3c26d580
5
5
  SHA512:
6
- metadata.gz: 15411df49fdb161491e6e4e746325eb5c735ffdb00f0057d9b0084dea4011f2a890b819f8ec232b78230616398d3b8134432cd6ec6be5215a8c6a60925d804a5
7
- data.tar.gz: e66a6f427327a47a0804a5f6faa754f36962abf92233514b56b565ed01f594a797d418c2f4389c91a8859e9bf5809a4c053594185963eaef150db25460193847
6
+ metadata.gz: 8e8428e37d7c008253af9146fcbdaa3c5f7e3dedd87db562fff295956cbc21e0e3498635b55c500621cc2e23bb183b7c1c36a9da0971571fae00b0c61fa6b6d3
7
+ data.tar.gz: 5894ea8ebfd581f8a110c01f71e00b2d4200d1c428bba4bf4002d5fe4fd2450bc662a70ebcc5812a3499264ef7f00af07fbd769820ce4af23f748516e561c821
data/.gitignore CHANGED
@@ -19,3 +19,4 @@ ext/ruby_generator/protoc-ruby
19
19
  .ruby-version
20
20
  ext/ruby_generator/gdb.run
21
21
  ext/ruby_generator/protoc-ruby.dSYM
22
+ .byebug_history
data/.rubocop.yml ADDED
@@ -0,0 +1,67 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ DisplayCopNames: true
5
+ Exclude:
6
+ - 'spec/support/protos/*.pb.rb'
7
+
8
+ Lint/EndAlignment:
9
+ AlignWith: keyword
10
+
11
+ Lint/Loop:
12
+ Enabled: false
13
+
14
+ Metrics/ClassLength:
15
+ Enabled: false
16
+
17
+ Metrics/ModuleLength:
18
+ Enabled: false
19
+
20
+ Style/CaseIndentation:
21
+ IndentWhenRelativeTo: end
22
+
23
+ Style/ClassAndModuleChildren:
24
+ Exclude:
25
+ - '**/*.pb.rb'
26
+
27
+ Style/ClassAndModuleCamelCase:
28
+ Exclude:
29
+ - '**/*.pb.rb'
30
+
31
+ Style/EmptyLineBetweenDefs:
32
+ AllowAdjacentOneLineDefs: true
33
+
34
+ Style/EmptyLines:
35
+ Exclude:
36
+ - '**/*.pb.rb'
37
+
38
+ Style/FileName:
39
+ Exclude:
40
+ - '**/protoc-gen-ruby*'
41
+ - '**/reverse-*'
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/TrailingCommaInLiteral:
63
+ EnforcedStyleForMultiline: comma
64
+
65
+ Style/TrivialAccessors:
66
+ AllowDSLWriters: true
67
+ AllowPredicates: true
data/.rubocop_todo.yml ADDED
@@ -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
data/.travis.yml CHANGED
@@ -1,10 +1,30 @@
1
+ before_install:
2
+ - sudo apt-get update -qq
3
+ - sudo apt-get install -y libzmq3-dev
4
+ - sudo -E ./install-protobuf.sh
5
+ - java -Xmx1g -version
6
+ - javac -J-Xmx1g -version
7
+ - export JRUBY_OPTS=-J-Xmx1g
8
+ # Required for rainbow installation issue, https://github.com/sickill/rainbow/issues/44
9
+ - gem update --system
10
+ - gem update bundler
1
11
  language: ruby
2
12
  rvm:
3
- - 1.9.3
4
- - 2.3.1
5
- before_install:
6
- - gem install bundler
7
- script: NO_COMPILE_TEST_PROTOS=1 bundle _1.12.5_ exec rake spec/lib
13
+ - 1.9.3
14
+ - 2.0.0
15
+ - 2.1
16
+ - 2.2
17
+ - 2.2.2
18
+ - 2.3
19
+ - jruby-9.1.7.0
20
+ - rbx-2
21
+ env:
22
+ - PROTOBUF_VERSION=2.6.1
23
+ - PROTOBUF_VERSION=3.0.0-alpha-2
24
+ matrix:
25
+ allow_failures:
26
+ - rvm: rbx-2
27
+ - env: PROTOBUF_VERSION=3.0.0-alpha-2
8
28
  notifications:
9
29
  webhooks:
10
30
  urls:
data/CHANGES.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Stable (3.x)
2
2
 
3
+ 4.0.0
4
+ -----------
5
+ - Merge in ruby-protobuf/protobuf
6
+
7
+ Upstream 3.7.0 (pre2)
8
+ -----------
9
+ - BUG: Track if a repeated field has been deliberately set (#325)
10
+
11
+ Upstream 3.7.0 (pre1)
12
+ -----------
13
+ - BUG: Revert to old behavior for setting repeated fields to nil
14
+ - BUG: Set binmode for protoc-gen-ruby STDIN and STDOUT to compile proto files on Windows
15
+ - Make all things Optionable and fix requires
16
+
17
+ Upstream 3.7.0 (pre0)
18
+ -----------
19
+ - Add `PB_USE_RAW_RPC_NAMES` option to preserve raw RPC name (since #underscore can be lossy).
20
+ - Add `PB_ENUM_UPCASE` option to generate enum values as upcased.
21
+ - Clean up dynamic code generation in prep for extension namespacing.
22
+ - Namespace extension fields.
23
+ - Field values should be stored via their fully qualified names
24
+ - Refresh google/protobuf/descriptor.{proto,pb.rb}
25
+ - Properly encode and decode negative enum values.
26
+
27
+ Upstream 3.6.9
28
+ --------
29
+ - Make protobuf serivce directory pluggable.
30
+
31
+ Upstream 3.6.7
32
+ -----
33
+ - An issue was reported with the encode memoization added in #293 with using any array modification
34
+ method on repeated fields. Remove memoization on encode (#305) until we can find a better solution.
35
+
36
+ Upstream 3.5.5
37
+ --------
38
+ - Add native Varint for MRI.
39
+
40
+ Upstream 3.5.4
41
+ --------
42
+ - Ensures ActiveSupport::Deprecation does not get a stack trace when deprecations are disabled.
43
+
44
+ Upstream 3.5.3
45
+ --------
46
+ - Optimized get_extension_field and get_field calls.
47
+
48
+ Upstream 3.5.2
49
+ --------
50
+ - Optimized valid_tag?, enums_for_tag and enums_for_tags
51
+
52
+ Upstream 3.5.1
53
+ --------
54
+ - Adds compatibility for Rails 4.2+ as CLI options were broken
55
+ - Fixes bug with MRI and "dead" thread in zmq broker
56
+ - Fixes Rubocop compatability with new version
57
+
3
58
  3.2.0
4
59
  --------
5
60
 
data/CONTRIBUTING.md CHANGED
@@ -6,7 +6,7 @@ your code merged.
6
6
 
7
7
  1. Use GitHub Issues or Pull Requests over sending an email. It's much easier for me to keep track of your issue through GitHub.
8
8
  2. For __compiler issues__, please provide both a gist for the __source definition(s)__ as well as the __generated output__ (if any).
9
- 3. For __existing issues or functionality__, please use __`2-8-stable`__ as the base branch for the pull request. This helps us maintain a stable gem release strategy. All commits merged to `2-8-stable` will also be merged down to `master`.
9
+ 3. For __existing issues or functionality__, please use the latest stable branch (currently __`3-5-stable`__) as the base branch for the pull request. This helps us maintain a stable gem release strategy. All commits merged to stable will also be merged down to `master`.
10
10
  4. For __new functionality__, please use __`master`__ as the base branch for the pull request. The `master` branch is used to stage all "next iteration" work.
11
11
  5. Be patient with me as I work on your issue.
12
12
 
data/LICENSE.txt CHANGED
@@ -1,14 +1,22 @@
1
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
- Version 2, December 2004
1
+ The MIT License (MIT)
3
2
 
4
- Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
3
+ Copyright (c) 2014 BJ Neilsen
5
4
 
6
- Everyone is permitted to copy and distribute verbatim or modified
7
- copies of this license document, and changing it is allowed as long
8
- as the name is changed.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
9
11
 
10
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
12
14
 
13
- 0. You just DO WHAT THE FUCK YOU WANT TO.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
14
22
 
data/README.md CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  (the JSON slayer)
4
4
 
5
- [![Gem Version](https://badge.fury.io/rb/protobuf.png)](http://badge.fury.io/rb/protobuf)
6
- [![Build Status](https://secure.travis-ci.org/localshred/protobuf.png?branch=master)](https://travis-ci.org/localshred/protobuf)
7
- [![Gitter chat](https://badges.gitter.im/localshred/protobuf.png)](https://gitter.im/localshred/protobuf)
5
+ [![Gem Version](https://badge.fury.io/rb/protobuf.svg)](http://badge.fury.io/rb/protobuf)
6
+ [![Build Status](https://secure.travis-ci.org/ruby-protobuf/protobuf.svg?branch=master)](https://travis-ci.org/ruby-protobuf/protobuf)
7
+ [![Gitter chat](https://badges.gitter.im/ruby-protobuf/protobuf.svg)](https://gitter.im/ruby-protobuf/protobuf)
8
+ [![protobuf API Documentation](https://www.omniref.com/ruby/gems/protobuf.png)](https://www.omniref.com/ruby/gems/protobuf)
8
9
 
9
10
  Protobuffy is an implementation of [Google's protocol buffers][google-pb] in
10
11
  ruby, version 2.5.0 is currently supported.
@@ -47,12 +48,12 @@ Alternatively, start the server as a Rack app using a `rackup` and a standard `c
47
48
  See recent changes in the [release notes][] or the [changelog][].
48
49
 
49
50
  [google-pb]: http://code.google.com/p/protobuf "Google Protocol Buffers"
50
- [wiki]: https://github.com/localshred/protobuf/wiki "Wiki home page"
51
- [Installation Guide]: https://github.com/localshred/protobuf/wiki/Installation "Installation guide"
52
- [compiling definitions]: https://github.com/localshred/protobuf/wiki/Compiling-Definitions "Compiling guide"
53
- [object APIs]: https://github.com/localshred/protobuf/wiki/Messages-&-Enums "Message & Enum object APIs guide"
54
- [services]: https://github.com/localshred/protobuf/wiki/Services "Services object API guide"
55
- [clients]: https://github.com/localshred/protobuf/wiki/Clients "Client object API guide"
56
- [API roadmap]: https://github.com/localshred/protobuf/wiki/API-Roadmap "API Roadmap guide"
57
- [release notes]: https://github.com/localshred/protobuf/releases "Release notes"
58
- [changelog]: https://github.com/localshred/protobuf/blob/master/CHANGES.md "CHANGES.md"
51
+ [wiki]: https://github.com/ruby-protobuf/protobuf/wiki "Wiki home page"
52
+ [Installation Guide]: https://github.com/ruby-protobuf/protobuf/wiki/Installation "Installation guide"
53
+ [compiling definitions]: https://github.com/ruby-protobuf/protobuf/wiki/Compiling-Definitions "Compiling guide"
54
+ [object APIs]: https://github.com/ruby-protobuf/protobuf/wiki/Messages-&-Enums "Message & Enum object APIs guide"
55
+ [services]: https://github.com/ruby-protobuf/protobuf/wiki/Services "Services object API guide"
56
+ [clients]: https://github.com/ruby-protobuf/protobuf/wiki/Clients "Client object API guide"
57
+ [API roadmap]: https://github.com/ruby-protobuf/protobuf/wiki/API-Roadmap "API Roadmap guide"
58
+ [release notes]: https://github.com/ruby-protobuf/protobuf/releases "Release notes"
59
+ [changelog]: https://github.com/ruby-protobuf/protobuf/blob/master/CHANGES.md "CHANGES.md"
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
- $: << ::File.expand_path('../', __FILE__)
2
- $: << ::File.expand_path('../spec', __FILE__)
1
+ $LOAD_PATH << ::File.expand_path('../', __FILE__)
2
+ $LOAD_PATH << ::File.expand_path('../spec', __FILE__)
3
3
 
4
4
  require 'fileutils'
5
5
  require 'rubygems'
@@ -8,31 +8,35 @@ require 'bundler/gem_tasks'
8
8
  require 'benchmark/tasks'
9
9
 
10
10
  require 'rspec/core/rake_task'
11
-
12
- desc 'Default: run specs.'
13
- task :default => :spec
11
+ require 'rubocop/rake_task'
14
12
 
15
13
  RSpec::Core::RakeTask.new(:spec)
14
+ RuboCop::RakeTask.new
15
+
16
+ task :default => ['compile:spec', 'compile:rpc', :spec, :rubocop]
16
17
 
17
18
  desc 'Run specs'
18
19
  namespace :compile do
19
20
 
20
21
  desc 'Compile spec protos in spec/supprt/ directory'
21
- task :spec do |task, args|
22
+ task :spec do
22
23
  proto_path = ::File.expand_path('../spec/support/', __FILE__)
23
- cmd = %Q{protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{proto_path} -I #{proto_path} #{File.join(proto_path, '**', '*.proto')}}
24
+ proto_files = Dir[File.join(proto_path, '**', '*.proto')]
25
+ cmd = %(protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{proto_path} -I #{proto_path} #{proto_files.join(' ')})
24
26
 
25
27
  puts cmd
26
- exec(cmd)
28
+ system(cmd)
27
29
  end
28
30
 
29
31
  desc 'Compile rpc protos in protos/ directory'
30
- task :rpc do |task, args|
32
+ task :rpc do
31
33
  proto_path = ::File.expand_path('../proto', __FILE__)
34
+ proto_files = Dir[File.join(proto_path, '**', '*.proto')]
35
+ puts "\n\n #{proto_files} \n\n"
32
36
  output_dir = ::File.expand_path('../tmp/rpc', __FILE__)
33
37
  ::FileUtils.mkdir_p(output_dir)
34
38
 
35
- cmd = %Q{protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{output_dir} -I #{proto_path} #{File.join(proto_path, '**', '*.proto')}}
39
+ cmd = %(protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{output_dir} -I #{proto_path} #{proto_files.join(' ')})
36
40
 
37
41
  puts cmd
38
42
  system(cmd)
@@ -41,7 +45,7 @@ namespace :compile do
41
45
  'tmp/rpc/dynamic_discovery.pb.rb' => 'lib/protobuf/rpc',
42
46
  'tmp/rpc/rpc.pb.rb' => 'lib/protobuf/rpc',
43
47
  'tmp/rpc/google/protobuf/descriptor.pb.rb' => 'lib/protobuf/descriptors/google/protobuf',
44
- 'tmp/rpc/google/protobuf/compiler/plugin.pb.rb' => 'lib/protobuf/descriptors/google/protobuf/compiler'
48
+ 'tmp/rpc/google/protobuf/compiler/plugin.pb.rb' => 'lib/protobuf/descriptors/google/protobuf/compiler',
45
49
  }
46
50
 
47
51
  files.each_pair do |source_file, destination_dir|