mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33978 This Diff moves part of the utilities from the `react_native_pods` file to a specific `utils.rb` file. It adds tests for these utils and improve our test mocks. The goal is to simplify the `react_native_pods.rb` so it's easier to work with it. I decided to split this diff in 2 because it was becoming quite big. ## Changelog [iOS][Changed] - Refactoring part of the react_native_pods.rb script Reviewed By: cortinico Differential Revision: D37004347 fbshipit-source-id: a5156f7c199d082d5d895a58af80948556c51c2a
21 lines
603 B
Ruby
21 lines
603 B
Ruby
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
# Helper object to wrap the invocation of sysctl
|
|
# This makes it easier to mock the behaviour in tests
|
|
class SysctlChecker
|
|
def call_sysctl_arm64
|
|
return `/usr/sbin/sysctl -n hw.optional.arm64 2>&1`.to_i
|
|
end
|
|
end
|
|
|
|
# Helper object to wrap system properties like RUBY_PLATFORM
|
|
# This makes it easier to mock the behaviour in tests
|
|
class Environment
|
|
def ruby_platform
|
|
return RUBY_PLATFORM
|
|
end
|
|
end
|