gapic-generator 0.6.4 → 0.6.5
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 +5 -0
- data/gem_templates/dockerfile.erb +1 -1
- data/lib/gapic/generator/version.rb +1 -1
- data/lib/gapic/presenters/gem_presenter.rb +4 -0
- data/lib/gapic/schema/api.rb +17 -1
- data/templates/default/gem/readme.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27e2894595efed8561aa48e9059465257267e7f29310a806251bcc6d4d85c63f
|
4
|
+
data.tar.gz: af47f16264074317a8d02e73539208a4b43f565ae346aef480619bc73a6b1203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eacd1840fadb1236cb5ed7efe7ba254a977529435ee7ddff1fcee7bb900fa847ccc0a3b861098f1292a63f72e82f6065146f1f0a0260b0624dc9a184de3d3389
|
7
|
+
data.tar.gz: 8a93aaef7317b85fc048604b626af4cef13cf90ea2dd785a12180d94d71dbf0bc4ea24a34c828a04825adcfd4ae2b88e4cc3934d41de7de01b3be27f6302aaba
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Release History for gapic-generator
|
2
2
|
|
3
|
+
### 0.6.5 / 2020-07-16
|
4
|
+
|
5
|
+
* Examples in auth, rakefile, and readme should pick a non-common service.
|
6
|
+
* Emit a warning if common_services config references a nonexistent service.
|
7
|
+
|
3
8
|
### 0.6.4 / 2020-07-13
|
4
9
|
|
5
10
|
* Fix rubocop warning on a generated multi-path helper if it could take no arguments.
|
@@ -30,7 +30,7 @@ COPY --from=gcr.io/gapic-images/api-common-protos:beta /protos/ /workspace/commo
|
|
30
30
|
COPY --from=builder /workspace/*.gem /workspace/
|
31
31
|
|
32
32
|
# Install the subgenerator and other needed tools.
|
33
|
-
RUN gem install
|
33
|
+
RUN gem install grpc-tools gapic-generator-<%= gem_name %>.gem \
|
34
34
|
&& rm gapic-generator-<%= gem_name %>.gem \
|
35
35
|
&& mkdir -p --mode=777 /.cache
|
36
36
|
|
data/lib/gapic/schema/api.rb
CHANGED
@@ -44,14 +44,18 @@ module Gapic
|
|
44
44
|
#
|
45
45
|
# @param request [Google::Protobuf::Compiler::CodeGeneratorRequest]
|
46
46
|
# The request object.
|
47
|
-
|
47
|
+
# @param error_output [IO] An IO to write any errors/warnings to.
|
48
|
+
# @param configuration [Hash] Optional override of configuration.
|
49
|
+
def initialize request, error_output: STDERR, configuration: nil
|
48
50
|
@request = request
|
49
51
|
loader = Loader.new
|
50
52
|
@files = request.proto_file.map do |fd|
|
51
53
|
loader.load_file fd, request.file_to_generate.include?(fd.name)
|
52
54
|
end
|
53
55
|
@files.each { |f| f.parent = self }
|
56
|
+
@configuration = configuration
|
54
57
|
@resource_types = analyze_resources
|
58
|
+
sanity_checks error_output
|
55
59
|
end
|
56
60
|
|
57
61
|
def containing_api
|
@@ -295,6 +299,18 @@ module Gapic
|
|
295
299
|
|
296
300
|
private
|
297
301
|
|
302
|
+
# Perform a variety of sanity checks on the data, and prints errors to
|
303
|
+
# the given output as appropriate.
|
304
|
+
#
|
305
|
+
# @param output [IO] Stream to write outputs to.
|
306
|
+
def sanity_checks output
|
307
|
+
addrs = services.map { |service| service.address.join "." }
|
308
|
+
configuration[:common_services]&.each do |k, v|
|
309
|
+
output.puts "WARNING: configured common service #{k} is not present" unless addrs.include? k
|
310
|
+
output.puts "WARNING: configured common service delegate #{v} is not present" unless addrs.include? v
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
298
314
|
# Does a pre-analysis of all resources defined in the job. This has
|
299
315
|
# two effects:
|
300
316
|
# * Side effect: each resource has its parent_resources field set.
|
@@ -16,7 +16,7 @@ $ gem install <%= gem.name %>
|
|
16
16
|
|
17
17
|
```ruby
|
18
18
|
require "<%= gem.entrypoint_require %>"
|
19
|
-
<%- service = gem.
|
19
|
+
<%- service = gem.first_non_common_service -%>
|
20
20
|
<%- method = service&.methods.first -%>
|
21
21
|
<%- if service && method -%>
|
22
22
|
|
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.6.
|
4
|
+
version: 0.6.5
|
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: 2020-07-
|
13
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|