Skip to content

Move ruby utils to module#4245

Open
m-bert wants to merge 2 commits into
mainfrom
@mbert/make-ruby-functions-local
Open

Move ruby utils to module#4245
m-bert wants to merge 2 commits into
mainfrom
@mbert/make-ruby-functions-local

Conversation

@m-bert

@m-bert m-bert commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Description

In ruby, functions and variables are global by design. In #4232 we dealt with it by changing name of exported function. However, the correct approach would be to keep our utils in separate module. This has also been introduced in Reanimated.

Test plan

pod install

Copilot AI review requested due to automatic review settings June 8, 2026 14:49
@m-bert m-bert requested review from j-piasecki and tjzel June 8, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR scopes the CocoaPods Ruby helper functions into a dedicated GestureHandlerUtils module to avoid leaking global methods/variables when evaluating the podspec (similar to the approach taken in Reanimated).

Changes:

  • Wrap the Ruby utilities in GestureHandlerUtils and expose them via module_function.
  • Update the podspec to call GestureHandlerUtils.get_react_native_minor_version instead of a global function.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/react-native-gesture-handler/scripts/gesture_handler_utils.rb Moves helper methods into a GestureHandlerUtils module to avoid global namespace pollution.
packages/react-native-gesture-handler/RNGestureHandler.podspec Switches version flag generation to use the new module-scoped utility method.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants