gapic-generator-cloud 0.4.0 → 0.4.2

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: 67c698edddd3e5884a7ea49222c4bc4fcda045354d60380db267279d2524aa82
4
- data.tar.gz: 7367fbc57dec1cf102cd69de072bf0f8a57d0a01fc895bcdf376c32163568b11
3
+ metadata.gz: eec7df4dfcbb98ec9f6a1a8b005730b679469b7cb2f3988066ad8bbeef97d705
4
+ data.tar.gz: 52c89e5c4b99a86e491192b32ab9cc7b156bf6c7d2060e5825c529b01c733ae1
5
5
  SHA512:
6
- metadata.gz: 45d9725ff2c9b1b1db1fcd426edf33fdbfd3709274cbe9f172483ec86e315173fd342d520a2ffa05e55ac5df3a1bb633a06325120550bbdd78b271b7c2038f35
7
- data.tar.gz: 69812b1f0fe041ed416b82a8fdc7af1408ae3e642f11917541a3277ba69e65ef2b52feb85fd5a9fec52da25bb3688dfd2e8bf0c4edc0b9bd6896efc0f2eccce9
6
+ metadata.gz: 2f8e1372befecc7c33904ff5f267ae05b762c5343d771d65f5cc0518505ff406c304bd497b131884190c8a198d0a4f84dcc57eb0cf0277572c5c42035a4f51d9
7
+ data.tar.gz: 34a3a70bcffa3c1afd591e710c51ba7ce886ee69dad70e60a585793848bfadb8691cd233d6ec1a2e953b6a8e5990ffd566664b1f17adbf8d602d2d78ef49a555
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Release History for gapic-generator-cloud
2
2
 
3
+ ### 0.4.2 / 2020-04-28
4
+
5
+ * Includes changes from gapic-generator 0.4.2
6
+ * Eliminate a circular require in generated wrappers.
7
+
8
+ ### 0.4.1 / 2020-04-23
9
+
10
+ * Wrapper templates honor overridden namespaces.
11
+ * Support setting the gem namespace from the docker interface.
12
+
3
13
  ### 0.4.0 / 2020-04-20
4
14
 
5
15
  * Includes changes from gapic-generator 0.4.0
@@ -28,6 +28,7 @@ bool_option_map = {
28
28
  value_option_map = {
29
29
  "configuration" => "ruby-cloud-config",
30
30
  ":gem.:name" => "ruby-cloud-gem-name",
31
+ ":gem.:namespace" => "ruby-cloud-gem-namespace",
31
32
  ":gem.:title" => "ruby-cloud-title",
32
33
  ":gem.:description" => "ruby-cloud-description",
33
34
  ":gem.:summary" => "ruby-cloud-summary",
@@ -18,7 +18,7 @@
18
18
  module Gapic
19
19
  module Generator
20
20
  module Cloud
21
- VERSION = "0.4.0"
21
+ VERSION = "0.4.2"
22
22
  end
23
23
  end
24
24
  end
@@ -3,7 +3,7 @@
3
3
  require "googleauth"
4
4
  <% end %>
5
5
  # Credentials for the <%= service.name %> API.
6
- class <%= service.credentials_name %> < Google::Auth::Credentials
6
+ class <%= service.credentials_name %> < ::Google::Auth::Credentials
7
7
  <%- if service.client_scopes.any? -%>
8
8
  self.scope = [
9
9
  <%- service.client_scopes.each_with_index do |client_scope, index| -%>
@@ -1,6 +1,6 @@
1
1
  <%- assert_locals service -%>
2
2
  @configure ||= begin
3
- namespace = <%= service.namespace.split("::").inspect %>
3
+ namespace = <%= service.namespace.split("::").reject(&:empty?).inspect %>
4
4
  parent_config = while namespace.any?
5
5
  parent_name = namespace.join "::"
6
6
  parent_const = const_get parent_name
@@ -1,3 +1,3 @@
1
1
  <%- assert_locals method -%>
2
- rescue GRPC::BadStatus => e
3
- raise Google::Cloud::Error.from_error(e)
2
+ rescue ::GRPC::BadStatus => e
3
+ raise ::Google::Cloud::Error.from_error(e)
@@ -1,2 +1,2 @@
1
1
  <%- assert_locals method -%>
2
- # @raise [Google::Cloud::Error] if the RPC is aborted.
2
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
@@ -1,45 +1,50 @@
1
1
  <%- assert_locals gem -%>
2
2
  <% @requires = capture do %>
3
+ # Require this file early so that the version constant gets defined before
4
+ # requiring "google/cloud". This is because google-cloud-core will load the
5
+ # entrypoint (gem name) file, which in turn re-requires this file (hence
6
+ # causing a require cycle) unless the version constant is already defined.
3
7
  require "<%= gem.version_require %>"
8
+
4
9
  require "googleauth"
5
10
  <%- if gem.needs_default_config_block? -%>
6
11
  gem "google-cloud-core"
7
- require "google/cloud" unless defined? Google::Cloud.new
12
+ require "google/cloud" unless defined? ::Google::Cloud.new
8
13
  require "google/cloud/config"
9
14
 
10
15
  # Set the default configuration
11
- Google::Cloud.configure.add_config! :<%= gem.google_cloud_short_name %> do |config|
12
- config.add_field! :credentials, nil, match: [String, Hash, Google::Auth::Credentials]
13
- config.add_field! :lib_name, nil, match: String
14
- config.add_field! :lib_version, nil, match: String
15
- config.add_field! :interceptors, nil, match: Array
16
- config.add_field! :timeout, nil, match: Numeric
17
- config.add_field! :metadata, nil, match: Hash
18
- config.add_field! :retry_policy, nil, match: [Hash, Proc]
16
+ ::Google::Cloud.configure.add_config! :<%= gem.google_cloud_short_name %> do |config|
17
+ config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
18
+ config.add_field! :lib_name, nil, match: ::String
19
+ config.add_field! :lib_version, nil, match: ::String
20
+ config.add_field! :interceptors, nil, match: ::Array
21
+ config.add_field! :timeout, nil, match: ::Numeric
22
+ config.add_field! :metadata, nil, match: ::Hash
23
+ config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
19
24
  end
20
25
  <%- end -%>
21
26
  <% end %>
22
27
  <%- gem.services.each do |service| -%>
23
28
  ##
24
- # Create a new client object for <%= service.name %>.
29
+ # Create a new client object for <%= service.module_name %>.
25
30
  #
26
31
  # By default, this returns an instance of
27
- # <%= gem.docs_link version: gem.default_version, class_name: "#{service.name}::Client" %>
32
+ # <%= gem.docs_link version: gem.default_version, class_name: "#{service.module_name}::Client" %>
28
33
  # for version <%= gem.default_version.capitalize %> of the API.
29
34
  # However, you can specify specify a different API version by passing it in the
30
- # `version` parameter. If the <%= service.name %> service is
35
+ # `version` parameter. If the <%= service.module_name %> service is
31
36
  # supported by that API version, and the corresponding gem is available, the
32
37
  # appropriate versioned client will be returned.
33
38
  #
34
39
  <%- if service.doc_description -%>
35
- # ## About <%= service.name %>
40
+ # ## About <%= service.module_name %>
36
41
  #
37
42
  <%= indent service.doc_description(disable_xrefs: true), "# " %>
38
43
  #
39
44
  <%- end -%>
40
- # @param version [String, Symbol] The API version to connect to. Optional.
45
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
41
46
  # Defaults to `:<%= gem.default_version %>`.
42
- # @return [<%= service.name %>::Client] A client object for the specified version.
47
+ # @return [<%= service.module_name %>::Client] A client object for the specified version.
43
48
  #
44
49
  def self.<%= service.factory_method_name %> version: :<%= gem.default_version %>, &block
45
50
  require "<%= gem.namespace_require %>/#{version.to_s.downcase}"
@@ -49,7 +54,7 @@ def self.<%= service.factory_method_name %> version: :<%= gem.default_version %>
49
54
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
50
55
  .first
51
56
  package_module = <%= gem.namespace %>.const_get package_name
52
- package_module.const_get(:<%= service.name %>).const_get(:Client).new(&block)
57
+ package_module.const_get(:<%= service.module_name %>).const_get(:Client).new(&block)
53
58
  end
54
59
 
55
60
  <%- end -%>
@@ -80,11 +85,11 @@ end
80
85
  # * `:retry_codes` (*type:* `Array<String>`) -
81
86
  # The error codes that should trigger a retry.
82
87
  #
83
- # @return [Google::Cloud::Config] The default configuration used by this library
88
+ # @return [::Google::Cloud::Config] The default configuration used by this library
84
89
  #
85
90
  def self.configure
86
- yield Google::Cloud.configure.<%= gem.google_cloud_short_name %> if block_given?
91
+ yield ::Google::Cloud.configure.<%= gem.google_cloud_short_name %> if block_given?
87
92
 
88
- Google::Cloud.configure.<%= gem.google_cloud_short_name %>
93
+ ::Google::Cloud.configure.<%= gem.google_cloud_short_name %>
89
94
  end
90
95
  <%- end -%>
@@ -14,7 +14,7 @@ class <%= gem.namespace %>::ClientConstructionMinitest < Minitest::Test
14
14
  client = <%= gem.namespace %>.<%= service.factory_method_name %> do |config|
15
15
  config.credentials = grpc_channel
16
16
  end
17
- assert_kind_of <%= gem.namespaced_class "#{service.name}::Client", version: gem.default_version %>, client
17
+ assert_kind_of <%= gem.namespaced_class "#{service.module_name}::Client", version: gem.default_version %>, client
18
18
  end
19
19
  end
20
20
 
@@ -1,4 +1,4 @@
1
1
  <%- assert_locals gem -%>
2
2
  <%= render partial: "shared/header" -%>
3
3
 
4
- require "<%= gem.namespace_require %>"
4
+ require "<%= gem.namespace_require %>" unless defined? <%= gem.namespace %>::VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gapic-generator-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.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: 2020-04-20 00:00:00.000000000 Z
13
+ date: 2020-04-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.4.0
35
+ version: 0.4.2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.4.0
42
+ version: 0.4.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: google-style
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
222
  requirements: []
223
- rubygems_version: 3.1.2
223
+ rubygems_version: 3.0.3
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: An API Client Generator for Ruby in Ruby!