ruby_protobuf 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/protobuf/compiler/compiler.rb +2 -2
- data/lib/protobuf/compiler/proto.y +9 -1
- data/lib/protobuf/compiler/proto_parser.rb +267 -239
- data/lib/protobuf/compiler/template/rpc_client.erb +2 -2
- data/lib/protobuf/compiler/visitors.rb +5 -5
- data/lib/protobuf/message/message.rb +7 -3
- data/test/test_standard_message.rb +16 -0
- metadata +25 -27
- data/test/proto/float_default.pb.rb +0 -28
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.8
|
@@ -15,7 +15,7 @@ module Protobuf
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def create_message(proto_file, proto_dir='.', out_dir='.', file_create=true)
|
18
|
-
rb_file = File.join(out_dir, File.basename(proto_file
|
18
|
+
rb_file = File.join(out_dir, File.basename(proto_file, '.proto') + '.pb.rb')
|
19
19
|
proto_path = validate_existence(proto_file, proto_dir)
|
20
20
|
|
21
21
|
message_visitor = Visitor::CreateMessageVisitor.new(proto_file, proto_dir, out_dir)
|
@@ -26,7 +26,7 @@ module Protobuf
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def create_rpc(proto_file, proto_dir='.', out_dir='.', file_create=true)
|
29
|
-
message_file = File.join(out_dir, File.basename(proto_file
|
29
|
+
message_file = File.join(out_dir, File.basename(proto_file, '.proto') + '.pb.rb')
|
30
30
|
proto_path = validate_existence(proto_file, proto_dir)
|
31
31
|
|
32
32
|
rpc_visitor = Visitor::CreateRpcVisitor.new
|
@@ -76,9 +76,17 @@ rule
|
|
76
76
|
|
77
77
|
syntax : 'syntax' '=' STRING_LITERAL ';' { result = Protobuf::Node::SyntaxNode.new(val[2]) }
|
78
78
|
|
79
|
-
rpc : 'rpc' IDENT '(' rpc_arg ')' 'returns' '(' rpc_arg ')'
|
79
|
+
rpc : 'rpc' IDENT '(' rpc_arg ')' 'returns' '(' rpc_arg ')' rpc_option_body
|
80
80
|
{ result = Protobuf::Node::RpcNode.new(val[1], val[3], val[7]) }
|
81
81
|
|
82
|
+
rpc_option_body : '{' option_list '}'
|
83
|
+
| ';'
|
84
|
+
|
85
|
+
option_list :
|
86
|
+
{ result = [] }
|
87
|
+
| option_list option
|
88
|
+
{ result << val[1] if val[1] }
|
89
|
+
|
82
90
|
rpc_arg :
|
83
91
|
| user_type
|
84
92
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
unless $".index 'racc/parser.rb'
|
11
11
|
$".push 'racc/parser.rb'
|
12
12
|
|
13
|
-
self.class.module_eval <<'..end racc/parser.rb modeval..
|
13
|
+
self.class.module_eval <<'..end racc/parser.rb modeval..ide7023bcd25', 'racc/parser.rb', 1
|
14
14
|
#
|
15
15
|
# $Id: parser.rb,v 1.7 2005/11/20 17:31:32 aamine Exp $
|
16
16
|
#
|
@@ -453,7 +453,7 @@ module Racc
|
|
453
453
|
end
|
454
454
|
|
455
455
|
end
|
456
|
-
..end racc/parser.rb modeval..
|
456
|
+
..end racc/parser.rb modeval..ide7023bcd25
|
457
457
|
end
|
458
458
|
###### racc/parser.rb end
|
459
459
|
|
@@ -462,7 +462,7 @@ module Protobuf
|
|
462
462
|
|
463
463
|
class ProtoParser < Racc::Parser
|
464
464
|
|
465
|
-
module_eval <<'..end lib/protobuf/compiler/proto.y modeval..
|
465
|
+
module_eval <<'..end lib/protobuf/compiler/proto.y modeval..id236e3e3c5b', 'lib/protobuf/compiler/proto.y', 169
|
466
466
|
|
467
467
|
require 'strscan'
|
468
468
|
|
@@ -520,7 +520,7 @@ module_eval <<'..end lib/protobuf/compiler/proto.y modeval..idf83c19ba1e', 'lib/
|
|
520
520
|
end
|
521
521
|
false
|
522
522
|
end
|
523
|
-
..end lib/protobuf/compiler/proto.y modeval..
|
523
|
+
..end lib/protobuf/compiler/proto.y modeval..id236e3e3c5b
|
524
524
|
|
525
525
|
##### racc 1.4.5 generates ###
|
526
526
|
|
@@ -565,87 +565,91 @@ racc_reduce_table = [
|
|
565
565
|
1, 77, :_reduce_37,
|
566
566
|
4, 62, :_reduce_38,
|
567
567
|
10, 78, :_reduce_39,
|
568
|
+
3, 80, :_reduce_none,
|
569
|
+
1, 80, :_reduce_none,
|
570
|
+
0, 81, :_reduce_42,
|
571
|
+
2, 81, :_reduce_43,
|
568
572
|
0, 79, :_reduce_none,
|
569
573
|
1, 79, :_reduce_none,
|
570
|
-
3, 66, :
|
571
|
-
0,
|
572
|
-
2,
|
573
|
-
1,
|
574
|
-
1,
|
575
|
-
1, 81, :_reduce_none,
|
576
|
-
1, 81, :_reduce_none,
|
577
|
-
1, 81, :_reduce_none,
|
578
|
-
1, 81, :_reduce_none,
|
579
|
-
1, 81, :_reduce_none,
|
580
|
-
1, 81, :_reduce_52,
|
581
|
-
6, 71, :_reduce_53,
|
582
|
-
6, 70, :_reduce_54,
|
583
|
-
9, 70, :_reduce_55,
|
584
|
-
1, 85, :_reduce_none,
|
585
|
-
1, 85, :_reduce_none,
|
586
|
-
1, 85, :_reduce_none,
|
587
|
-
1, 85, :_reduce_none,
|
588
|
-
1, 85, :_reduce_none,
|
589
|
-
1, 85, :_reduce_none,
|
590
|
-
1, 85, :_reduce_none,
|
591
|
-
1, 85, :_reduce_none,
|
592
|
-
1, 85, :_reduce_none,
|
593
|
-
1, 85, :_reduce_none,
|
594
|
-
1, 85, :_reduce_none,
|
595
|
-
1, 85, :_reduce_none,
|
596
|
-
1, 85, :_reduce_none,
|
597
|
-
1, 85, :_reduce_none,
|
598
|
-
1, 85, :_reduce_none,
|
599
|
-
1, 85, :_reduce_none,
|
600
|
-
1, 85, :_reduce_none,
|
601
|
-
1, 85, :_reduce_none,
|
602
|
-
1, 85, :_reduce_none,
|
603
|
-
1, 85, :_reduce_none,
|
604
|
-
1, 85, :_reduce_none,
|
605
|
-
1, 85, :_reduce_none,
|
606
|
-
1, 85, :_reduce_none,
|
607
|
-
1, 85, :_reduce_none,
|
608
|
-
1, 85, :_reduce_none,
|
609
|
-
1, 85, :_reduce_none,
|
610
|
-
1, 85, :_reduce_none,
|
611
|
-
1, 85, :_reduce_none,
|
612
|
-
1, 85, :_reduce_none,
|
613
|
-
1, 85, :_reduce_none,
|
614
|
-
1, 85, :_reduce_none,
|
615
|
-
1, 85, :_reduce_none,
|
616
|
-
1, 85, :_reduce_none,
|
617
|
-
1, 85, :_reduce_none,
|
618
|
-
1, 86, :_reduce_90,
|
619
|
-
3, 86, :_reduce_91,
|
620
|
-
1, 87, :_reduce_none,
|
621
|
-
3, 87, :_reduce_93,
|
622
|
-
4, 82, :_reduce_94,
|
623
|
-
0, 89, :_reduce_95,
|
624
|
-
2, 89, :_reduce_96,
|
625
|
-
1, 88, :_reduce_97,
|
626
|
-
3, 88, :_reduce_98,
|
627
|
-
3, 88, :_reduce_99,
|
574
|
+
3, 66, :_reduce_46,
|
575
|
+
0, 82, :_reduce_47,
|
576
|
+
2, 82, :_reduce_48,
|
577
|
+
1, 83, :_reduce_none,
|
578
|
+
1, 83, :_reduce_none,
|
628
579
|
1, 83, :_reduce_none,
|
629
580
|
1, 83, :_reduce_none,
|
630
581
|
1, 83, :_reduce_none,
|
631
|
-
1,
|
632
|
-
1,
|
633
|
-
1,
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
1,
|
638
|
-
1,
|
639
|
-
1,
|
640
|
-
1,
|
641
|
-
1,
|
642
|
-
1,
|
643
|
-
1,
|
644
|
-
1,
|
645
|
-
1,
|
646
|
-
1,
|
647
|
-
|
648
|
-
|
582
|
+
1, 83, :_reduce_none,
|
583
|
+
1, 83, :_reduce_none,
|
584
|
+
1, 83, :_reduce_56,
|
585
|
+
6, 71, :_reduce_57,
|
586
|
+
6, 70, :_reduce_58,
|
587
|
+
9, 70, :_reduce_59,
|
588
|
+
1, 87, :_reduce_none,
|
589
|
+
1, 87, :_reduce_none,
|
590
|
+
1, 87, :_reduce_none,
|
591
|
+
1, 87, :_reduce_none,
|
592
|
+
1, 87, :_reduce_none,
|
593
|
+
1, 87, :_reduce_none,
|
594
|
+
1, 87, :_reduce_none,
|
595
|
+
1, 87, :_reduce_none,
|
596
|
+
1, 87, :_reduce_none,
|
597
|
+
1, 87, :_reduce_none,
|
598
|
+
1, 87, :_reduce_none,
|
599
|
+
1, 87, :_reduce_none,
|
600
|
+
1, 87, :_reduce_none,
|
601
|
+
1, 87, :_reduce_none,
|
602
|
+
1, 87, :_reduce_none,
|
603
|
+
1, 87, :_reduce_none,
|
604
|
+
1, 87, :_reduce_none,
|
605
|
+
1, 87, :_reduce_none,
|
606
|
+
1, 87, :_reduce_none,
|
607
|
+
1, 87, :_reduce_none,
|
608
|
+
1, 87, :_reduce_none,
|
609
|
+
1, 87, :_reduce_none,
|
610
|
+
1, 87, :_reduce_none,
|
611
|
+
1, 87, :_reduce_none,
|
612
|
+
1, 87, :_reduce_none,
|
613
|
+
1, 87, :_reduce_none,
|
614
|
+
1, 87, :_reduce_none,
|
615
|
+
1, 87, :_reduce_none,
|
616
|
+
1, 87, :_reduce_none,
|
617
|
+
1, 87, :_reduce_none,
|
618
|
+
1, 87, :_reduce_none,
|
619
|
+
1, 87, :_reduce_none,
|
620
|
+
1, 87, :_reduce_none,
|
621
|
+
1, 87, :_reduce_none,
|
622
|
+
1, 88, :_reduce_94,
|
623
|
+
3, 88, :_reduce_95,
|
624
|
+
1, 89, :_reduce_none,
|
625
|
+
3, 89, :_reduce_97,
|
626
|
+
4, 84, :_reduce_98,
|
627
|
+
0, 91, :_reduce_99,
|
628
|
+
2, 91, :_reduce_100,
|
629
|
+
1, 90, :_reduce_101,
|
630
|
+
3, 90, :_reduce_102,
|
631
|
+
3, 90, :_reduce_103,
|
632
|
+
1, 85, :_reduce_none,
|
633
|
+
1, 85, :_reduce_none,
|
634
|
+
1, 85, :_reduce_none,
|
635
|
+
1, 86, :_reduce_none,
|
636
|
+
1, 86, :_reduce_none,
|
637
|
+
1, 86, :_reduce_none,
|
638
|
+
1, 86, :_reduce_none,
|
639
|
+
1, 86, :_reduce_none,
|
640
|
+
1, 86, :_reduce_none,
|
641
|
+
1, 86, :_reduce_none,
|
642
|
+
1, 86, :_reduce_none,
|
643
|
+
1, 86, :_reduce_none,
|
644
|
+
1, 86, :_reduce_none,
|
645
|
+
1, 86, :_reduce_none,
|
646
|
+
1, 86, :_reduce_none,
|
647
|
+
1, 86, :_reduce_none,
|
648
|
+
1, 86, :_reduce_none,
|
649
|
+
1, 86, :_reduce_none,
|
650
|
+
1, 86, :_reduce_none,
|
651
|
+
2, 67, :_reduce_123,
|
652
|
+
3, 67, :_reduce_124,
|
649
653
|
1, 65, :_reduce_none,
|
650
654
|
1, 65, :_reduce_none,
|
651
655
|
1, 65, :_reduce_none,
|
@@ -655,137 +659,141 @@ racc_reduce_table = [
|
|
655
659
|
1, 75, :_reduce_none,
|
656
660
|
1, 75, :_reduce_none ]
|
657
661
|
|
658
|
-
racc_reduce_n =
|
662
|
+
racc_reduce_n = 133
|
659
663
|
|
660
|
-
racc_shift_n =
|
664
|
+
racc_shift_n = 195
|
661
665
|
|
662
666
|
racc_action_table = [
|
663
667
|
79, 56, 82, 21, 22, 79, 28, 82, 47, 65,
|
664
|
-
53, 73, 57, 68, 52, 16,
|
665
|
-
66,
|
666
|
-
98, 101, 102, 103, 104, 105, 106, 107,
|
668
|
+
53, 73, 57, 68, 52, 16, 16, 16, 114, 47,
|
669
|
+
66, 193, 74, 55, 58, 60, 76, 178, 110, 113,
|
670
|
+
98, 101, 102, 103, 104, 105, 106, 107, 108, 109,
|
667
671
|
112, 97, 100, 77, 78, 80, 81, 83, 77, 78,
|
668
|
-
80, 81, 83, 128,
|
669
|
-
|
670
|
-
|
671
|
-
144,
|
672
|
-
141, 143,
|
672
|
+
80, 81, 83, 128, 161, 136, 140, 37, 145, 190,
|
673
|
+
152, 121, 21, 22, 127, 131, 135, 139, 36, 189,
|
674
|
+
148, 151, 21, 22, 125, 129, 132, 134, 138, 142,
|
675
|
+
144, 147, 150, 120, 123, 124, 126, 130, 133, 137,
|
676
|
+
141, 143, 146, 149, 119, 122, 88, 173, 181, 80,
|
673
677
|
81, 83, 16, 28, 18, 1, 167, 90, 6, 80,
|
674
|
-
81, 83, 80, 81, 83,
|
675
|
-
60,
|
676
|
-
4, 7,
|
677
|
-
|
678
|
-
|
679
|
-
80, 81, 83, 80, 81, 83,
|
680
|
-
|
681
|
-
23, 188,
|
678
|
+
81, 83, 80, 81, 83, 21, 22, 172, 55, 58,
|
679
|
+
60, 182, 94, 35, 178, 80, 81, 83, 30, 115,
|
680
|
+
4, 7, 33, 12, 39, 32, 16, 154, 18, 1,
|
681
|
+
47, 156, 6, 9, 11, 4, 7, 157, 12, 159,
|
682
|
+
160, 16, 38, 18, 1, 162, 64, 6, 9, 11,
|
683
|
+
80, 81, 83, 80, 81, 83, 42, 166, 28, 45,
|
684
|
+
43, 171, 27, 45, 175, 26, 180, 25, 183, 51,
|
685
|
+
185, 24, 23, 188, 47, 116 ]
|
682
686
|
|
683
687
|
racc_action_check = [
|
684
|
-
|
685
|
-
41, 50, 46, 49, 40, 49,
|
686
|
-
49,
|
688
|
+
183, 46, 183, 63, 63, 53, 182, 53, 41, 49,
|
689
|
+
41, 50, 46, 49, 40, 49, 192, 50, 63, 40,
|
690
|
+
49, 192, 50, 46, 46, 46, 50, 182, 63, 63,
|
687
691
|
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
|
688
|
-
63, 63, 63,
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
54,
|
697
|
-
17, 17,
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
6, 184,
|
692
|
+
63, 63, 63, 183, 183, 183, 183, 183, 53, 53,
|
693
|
+
53, 53, 53, 111, 154, 111, 111, 24, 111, 188,
|
694
|
+
111, 111, 156, 156, 111, 111, 111, 111, 23, 188,
|
695
|
+
111, 111, 180, 180, 111, 111, 111, 111, 111, 111,
|
696
|
+
111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
|
697
|
+
111, 111, 111, 111, 111, 111, 54, 169, 176, 94,
|
698
|
+
94, 94, 54, 172, 54, 54, 159, 54, 54, 115,
|
699
|
+
115, 115, 161, 161, 161, 1, 1, 169, 54, 54,
|
700
|
+
54, 176, 54, 22, 172, 159, 159, 159, 17, 68,
|
701
|
+
17, 17, 20, 17, 26, 18, 17, 114, 17, 17,
|
702
|
+
48, 116, 17, 17, 17, 0, 0, 117, 0, 118,
|
703
|
+
153, 0, 25, 0, 0, 155, 47, 0, 0, 0,
|
704
|
+
157, 157, 157, 160, 160, 160, 29, 158, 16, 32,
|
705
|
+
30, 164, 12, 170, 171, 11, 175, 9, 178, 39,
|
706
|
+
181, 7, 6, 184, 34, 76 ]
|
703
707
|
|
704
708
|
racc_action_pointer = [
|
705
|
-
143,
|
706
|
-
nil,
|
707
|
-
|
708
|
-
|
709
|
-
12, 1, nil, nil, nil, nil, -1,
|
710
|
-
9, nil, nil,
|
711
|
-
nil, nil, nil, -3, nil, nil, nil, nil,
|
712
|
-
nil, nil, nil, nil, nil, nil,
|
709
|
+
143, 109, nil, nil, nil, nil, 176, 177, nil, 171,
|
710
|
+
nil, 166, 166, nil, nil, nil, 162, 128, 129, nil,
|
711
|
+
120, nil, 117, 56, 55, 140, 130, nil, nil, 164,
|
712
|
+
170, nil, 157, nil, 177, nil, nil, nil, nil, 177,
|
713
|
+
12, 1, nil, nil, nil, nil, -1, 150, 133, 7,
|
714
|
+
9, nil, nil, 1, 94, nil, nil, nil, nil, nil,
|
715
|
+
nil, nil, nil, -3, nil, nil, nil, nil, 120, nil,
|
716
|
+
nil, nil, nil, nil, nil, nil, 179, nil, nil, nil,
|
717
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
718
|
+
nil, nil, nil, nil, 50, nil, nil, nil, nil, nil,
|
719
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
720
|
+
nil, 50, nil, nil, 131, 60, 123, 101, 120, nil,
|
713
721
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
714
|
-
nil, nil, nil, nil, nil, nil, 60, nil, nil, nil,
|
715
|
-
nil, nil, nil, nil, nil, nil, nil, nil, 50, nil,
|
716
|
-
nil, nil, nil, nil, 128, 111, 119, 94, 112, nil,
|
717
722
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
718
723
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
719
|
-
nil, nil, nil,
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
+
nil, nil, nil, 141, 45, 153, 56, 111, 165, 76,
|
725
|
+
114, 63, nil, nil, 152, nil, nil, nil, nil, 95,
|
726
|
+
161, 154, 97, nil, nil, 158, 75, nil, 169, nil,
|
727
|
+
66, 178, 0, -4, 164, nil, nil, nil, 57, nil,
|
728
|
+
nil, nil, 8, nil, nil ]
|
724
729
|
|
725
730
|
racc_action_default = [
|
726
|
-
-
|
727
|
-
-7, -
|
728
|
-
-
|
729
|
-
-
|
730
|
-
-
|
731
|
-
-
|
732
|
-
-
|
733
|
-
-29, -34, -36, -37, -32, -35, -
|
734
|
-
-
|
735
|
-
-
|
736
|
-
-
|
737
|
-
-
|
738
|
-
-
|
739
|
-
-
|
740
|
-
-
|
741
|
-
-
|
742
|
-
-
|
743
|
-
-
|
744
|
-
-
|
731
|
+
-133, -133, -3, -4, -11, -5, -133, -133, -6, -133,
|
732
|
+
-7, -133, -133, -8, -9, -10, -133, -133, -133, -1,
|
733
|
+
-133, -14, -133, -133, -133, -133, -133, -14, -14, -133,
|
734
|
+
-133, -2, -133, -20, -123, -14, -26, -12, -33, -133,
|
735
|
+
-133, -133, -16, 195, -18, -47, -133, -133, -124, -133,
|
736
|
+
-133, -38, -13, -133, -133, -104, -24, -19, -105, -21,
|
737
|
+
-106, -22, -23, -133, -15, -30, -25, -28, -133, -27,
|
738
|
+
-29, -34, -36, -37, -32, -35, -133, -127, -129, -128,
|
739
|
+
-130, -131, -125, -132, -126, -17, -51, -52, -56, -50,
|
740
|
+
-46, -49, -55, -54, -133, -48, -53, -120, -109, -122,
|
741
|
+
-121, -110, -111, -112, -113, -114, -115, -116, -117, -118,
|
742
|
+
-107, -133, -119, -108, -133, -133, -133, -99, -101, -92,
|
743
|
+
-81, -68, -93, -82, -83, -61, -84, -69, -64, -62,
|
744
|
+
-85, -70, -63, -86, -75, -71, -65, -87, -76, -72,
|
745
|
+
-60, -88, -77, -89, -78, -66, -90, -79, -73, -91,
|
746
|
+
-80, -74, -67, -133, -133, -133, -44, -133, -133, -133,
|
747
|
+
-133, -133, -31, -45, -133, -100, -98, -103, -102, -133,
|
748
|
+
-133, -133, -133, -58, -57, -133, -133, -94, -133, -96,
|
749
|
+
-44, -133, -133, -133, -133, -59, -95, -97, -133, -42,
|
750
|
+
-41, -39, -133, -40, -43 ]
|
745
751
|
|
746
752
|
racc_goto_table = [
|
747
|
-
44, 85, 118,
|
748
|
-
40, 41, 61,
|
749
|
-
|
750
|
-
|
751
|
-
86, 17,
|
753
|
+
67, 75, 44, 85, 118, 92, 20, 164, 34, 117,
|
754
|
+
19, 177, 62, 70, 40, 41, 61, 46, 29, 49,
|
755
|
+
93, 186, 48, 69, 91, 155, 59, 31, 89, 50,
|
756
|
+
71, 184, 72, 87, 191, 192, 54, 95, 96, 111,
|
757
|
+
153, 176, 86, 17, 158, nil, nil, nil, nil, nil,
|
752
758
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
753
|
-
nil, nil, nil, nil,
|
759
|
+
nil, nil, nil, nil, nil, nil, nil, 118, 99, 168,
|
760
|
+
169, 170, 165, nil, nil, nil, nil, nil, nil, nil,
|
754
761
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
755
762
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
756
763
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
757
764
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
758
765
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
759
|
-
nil, nil, nil,
|
760
|
-
|
766
|
+
nil, nil, nil, 187, nil, nil, nil, nil, nil, nil,
|
767
|
+
174, nil, nil, 194 ]
|
761
768
|
|
762
769
|
racc_goto_check = [
|
763
|
-
14, 13, 23,
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
3, 1,
|
770
|
+
8, 8, 14, 13, 23, 8, 15, 27, 11, 38,
|
771
|
+
2, 37, 19, 22, 11, 11, 18, 16, 12, 20,
|
772
|
+
19, 37, 11, 21, 18, 23, 17, 2, 5, 24,
|
773
|
+
25, 27, 26, 4, 28, 29, 30, 31, 32, 34,
|
774
|
+
35, 36, 3, 1, 39, nil, nil, nil, nil, nil,
|
768
775
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
769
|
-
nil, nil, nil, nil,
|
776
|
+
nil, nil, nil, nil, nil, nil, nil, 23, 15, 23,
|
777
|
+
23, 23, 38, nil, nil, nil, nil, nil, nil, nil,
|
770
778
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
771
779
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
772
780
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
773
781
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
774
782
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
775
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
776
|
-
|
783
|
+
nil, nil, nil, 13, nil, nil, nil, nil, nil, nil,
|
784
|
+
14, nil, nil, 8 ]
|
777
785
|
|
778
786
|
racc_goto_pointer = [
|
779
|
-
nil,
|
780
|
-
nil, -
|
781
|
-
-
|
782
|
-
-
|
787
|
+
nil, 43, 10, -12, -21, -26, nil, nil, -49, nil,
|
788
|
+
nil, -13, 2, -50, -30, 5, -16, -20, -30, -34,
|
789
|
+
-17, -26, -36, -90, -9, -20, -18, -149, -154, -154,
|
790
|
+
-9, -17, -16, nil, -24, -71, -131, -161, -85, -73 ]
|
783
791
|
|
784
792
|
racc_goto_default = [
|
785
793
|
nil, nil, nil, 2, 3, 5, 8, 10, 13, 14,
|
786
|
-
15, nil,
|
794
|
+
15, nil, 179, nil, nil, 163, nil, nil, nil, nil,
|
787
795
|
nil, nil, nil, 84, nil, nil, nil, nil, nil, nil,
|
788
|
-
nil, 63, nil, nil, nil, nil, nil, nil ]
|
796
|
+
nil, nil, nil, 63, nil, nil, nil, nil, nil, nil ]
|
789
797
|
|
790
798
|
racc_token_table = {
|
791
799
|
false => 0,
|
@@ -942,6 +950,8 @@ Racc_token_to_s_table = [
|
|
942
950
|
'service_body',
|
943
951
|
'rpc',
|
944
952
|
'rpc_arg',
|
953
|
+
'rpc_option_body',
|
954
|
+
'option_list',
|
945
955
|
'message_body_body_list',
|
946
956
|
'message_body_body',
|
947
957
|
'extensions',
|
@@ -1168,75 +1178,85 @@ module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 79
|
|
1168
1178
|
|
1169
1179
|
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 85
|
1170
1180
|
def _reduce_42( val, _values, result )
|
1171
|
-
result =
|
1181
|
+
result = []
|
1172
1182
|
result
|
1173
1183
|
end
|
1174
1184
|
.,.,
|
1175
1185
|
|
1176
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1186
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 87
|
1177
1187
|
def _reduce_43( val, _values, result )
|
1188
|
+
result << val[1] if val[1]
|
1189
|
+
result
|
1190
|
+
end
|
1191
|
+
.,.,
|
1192
|
+
|
1193
|
+
# reduce 44 omitted
|
1194
|
+
|
1195
|
+
# reduce 45 omitted
|
1196
|
+
|
1197
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 93
|
1198
|
+
def _reduce_46( val, _values, result )
|
1199
|
+
result = val[1]
|
1200
|
+
result
|
1201
|
+
end
|
1202
|
+
.,.,
|
1203
|
+
|
1204
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 96
|
1205
|
+
def _reduce_47( val, _values, result )
|
1178
1206
|
result = []
|
1179
1207
|
result
|
1180
1208
|
end
|
1181
1209
|
.,.,
|
1182
1210
|
|
1183
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1184
|
-
def
|
1211
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 98
|
1212
|
+
def _reduce_48( val, _values, result )
|
1185
1213
|
result << val[1] if val[1]
|
1186
1214
|
result
|
1187
1215
|
end
|
1188
1216
|
.,.,
|
1189
1217
|
|
1190
|
-
# reduce
|
1218
|
+
# reduce 49 omitted
|
1191
1219
|
|
1192
|
-
# reduce
|
1220
|
+
# reduce 50 omitted
|
1193
1221
|
|
1194
|
-
# reduce
|
1222
|
+
# reduce 51 omitted
|
1195
1223
|
|
1196
|
-
# reduce
|
1224
|
+
# reduce 52 omitted
|
1197
1225
|
|
1198
|
-
# reduce
|
1226
|
+
# reduce 53 omitted
|
1199
1227
|
|
1200
|
-
# reduce
|
1228
|
+
# reduce 54 omitted
|
1201
1229
|
|
1202
|
-
# reduce
|
1230
|
+
# reduce 55 omitted
|
1203
1231
|
|
1204
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1205
|
-
def
|
1232
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 107
|
1233
|
+
def _reduce_56( val, _values, result )
|
1206
1234
|
result = nil
|
1207
1235
|
result
|
1208
1236
|
end
|
1209
1237
|
.,.,
|
1210
1238
|
|
1211
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1212
|
-
def
|
1239
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 110
|
1240
|
+
def _reduce_57( val, _values, result )
|
1213
1241
|
result = Protobuf::Node::GroupNode.new(val[0], val[2], val[4], val[5])
|
1214
1242
|
result
|
1215
1243
|
end
|
1216
1244
|
.,.,
|
1217
1245
|
|
1218
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1219
|
-
def
|
1246
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 113
|
1247
|
+
def _reduce_58( val, _values, result )
|
1220
1248
|
result = Protobuf::Node::FieldNode.new(val[0], val[1], val[2], val[4])
|
1221
1249
|
result
|
1222
1250
|
end
|
1223
1251
|
.,.,
|
1224
1252
|
|
1225
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1226
|
-
def
|
1253
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 115
|
1254
|
+
def _reduce_59( val, _values, result )
|
1227
1255
|
result = Protobuf::Node::FieldNode.new(val[0], val[1], val[2], val[4], val[6])
|
1228
1256
|
result
|
1229
1257
|
end
|
1230
1258
|
.,.,
|
1231
1259
|
|
1232
|
-
# reduce 56 omitted
|
1233
|
-
|
1234
|
-
# reduce 57 omitted
|
1235
|
-
|
1236
|
-
# reduce 58 omitted
|
1237
|
-
|
1238
|
-
# reduce 59 omitted
|
1239
|
-
|
1240
1260
|
# reduce 60 omitted
|
1241
1261
|
|
1242
1262
|
# reduce 61 omitted
|
@@ -1297,79 +1317,79 @@ module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 107
|
|
1297
1317
|
|
1298
1318
|
# reduce 89 omitted
|
1299
1319
|
|
1300
|
-
|
1301
|
-
|
1320
|
+
# reduce 90 omitted
|
1321
|
+
|
1322
|
+
# reduce 91 omitted
|
1323
|
+
|
1324
|
+
# reduce 92 omitted
|
1325
|
+
|
1326
|
+
# reduce 93 omitted
|
1327
|
+
|
1328
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 120
|
1329
|
+
def _reduce_94( val, _values, result )
|
1302
1330
|
result = val
|
1303
1331
|
result
|
1304
1332
|
end
|
1305
1333
|
.,.,
|
1306
1334
|
|
1307
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1308
|
-
def
|
1335
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 122
|
1336
|
+
def _reduce_95( val, _values, result )
|
1309
1337
|
result << val[2]
|
1310
1338
|
result
|
1311
1339
|
end
|
1312
1340
|
.,.,
|
1313
1341
|
|
1314
|
-
# reduce
|
1342
|
+
# reduce 96 omitted
|
1315
1343
|
|
1316
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1317
|
-
def
|
1344
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 126
|
1345
|
+
def _reduce_97( val, _values, result )
|
1318
1346
|
result = [:default, val[2]]
|
1319
1347
|
result
|
1320
1348
|
end
|
1321
1349
|
.,.,
|
1322
1350
|
|
1323
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1324
|
-
def
|
1351
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 129
|
1352
|
+
def _reduce_98( val, _values, result )
|
1325
1353
|
result = Protobuf::Node::ExtensionsNode.new(val[2].unshift(val[1]))
|
1326
1354
|
result
|
1327
1355
|
end
|
1328
1356
|
.,.,
|
1329
1357
|
|
1330
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1331
|
-
def
|
1358
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 132
|
1359
|
+
def _reduce_99( val, _values, result )
|
1332
1360
|
result = []
|
1333
1361
|
result
|
1334
1362
|
end
|
1335
1363
|
.,.,
|
1336
1364
|
|
1337
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1338
|
-
def
|
1365
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 134
|
1366
|
+
def _reduce_100( val, _values, result )
|
1339
1367
|
result << val[1]
|
1340
1368
|
result
|
1341
1369
|
end
|
1342
1370
|
.,.,
|
1343
1371
|
|
1344
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1345
|
-
def
|
1372
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 137
|
1373
|
+
def _reduce_101( val, _values, result )
|
1346
1374
|
result = Protobuf::Node::ExtensionRangeNode.new(val[0])
|
1347
1375
|
result
|
1348
1376
|
end
|
1349
1377
|
.,.,
|
1350
1378
|
|
1351
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1352
|
-
def
|
1379
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 139
|
1380
|
+
def _reduce_102( val, _values, result )
|
1353
1381
|
result = Protobuf::Node::ExtensionRangeNode.new(val[0], val[2])
|
1354
1382
|
result
|
1355
1383
|
end
|
1356
1384
|
.,.,
|
1357
1385
|
|
1358
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1359
|
-
def
|
1386
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 141
|
1387
|
+
def _reduce_103( val, _values, result )
|
1360
1388
|
result = Protobuf::Node::ExtensionRangeNode.new(val[0], :max)
|
1361
1389
|
result
|
1362
1390
|
end
|
1363
1391
|
.,.,
|
1364
1392
|
|
1365
|
-
# reduce 100 omitted
|
1366
|
-
|
1367
|
-
# reduce 101 omitted
|
1368
|
-
|
1369
|
-
# reduce 102 omitted
|
1370
|
-
|
1371
|
-
# reduce 103 omitted
|
1372
|
-
|
1373
1393
|
# reduce 104 omitted
|
1374
1394
|
|
1375
1395
|
# reduce 105 omitted
|
@@ -1400,28 +1420,28 @@ module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 133
|
|
1400
1420
|
|
1401
1421
|
# reduce 118 omitted
|
1402
1422
|
|
1403
|
-
|
1404
|
-
|
1423
|
+
# reduce 119 omitted
|
1424
|
+
|
1425
|
+
# reduce 120 omitted
|
1426
|
+
|
1427
|
+
# reduce 121 omitted
|
1428
|
+
|
1429
|
+
# reduce 122 omitted
|
1430
|
+
|
1431
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 152
|
1432
|
+
def _reduce_123( val, _values, result )
|
1405
1433
|
result = val[1].unshift(val[0])
|
1406
1434
|
result
|
1407
1435
|
end
|
1408
1436
|
.,.,
|
1409
1437
|
|
1410
|
-
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y',
|
1411
|
-
def
|
1438
|
+
module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 154
|
1439
|
+
def _reduce_124( val, _values, result )
|
1412
1440
|
result = val[1].unshift(val[0])
|
1413
1441
|
result
|
1414
1442
|
end
|
1415
1443
|
.,.,
|
1416
1444
|
|
1417
|
-
# reduce 121 omitted
|
1418
|
-
|
1419
|
-
# reduce 122 omitted
|
1420
|
-
|
1421
|
-
# reduce 123 omitted
|
1422
|
-
|
1423
|
-
# reduce 124 omitted
|
1424
|
-
|
1425
1445
|
# reduce 125 omitted
|
1426
1446
|
|
1427
1447
|
# reduce 126 omitted
|
@@ -1430,6 +1450,14 @@ module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 146
|
|
1430
1450
|
|
1431
1451
|
# reduce 128 omitted
|
1432
1452
|
|
1453
|
+
# reduce 129 omitted
|
1454
|
+
|
1455
|
+
# reduce 130 omitted
|
1456
|
+
|
1457
|
+
# reduce 131 omitted
|
1458
|
+
|
1459
|
+
# reduce 132 omitted
|
1460
|
+
|
1433
1461
|
def _reduce_none( val, _values, result )
|
1434
1462
|
result
|
1435
1463
|
end
|
@@ -3,12 +3,12 @@ require 'protobuf/rpc/client'
|
|
3
3
|
require '<%= required_file %>'
|
4
4
|
|
5
5
|
# build request
|
6
|
-
request = <%=
|
6
|
+
request = <%= module_name %>::<%= Util.modulize(request) %>.new
|
7
7
|
# TODO: setup a request
|
8
8
|
raise StandardError, 'setup a request'
|
9
9
|
|
10
10
|
# create blank response
|
11
|
-
response = <%=
|
11
|
+
response = <%= module_name %>::<%= Util.modulize(response) %>.new
|
12
12
|
|
13
13
|
# execute rpc
|
14
14
|
Protobuf::Rpc::Client.new('localhost', <%= default_port %>).call :<%= Util.underscore(name) %>, request, response
|
@@ -144,15 +144,15 @@ module Protobuf
|
|
144
144
|
default_port = 9999
|
145
145
|
@services.each do |service_name, rpcs|
|
146
146
|
underscored_name = Util.underscore(service_name.to_s)
|
147
|
-
|
147
|
+
module_name = package.map{|p| Util.camelize(p.to_s)}.join('::') if package
|
148
148
|
required_file = message_file.sub(/^\.\//, '').sub(/\.rb$/, '')
|
149
149
|
|
150
|
-
create_bin(out_dir, underscored_name,
|
151
|
-
create_service(message_file, out_dir, underscored_name,
|
150
|
+
create_bin(out_dir, underscored_name, module_name, service_name, default_port)
|
151
|
+
create_service(message_file, out_dir, underscored_name, module_name,
|
152
152
|
service_name, default_port, rpcs, required_file)
|
153
153
|
rpcs.each do |name, request, response|
|
154
154
|
create_client(out_dir, underscored_name, default_port, name, request, response,
|
155
|
-
|
155
|
+
module_name, required_file)
|
156
156
|
end
|
157
157
|
end
|
158
158
|
@file_contents
|
@@ -172,7 +172,7 @@ module Protobuf
|
|
172
172
|
@file_contents[service_filename] = service_contents
|
173
173
|
end
|
174
174
|
|
175
|
-
def create_client(out_dir, underscored_name, default_port, name, request, response,
|
175
|
+
def create_client(out_dir, underscored_name, default_port, name, request, response, module_name, required_file)
|
176
176
|
client_filename = "#{out_dir}/client_#{Util.underscore(name)}.rb"
|
177
177
|
client_contents = template_erb('rpc_client').result binding
|
178
178
|
create_file_with_backup(client_filename, client_contents, true) if @create_file
|
@@ -40,7 +40,7 @@ module Protobuf
|
|
40
40
|
end
|
41
41
|
|
42
42
|
if fields.include?(tag)
|
43
|
-
raise TagCollisionError, "Field tag #{tag} has already been used."
|
43
|
+
raise TagCollisionError, "Field tag #{tag} has already been used in #{self.name}."
|
44
44
|
end
|
45
45
|
fields[tag] = Field.build(self, rule, type, fname, tag, options)
|
46
46
|
end
|
@@ -54,6 +54,11 @@ module Protobuf
|
|
54
54
|
@fields ||= {}
|
55
55
|
end
|
56
56
|
|
57
|
+
# A collection of field object, which is sorted by tag number.
|
58
|
+
def sorted_fields
|
59
|
+
@sorted_fields ||= fields.sort_by {|tag, _| tag}
|
60
|
+
end
|
61
|
+
|
57
62
|
# Find a field object by +name+.
|
58
63
|
def get_field_by_name(name)
|
59
64
|
name = name.to_sym
|
@@ -277,8 +282,7 @@ module Protobuf
|
|
277
282
|
# # do something
|
278
283
|
# end
|
279
284
|
def each_field
|
280
|
-
|
281
|
-
@sorted_fields.each do |_, field|
|
285
|
+
self.class.sorted_fields.each do |_, field|
|
282
286
|
value = __send__(field.name)
|
283
287
|
yield(field, value)
|
284
288
|
end
|
@@ -93,4 +93,20 @@ phone {
|
|
93
93
|
}
|
94
94
|
EOS
|
95
95
|
end
|
96
|
+
|
97
|
+
def test_inspect_frozen_object
|
98
|
+
person = Tutorial::Person.new
|
99
|
+
person.name = 'name'
|
100
|
+
person.id = 1234
|
101
|
+
person.email = 'abc@cde.fgh'
|
102
|
+
person.phone << Tutorial::Person::PhoneNumber.new
|
103
|
+
person.phone.last.number = '123-456'
|
104
|
+
person.phone.last.type = Tutorial::Person::PhoneType::MOBILE
|
105
|
+
person.phone << Tutorial::Person::PhoneNumber.new
|
106
|
+
person.phone.last.number = '456-123'
|
107
|
+
person.phone.last.type = Tutorial::Person::PhoneType::WORK
|
108
|
+
|
109
|
+
person.freeze
|
110
|
+
assert_nothing_raised { person.inspect }
|
111
|
+
end
|
96
112
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 8
|
10
|
+
version: 0.4.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- MATSUYAMA Kengo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-23 00:00:00 +09:00
|
19
19
|
default_executable: rprotoc
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -117,14 +117,13 @@ files:
|
|
117
117
|
- test/test_serialize.rb
|
118
118
|
- test/test_standard_message.rb
|
119
119
|
- test/test_types.rb
|
120
|
-
- test/proto/float_default.pb.rb
|
121
120
|
has_rdoc: true
|
122
121
|
homepage: http://code.google.com/p/ruby-protobuf
|
123
122
|
licenses: []
|
124
123
|
|
125
124
|
post_install_message:
|
126
|
-
rdoc_options:
|
127
|
-
|
125
|
+
rdoc_options: []
|
126
|
+
|
128
127
|
require_paths:
|
129
128
|
- lib
|
130
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -153,34 +152,33 @@ signing_key:
|
|
153
152
|
specification_version: 3
|
154
153
|
summary: Protocol Buffers for Ruby
|
155
154
|
test_files:
|
156
|
-
-
|
157
|
-
-
|
155
|
+
- examples/addressbook.pb.rb
|
156
|
+
- examples/reading_a_message.rb
|
157
|
+
- examples/writing_a_message.rb
|
158
|
+
- test/check_unbuild.rb
|
158
159
|
- test/proto/addressbook.pb.rb
|
159
|
-
- test/proto/ext_range.pb.rb
|
160
|
-
- test/proto/nested.pb.rb
|
161
160
|
- test/proto/addressbook_base.pb.rb
|
162
|
-
- test/proto/collision.pb.rb
|
163
|
-
- test/proto/optional_field.pb.rb
|
164
|
-
- test/proto/merge.pb.rb
|
165
161
|
- test/proto/addressbook_ext.pb.rb
|
166
|
-
- test/proto/
|
167
|
-
- test/proto/lowercase.pb.rb
|
162
|
+
- test/proto/collision.pb.rb
|
168
163
|
- test/proto/ext_collision.pb.rb
|
169
|
-
- test/
|
170
|
-
- test/
|
164
|
+
- test/proto/ext_range.pb.rb
|
165
|
+
- test/proto/lowercase.pb.rb
|
166
|
+
- test/proto/merge.pb.rb
|
167
|
+
- test/proto/nested.pb.rb
|
168
|
+
- test/proto/optional_field.pb.rb
|
169
|
+
- test/proto/packed.pb.rb
|
170
|
+
- test/proto/types.pb.rb
|
171
171
|
- test/test_addressbook.rb
|
172
|
+
- test/test_compiler.rb
|
173
|
+
- test/test_descriptor.rb
|
174
|
+
- test/test_enum_value.rb
|
172
175
|
- test/test_extension.rb
|
173
176
|
- test/test_lowercase.rb
|
174
|
-
- test/test_standard_message.rb
|
175
|
-
- test/test_enum_value.rb
|
176
177
|
- test/test_message.rb
|
177
|
-
- test/test_types.rb
|
178
|
-
- test/test_repeated_types.rb
|
179
|
-
- test/test_descriptor.rb
|
180
178
|
- test/test_optional_field.rb
|
181
179
|
- test/test_packed_field.rb
|
180
|
+
- test/test_parse.rb
|
181
|
+
- test/test_repeated_types.rb
|
182
182
|
- test/test_serialize.rb
|
183
|
-
- test/
|
184
|
-
-
|
185
|
-
- examples/writing_a_message.rb
|
186
|
-
- examples/reading_a_message.rb
|
183
|
+
- test/test_standard_message.rb
|
184
|
+
- test/test_types.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
### Generated by rprotoc. DO NOT EDIT!
|
2
|
-
### <proto file: test/proto/float_default.proto>
|
3
|
-
# message M {
|
4
|
-
# optional float f = 1 [default = 4.2];
|
5
|
-
# optional float g = 2 [default = -4.2];
|
6
|
-
# optional float h = 3 [default = 4352];
|
7
|
-
# optional float i = 4 [default = 23145.2 ];
|
8
|
-
# optional float j = 5 [default = -5 ];
|
9
|
-
# optional float k = 6 [default = +23 ];
|
10
|
-
# optional float l = 7 [default = +23.42 ];
|
11
|
-
# }
|
12
|
-
#
|
13
|
-
|
14
|
-
require 'protobuf/message/message'
|
15
|
-
require 'protobuf/message/enum'
|
16
|
-
require 'protobuf/message/service'
|
17
|
-
require 'protobuf/message/extend'
|
18
|
-
|
19
|
-
class M < ::Protobuf::Message
|
20
|
-
defined_in __FILE__
|
21
|
-
optional :float, :f, 1, :default => 4.2
|
22
|
-
optional :float, :g, 2, :default => -4.2
|
23
|
-
optional :float, :h, 3, :default => 4352
|
24
|
-
optional :float, :i, 4, :default => 23145.2
|
25
|
-
optional :float, :j, 5, :default => -5
|
26
|
-
optional :float, :k, 6, :default => 23
|
27
|
-
optional :float, :l, 7, :default => 23.42
|
28
|
-
end
|