ruby_protobuf 0.3.3 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/History.txt +10 -2
  2. data/Manifest.txt +26 -12
  3. data/README.txt +6 -1
  4. data/Rakefile +51 -14
  5. data/TODO +15 -0
  6. data/VERSION +1 -0
  7. data/bin/rprotoc +11 -6
  8. data/lib/protobuf/common/exceptions.rb +11 -0
  9. data/lib/protobuf/common/util.rb +9 -0
  10. data/lib/protobuf/common/wire_type.rb +6 -6
  11. data/lib/protobuf/compiler/compiler.rb +16 -16
  12. data/lib/protobuf/compiler/nodes.rb +67 -65
  13. data/lib/protobuf/compiler/proto.y +31 -38
  14. data/lib/protobuf/compiler/proto_parser.rb +315 -294
  15. data/lib/protobuf/compiler/template/rpc_bin.erb +1 -1
  16. data/lib/protobuf/compiler/template/rpc_client.erb +1 -1
  17. data/lib/protobuf/compiler/template/rpc_service.erb +2 -2
  18. data/lib/protobuf/compiler/visitors.rb +45 -39
  19. data/lib/protobuf/descriptor/descriptor.proto +0 -0
  20. data/lib/protobuf/descriptor/descriptor.rb +11 -10
  21. data/lib/protobuf/descriptor/descriptor_builder.rb +6 -7
  22. data/lib/protobuf/descriptor/descriptor_proto.rb +51 -31
  23. data/lib/protobuf/descriptor/enum_descriptor.rb +5 -5
  24. data/lib/protobuf/descriptor/field_descriptor.rb +8 -9
  25. data/lib/protobuf/descriptor/file_descriptor.rb +0 -1
  26. data/lib/protobuf/message/decoder.rb +33 -35
  27. data/lib/protobuf/message/encoder.rb +23 -19
  28. data/lib/protobuf/message/enum.rb +43 -9
  29. data/lib/protobuf/message/field.rb +281 -193
  30. data/lib/protobuf/message/message.rb +166 -110
  31. data/lib/protobuf/message/protoable.rb +4 -3
  32. data/lib/protobuf/message/service.rb +1 -1
  33. data/lib/protobuf/rpc/client.rb +3 -3
  34. data/lib/protobuf/rpc/handler.rb +1 -1
  35. data/lib/protobuf/rpc/server.rb +8 -8
  36. data/lib/ruby_protobuf.rb +1 -1
  37. data/test/check_unbuild.rb +7 -7
  38. data/test/proto/addressbook.pb.rb +67 -0
  39. data/test/proto/addressbook.proto +2 -0
  40. data/test/proto/addressbook_base.pb.rb +59 -0
  41. data/test/proto/addressbook_base.proto +1 -1
  42. data/test/proto/addressbook_ext.pb.rb +21 -0
  43. data/test/proto/addressbook_ext.proto +2 -2
  44. data/test/{collision.rb → proto/collision.pb.rb} +0 -0
  45. data/test/{ext_collision.rb → proto/ext_collision.pb.rb} +1 -1
  46. data/test/{ext_range.rb → proto/ext_range.pb.rb} +4 -4
  47. data/test/proto/ext_range.proto +2 -2
  48. data/test/proto/float_default.proto +10 -0
  49. data/test/proto/lowercase.pb.rb +31 -0
  50. data/test/proto/lowercase.proto +9 -0
  51. data/test/{merge.rb → proto/merge.pb.rb} +2 -2
  52. data/test/proto/nested.pb.rb +31 -0
  53. data/test/proto/nested.proto +2 -0
  54. data/test/proto/optional_field.pb.rb +36 -0
  55. data/test/proto/optional_field.proto +12 -0
  56. data/test/proto/packed.pb.rb +23 -0
  57. data/test/proto/packed.proto +6 -0
  58. data/test/{types.rb → proto/types.pb.rb} +43 -1
  59. data/test/test_addressbook.rb +30 -17
  60. data/test/test_compiler.rb +79 -78
  61. data/test/test_descriptor.rb +12 -12
  62. data/test/test_enum_value.rb +41 -0
  63. data/test/test_extension.rb +10 -14
  64. data/test/test_lowercase.rb +11 -0
  65. data/test/test_message.rb +44 -41
  66. data/test/test_optional_field.rb +61 -38
  67. data/test/test_packed_field.rb +40 -0
  68. data/test/test_parse.rb +8 -8
  69. data/test/test_repeated_types.rb +29 -3
  70. data/test/test_serialize.rb +12 -12
  71. data/test/test_standard_message.rb +30 -30
  72. data/test/test_types.rb +95 -95
  73. metadata +69 -39
  74. data/test/addressbook.rb +0 -98
  75. data/test/addressbook_base.rb +0 -62
  76. data/test/addressbook_ext.rb +0 -12
  77. data/test/nested.rb +0 -25
  78. data/test/test_ruby_protobuf.rb +0 -1
data/test/nested.rb DELETED
@@ -1,25 +0,0 @@
1
- ### Generated by rprotoc. DO NOT EDIT!
2
- ### <proto file: test/nested.proto>
3
- # message Foo {
4
- # message Bar {
5
- # }
6
- # }
7
- # message Baaz {
8
- # optional Foo.Bar x = 1;
9
- # }
10
-
11
- require 'protobuf/message/message'
12
- require 'protobuf/message/enum'
13
- require 'protobuf/message/service'
14
- require 'protobuf/message/extend'
15
-
16
- class Foo < ::Protobuf::Message
17
- defined_in __FILE__
18
- class Bar < ::Protobuf::Message
19
- defined_in __FILE__
20
- end
21
- end
22
- class Baaz < ::Protobuf::Message
23
- defined_in __FILE__
24
- optional :'Foo::Bar', :x, 1
25
- end
@@ -1 +0,0 @@
1
-