ruby / gem_rbs_collection

A collection of RBS for gems.
MIT License
255 stars 106 forks source link

actionview: Make a block to url helpers optional #589

Closed tk0miya closed 3 months ago

tk0miya commented 3 months ago

These helper methods can be called without block. So it would be better to declare as optional.

github-actions[bot] commented 3 months ago

@tk0miya Thanks for your contribution!

Please follow the instructions below for each change. See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.


actionview

You changed RBS files for an existing gem. You need to get approval from the reviewers of this gem.

@ksss, @ydah, please review this pull request. If this change is acceptable, please make a review comment including APPROVE from here. Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR. Just comment /merge to merge this PR.

ksss commented 3 months ago

I would like rbs diff to have an option to read unified format...

Please wait a moment while I look at the diff.

ksss commented 3 months ago

@tk0miya Is this all the difference you intend?

$ bundle exec rbs diff --detail --format diff --type-name ActionView::Helpers::UrlHelper --before gems/actionview/6.0 --after tk0miya-actionview_urlhelper-patch
- [::ActionView::Helpers::UrlHelper public] def link_to: (?untyped? name, ?untyped? options, ?untyped? html_options) { () -> untyped } -> untyped
+ [::ActionView::Helpers::UrlHelper public] def link_to: (?untyped? name, ?untyped? options, ?untyped? html_options) ?{ () -> untyped } -> untyped

- [::ActionView::Helpers::UrlHelper public] def button_to: (?untyped? name, ?untyped? options, ?untyped? html_options) { () -> untyped } -> untyped
+ [::ActionView::Helpers::UrlHelper public] def button_to: (?untyped? name, ?untyped? options, ?untyped? html_options) ?{ () -> untyped } -> untyped

- [::ActionView::Helpers::UrlHelper public] def link_to_unless_current: (untyped name, ?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] html_options) { () -> untyped } -> untyped
+ [::ActionView::Helpers::UrlHelper public] def link_to_unless_current: (untyped name, ?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] html_options) ?{ () -> untyped } -> untyped

- [::ActionView::Helpers::UrlHelper public] def link_to_unless: (untyped condition, untyped name, ?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] html_options) { () -> untyped } -> untyped
+ [::ActionView::Helpers::UrlHelper public] def link_to_unless: (untyped condition, untyped name, ?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] html_options) ?{ () -> untyped } -> untyped

- [::ActionView::Helpers::UrlHelper public] def link_to_if: (untyped condition, untyped name, ?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] html_options) { () -> untyped } -> untyped
+ [::ActionView::Helpers::UrlHelper public] def link_to_if: (untyped condition, untyped name, ?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] html_options) ?{ () -> untyped } -> untyped

- [::ActionView::Helpers::UrlHelper public] def mail_to: (untyped email_address, ?untyped? name, ?::Hash[untyped, untyped] html_options) { () -> untyped } -> untyped
+ [::ActionView::Helpers::UrlHelper public] def mail_to: (untyped email_address, ?untyped? name, ?::Hash[untyped, untyped] html_options) ?{ () -> untyped } -> untyped
tk0miya commented 3 months ago

Yes. This commit https://github.com/ruby/gem_rbs_collection/pull/589/commits/6a6c44b1a9342534482d9f35d837e4ae99b970ed is what you want to see.

tk0miya commented 3 months ago

Now I updated this PR not to move the unrelated methods to actionview.rbs.

github-actions[bot] commented 3 months ago

Thanks for your review, @ksss!

@tk0miya, @ksss This PR is ready to be merged. Just comment /merge to merge this PR.

tk0miya commented 3 months ago

/merge