protip 0.36 → 0.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4814bf529a854dfa493cdf41b44fcd972540296fb8efc53466071d72966ef42c
4
- data.tar.gz: e3fbbc645541382e5f58d32964284a75b79899d561bdbcc7d36e8de319947767
3
+ metadata.gz: b91d785c337df88feedaf062679787c1745e8e7ee420535549ccbd6e5f61fab1
4
+ data.tar.gz: e897d6cda03fe31835f9a8e2243be0cb7f0875adbf590a05154d169e6252924b
5
5
  SHA512:
6
- metadata.gz: d3b36f9db24a47836307862876fc10243cf85d09a0be0f1fef29f2152354de8f8bebe910310599d7602837c0e4e71733e69981c3746d31e65e0f01943bae0123
7
- data.tar.gz: 39a16f61c8eb90de85ba7df7ca0bf2ff3e76608284ed46f348b515a94046c377c670548c1f9c417639c23f67a0d9d7a51f26bfb4f659048d4e641bab4f1738ee
6
+ metadata.gz: 84d548ff44b595968e6c05e7a794e2aca2bb9e51f4f3068615034de13bb2f2a02a0d94f3cfa1490c99b1856c5fc5c2c66661793b989c9f3430a891a445ad3a24
7
+ data.tar.gz: d5e34084b562c4a3b424a94d1fe2a46926fd14a3c0e3da6b9f5bc0d335af24d824a0cbc0be3c30b8eedbcaba316b374d6372bd1caeb83a94290c540cc5f5b200
data/lib/protip/client.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'active_support/concern'
2
+ require 'active_support/deprecation'
2
3
  require 'protip/error'
3
4
  require 'net/http'
4
5
 
@@ -226,11 +226,11 @@ module Protip
226
226
  end
227
227
 
228
228
  def set(field, value)
229
- if field.label == :repeated
230
- message[field.name].replace value.map{|v| to_protobuf_value field, v}
231
- else
232
- message[field.name] = to_protobuf_value(field, value)
233
- end
229
+ return if field.label == :optional && value.nil? && get(field).nil?
230
+
231
+ return message[field.name].replace value.map{|v| to_protobuf_value field, v} if field.label == :repeated
232
+
233
+ message[field.name] = to_protobuf_value(field, value)
234
234
  end
235
235
 
236
236
  # Helper for setting values - converts the value for the given
@@ -3,6 +3,10 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
+ require 'google/protobuf/descriptor_pb'
7
+
6
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("protip/extensions.proto", :syntax => :proto3) do
10
+ end
7
11
  end
8
12
 
@@ -4,16 +4,18 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protip.messages.ActiveSupport.TimeWithZone" do
8
- optional :utc_timestamp, :int64, 1
9
- optional :time_zone_name, :string, 2
7
+ add_file("protip/messages/active_support/time_with_zone.proto", :syntax => :proto3) do
8
+ add_message "protip.messages.ActiveSupport.TimeWithZone" do
9
+ optional :utc_timestamp, :int64, 1
10
+ optional :time_zone_name, :string, 2
11
+ end
10
12
  end
11
13
  end
12
14
 
13
15
  module Protip
14
16
  module Messages
15
17
  module ActiveSupport
16
- TimeWithZone = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.ActiveSupport.TimeWithZone").msgclass
18
+ TimeWithZone = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.ActiveSupport.TimeWithZone").msgclass
17
19
  end
18
20
  end
19
21
  end
@@ -4,13 +4,15 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protip.messages.Array" do
8
- repeated :messages, :bytes, 1
7
+ add_file("protip/messages/array.proto", :syntax => :proto3) do
8
+ add_message "protip.messages.Array" do
9
+ repeated :messages, :bytes, 1
10
+ end
9
11
  end
10
12
  end
11
13
 
12
14
  module Protip
13
15
  module Messages
14
- Array = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Array").msgclass
16
+ Array = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Array").msgclass
15
17
  end
16
18
  end
@@ -4,15 +4,17 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protip.messages.BigDecimalValue" do
8
- optional :numerator, :int64, 1
9
- optional :denominator, :uint64, 2
10
- optional :precision, :uint32, 3
7
+ add_file("protip/messages/big_decimal_value.proto", :syntax => :proto3) do
8
+ add_message "protip.messages.BigDecimalValue" do
9
+ optional :numerator, :int64, 1
10
+ optional :denominator, :uint64, 2
11
+ optional :precision, :uint32, 3
12
+ end
11
13
  end
12
14
  end
13
15
 
14
16
  module Protip
15
17
  module Messages
16
- BigDecimalValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.BigDecimalValue").msgclass
18
+ BigDecimalValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.BigDecimalValue").msgclass
17
19
  end
18
20
  end
@@ -4,189 +4,191 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protip.messages.Currency" do
8
- optional :currency_code, :enum, 1, "protip.messages.Currency.CurrencyCode"
9
- end
10
- add_enum "protip.messages.Currency.CurrencyCode" do
11
- value :AED, 0
12
- value :AFN, 1
13
- value :ALL, 2
14
- value :AMD, 3
15
- value :ANG, 4
16
- value :AOA, 5
17
- value :ARS, 6
18
- value :AUD, 7
19
- value :AWG, 8
20
- value :AZN, 9
21
- value :BAM, 10
22
- value :BBD, 11
23
- value :BDT, 12
24
- value :BGN, 13
25
- value :BHD, 14
26
- value :BIF, 15
27
- value :BMD, 16
28
- value :BND, 17
29
- value :BOB, 18
30
- value :BRL, 19
31
- value :BSD, 20
32
- value :BTN, 21
33
- value :BWP, 22
34
- value :BYR, 23
35
- value :BZD, 24
36
- value :CAD, 25
37
- value :CDF, 26
38
- value :CHF, 27
39
- value :CLF, 28
40
- value :CLP, 29
41
- value :CNY, 30
42
- value :COP, 31
43
- value :CRC, 32
44
- value :CUC, 33
45
- value :CUP, 34
46
- value :CVE, 35
47
- value :CZK, 36
48
- value :DJF, 37
49
- value :DKK, 38
50
- value :DOP, 39
51
- value :DZD, 40
52
- value :EGP, 41
53
- value :ERN, 42
54
- value :ETB, 43
55
- value :EUR, 44
56
- value :FJD, 45
57
- value :FKP, 46
58
- value :GBP, 47
59
- value :GEL, 48
60
- value :GHS, 49
61
- value :GIP, 50
62
- value :GMD, 51
63
- value :GNF, 52
64
- value :GTQ, 53
65
- value :GYD, 54
66
- value :HKD, 55
67
- value :HNL, 56
68
- value :HRK, 57
69
- value :HTG, 58
70
- value :HUF, 59
71
- value :IDR, 60
72
- value :ILS, 61
73
- value :INR, 62
74
- value :IQD, 63
75
- value :IRR, 64
76
- value :ISK, 65
77
- value :JMD, 66
78
- value :JOD, 67
79
- value :JPY, 68
80
- value :KES, 69
81
- value :KGS, 70
82
- value :KHR, 71
83
- value :KMF, 72
84
- value :KPW, 73
85
- value :KRW, 74
86
- value :KWD, 75
87
- value :KYD, 76
88
- value :KZT, 77
89
- value :LAK, 78
90
- value :LBP, 79
91
- value :LKR, 80
92
- value :LRD, 81
93
- value :LSL, 82
94
- value :LTL, 83
95
- value :LVL, 84
96
- value :LYD, 85
97
- value :MAD, 86
98
- value :MDL, 87
99
- value :MGA, 88
100
- value :MKD, 89
101
- value :MMK, 90
102
- value :MNT, 91
103
- value :MOP, 92
104
- value :MRO, 93
105
- value :MUR, 94
106
- value :MVR, 95
107
- value :MWK, 96
108
- value :MXN, 97
109
- value :MYR, 98
110
- value :MZN, 99
111
- value :NAD, 100
112
- value :NGN, 101
113
- value :NIO, 102
114
- value :NOK, 103
115
- value :NPR, 104
116
- value :NZD, 105
117
- value :OMR, 106
118
- value :PAB, 107
119
- value :PEN, 108
120
- value :PGK, 109
121
- value :PHP, 110
122
- value :PKR, 111
123
- value :PLN, 112
124
- value :PYG, 113
125
- value :QAR, 114
126
- value :RON, 115
127
- value :RSD, 116
128
- value :RUB, 117
129
- value :RWF, 118
130
- value :SAR, 119
131
- value :SBD, 120
132
- value :SCR, 121
133
- value :SDG, 122
134
- value :SEK, 123
135
- value :SGD, 124
136
- value :SHP, 125
137
- value :SKK, 126
138
- value :SLL, 127
139
- value :SOS, 128
140
- value :SRD, 129
141
- value :SSP, 130
142
- value :STD, 131
143
- value :SVC, 132
144
- value :SYP, 133
145
- value :SZL, 134
146
- value :THB, 135
147
- value :TJS, 136
148
- value :TMT, 137
149
- value :TND, 138
150
- value :TOP, 139
151
- value :TRY, 140
152
- value :TTD, 141
153
- value :TWD, 142
154
- value :TZS, 143
155
- value :UAH, 144
156
- value :UGX, 145
157
- value :USD, 146
158
- value :UYU, 147
159
- value :UZS, 148
160
- value :VEF, 149
161
- value :VND, 150
162
- value :VUV, 151
163
- value :WST, 152
164
- value :XAF, 153
165
- value :XAG, 154
166
- value :XAU, 155
167
- value :XCD, 156
168
- value :XDR, 157
169
- value :XOF, 158
170
- value :XPF, 159
171
- value :YER, 160
172
- value :ZAR, 161
173
- value :ZMK, 162
174
- value :ZMW, 163
175
- value :BTC, 164
176
- value :JEP, 165
177
- value :EEK, 166
178
- value :MTL, 167
179
- value :TMM, 168
180
- value :ZWD, 169
181
- value :ZWL, 170
182
- value :ZWN, 171
183
- value :ZWR, 172
7
+ add_file("protip/messages/currency.proto", :syntax => :proto3) do
8
+ add_message "protip.messages.Currency" do
9
+ optional :currency_code, :enum, 1, "protip.messages.Currency.CurrencyCode"
10
+ end
11
+ add_enum "protip.messages.Currency.CurrencyCode" do
12
+ value :AED, 0
13
+ value :AFN, 1
14
+ value :ALL, 2
15
+ value :AMD, 3
16
+ value :ANG, 4
17
+ value :AOA, 5
18
+ value :ARS, 6
19
+ value :AUD, 7
20
+ value :AWG, 8
21
+ value :AZN, 9
22
+ value :BAM, 10
23
+ value :BBD, 11
24
+ value :BDT, 12
25
+ value :BGN, 13
26
+ value :BHD, 14
27
+ value :BIF, 15
28
+ value :BMD, 16
29
+ value :BND, 17
30
+ value :BOB, 18
31
+ value :BRL, 19
32
+ value :BSD, 20
33
+ value :BTN, 21
34
+ value :BWP, 22
35
+ value :BYR, 23
36
+ value :BZD, 24
37
+ value :CAD, 25
38
+ value :CDF, 26
39
+ value :CHF, 27
40
+ value :CLF, 28
41
+ value :CLP, 29
42
+ value :CNY, 30
43
+ value :COP, 31
44
+ value :CRC, 32
45
+ value :CUC, 33
46
+ value :CUP, 34
47
+ value :CVE, 35
48
+ value :CZK, 36
49
+ value :DJF, 37
50
+ value :DKK, 38
51
+ value :DOP, 39
52
+ value :DZD, 40
53
+ value :EGP, 41
54
+ value :ERN, 42
55
+ value :ETB, 43
56
+ value :EUR, 44
57
+ value :FJD, 45
58
+ value :FKP, 46
59
+ value :GBP, 47
60
+ value :GEL, 48
61
+ value :GHS, 49
62
+ value :GIP, 50
63
+ value :GMD, 51
64
+ value :GNF, 52
65
+ value :GTQ, 53
66
+ value :GYD, 54
67
+ value :HKD, 55
68
+ value :HNL, 56
69
+ value :HRK, 57
70
+ value :HTG, 58
71
+ value :HUF, 59
72
+ value :IDR, 60
73
+ value :ILS, 61
74
+ value :INR, 62
75
+ value :IQD, 63
76
+ value :IRR, 64
77
+ value :ISK, 65
78
+ value :JMD, 66
79
+ value :JOD, 67
80
+ value :JPY, 68
81
+ value :KES, 69
82
+ value :KGS, 70
83
+ value :KHR, 71
84
+ value :KMF, 72
85
+ value :KPW, 73
86
+ value :KRW, 74
87
+ value :KWD, 75
88
+ value :KYD, 76
89
+ value :KZT, 77
90
+ value :LAK, 78
91
+ value :LBP, 79
92
+ value :LKR, 80
93
+ value :LRD, 81
94
+ value :LSL, 82
95
+ value :LTL, 83
96
+ value :LVL, 84
97
+ value :LYD, 85
98
+ value :MAD, 86
99
+ value :MDL, 87
100
+ value :MGA, 88
101
+ value :MKD, 89
102
+ value :MMK, 90
103
+ value :MNT, 91
104
+ value :MOP, 92
105
+ value :MRO, 93
106
+ value :MUR, 94
107
+ value :MVR, 95
108
+ value :MWK, 96
109
+ value :MXN, 97
110
+ value :MYR, 98
111
+ value :MZN, 99
112
+ value :NAD, 100
113
+ value :NGN, 101
114
+ value :NIO, 102
115
+ value :NOK, 103
116
+ value :NPR, 104
117
+ value :NZD, 105
118
+ value :OMR, 106
119
+ value :PAB, 107
120
+ value :PEN, 108
121
+ value :PGK, 109
122
+ value :PHP, 110
123
+ value :PKR, 111
124
+ value :PLN, 112
125
+ value :PYG, 113
126
+ value :QAR, 114
127
+ value :RON, 115
128
+ value :RSD, 116
129
+ value :RUB, 117
130
+ value :RWF, 118
131
+ value :SAR, 119
132
+ value :SBD, 120
133
+ value :SCR, 121
134
+ value :SDG, 122
135
+ value :SEK, 123
136
+ value :SGD, 124
137
+ value :SHP, 125
138
+ value :SKK, 126
139
+ value :SLL, 127
140
+ value :SOS, 128
141
+ value :SRD, 129
142
+ value :SSP, 130
143
+ value :STD, 131
144
+ value :SVC, 132
145
+ value :SYP, 133
146
+ value :SZL, 134
147
+ value :THB, 135
148
+ value :TJS, 136
149
+ value :TMT, 137
150
+ value :TND, 138
151
+ value :TOP, 139
152
+ value :TRY, 140
153
+ value :TTD, 141
154
+ value :TWD, 142
155
+ value :TZS, 143
156
+ value :UAH, 144
157
+ value :UGX, 145
158
+ value :USD, 146
159
+ value :UYU, 147
160
+ value :UZS, 148
161
+ value :VEF, 149
162
+ value :VND, 150
163
+ value :VUV, 151
164
+ value :WST, 152
165
+ value :XAF, 153
166
+ value :XAG, 154
167
+ value :XAU, 155
168
+ value :XCD, 156
169
+ value :XDR, 157
170
+ value :XOF, 158
171
+ value :XPF, 159
172
+ value :YER, 160
173
+ value :ZAR, 161
174
+ value :ZMK, 162
175
+ value :ZMW, 163
176
+ value :BTC, 164
177
+ value :JEP, 165
178
+ value :EEK, 166
179
+ value :MTL, 167
180
+ value :TMM, 168
181
+ value :ZWD, 169
182
+ value :ZWL, 170
183
+ value :ZWN, 171
184
+ value :ZWR, 172
185
+ end
184
186
  end
185
187
  end
186
188
 
187
189
  module Protip
188
190
  module Messages
189
- Currency = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Currency").msgclass
190
- Currency::CurrencyCode = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Currency.CurrencyCode").enummodule
191
+ Currency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Currency").msgclass
192
+ Currency::CurrencyCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Currency.CurrencyCode").enummodule
191
193
  end
192
194
  end
@@ -4,19 +4,21 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protip.messages.Errors" do
8
- repeated :messages, :string, 1
9
- repeated :field_errors, :message, 2, "protip.messages.FieldError"
10
- end
11
- add_message "protip.messages.FieldError" do
12
- optional :field, :string, 1
13
- optional :message, :string, 2
7
+ add_file("protip/messages/errors.proto", :syntax => :proto3) do
8
+ add_message "protip.messages.Errors" do
9
+ repeated :messages, :string, 1
10
+ repeated :field_errors, :message, 2, "protip.messages.FieldError"
11
+ end
12
+ add_message "protip.messages.FieldError" do
13
+ optional :field, :string, 1
14
+ optional :message, :string, 2
15
+ end
14
16
  end
15
17
  end
16
18
 
17
19
  module Protip
18
20
  module Messages
19
- Errors = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Errors").msgclass
20
- FieldError = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.FieldError").msgclass
21
+ Errors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Errors").msgclass
22
+ FieldError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.FieldError").msgclass
21
23
  end
22
24
  end
@@ -4,15 +4,18 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'protip/messages/currency_pb'
7
+
7
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "protip.messages.Money" do
9
- optional :amount_cents, :int64, 1
10
- optional :currency, :message, 2, "protip.messages.Currency"
9
+ add_file("protip/messages/money.proto", :syntax => :proto3) do
10
+ add_message "protip.messages.Money" do
11
+ optional :amount_cents, :int64, 1
12
+ optional :currency, :message, 2, "protip.messages.Currency"
13
+ end
11
14
  end
12
15
  end
13
16
 
14
17
  module Protip
15
18
  module Messages
16
- Money = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Money").msgclass
19
+ Money = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Money").msgclass
17
20
  end
18
21
  end
@@ -4,14 +4,16 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protip.messages.Range" do
8
- optional :begin, :int64, 1
9
- optional :end, :int64, 2
7
+ add_file("protip/messages/range.proto", :syntax => :proto3) do
8
+ add_message "protip.messages.Range" do
9
+ optional :begin, :int64, 1
10
+ optional :end, :int64, 2
11
+ end
10
12
  end
11
13
  end
12
14
 
13
15
  module Protip
14
16
  module Messages
15
- Range = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Range").msgclass
17
+ Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Range").msgclass
16
18
  end
17
19
  end
@@ -4,50 +4,53 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'protip/extensions_pb'
7
+
7
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "protip.messages.RepeatedDouble" do
9
- repeated :values, :double, 1
10
- end
11
- add_message "protip.messages.RepeatedFloat" do
12
- repeated :values, :float, 1
13
- end
14
- add_message "protip.messages.RepeatedInt64" do
15
- repeated :values, :int64, 1
16
- end
17
- add_message "protip.messages.RepeatedUInt64" do
18
- repeated :values, :uint64, 1
19
- end
20
- add_message "protip.messages.RepeatedInt32" do
21
- repeated :values, :int32, 1
22
- end
23
- add_message "protip.messages.RepeatedUInt32" do
24
- repeated :values, :uint32, 1
25
- end
26
- add_message "protip.messages.RepeatedBool" do
27
- repeated :values, :bool, 1
28
- end
29
- add_message "protip.messages.RepeatedString" do
30
- repeated :values, :string, 1
31
- end
32
- add_message "protip.messages.RepeatedBytes" do
33
- repeated :values, :bytes, 1
34
- end
35
- add_message "protip.messages.RepeatedEnum" do
36
- repeated :values, :int32, 1
9
+ add_file("protip/messages/repeated_wrappers.proto", :syntax => :proto3) do
10
+ add_message "protip.messages.RepeatedDouble" do
11
+ repeated :values, :double, 1
12
+ end
13
+ add_message "protip.messages.RepeatedFloat" do
14
+ repeated :values, :float, 1
15
+ end
16
+ add_message "protip.messages.RepeatedInt64" do
17
+ repeated :values, :int64, 1
18
+ end
19
+ add_message "protip.messages.RepeatedUInt64" do
20
+ repeated :values, :uint64, 1
21
+ end
22
+ add_message "protip.messages.RepeatedInt32" do
23
+ repeated :values, :int32, 1
24
+ end
25
+ add_message "protip.messages.RepeatedUInt32" do
26
+ repeated :values, :uint32, 1
27
+ end
28
+ add_message "protip.messages.RepeatedBool" do
29
+ repeated :values, :bool, 1
30
+ end
31
+ add_message "protip.messages.RepeatedString" do
32
+ repeated :values, :string, 1
33
+ end
34
+ add_message "protip.messages.RepeatedBytes" do
35
+ repeated :values, :bytes, 1
36
+ end
37
+ add_message "protip.messages.RepeatedEnum" do
38
+ repeated :values, :int32, 1
39
+ end
37
40
  end
38
41
  end
39
42
 
40
43
  module Protip
41
44
  module Messages
42
- RepeatedDouble = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedDouble").msgclass
43
- RepeatedFloat = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedFloat").msgclass
44
- RepeatedInt64 = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedInt64").msgclass
45
- RepeatedUInt64 = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedUInt64").msgclass
46
- RepeatedInt32 = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedInt32").msgclass
47
- RepeatedUInt32 = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedUInt32").msgclass
48
- RepeatedBool = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedBool").msgclass
49
- RepeatedString = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedString").msgclass
50
- RepeatedBytes = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedBytes").msgclass
51
- RepeatedEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedEnum").msgclass
45
+ RepeatedDouble = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedDouble").msgclass
46
+ RepeatedFloat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedFloat").msgclass
47
+ RepeatedInt64 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedInt64").msgclass
48
+ RepeatedUInt64 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedUInt64").msgclass
49
+ RepeatedInt32 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedInt32").msgclass
50
+ RepeatedUInt32 = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedUInt32").msgclass
51
+ RepeatedBool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedBool").msgclass
52
+ RepeatedString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedString").msgclass
53
+ RepeatedBytes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedBytes").msgclass
54
+ RepeatedEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.RepeatedEnum").msgclass
52
55
  end
53
56
  end
@@ -5,21 +5,24 @@ require 'google/protobuf'
5
5
 
6
6
  require 'protip/messages/repeated_wrappers_pb'
7
7
  require 'protip/messages/wrappers_pb'
8
+
8
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_message "protip.messages.EnumTest" do
10
- optional :enum, :message, 1, "protip.messages.EnumValue"
11
- optional :repeated_enums, :message, 2, "protip.messages.RepeatedEnum"
12
- end
13
- add_enum "protip.messages.EnumTest.Enum" do
14
- value :ZERO, 0
15
- value :ONE, 1
10
+ add_file("protip/messages/test.proto", :syntax => :proto3) do
11
+ add_message "protip.messages.EnumTest" do
12
+ optional :enum, :message, 1, "protip.messages.EnumValue"
13
+ optional :repeated_enums, :message, 2, "protip.messages.RepeatedEnum"
14
+ end
15
+ add_enum "protip.messages.EnumTest.Enum" do
16
+ value :ZERO, 0
17
+ value :ONE, 1
18
+ end
16
19
  end
17
20
  end
18
21
 
19
22
  module Protip
20
23
  module Messages
21
- EnumTest = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.EnumTest").msgclass
22
- EnumTest::Enum = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.EnumTest.Enum").enummodule
24
+ EnumTest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.EnumTest").msgclass
25
+ EnumTest::Enum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.EnumTest.Enum").enummodule
23
26
  end
24
27
  end
25
28
 
@@ -4,15 +4,17 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protip.messages.Date" do
8
- optional :year, :int64, 1
9
- optional :month, :uint32, 2
10
- optional :day, :uint32, 3
7
+ add_file("protip/messages/types.proto", :syntax => :proto3) do
8
+ add_message "protip.messages.Date" do
9
+ optional :year, :int64, 1
10
+ optional :month, :uint32, 2
11
+ optional :day, :uint32, 3
12
+ end
11
13
  end
12
14
  end
13
15
 
14
16
  module Protip
15
17
  module Messages
16
- Date = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Date").msgclass
18
+ Date = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.Date").msgclass
17
19
  end
18
20
  end
@@ -4,14 +4,17 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'protip/extensions_pb'
7
+
7
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "protip.messages.EnumValue" do
9
- optional :value, :int32, 1
9
+ add_file("protip/messages/wrappers.proto", :syntax => :proto3) do
10
+ add_message "protip.messages.EnumValue" do
11
+ optional :value, :int32, 1
12
+ end
10
13
  end
11
14
  end
12
15
 
13
16
  module Protip
14
17
  module Messages
15
- EnumValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.EnumValue").msgclass
18
+ EnumValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("protip.messages.EnumValue").msgclass
16
19
  end
17
20
  end
@@ -13,6 +13,9 @@ require 'protip/messages/repeated_wrappers_pb'
13
13
  require 'protip/messages/types_pb'
14
14
  require 'protip/messages/wrappers_pb'
15
15
  require 'protip/messages/active_support/time_with_zone_pb'
16
+
16
17
  Google::Protobuf::DescriptorPool.generated_pool.build do
18
+ add_file("protip/messages.proto", :syntax => :proto3) do
19
+ end
17
20
  end
18
21
 
@@ -3,7 +3,7 @@ require 'bundler/setup'
3
3
 
4
4
  namespace :protip do
5
5
  desc 'compile a single .proto file to Ruby'
6
- task :compile, [:filename, :proto_path, :ruby_path] do |t, args|
6
+ task :compile, [:filename, :proto_path, :ruby_path, :rbi_path, :protoc_gen_rbi_path] do |t, args|
7
7
  proto_path = [args[:proto_path] || 'definitions'].flatten.compact.reject{|path| path == ''}
8
8
  proto_path << File.join(Gem.loaded_specs['protip'].full_gem_path, 'definitions')
9
9
 
@@ -11,7 +11,10 @@ namespace :protip do
11
11
 
12
12
  filename = args[:filename] || raise(ArgumentError.new 'filename argument is required')
13
13
 
14
- command = "bundle exec grpc_tools_ruby_protoc #{proto_path.map{|p| "--proto_path=#{Shellwords.escape p}"}.join ' '} --ruby_out=#{Shellwords.escape ruby_path} #{Shellwords.escape filename}"
14
+ command = "bundle exec grpc_tools_ruby_protoc #{proto_path.map{|p| "--proto_path=#{Shellwords.escape p}"}.join ' '} --ruby_out=#{Shellwords.escape ruby_path}"
15
+ command << " --plugin=protoc-gen-rbi=#{args[:protoc_gen_rbi_path]}" if args[:protoc_gen_rbi_path]
16
+ command << " --rbi_out=#{args[:rbi_path]}" if args[:rbi_path]
17
+ command << " #{Shellwords.escape filename}"
15
18
  puts command
16
19
  system command
17
20
 
@@ -1,3 +1,3 @@
1
1
  module Protip
2
- VERSION = '0.36'
2
+ VERSION = '0.37'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protip
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.36'
4
+ version: '0.37'
5
5
  platform: ruby
6
6
  authors:
7
7
  - AngelList
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-30 00:00:00.000000000 Z
11
+ date: 2022-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 4.2.10
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.0'
22
+ version: '8.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 4.2.10
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.0'
32
+ version: '8.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activesupport
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 4.2.10
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '7.0'
42
+ version: '8.0'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 4.2.10
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '7.0'
52
+ version: '8.0'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: money
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -90,14 +90,14 @@ dependencies:
90
90
  requirements:
91
91
  - - '='
92
92
  - !ruby/object:Gem::Version
93
- version: 1.3.4
93
+ version: 1.48.0
94
94
  type: :development
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - '='
99
99
  - !ruby/object:Gem::Version
100
- version: 1.3.4
100
+ version: 1.48.0
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: minitest
103
103
  requirement: !ruby/object:Gem::Requirement
@@ -196,7 +196,7 @@ dependencies:
196
196
  - - "~>"
197
197
  - !ruby/object:Gem::Version
198
198
  version: '3'
199
- description:
199
+ description:
200
200
  email:
201
201
  - team@angel.co
202
202
  executables: []
@@ -277,7 +277,7 @@ homepage: https://github.com/AngelList/protip
277
277
  licenses:
278
278
  - MIT
279
279
  metadata: {}
280
- post_install_message:
280
+ post_install_message:
281
281
  rdoc_options: []
282
282
  require_paths:
283
283
  - lib
@@ -292,8 +292,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.1.4
296
- signing_key:
295
+ rubygems_version: 3.1.6
296
+ signing_key:
297
297
  specification_version: 4
298
298
  summary: Resources backed by protobuf messages
299
299
  test_files: []