Commit ff3a6d1
authored
fix(internal/librarian/ruby): pass ruby-cloud-summary generator option alongside description (#7114)
Pass `ruby-cloud-summary` generator option with `sc.Description`
alongside `ruby-cloud-description` when generating Ruby client
libraries.
When `ruby-cloud-description` was passed alone without
`ruby-cloud-summary`, `gapic-generator-cloud` parsed `summary` directly
from `service.yaml` (which preserves internal newlines `\n` from YAML
block scalar parsing `|-`). Because `gem.summary` (with `\n`) did not
equal `gem.description` (with spaces), `gapic-generator-cloud` evaluated
`gem.summary != gem.description` to `true` in
[`gapic-generator-cloud/templates/cloud/wrapper_gem/readme.text.erb`](https://github.com/googleapis/gapic-generator-ruby/blob/5c65b2ab4910da4315fe210a831ad258d5097409/gapic-generator-cloud/templates/cloud/wrapper_gem/readme.text.erb#L3-L9),
causing the summary text to be rendered twice in wrapper gem
`README.md`.
### Code References
- [`buildGAPICOpts` in
`internal/librarian/ruby/generate.go`](https://github.com/googleapis/librarian/blob/089e2153f7ea740abff54f23c4cbc889c3dea34c/internal/librarian/ruby/generate.go#L164-L167)
- [`readme.text.erb` in
`gapic-generator-ruby`](https://github.com/googleapis/gapic-generator-ruby/blob/5c65b2ab4910da4315fe210a831ad258d5097409/gapic-generator-cloud/templates/cloud/wrapper_gem/readme.text.erb#L3-L9)
- [`GemPresenter` in
`gapic-generator-ruby`](https://github.com/googleapis/gapic-generator-ruby/blob/5c65b2ab4910da4315fe210a831ad258d5097409/gapic-generator/lib/gapic/presenters/gem_presenter.rb#L118-L149)
### Verification
Ran `librarian generate google-cloud-asset`:
```diff
--- a/google-cloud-asset/README.md
+++ b/google-cloud-asset/README.md
@@ -1,8 +1,8 @@
# Ruby Client for the Cloud Asset API
-The Cloud Asset API manages the history and inventory of Google Cloud resources.
+The Cloud Asset API manages the history and inventory of Google Cloud
+resources.
-The Cloud Asset API manages the history and inventory of Google Cloud resources.
Actual client classes for the various versions of this API are defined in
```
The duplicate summary line is removed and rendered exactly once.
Fixes #71131 parent fa48762 commit ff3a6d1
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
0 commit comments