gapic-generator 0.6.13 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/bin/protoc-gen-ruby_gapic +6 -6
- data/lib/gapic/file_formatter.rb +2 -1
- data/lib/gapic/formatting_utils.rb +4 -4
- data/lib/gapic/generator/version.rb +1 -1
- data/lib/gapic/grpc_service_config/method_config.rb +2 -1
- data/lib/gapic/grpc_service_config/retry_policy.rb +4 -1
- data/lib/gapic/grpc_service_config/service_config.rb +2 -1
- data/lib/gapic/path_pattern/parser.rb +1 -1
- data/lib/gapic/path_pattern/pattern.rb +2 -1
- data/lib/gapic/path_pattern/segment.rb +10 -3
- data/lib/gapic/presenters/package_presenter.rb +3 -3
- data/lib/gapic/presenters/resource_presenter.rb +2 -1
- data/lib/gapic/presenters/sample_presenter.rb +6 -1
- data/lib/gapic/presenters/service_presenter.rb +6 -6
- data/lib/gapic/schema/api.rb +4 -3
- data/lib/gapic/schema/parameter_schema.rb +4 -1
- data/lib/gapic/schema/request_parameter.rb +5 -1
- data/lib/gapic/schema/wrappers.rb +31 -18
- data/lib/gapic/uri_template/parser.rb +4 -6
- data/templates/default/gem/gemspec.erb +2 -2
- data/templates/default/gem/readme.erb +2 -2
- data/templates/default/gem/rubocop.erb +2 -12
- data/templates/default/service/client/_config.erb +2 -2
- data/templates/default/service/test/method/_normal.erb +1 -1
- data/templates/default/service/test/method/_server.erb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b183bf887e0c6df34d3374b75524ff8b1d4fc55cad3d54951de36fa3a9c58072
|
4
|
+
data.tar.gz: 1026bc4ec2ec151a363ce30ff75d7b37324d1f438ef44746ceaede0b482a1901
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8451fc41ccc52620ed922d0e75c734f824f6f7c411402697332083554598e4add7c65dbd1edd6b1d6692b11b04aceb216f23bb3de96ebc0730334be8433dbeac
|
7
|
+
data.tar.gz: 46cc19f65b3f4c6de7ceda0af826828a94ab635ad673d94cc4df5a13c17f0055b43f4b62ff6e3ac0cc22c6f22edce88e88129e5368bf26c87b6fa189017dac4d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Release History for gapic-generator
|
2
2
|
|
3
|
+
### 0.7.2 / 2021-03-05
|
4
|
+
|
5
|
+
* No changes.
|
6
|
+
|
7
|
+
### 0.7.1 / 2021-02-27
|
8
|
+
|
9
|
+
* Update generated readmes to reflect that Ruby 2.5 or later is now required.
|
10
|
+
|
11
|
+
### 0.7.0 / 2021-02-27
|
12
|
+
|
13
|
+
* Update minimum Ruby version to 2.5 for generated libraries.
|
14
|
+
* Update supported Rubocop to 1.x for generated libraries.
|
15
|
+
|
16
|
+
### 0.6.15 / 2021-02-22
|
17
|
+
|
18
|
+
* Really fixed encoding arguments in executable entrypoints
|
19
|
+
|
20
|
+
### 0.6.14 / 2021-02-22
|
21
|
+
|
22
|
+
* Fixed encoding arguments in executable entrypoints
|
23
|
+
|
3
24
|
### 0.6.13 / 2021-02-22
|
4
25
|
|
5
26
|
* Remove InputOnly and OutputOnly proto tags from docs to avoid confusing YARD.
|
data/bin/protoc-gen-ruby_gapic
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/env -S ruby -
|
1
|
+
#!/usr/bin/env -S ruby -EUTF-8
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# Copyright 2018 Google LLC
|
@@ -15,19 +15,19 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
|
18
|
-
$LOAD_PATH.unshift ::File.expand_path("
|
18
|
+
$LOAD_PATH.unshift ::File.expand_path("../lib", __dir__)
|
19
19
|
require "gapic/runner"
|
20
20
|
require "google/protobuf/compiler/plugin.pb"
|
21
21
|
|
22
22
|
# Ensure that no encoding conversions are done on STDIN and STDOUT
|
23
23
|
# since we are passing binary data back and forth. Otherwise these
|
24
24
|
# streams will be mangled on Windows.
|
25
|
-
|
26
|
-
|
25
|
+
$stdin.binmode
|
26
|
+
$stdout.binmode
|
27
27
|
|
28
|
-
request = Google::Protobuf::Compiler::CodeGeneratorRequest.decode
|
28
|
+
request = Google::Protobuf::Compiler::CodeGeneratorRequest.decode $stdin.read
|
29
29
|
|
30
30
|
# Run the request
|
31
31
|
response = Gapic::Runner.run request
|
32
32
|
|
33
|
-
|
33
|
+
$stdout.print response.serialize
|
data/lib/gapic/file_formatter.rb
CHANGED
@@ -21,9 +21,9 @@ module Gapic
|
|
21
21
|
# Various string formatting utils
|
22
22
|
#
|
23
23
|
module FormattingUtils
|
24
|
-
@brace_detector = /\A(?<pre>[^`]*(
|
25
|
-
@xref_detector = /\A(?<pre>[^`]*(
|
26
|
-
@list_element_detector = /\A\s*(
|
24
|
+
@brace_detector = /\A(?<pre>[^`]*(?:`[^`]*`[^`]*)*[^`\\])?\{(?<inside>[^\s][^}]*)\}(?<post>.*)\z/m
|
25
|
+
@xref_detector = /\A(?<pre>[^`]*(?:`[^`]*`[^`]*)*)?\[(?<text>[\w. `-]+)\]\[(?<addr>[\w.]+)\](?<post>.*)\z/m
|
26
|
+
@list_element_detector = /\A\s*(?:\*|\+|-|[0-9a-zA-Z]+\.)\s/
|
27
27
|
@omit_lines = ["@InputOnly\n", "@OutputOnly\n"]
|
28
28
|
|
29
29
|
class << self
|
@@ -76,7 +76,7 @@ module Gapic
|
|
76
76
|
def format_number value
|
77
77
|
return value.to_s if value.abs < 10_000
|
78
78
|
str = value.is_a?(Integer) ? value.to_s : BigDecimal(value.to_f.to_s).to_s("F")
|
79
|
-
re = /^(-?\d+)(\d\d\d)([_
|
79
|
+
re = /^(-?\d+)(\d\d\d)([_.][_.\d]+)?$/
|
80
80
|
while (m = re.match str)
|
81
81
|
str = "#{m[1]}_#{m[2]}#{m[3]}"
|
82
82
|
end
|
@@ -21,7 +21,10 @@ module Gapic
|
|
21
21
|
# for the GRPC method invocation. It is embedded into the MethodConfig
|
22
22
|
#
|
23
23
|
class RetryPolicy
|
24
|
-
attr_reader :initial_delay_seconds
|
24
|
+
attr_reader :initial_delay_seconds
|
25
|
+
attr_reader :max_delay_seconds
|
26
|
+
attr_reader :multiplier
|
27
|
+
attr_reader :status_codes
|
25
28
|
|
26
29
|
##
|
27
30
|
# Create new ParsedRetryPolicy.
|
@@ -22,7 +22,8 @@ module Gapic
|
|
22
22
|
# applied to the specific methods
|
23
23
|
#
|
24
24
|
class ServiceConfig
|
25
|
-
attr_reader :service_level_configs
|
25
|
+
attr_reader :service_level_configs
|
26
|
+
attr_reader :service_method_level_configs
|
26
27
|
|
27
28
|
##
|
28
29
|
# Create new ServiceConfig.
|
@@ -87,7 +87,7 @@ module Gapic
|
|
87
87
|
# @private
|
88
88
|
def self.try_capture_complex_resource_id_segment url_pattern
|
89
89
|
complex_resource_id_regex =
|
90
|
-
%r/^(?<segment_pattern>{(?<name_first>[^\/}]+?)}(?:(?<separator>[_
|
90
|
+
%r/^(?<segment_pattern>{(?<name_first>[^\/}]+?)}(?:(?<separator>[_\-~.]){(?<name_seq>[^\/}]+?)})+)(?:\/|$)/
|
91
91
|
|
92
92
|
return nil, url_pattern unless complex_resource_id_regex.match? url_pattern
|
93
93
|
|
@@ -29,7 +29,8 @@ module Gapic
|
|
29
29
|
# @return [Array<PositionalSegment|ResourceIdSegment|CollectionIdSegment>]
|
30
30
|
# The parsed segments of the path pattern
|
31
31
|
class Pattern
|
32
|
-
attr_reader :path_pattern
|
32
|
+
attr_reader :path_pattern
|
33
|
+
attr_reader :segments
|
33
34
|
|
34
35
|
def initialize path_pattern, segments
|
35
36
|
@path_pattern = path_pattern
|
@@ -29,7 +29,10 @@ module Gapic
|
|
29
29
|
# @return [String] The pattern of the segment, for the positional segment it is also
|
30
30
|
# a pattern of its resource
|
31
31
|
class PositionalSegment
|
32
|
-
attr_reader :type
|
32
|
+
attr_reader :type
|
33
|
+
attr_reader :position
|
34
|
+
attr_reader :pattern
|
35
|
+
|
33
36
|
def initialize position, pattern
|
34
37
|
@type = :positional
|
35
38
|
@position = position
|
@@ -117,7 +120,10 @@ module Gapic
|
|
117
120
|
# @return [Array<String>] The resource patterns associated with
|
118
121
|
# the resource_names of this segment
|
119
122
|
class ResourceIdSegment
|
120
|
-
attr_reader :type
|
123
|
+
attr_reader :type
|
124
|
+
attr_reader :pattern
|
125
|
+
attr_reader :resource_names
|
126
|
+
attr_reader :resource_patterns
|
121
127
|
|
122
128
|
def initialize type, pattern, resource_names, resource_patterns = []
|
123
129
|
@type = type
|
@@ -216,7 +222,8 @@ module Gapic
|
|
216
222
|
# @return [String] The pattern of the segment, for the positional segment it is also
|
217
223
|
# a pattern of its resource
|
218
224
|
class CollectionIdSegment
|
219
|
-
attr_reader :type
|
225
|
+
attr_reader :type
|
226
|
+
attr_reader :pattern
|
220
227
|
|
221
228
|
def initialize pattern
|
222
229
|
@type = :collection_id
|
@@ -77,7 +77,7 @@ module Gapic
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def package_file_path
|
80
|
-
package_require
|
80
|
+
"#{package_require}.rb"
|
81
81
|
end
|
82
82
|
|
83
83
|
def package_directory_name
|
@@ -89,7 +89,7 @@ module Gapic
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def helpers_file_path
|
92
|
-
helpers_require
|
92
|
+
"#{helpers_require}.rb"
|
93
93
|
end
|
94
94
|
|
95
95
|
def helpers_file_name
|
@@ -97,7 +97,7 @@ module Gapic
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def helpers_require
|
100
|
-
package_require
|
100
|
+
"#{package_require}/_helpers"
|
101
101
|
end
|
102
102
|
|
103
103
|
##
|
@@ -59,7 +59,8 @@ module Gapic
|
|
59
59
|
@path_string = build_path_string
|
60
60
|
end
|
61
61
|
|
62
|
-
attr_reader :pattern
|
62
|
+
attr_reader :pattern
|
63
|
+
attr_reader :path_string
|
63
64
|
|
64
65
|
def useful_for_helpers?
|
65
66
|
!@parsed_pattern.positional_segments? && !@parsed_pattern.nontrivial_pattern_segments?
|
@@ -58,7 +58,12 @@ module Gapic
|
|
58
58
|
# Representation of a request field.
|
59
59
|
#
|
60
60
|
class RequestField
|
61
|
-
attr_reader :field
|
61
|
+
attr_reader :field
|
62
|
+
attr_reader :value
|
63
|
+
attr_reader :input_parameter
|
64
|
+
attr_reader :comment
|
65
|
+
attr_reader :value_is_file
|
66
|
+
|
62
67
|
def initialize field
|
63
68
|
@field = field["field"]
|
64
69
|
@value = convert field["value"]
|
@@ -144,7 +144,7 @@ module Gapic
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def service_file_path
|
147
|
-
service_require
|
147
|
+
"#{service_require}.rb"
|
148
148
|
end
|
149
149
|
|
150
150
|
def service_file_name
|
@@ -180,7 +180,7 @@ module Gapic
|
|
180
180
|
end
|
181
181
|
|
182
182
|
def client_file_path
|
183
|
-
client_require
|
183
|
+
"#{client_require}.rb"
|
184
184
|
end
|
185
185
|
|
186
186
|
def client_file_name
|
@@ -220,7 +220,7 @@ module Gapic
|
|
220
220
|
end
|
221
221
|
|
222
222
|
def credentials_file_path
|
223
|
-
credentials_require
|
223
|
+
"#{credentials_require}.rb"
|
224
224
|
end
|
225
225
|
|
226
226
|
def credentials_file_name
|
@@ -232,7 +232,7 @@ module Gapic
|
|
232
232
|
end
|
233
233
|
|
234
234
|
def helpers_file_path
|
235
|
-
helpers_require
|
235
|
+
"#{helpers_require}.rb"
|
236
236
|
end
|
237
237
|
|
238
238
|
def helpers_file_name
|
@@ -260,7 +260,7 @@ module Gapic
|
|
260
260
|
end
|
261
261
|
|
262
262
|
def paths_file_path
|
263
|
-
paths_require
|
263
|
+
"#{paths_require}.rb"
|
264
264
|
end
|
265
265
|
|
266
266
|
def paths_file_name
|
@@ -308,7 +308,7 @@ module Gapic
|
|
308
308
|
end
|
309
309
|
|
310
310
|
def operations_file_path
|
311
|
-
operations_require
|
311
|
+
"#{operations_require}.rb"
|
312
312
|
end
|
313
313
|
|
314
314
|
def operations_file_name
|
data/lib/gapic/schema/api.rb
CHANGED
@@ -39,7 +39,8 @@ module Gapic
|
|
39
39
|
# @return [Array<Enum>] The top level enums seen across all files in
|
40
40
|
# this API.
|
41
41
|
class Api
|
42
|
-
attr_accessor :request
|
42
|
+
attr_accessor :request
|
43
|
+
attr_accessor :files
|
43
44
|
|
44
45
|
# Initializes an API object with the file descriptors that represent the
|
45
46
|
# API.
|
@@ -50,7 +51,7 @@ module Gapic
|
|
50
51
|
# The request parameters schema to use
|
51
52
|
# @param error_output [IO] An IO to write any errors/warnings to.
|
52
53
|
# @param configuration [Hash] Optional override of configuration.
|
53
|
-
def initialize request, parameter_schema: nil, error_output:
|
54
|
+
def initialize request, parameter_schema: nil, error_output: $stderr, configuration: nil
|
54
55
|
@request = request
|
55
56
|
loader = Loader.new
|
56
57
|
@files = request.proto_file.map do |fd|
|
@@ -359,7 +360,7 @@ module Gapic
|
|
359
360
|
# split the string on periods, but map backslash-escaped periods to
|
360
361
|
# literal periods.
|
361
362
|
def parse_key str
|
362
|
-
str.scan(/\.|\\.|[
|
363
|
+
str.scan(/\.|\\.|[^.\\]+/)
|
363
364
|
.each_with_object([String.new]) do |tok, arr|
|
364
365
|
if tok == "."
|
365
366
|
arr.append String.new
|
@@ -19,7 +19,10 @@ module Gapic
|
|
19
19
|
# Contains information about known parameter names
|
20
20
|
# and the types expected to be parsed from the request options string
|
21
21
|
class ParameterSchema
|
22
|
-
attr_accessor :bool_params
|
22
|
+
attr_accessor :bool_params
|
23
|
+
attr_accessor :string_params
|
24
|
+
attr_accessor :array_params
|
25
|
+
attr_accessor :map_params
|
23
26
|
|
24
27
|
# Creates a schema with given alias-parameter maps
|
25
28
|
# @param bool_params [Hash{String => String}]
|
@@ -19,7 +19,11 @@ module Gapic
|
|
19
19
|
# Encapsulates information that is parsed from a single command line parameter
|
20
20
|
# from the plugin_opt command line
|
21
21
|
class RequestParameter
|
22
|
-
attr_reader :input_str
|
22
|
+
attr_reader :input_str
|
23
|
+
attr_reader :input_name
|
24
|
+
attr_reader :input_value
|
25
|
+
attr_reader :config_name
|
26
|
+
attr_reader :config_value
|
23
27
|
|
24
28
|
# @param input_str [String] the input string containing parameter and value
|
25
29
|
# that the parameter and value were parsed from
|
@@ -80,7 +80,11 @@ module Gapic
|
|
80
80
|
# of locations could be recorded in the future.
|
81
81
|
class Proto
|
82
82
|
extend Forwardable
|
83
|
-
|
83
|
+
|
84
|
+
attr_reader :descriptor
|
85
|
+
attr_reader :address
|
86
|
+
attr_reader :docs
|
87
|
+
|
84
88
|
attr_accessor :parent
|
85
89
|
|
86
90
|
# Initializes a Proto object.
|
@@ -228,6 +232,7 @@ module Gapic
|
|
228
232
|
# @ return [Enumerable<Method>] The methods of this service.
|
229
233
|
class Service < Proto
|
230
234
|
extend Forwardable
|
235
|
+
|
231
236
|
attr_reader :methods
|
232
237
|
|
233
238
|
# Initializes a Service object.
|
@@ -292,7 +297,9 @@ module Gapic
|
|
292
297
|
# @ return [Message] The output message of this method.
|
293
298
|
class Method < Proto
|
294
299
|
extend Forwardable
|
295
|
-
|
300
|
+
|
301
|
+
attr_reader :input
|
302
|
+
attr_reader :output
|
296
303
|
|
297
304
|
# Initializes a method object.
|
298
305
|
# @param descriptor [Google::Protobuf::MethodDescriptorProto] the
|
@@ -370,7 +377,12 @@ module Gapic
|
|
370
377
|
# this file.
|
371
378
|
class File < Proto
|
372
379
|
extend Forwardable
|
373
|
-
|
380
|
+
|
381
|
+
attr_reader :messages
|
382
|
+
attr_reader :enums
|
383
|
+
attr_reader :services
|
384
|
+
attr_reader :resources
|
385
|
+
attr_reader :registry
|
374
386
|
|
375
387
|
# Initializes a message object.
|
376
388
|
# @param descriptor [Google::Protobuf::DescriptorProto] the protobuf
|
@@ -447,6 +459,7 @@ module Gapic
|
|
447
459
|
# @ return [EnumValue] the EnumValues contained in this file.
|
448
460
|
class Enum < Proto
|
449
461
|
extend Forwardable
|
462
|
+
|
450
463
|
attr_reader :values
|
451
464
|
|
452
465
|
# Initializes a message object.
|
@@ -479,17 +492,6 @@ module Gapic
|
|
479
492
|
class EnumValue < Proto
|
480
493
|
extend Forwardable
|
481
494
|
|
482
|
-
# Initializes a message object.
|
483
|
-
# @param descriptor [Google::Protobuf::DescriptorProto] the protobuf
|
484
|
-
# representation of this service.
|
485
|
-
# @param address [Enumerable<String>] The address of the proto. See
|
486
|
-
# #address for more info.
|
487
|
-
# @param docs [Google::Protobuf::SourceCodeInfo::Location] The docs
|
488
|
-
# of the proto. See #docs for more info.
|
489
|
-
def initialize descriptor, address, docs
|
490
|
-
super descriptor, address, docs
|
491
|
-
end
|
492
|
-
|
493
495
|
# @!method name
|
494
496
|
# @return [String] the unqualified name of the EnumValue
|
495
497
|
# @!method number
|
@@ -520,7 +522,12 @@ module Gapic
|
|
520
522
|
# @ return [Enumerable<Enum>] The nested enum declarations of a message.
|
521
523
|
class Message < Proto
|
522
524
|
extend Forwardable
|
523
|
-
|
525
|
+
|
526
|
+
attr_reader :fields
|
527
|
+
attr_reader :extensions
|
528
|
+
attr_reader :resource
|
529
|
+
attr_reader :nested_messages
|
530
|
+
attr_reader :nested_enums
|
524
531
|
|
525
532
|
# Initializes a message object.
|
526
533
|
# @param descriptor [Google::Protobuf::DescriptorProto] the protobuf
|
@@ -583,8 +590,9 @@ module Gapic
|
|
583
590
|
# otherwise.
|
584
591
|
class Field < Proto
|
585
592
|
extend Forwardable
|
586
|
-
|
587
|
-
|
593
|
+
|
594
|
+
attr_accessor :message
|
595
|
+
attr_accessor :enum
|
588
596
|
|
589
597
|
# Initializes a message object.
|
590
598
|
# @param descriptor [Google::Protobuf::FieldDescriptorProto] the
|
@@ -784,7 +792,12 @@ module Gapic
|
|
784
792
|
# @return [Array<Gapic::Schema::Resource>] Parent resources
|
785
793
|
class Resource
|
786
794
|
extend Forwardable
|
787
|
-
|
795
|
+
|
796
|
+
attr_reader :descriptor
|
797
|
+
attr_reader :parsed_patterns
|
798
|
+
attr_reader :parsed_parent_patterns
|
799
|
+
attr_reader :parent_resources
|
800
|
+
|
788
801
|
attr_accessor :parent
|
789
802
|
|
790
803
|
# Initializes a resource object.
|
@@ -25,13 +25,11 @@ module Gapic
|
|
25
25
|
# @return [Array<Segment|String>] The segments of the parsed path pattern.
|
26
26
|
module Parser
|
27
27
|
# @private
|
28
|
-
#
|
28
|
+
# `/(?<positional>\*\*?)|{(?<name>[^\/]+?)(?:=(?<template>.+?))?}/`
|
29
29
|
URI_TEMPLATE = %r{
|
30
|
-
(
|
31
|
-
|
32
|
-
|
33
|
-
{(?<name>[^\/]+?)(?:=(?<template>.+?))?}
|
34
|
-
)
|
30
|
+
(?<positional>\*\*?)
|
31
|
+
|
|
32
|
+
{(?<name>[^/]+?)(?:=(?<template>.+?))?}
|
35
33
|
}x.freeze
|
36
34
|
|
37
35
|
def self.parse_arguments uri_template
|
@@ -21,13 +21,13 @@ Gem::Specification.new do |gem|
|
|
21
21
|
<%= gem.extra_files.inspect %>
|
22
22
|
gem.require_paths = ["lib"]
|
23
23
|
|
24
|
-
gem.required_ruby_version = ">= 2.
|
24
|
+
gem.required_ruby_version = ">= 2.5"
|
25
25
|
|
26
26
|
<%- gem.dependency_list.each do |name, requirements| -%>
|
27
27
|
gem.add_dependency <%= name.inspect %>, <%= requirements.map { |v| v.inspect }.join ", " %>
|
28
28
|
<%- end -%>
|
29
29
|
|
30
|
-
gem.add_development_dependency "google-style", "~> 1.
|
30
|
+
gem.add_development_dependency "google-style", "~> 1.25.1"
|
31
31
|
gem.add_development_dependency "minitest", "~> 5.14"
|
32
32
|
gem.add_development_dependency "minitest-focus", "~> 1.1"
|
33
33
|
gem.add_development_dependency "minitest-rg", "~> 5.2"
|
@@ -28,11 +28,11 @@ response = client.<%= method.name %> request
|
|
28
28
|
|
29
29
|
## Supported Ruby Versions
|
30
30
|
|
31
|
-
This library is supported on Ruby 2.
|
31
|
+
This library is supported on Ruby 2.5+.
|
32
32
|
|
33
33
|
Google provides official support for Ruby versions that are actively supported
|
34
34
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
35
|
-
in security maintenance, and not end of life. Currently, this means Ruby 2.
|
35
|
+
in security maintenance, and not end of life. Currently, this means Ruby 2.5
|
36
36
|
and later. Older versions of Ruby _may_ still work, but are unsupported and not
|
37
37
|
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
38
38
|
about the Ruby support schedule.
|
@@ -8,14 +8,14 @@ AllCops:
|
|
8
8
|
- "proto_docs/**/*"
|
9
9
|
- "test/**/*"
|
10
10
|
|
11
|
+
Layout/LineLength:
|
12
|
+
Enabled: false
|
11
13
|
Metrics/AbcSize:
|
12
14
|
Enabled: false
|
13
15
|
Metrics/ClassLength:
|
14
16
|
Enabled: false
|
15
17
|
Metrics/CyclomaticComplexity:
|
16
18
|
Enabled: false
|
17
|
-
Metrics/LineLength:
|
18
|
-
Enabled: false
|
19
19
|
Metrics/MethodLength:
|
20
20
|
Enabled: false
|
21
21
|
Metrics/ModuleLength:
|
@@ -25,13 +25,3 @@ Metrics/PerceivedComplexity:
|
|
25
25
|
Naming/FileName:
|
26
26
|
Exclude:
|
27
27
|
- "lib/<%= gem.name %>.rb"
|
28
|
-
Naming/PredicateName:
|
29
|
-
Enabled: false
|
30
|
-
Style/AsciiComments:
|
31
|
-
Enabled: false
|
32
|
-
Style/CaseEquality:
|
33
|
-
Enabled: false
|
34
|
-
Style/IfUnlessModifier:
|
35
|
-
Enabled: false
|
36
|
-
Style/ModuleFunction:
|
37
|
-
Enabled: false
|
@@ -115,7 +115,7 @@ class Configuration
|
|
115
115
|
def rpcs
|
116
116
|
@rpcs ||= begin
|
117
117
|
parent_rpcs = nil
|
118
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
118
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
119
119
|
Rpcs.new parent_rpcs
|
120
120
|
end
|
121
121
|
end
|
@@ -149,7 +149,7 @@ class Configuration
|
|
149
149
|
# @private
|
150
150
|
def initialize parent_rpcs = nil
|
151
151
|
<%- method_service.methods.each do |method| -%>
|
152
|
-
<%= method.name %>_config = parent_rpcs
|
152
|
+
<%= method.name %>_config = parent_rpcs.<%= method.name %> if parent_rpcs.respond_to? :<%= method.name %>
|
153
153
|
@<%= method.name %> = ::Gapic::Config::Method.new <%= method.name %>_config
|
154
154
|
<%- end -%>
|
155
155
|
|
@@ -65,7 +65,7 @@ def test_<%= method.name %>
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# Use protobuf object with options
|
68
|
-
client.<%= method.name %>
|
68
|
+
client.<%= method.name %>(<%= method.request_type %>.new(<%= fields.map(&:as_kwarg).join ", " %>), grpc_options) do |response, operation|
|
69
69
|
<%= indent_tail render(partial: "service/test/method/assert_response", locals: { method: method }), 6 %>
|
70
70
|
end
|
71
71
|
|
@@ -79,7 +79,7 @@ def test_<%= method.name %>
|
|
79
79
|
end
|
80
80
|
|
81
81
|
# Use protobuf object with options
|
82
|
-
client.<%= method.name %>
|
82
|
+
client.<%= method.name %>(<%= method.request_type %>.new(<%= fields.map(&:as_kwarg).join ", " %>), grpc_options) do |response, operation|
|
83
83
|
assert_kind_of Enumerable, response
|
84
84
|
response.to_a.each do |r|
|
85
85
|
assert_kind_of <%= method.return_type %>, r
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gapic-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernest Landrito
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-03-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|
@@ -46,28 +46,28 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.
|
49
|
+
version: 1.25.1
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 1.
|
56
|
+
version: 1.25.1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: grpc-tools
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 1.
|
63
|
+
version: 1.36.0
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 1.
|
70
|
+
version: 1.36.0
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: minitest
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -341,14 +341,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
341
341
|
requirements:
|
342
342
|
- - ">="
|
343
343
|
- !ruby/object:Gem::Version
|
344
|
-
version: '
|
344
|
+
version: '2.5'
|
345
345
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
346
346
|
requirements:
|
347
347
|
- - ">="
|
348
348
|
- !ruby/object:Gem::Version
|
349
349
|
version: '0'
|
350
350
|
requirements: []
|
351
|
-
rubygems_version: 3.
|
351
|
+
rubygems_version: 3.2.11
|
352
352
|
signing_key:
|
353
353
|
specification_version: 4
|
354
354
|
summary: An API Client Generator for Ruby in Ruby!
|