gapic-generator-cloud 0.51.1 → 0.52.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad6748dc0be70bea29c8d011b44d210bab9517976a3c13179d7a0b3a6c6b9c15
4
- data.tar.gz: 3a1ca5f6575deb27c6120da5ab99638efa751be94d73c7df4498aec194461cc7
3
+ metadata.gz: 4b35f4c9b0ce27de202ffa67ef2567873ab62626caf1085f4e4cfbaedee634c8
4
+ data.tar.gz: 6b2886f368438fba1f381aa70e2c00abca031f15a5854ad8fdb7f63739b840c5
5
5
  SHA512:
6
- metadata.gz: 45d56f038ca9b6f2461e9525ea67a1f8ddd9fbbafb4b160426908c63c3a8931c0b8fa0045cd68b25ee8e85fc844b6283ec03a4f3e8ae334cc7a41ec8389c00a4
7
- data.tar.gz: 4fcddb8addccf51056adefefd0a71bced8d8b1d649370deda6d4b334cb18da45d3a0476d6aba950013b482ba0bd05dc3553e3611959bc7e4bcf376846f37b3dc
6
+ metadata.gz: 6e6bb757ea300bc7c05053e38e62cd543d410d4f168f187a30f5684f8b769c34c4944caea61d04d26e3364c085c0add8539bcb190d83da802ece51a5f3d5d882
7
+ data.tar.gz: 869549c1f6d1167ec20a01ac07a730ac4af934e3c8574ea611aa984834ddcaa064775b3e308a49b85352b463da40069f3d75b4d3a9f20343d756ebea314f2d72
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release History for gapic-generator-cloud
2
2
 
3
+ ### 0.52.0 / 2026-09-04
4
+
5
+ * Includes changes from gapic-generator 0.52.0
6
+ * Feature: add ruby-cloud-renamed-from for renamed wrapper gems
7
+
3
8
  ### 0.51.1 / 2026-08-05
4
9
 
5
10
  * Includes changes from gapic-generator 0.51.1
@@ -18,7 +18,7 @@
18
18
  module Gapic
19
19
  module Generator
20
20
  module Cloud
21
- VERSION = "0.51.1"
21
+ VERSION = "0.52.0"
22
22
  end
23
23
  end
24
24
  end
@@ -40,6 +40,7 @@ module Gapic
40
40
  "ruby-cloud-homepage" => ":gem.:homepage",
41
41
  "ruby-cloud-env-prefix" => ":gem.:env_prefix",
42
42
  "ruby-cloud-wrapper-of" => ":gem.:version_dependencies",
43
+ "ruby-cloud-renamed-from" => ":gem.:renamed_from",
43
44
  "ruby-cloud-migration-version" => ":gem.:migration_version",
44
45
  "ruby-cloud-product-url" => ":gem.:product_documentation_url",
45
46
  "ruby-cloud-issues-url" => ":gem.:issue_tracker_url",
@@ -105,12 +105,53 @@ module Gapic
105
105
  gem_config(:factory_method_suffix).to_s
106
106
  end
107
107
 
108
+ ##
109
+ # The canonical gem name prior to renaming.
110
+ #
111
+ # In some cases, a wrapper gem cannot be published under its canonical
112
+ # name because a conflicting gem already exists on RubyGems.org. For example:
113
+ # - "google-cloud-run" was renamed to "google-cloud-run-client" because RubyGems
114
+ # already had an existing gem named "google_cloud_run".
115
+ # - "google-iam" was renamed to "google-iam-client" because RubyGems already had
116
+ # an unrelated gem named "google-iam".
117
+ #
118
+ # Even though the wrapper gem itself is renamed with a "-client" suffix, it
119
+ # still wraps versioned client gems named after the canonical name (e.g.
120
+ # "google-cloud-run-v2", "google-iam-v2") and defines classes in the canonical
121
+ # namespace (e.g. "Google::Cloud::Run", "Google::Iam").
122
+ #
123
+ # @return [String]
124
+ def renamed_from
125
+ gem_config(:renamed_from) || name
126
+ end
127
+
128
+ def renamed_gem?
129
+ renamed_from != name
130
+ end
131
+
132
+ def namespace
133
+ gem_config(:namespace) ||
134
+ fix_namespace(@api, renamed_from.split("-").map(&:camelize).join("::"))
135
+ end
136
+
137
+ def gem_namespace
138
+ fix_namespace(@api, name.split("-").map(&:camelize).join("::"))
139
+ end
140
+
141
+ def version_name_full
142
+ if renamed_gem?
143
+ "#{gem_namespace}::VERSION"
144
+ else
145
+ "#{namespace}::VERSION"
146
+ end
147
+ end
148
+
108
149
  def version_dependencies
109
150
  gem_config(:version_dependencies).to_s.split(";").map { |str| str.split ":" }
110
151
  end
111
152
 
112
153
  def versioned_gems
113
- version_dependencies.map { |version, _requirement| "#{name}-#{version}" }.sort
154
+ version_dependencies.map { |version, _requirement| "#{renamed_from}-#{version}" }.sort
114
155
  end
115
156
 
116
157
  def default_version
@@ -129,7 +170,7 @@ module Gapic
129
170
  # 0.x and 1.x versions to ease the transition to 1.0 (GA) releases
130
171
  # for those dependencies. (Note the 0.x->1.0 transition is
131
172
  # generally not breaking.)
132
- deps["#{name}-#{version}"] =
173
+ deps["#{renamed_from}-#{version}"] =
133
174
  if requirement.start_with? "0."
134
175
  [">= #{requirement}", "< 2.a"]
135
176
  else
@@ -143,13 +184,13 @@ module Gapic
143
184
  end
144
185
 
145
186
  def google_cloud_short_name
146
- m = /^google-cloud-(.*)$/.match name
187
+ m = /^google-cloud-(.*)$/.match renamed_from
147
188
  return nil unless m
148
189
  m[1].tr "-", "_"
149
190
  end
150
191
 
151
192
  def docs_link version: nil, class_name: nil, text: nil, gem_name: nil
152
- gem_name ||= version ? "#{name}-#{version}" : name
193
+ gem_name ||= version ? "#{renamed_from}-#{version}" : name
153
194
  base_url =
154
195
  if cloud_product?
155
196
  "https://cloud.google.com/ruby/docs/reference/#{gem_name}/latest"
@@ -1,4 +1,4 @@
1
1
  <%- assert_locals gem -%>
2
2
  <%= render partial: "shared/header" -%>
3
3
 
4
- require "<%= gem.namespace_require %>" unless defined? <%= gem.namespace %>::VERSION
4
+ require "<%= gem.namespace_require %>" unless defined? <%= gem.version_name_full %>
@@ -9,7 +9,7 @@
9
9
  <%- end %>
10
10
 
11
11
  Actual client classes for the various versions of this API are defined in
12
- _versioned_ client gems, with names of the form `<%= gem.name %>-v*`.
12
+ _versioned_ client gems, with names of the form `<%= gem.renamed_from %>-v*`.
13
13
  The gem `<%= gem.name %>` is the main client library that brings the
14
14
  versioned gems in as dependencies, and provides high-level methods for
15
15
  constructing clients. More information on versioned clients can be found below
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.51.1
4
+ version: 0.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernest Landrito
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.51.1
20
+ version: 0.52.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.51.1
27
+ version: 0.52.0
28
28
  email:
29
29
  - landrito@google.com
30
30
  - quartzmo@gmail.com