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 CHANGED
@@ -1 +1 @@
1
- 0.4.7
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).sub(/\.[^\0]*\z/, '') + '.pb.rb')
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).sub(/\.[^\0]*\z/, '') + '.pb.rb')
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..id57af5bfae3', 'racc/parser.rb', 1
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..id57af5bfae3
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..idf83c19ba1e', 'lib/protobuf/compiler/proto.y', 161
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..idf83c19ba1e
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, :_reduce_42,
571
- 0, 80, :_reduce_43,
572
- 2, 80, :_reduce_44,
573
- 1, 81, :_reduce_none,
574
- 1, 81, :_reduce_none,
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, 84, :_reduce_none,
632
- 1, 84, :_reduce_none,
633
- 1, 84, :_reduce_none,
634
- 1, 84, :_reduce_none,
635
- 1, 84, :_reduce_none,
636
- 1, 84, :_reduce_none,
637
- 1, 84, :_reduce_none,
638
- 1, 84, :_reduce_none,
639
- 1, 84, :_reduce_none,
640
- 1, 84, :_reduce_none,
641
- 1, 84, :_reduce_none,
642
- 1, 84, :_reduce_none,
643
- 1, 84, :_reduce_none,
644
- 1, 84, :_reduce_none,
645
- 1, 84, :_reduce_none,
646
- 1, 84, :_reduce_none,
647
- 2, 67, :_reduce_119,
648
- 3, 67, :_reduce_120,
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 = 129
662
+ racc_reduce_n = 133
659
663
 
660
- racc_shift_n = 190
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, 115, 16, 114, 47,
665
- 66, 64, 74, 55, 58, 60, 76, 176, 111, 113,
666
- 98, 101, 102, 103, 104, 105, 106, 107, 109, 110,
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, 51, 136, 140, 47, 145, 45,
669
- 153, 121, 21, 22, 127, 131, 135, 139, 21, 22,
670
- 149, 152, 21, 22, 125, 129, 132, 134, 138, 142,
671
- 144, 148, 151, 120, 123, 124, 126, 130, 133, 137,
672
- 141, 143, 147, 150, 119, 122, 88, 173, 182, 80,
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, 43, 47, 172, 55, 58,
675
- 60, 183, 96, 116, 176, 80, 81, 83, 30, 42,
676
- 4, 7, 39, 12, 154, 38, 16, 156, 18, 1,
677
- 158, 159, 6, 9, 11, 4, 7, 160, 12, 161,
678
- 162, 16, 37, 18, 1, 165, 36, 6, 9, 11,
679
- 80, 81, 83, 80, 81, 83, 35, 33, 32, 171,
680
- 28, 45, 175, 27, 180, 181, 26, 25, 24, 186,
681
- 23, 188, 189 ]
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
- 53, 46, 53, 63, 63, 181, 172, 181, 41, 49,
685
- 41, 50, 46, 49, 40, 49, 68, 50, 63, 40,
686
- 49, 47, 50, 46, 46, 46, 50, 172, 63, 63,
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, 53, 53, 53, 53, 53, 181, 181,
689
- 181, 181, 181, 108, 39, 108, 108, 34, 108, 32,
690
- 108, 108, 156, 156, 108, 108, 108, 108, 1, 1,
691
- 108, 108, 180, 180, 108, 108, 108, 108, 108, 108,
692
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
693
- 108, 108, 108, 108, 108, 108, 54, 169, 178, 160,
694
- 160, 160, 54, 183, 54, 54, 159, 54, 54, 96,
695
- 96, 96, 161, 161, 161, 30, 48, 169, 54, 54,
696
- 54, 178, 54, 76, 183, 159, 159, 159, 17, 29,
697
- 17, 17, 26, 17, 114, 25, 17, 116, 17, 17,
698
- 117, 118, 17, 17, 17, 0, 0, 146, 0, 154,
699
- 155, 0, 24, 0, 0, 157, 23, 0, 0, 0,
700
- 115, 115, 115, 158, 158, 158, 22, 20, 18, 164,
701
- 16, 170, 171, 12, 175, 176, 11, 9, 7, 182,
702
- 6, 184, 188 ]
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, 62, nil, nil, nil, nil, 174, 174, nil, 171,
706
- nil, 167, 167, nil, nil, nil, 164, 128, 162, nil,
707
- 155, nil, 160, 144, 150, 123, 128, nil, nil, 127,
708
- 115, nil, 47, nil, 50, nil, nil, nil, nil, 52,
709
- 12, 1, nil, nil, nil, nil, -1, 15, 109, 7,
710
- 9, nil, nil, -4, 94, nil, nil, nil, nil, nil,
711
- nil, nil, nil, -3, nil, nil, nil, nil, 7, nil,
712
- nil, nil, nil, nil, nil, nil, 117, 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, nil, nil, nil, 138, nil, nil, nil,
720
- nil, nil, nil, nil, 140, 148, 56, 153, 114, 76,
721
- 50, 63, nil, nil, 150, nil, nil, nil, nil, 95,
722
- 159, 152, 0, nil, nil, 156, 166, nil, 75, nil,
723
- 66, 1, 177, 97, 162, nil, nil, nil, 180, nil ]
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
- -129, -129, -3, -4, -11, -5, -129, -129, -6, -129,
727
- -7, -129, -129, -8, -9, -10, -129, -129, -129, -1,
728
- -129, -14, -129, -129, -129, -129, -129, -14, -14, -129,
729
- -129, -2, -129, -20, -119, -14, -26, -12, -33, -129,
730
- -129, -129, -16, 190, -18, -43, -129, -129, -120, -129,
731
- -129, -38, -13, -129, -129, -100, -24, -19, -101, -21,
732
- -102, -22, -23, -129, -15, -30, -25, -28, -129, -27,
733
- -29, -34, -36, -37, -32, -35, -129, -123, -125, -124,
734
- -126, -127, -121, -128, -122, -17, -47, -48, -52, -46,
735
- -42, -45, -44, -51, -50, -49, -129, -116, -105, -118,
736
- -117, -106, -107, -108, -109, -110, -111, -112, -129, -113,
737
- -114, -103, -115, -104, -129, -129, -129, -95, -97, -88,
738
- -77, -64, -89, -78, -79, -57, -80, -65, -60, -58,
739
- -81, -66, -59, -82, -71, -67, -61, -83, -72, -68,
740
- -56, -84, -73, -85, -74, -62, -129, -86, -75, -69,
741
- -87, -76, -70, -63, -129, -129, -40, -129, -129, -129,
742
- -129, -129, -31, -41, -129, -94, -96, -99, -98, -129,
743
- -129, -129, -129, -54, -53, -129, -129, -92, -129, -90,
744
- -40, -129, -129, -129, -129, -93, -55, -91, -129, -39 ]
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, 164, 34, 19, 117, 20, 179, 62,
748
- 40, 41, 61, 69, 46, 29, 49, 94, 48, 187,
749
- 91, 155, 31, 67, 75, 59, 70, 184, 93, 89,
750
- 50, 71, 72, 87, 54, 92, 95, 108, 146, 178,
751
- 86, 17, 157, nil, nil, nil, nil, nil, nil, nil,
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, 118, 168, 169, 170, 166, 99,
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, nil, nil, nil, nil, nil, nil, 185,
760
- nil, nil, nil, nil, nil, nil, nil, nil, 174 ]
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, 27, 11, 2, 36, 15, 35, 19,
764
- 11, 11, 18, 21, 16, 12, 20, 19, 11, 35,
765
- 18, 23, 2, 8, 8, 17, 22, 27, 8, 5,
766
- 24, 25, 26, 4, 28, 29, 30, 32, 33, 34,
767
- 3, 1, 37, nil, nil, nil, nil, nil, nil, nil,
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, 23, 23, 23, 23, 36, 15,
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, 13,
776
- nil, nil, nil, nil, nil, nil, nil, nil, 14 ]
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, 41, 5, -14, -21, -25, nil, nil, -26, nil,
780
- nil, -17, -1, -52, -32, 6, -19, -21, -34, -37,
781
- -20, -36, -23, -94, -8, -19, -18, -153, -11, -19,
782
- -18, nil, -26, -70, -133, -164, -90, -75 ]
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, 177, nil, nil, 163, nil, nil, nil, 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 = val[1]
1181
+ result = []
1172
1182
  result
1173
1183
  end
1174
1184
  .,.,
1175
1185
 
1176
- module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 88
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', 90
1184
- def _reduce_44( val, _values, result )
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 45 omitted
1218
+ # reduce 49 omitted
1191
1219
 
1192
- # reduce 46 omitted
1220
+ # reduce 50 omitted
1193
1221
 
1194
- # reduce 47 omitted
1222
+ # reduce 51 omitted
1195
1223
 
1196
- # reduce 48 omitted
1224
+ # reduce 52 omitted
1197
1225
 
1198
- # reduce 49 omitted
1226
+ # reduce 53 omitted
1199
1227
 
1200
- # reduce 50 omitted
1228
+ # reduce 54 omitted
1201
1229
 
1202
- # reduce 51 omitted
1230
+ # reduce 55 omitted
1203
1231
 
1204
- module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 99
1205
- def _reduce_52( val, _values, result )
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', 102
1212
- def _reduce_53( val, _values, result )
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', 105
1219
- def _reduce_54( val, _values, result )
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', 107
1226
- def _reduce_55( val, _values, result )
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
- module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 112
1301
- def _reduce_90( val, _values, result )
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', 114
1308
- def _reduce_91( val, _values, result )
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 92 omitted
1342
+ # reduce 96 omitted
1315
1343
 
1316
- module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 118
1317
- def _reduce_93( val, _values, result )
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', 121
1324
- def _reduce_94( val, _values, result )
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', 124
1331
- def _reduce_95( val, _values, result )
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', 126
1338
- def _reduce_96( val, _values, result )
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', 129
1345
- def _reduce_97( val, _values, result )
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', 131
1352
- def _reduce_98( val, _values, result )
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', 133
1359
- def _reduce_99( val, _values, result )
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
- module_eval <<'.,.,', 'lib/protobuf/compiler/proto.y', 144
1404
- def _reduce_119( val, _values, result )
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', 146
1411
- def _reduce_120( val, _values, result )
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 = <%= message_module %>::<%= Util.modulize(request) %>.new
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 = <%= message_module %>::<%= Util.modulize(response) %>.new
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
- message_module = package.map{|p| Util.camelize(p.to_s)}.join('::')
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, message_module, service_name, default_port)
151
- create_service(message_file, out_dir, underscored_name, message_module,
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
- message_module, required_file)
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, message_module, required_file)
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
- @sorted_fields ||= fields.sort_by {|tag, _| tag}
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: 1
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 7
10
- version: 0.4.7
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-09-28 00:00:00 +09:00
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
- - --charset=UTF-8
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
- - test/proto/packed.pb.rb
157
- - test/proto/types.pb.rb
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/float_default.pb.rb
167
- - test/proto/lowercase.pb.rb
162
+ - test/proto/collision.pb.rb
168
163
  - test/proto/ext_collision.pb.rb
169
- - test/test_compiler.rb
170
- - test/test_parse.rb
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/check_unbuild.rb
184
- - examples/addressbook.pb.rb
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