Browse Source

UPDATE & FIX | Update react native version & fix crash errors (#1)

Co-authored-by: Vlad <vlad960706@gmail.com>
Reviewed-on: #1
Co-authored-by: Vlad Narizhnyi <vlad960706@gmail.com>
Co-committed-by: Vlad Narizhnyi <vlad960706@gmail.com>
pull/2/head
Vlad Narizhnyi 1 year ago committed by Vitalik Yatsenko
parent
commit
63b822bc92
  1. 3
      .gitignore
  2. 10
      App.tsx
  3. 176
      android/app/build.gradle
  4. 3
      android/app/src/debug/AndroidManifest.xml
  5. 7
      android/app/src/main/AndroidManifest.xml
  6. 23
      android/app/src/main/java/com/truth/MainActivity.java
  7. 54
      android/app/src/main/java/com/truth/MainApplication.java
  8. 20
      android/app/src/release/java/com/awesomeproject/ReactNativeFlipper.java
  9. 15
      android/build.gradle
  10. 22
      android/gradle.properties
  11. 3
      android/gradle/wrapper/gradle-wrapper.properties
  12. 269
      android/gradlew
  13. 13
      android/gradlew.bat
  14. 7
      android/settings.gradle
  15. 1
      ios/.xcode.env
  16. 51
      ios/Podfile
  17. 940
      ios/Podfile.lock
  18. 165
      ios/Truth.xcodeproj/project.pbxproj
  19. 2
      ios/Truth/AppDelegate.m
  20. 24867
      package-lock.json
  21. 33
      package.json
  22. 14
      src/i18n/locales/en/onBoardingButton.translation.ts
  23. 60
      src/module/game/screen/select-packages.screen.tsx
  24. 21
      src/module/package/components/packages-item.component.tsx
  25. 34
      src/module/package/components/packages-list.tsx
  26. 39
      src/module/root/atoms/premium-button.component.tsx
  27. 9
      src/module/root/navigations-groups/on-boardings-group.tsx
  28. 27
      src/module/root/screens/game.tsx
  29. 38
      src/module/root/screens/loading-screen.tsx
  30. 12
      src/module/root/screens/on-boarding.screen.tsx
  31. 29
      src/module/root/screens/questions.tsx
  32. 28
      src/module/root/screens/settings.screen.tsx
  33. 0
      src/module/shared/atoms/index.ts
  34. 17
      src/module/shared/components/buttons/red-button.tsx
  35. 1
      src/module/shared/hooks/index.ts
  36. 11
      src/module/shared/hooks/use-nav.hook.ts
  37. 2
      src/module/shared/index.ts
  38. 1
      truth
  39. 27
      vendor/bundle/ruby/2.7.0/bin/fuzzy_match
  40. 27
      vendor/bundle/ruby/2.7.0/bin/httpclient
  41. 27
      vendor/bundle/ruby/2.7.0/bin/pod
  42. 23
      vendor/bundle/ruby/2.7.0/bin/ruby_executable_hooks
  43. 27
      vendor/bundle/ruby/2.7.0/bin/sandbox-pod
  44. 27
      vendor/bundle/ruby/2.7.0/bin/xcodeproj
  45. BIN
      vendor/bundle/ruby/2.7.0/cache/CFPropertyList-3.0.5.gem
  46. BIN
      vendor/bundle/ruby/2.7.0/cache/activesupport-6.1.5.gem
  47. BIN
      vendor/bundle/ruby/2.7.0/cache/addressable-2.8.0.gem
  48. BIN
      vendor/bundle/ruby/2.7.0/cache/algoliasearch-1.27.5.gem
  49. BIN
      vendor/bundle/ruby/2.7.0/cache/atomos-0.1.3.gem
  50. BIN
      vendor/bundle/ruby/2.7.0/cache/claide-1.1.0.gem
  51. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-1.11.3.gem
  52. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-core-1.11.3.gem
  53. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-deintegrate-1.0.5.gem
  54. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-downloader-1.5.1.gem
  55. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-plugins-1.0.0.gem
  56. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-search-1.0.1.gem
  57. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-trunk-1.6.0.gem
  58. BIN
      vendor/bundle/ruby/2.7.0/cache/cocoapods-try-1.2.0.gem
  59. BIN
      vendor/bundle/ruby/2.7.0/cache/colored2-3.1.2.gem
  60. BIN
      vendor/bundle/ruby/2.7.0/cache/concurrent-ruby-1.1.9.gem
  61. BIN
      vendor/bundle/ruby/2.7.0/cache/escape-0.0.4.gem
  62. BIN
      vendor/bundle/ruby/2.7.0/cache/ethon-0.15.0.gem
  63. BIN
      vendor/bundle/ruby/2.7.0/cache/ffi-1.15.5.gem
  64. BIN
      vendor/bundle/ruby/2.7.0/cache/fourflusher-2.3.1.gem
  65. BIN
      vendor/bundle/ruby/2.7.0/cache/fuzzy_match-2.0.4.gem
  66. BIN
      vendor/bundle/ruby/2.7.0/cache/gh_inspector-1.1.3.gem
  67. BIN
      vendor/bundle/ruby/2.7.0/cache/httpclient-2.8.3.gem
  68. BIN
      vendor/bundle/ruby/2.7.0/cache/i18n-1.10.0.gem
  69. BIN
      vendor/bundle/ruby/2.7.0/cache/json-2.6.1.gem
  70. BIN
      vendor/bundle/ruby/2.7.0/cache/minitest-5.15.0.gem
  71. BIN
      vendor/bundle/ruby/2.7.0/cache/molinillo-0.8.0.gem
  72. BIN
      vendor/bundle/ruby/2.7.0/cache/nanaimo-0.3.0.gem
  73. BIN
      vendor/bundle/ruby/2.7.0/cache/nap-1.1.0.gem
  74. BIN
      vendor/bundle/ruby/2.7.0/cache/netrc-0.11.0.gem
  75. BIN
      vendor/bundle/ruby/2.7.0/cache/public_suffix-4.0.6.gem
  76. BIN
      vendor/bundle/ruby/2.7.0/cache/rexml-3.2.5.gem
  77. BIN
      vendor/bundle/ruby/2.7.0/cache/ruby-macho-2.5.1.gem
  78. BIN
      vendor/bundle/ruby/2.7.0/cache/typhoeus-1.4.0.gem
  79. BIN
      vendor/bundle/ruby/2.7.0/cache/tzinfo-2.0.4.gem
  80. BIN
      vendor/bundle/ruby/2.7.0/cache/xcodeproj-1.21.0.gem
  81. BIN
      vendor/bundle/ruby/2.7.0/cache/zeitwerk-2.5.4.gem
  82. BIN
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/ffi_c.bundle
  83. 0
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/gem.build_complete
  84. 4090
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/gem_make.out
  85. 229
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/mkmf.log
  86. 0
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/gem.build_complete
  87. 13
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/gem_make.out
  88. BIN
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/json/ext/generator.bundle
  89. BIN
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/json/ext/parser.bundle
  90. 118
      vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/mkmf.log
  91. 19
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/LICENSE
  92. 79
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/README.md
  93. 43
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/README.rdoc
  94. 7
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/THANKS
  95. 6
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist.rb
  96. 594
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbBinaryCFPropertyList.rb
  97. 26
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbCFPlistError.rb
  98. 449
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbCFPropertyList.rb
  99. 349
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbCFTypes.rb
  100. 149
      vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbLibXMLParser.rb
  101. Some files were not shown because too many files have changed in this diff Show More

3
.gitignore vendored

@ -58,6 +58,3 @@ buck-out/ @@ -58,6 +58,3 @@ buck-out/
# CocoaPods
/ios/Pods/
./vendor

10
App.tsx

@ -4,6 +4,7 @@ import {Navigation} from './src/module/root'; @@ -4,6 +4,7 @@ import {Navigation} from './src/module/root';
import './src/i18n/index';
import {Provider} from 'react-redux';
import {store} from './src/store/store';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
if (__DEV__) {
import('./ReactotronConfig').then(() => console.log('Reactotron Configured'));
@ -14,9 +15,12 @@ const App = () => { @@ -14,9 +15,12 @@ const App = () => {
SplashScreen.hide();
}, []);
return (
<Provider store={store}>
<Navigation />
</Provider>
<GestureHandlerRootView style={{flex: 1}}>
<Provider store={store}>
<Navigation />
</Provider>
</GestureHandlerRootView>
);
};
export default App;

176
android/app/build.gradle

@ -1,130 +1,27 @@ @@ -1,130 +1,27 @@
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
apply plugin: "com.facebook.react"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and that value will be read here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
android {
ndkVersion rootProject.ext.ndkVersion
@ -139,14 +36,6 @@ android { @@ -139,14 +36,6 @@ android {
versionName "1.0"
multiDexEnabled true
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
@ -158,11 +47,6 @@ android { @@ -158,11 +47,6 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
@ -172,63 +56,23 @@ android { @@ -172,63 +56,23 @@ android {
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-splash-screen')
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation project(':react-native-svg')
implementation project(':react-native-vector-icons')
implementation 'com.android.support:multidex:2.0.1'
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
// icon
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

3
android/app/src/debug/AndroidManifest.xml

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
</manifest>

7
android/app/src/main/AndroidManifest.xml

@ -7,14 +7,17 @@ @@ -7,14 +7,17 @@
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

23
android/app/src/main/java/com/truth/MainActivity.java

@ -1,17 +1,24 @@ @@ -1,17 +1,24 @@
package com.truth;
import android.os.Bundle;
import org.devio.rn.splashscreen.SplashScreen;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;
import org.devio.rn.splashscreen.SplashScreen;
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
super.onCreate(null);
}
@Override
@Override
protected String getMainComponentName() {
return "Truth";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new DefaultReactActivityDelegate(
this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
DefaultNewArchitectureEntryPoint.getFabricEnabled());
}
}

54
android/app/src/main/java/com/truth/MainApplication.java

@ -1,15 +1,14 @@ @@ -1,15 +1,14 @@
package com.truth;
import com.oblador.vectoricons.VectorIconsPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;
import com.horcrux.svg.SvgPackage;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
@ -26,11 +25,6 @@ public class MainApplication extends Application implements ReactApplication { @@ -26,11 +25,6 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
new SplashScreenReactPackage();
new SvgPackage();
new VectorIconsPackage();
//packages.add(new SplashScreenReactPackage());
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
@ -40,6 +34,14 @@ public class MainApplication extends Application implements ReactApplication { @@ -40,6 +34,14 @@ public class MainApplication extends Application implements ReactApplication {
protected String getJSMainModuleName() {
return "index";
}
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
protected Boolean isHermesEnabled() {
return BuildConfig.IS_HERMES_ENABLED;
}
};
@Override
@ -51,9 +53,14 @@ public class MainApplication extends Application implements ReactApplication { @@ -51,9 +53,14 @@ public class MainApplication extends Application implements ReactApplication {
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
DefaultNewArchitectureEntryPoint.load();
}
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
@ -61,27 +68,6 @@ public class MainApplication extends Application implements ReactApplication { @@ -61,27 +68,6 @@ public class MainApplication extends Application implements ReactApplication {
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.truth.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}

20
android/app/src/release/java/com/awesomeproject/ReactNativeFlipper.java

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.awesomeproject;
import android.content.Context;
import com.facebook.react.ReactInstanceManager;
/**
* Class responsible of loading Flipper inside your React Native application. This is the release
* flavor of it so it's empty as we don't want to load Flipper.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
// Do nothing as we don't want to initialize Flipper on Release.
}
}

15
android/build.gradle

@ -2,19 +2,22 @@ @@ -2,19 +2,22 @@
buildscript {
ext {
buildToolsVersion = "30.0.2"
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.14'
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath ("com.google.gms:google-services:4.3.14")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

22
android/gradle.properties

@ -9,8 +9,8 @@ @@ -9,8 +9,8 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
@ -25,4 +25,20 @@ android.useAndroidX=true @@ -25,4 +25,20 @@ android.useAndroidX=true
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.99.0
FLIPPER_VERSION=0.182.0
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

3
android/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

269
android/gradlew vendored

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,67 +17,101 @@ @@ -17,67 +17,101 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@ -106,80 +140,105 @@ location of your Java installation." @@ -106,80 +140,105 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
i=`expr $i + 1`
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

13
android/gradlew.bat vendored

@ -25,7 +25,8 @@ @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

7
android/settings.gradle

@ -1,9 +1,4 @@ @@ -1,9 +1,4 @@
rootProject.name = 'Truth'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
includeBuild('../node_modules/@react-native/gradle-plugin')

1
ios/.xcode.env

@ -0,0 +1 @@ @@ -0,0 +1 @@
export NODE_BINARY=$(command -v node)

51
ios/Podfile

@ -1,22 +1,44 @@ @@ -1,22 +1,44 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, '11.0'
platform :ios, '13.0'
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
prepare_react_native_project!
use_frameworks!
$RNFirebaseAsStaticFramework = true
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'Truth' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
# Hermes is now enabled by default. Disable by setting this flag to false.
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'TruthTests' do
@ -24,14 +46,13 @@ target 'Truth' do @@ -24,14 +46,13 @@ target 'Truth' do
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# use_flipper!()
post_install do |installer|
react_native_post_install(installer)
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
end

940
ios/Podfile.lock

File diff suppressed because it is too large Load Diff

165
ios/Truth.xcodeproj/project.pbxproj

File diff suppressed because one or more lines are too long

2
ios/Truth/AppDelegate.m

@ -57,7 +57,7 @@ static void InitializeFlipper(UIApplication *application) { @@ -57,7 +57,7 @@ static void InitializeFlipper(UIApplication *application) {
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif

24867
package-lock.json generated

File diff suppressed because it is too large Load Diff

33
package.json

@ -24,14 +24,14 @@ @@ -24,14 +24,14 @@
"i18next": "^21.8.14",
"i18next-react-native-async-storage": "^1.0.4",
"link": "^1.5.1",
"react": "17.0.2",
"react": "18.2.0",
"react-i18next": "^11.18.1",
"react-native": "^0.67.4",
"react-native": "0.72.7",
"react-native-animated-loader": "^1.0.0",
"react-native-gesture-handler": "^2.5.0",
"react-native-icomoon": "^0.1.1",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.15.0",
"react-native-screens": "^3.27.0",
"react-native-splash-screen": "^3.3.0",
"react-native-svg": "^12.5.1",
"react-native-svg-transformer": "^1.0.0",
@ -39,24 +39,27 @@ @@ -39,24 +39,27 @@
"react-redux": "^8.0.5"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@bam.tech/react-native-make": "^3.0.3",
"@react-native-community/eslint-config": "^2.0.0",
"@types/jest": "^26.0.23",
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/eslint-config": "^0.72.2",
"@react-native/metro-config": "^0.72.11",
"@tsconfig/react-native": "^3.0.0",
"@types/react": "^18.0.24",
"@types/react-native": "^0.66.15",
"@types/react-native-vector-icons": "^6.4.12",
"@types/react-redux": "^7.1.25",
"@types/react-test-renderer": "^17.0.1",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"babel-jest": "^26.6.3",
"eslint": "^7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.76.8",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"reactotron-react-native": "^5.0.3",
"typescript": "^4.4.4"
"typescript": "4.8.4"
},
"resolutions": {
"@types/react": "^17"

14
src/i18n/locales/en/onBoardingButton.translation.ts

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
export const buttonsTranslation = {
skip: 'Skip',
priceButton: 'Open now / $4.99',
later: 'Later',
truth: '-TRUTH-',
random: 'RANDOM CHANCE',
dare: '-DARE-',
}
skip: 'Skip',
priceButton: 'Open now / $4.99',
later: 'Later',
truth: '-TRUTH-',
random: 'RANDOM CHANCE',
dare: '-DARE-',
};

60
src/module/game/screen/select-packages.screen.tsx

@ -1,36 +1,60 @@ @@ -1,36 +1,60 @@
import React, {FC, useEffect} from 'react';
import React, {FC} from 'react';
import {
colors,
defaultPackages,
Header,
IRouteParams,
RouteKey,
ScreenLayout,
useNav,
} from '../../shared';
import {PackagesList} from '../../package';
import { ScrollView } from 'react-native-gesture-handler';
interface IProps extends IRouteParams {}
import {ScrollView} from 'react-native-gesture-handler';
import {StyleSheet, View} from 'react-native';
import {CustomPackage} from '../../package/atoms/create-custom-package.atom';
import {PackagesPageSeparator} from '../../package/atoms/packages-page-separator.atom';
import {PackagesItem} from '../../package/components/packages-item.component';
import {useTranslation} from 'react-i18next';
export const SelectPackages: FC<IProps> = ({navigation}) => {
export const SelectPackages: FC = () => {
const nav = useNav();
const {i18n} = useTranslation();
const lang = i18n.language;
return (
<ScreenLayout
backgroundColor={colors.primaryColor}
backgroundColor={colors.primaryColor}
backgroundStatusBar={colors.primaryColor}
headerComponent={
<Header
leftIcon="settings"
rightIcon="setting"
onPressRight={() =>
navigation.navigate(RouteKey.Setting, {
previous_screen: RouteKey.Game,
title: RouteKey.Setting,
})
}
/>
rightIcon="setting"
onPressRight={() => nav.navigate(RouteKey.Setting)}
/>
}>
<ScrollView contentContainerStyle={{paddingBottom: 30, paddingHorizontal: 5}}>
<PackagesList />
<ScrollView contentContainerStyle={styles.scrollView}>
<View style={styles.container}>
{defaultPackages.map((item: any, index) => (
<PackagesItem
title={item.title[lang]}
description={item.description[lang]}
questions={item.questions}
actions={item.actions}
image={item.image}
key={index}
/>
))}
<PackagesPageSeparator />
<CustomPackage />
</View>
</ScrollView>
</ScreenLayout>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
},
scrollView: {
paddingBottom: 30,
paddingHorizontal: 5,
},
});

21
src/module/package/components/packages-item.component.tsx

@ -1,15 +1,10 @@ @@ -1,15 +1,10 @@
import {useNavigation} from '@react-navigation/native';
import React, {FC} from 'react';
import {StyleSheet, TouchableOpacity, View, Text} from 'react-native';
import {useAppDispatch} from '../../../store/hooks';
import {
nextStep,
resetSteps,
} from '../../services/current-step/current-step-slice';
import {resetSteps} from '../../services/current-step/current-step-slice';
import {shuffleDares} from '../../services/dares/dares-slice';
import {shuffleItems} from '../../services/game-items/game-items-slice';
import {shuffleTruths} from '../../services/truths/truth-slice';
import {Icon, RouteKey} from '../../shared';
import {Icon, RouteKey, useNav} from '../../shared';
interface IType {
[key: string]: string;
@ -22,18 +17,12 @@ interface IPackage { @@ -22,18 +17,12 @@ interface IPackage {
actions: IType[];
}
export const PackagesItem: FC<IPackage> = ({
title,
description,
image,
questions,
actions,
}) => {
const navigation = useNavigation();
export const PackagesItem: FC<IPackage> = ({title, description, image}) => {
const nav = useNav();
const dispatch = useAppDispatch();
const play = () => {
navigation.navigate(RouteKey.Package as any);
nav.navigate(RouteKey.Game, {title});
dispatch(resetSteps());
dispatch(shuffleTruths());
dispatch(shuffleDares());

34
src/module/package/components/packages-list.tsx

@ -1,34 +0,0 @@ @@ -1,34 +0,0 @@
import React from 'react';
import {StyleSheet, View} from 'react-native';
import {PackagesPageSeparator} from '../atoms/packages-page-separator.atom';
import {PackagesItem} from './packages-item.component';
import {CustomPackage} from '../atoms/create-custom-package.atom';
import {defaultPackages} from '../../shared/config';
import {useTranslation} from 'react-i18next';
export const PackagesList = () => {
const {i18n} = useTranslation();
const lang = i18n.language;
console.log(lang);
return (
<View style={styles.container}>
{defaultPackages.map((item: any, index) => (
<PackagesItem
title={item.title[lang]}
description={item.description[lang]}
questions={item.questions}
actions={item.actions}
image={item.image}
key={index}
/>
))}
<PackagesPageSeparator />
<CustomPackage />
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
},
});

39
src/module/root/atoms/premium-button.component.tsx

@ -1,11 +1,10 @@ @@ -1,11 +1,10 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import {CommonActions, useNavigation} from '@react-navigation/native';
import {navigate} from '@react-navigation/routers/lib/typescript/src/CommonActions';
import React, {FC} from 'react';
import { useTranslation } from 'react-i18next';
import {useTranslation} from 'react-i18next';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {StorageKey, storageService} from '../../services/async-storage.service';
import {colors, IRouteParams, PrimaryBtn, RouteKey} from '../../shared';
import {StorageKey} from '../../services/async-storage.service';
import {colors, PrimaryBtn, RouteKey, useNav} from '../../shared';
interface IProps {
currentIndex: number;
data: Array<{
@ -21,30 +20,32 @@ interface IProps { @@ -21,30 +20,32 @@ interface IProps {
}>,
) => void;
}
export const GroupBtn: FC<IProps> = ({currentIndex, data, onPressItem}) => {
const navigation = useNavigation();
const {i18n, t} = useTranslation();
const nav = useNav();
const {t} = useTranslation();
const onBoardFinish = async () => {
await AsyncStorage.setItem(StorageKey.OnBoarding, 'true');
navigation.navigate(RouteKey.Game as any);
navigation.dispatch(CommonActions.reset({
index: 0,
routes: [{name: RouteKey.Game}]
}));
nav.navigate(RouteKey.Package);
};
if (data.length - 1 === currentIndex) {
return (
<View style={styles.btncontainer}>
<View style={styles.btnContainer}>
<PrimaryBtn
onPress={onBoardFinish}
children={<Text style={styles.text}>{t('buttonsTranslation.priceButton')}</Text>}
children={
<Text style={styles.text}>
{t('buttonsTranslation.priceButton')}
</Text>
}
width={190}
/>
<TouchableOpacity style={styles.laterBtn} onPress={onBoardFinish}>
<Text style={[styles.text, {fontWeight: '400'}]}>{t('buttonsTranslation.later')}</Text>
<Text style={[styles.text, {fontWeight: '400'}]}>
{t('buttonsTranslation.later')}
</Text>
</TouchableOpacity>
</View>
);
@ -52,7 +53,9 @@ export const GroupBtn: FC<IProps> = ({currentIndex, data, onPressItem}) => { @@ -52,7 +53,9 @@ export const GroupBtn: FC<IProps> = ({currentIndex, data, onPressItem}) => {
return (
<PrimaryBtn
onPress={() => onPressItem(data)}
children={<Text style={styles.text}>{t('buttonsTranslation.skip')}</Text>}
children={
<Text style={styles.text}>{t('buttonsTranslation.skip')}</Text>
}
width={155}
/>
);
@ -70,7 +73,7 @@ const styles = StyleSheet.create({ @@ -70,7 +73,7 @@ const styles = StyleSheet.create({
height: 40,
justifyContent: 'center',
},
btncontainer: {
btnContainer: {
alignItems: 'center',
marginTop: 'auto',
},

9
src/module/root/navigations-groups/on-boardings-group.tsx

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import React, {FC, useEffect, useState} from 'react';
import React, {FC} from 'react';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {RouteKey} from '../../shared';
import {LanguageSelect, Onboarding, Setting} from '../screens';
@ -8,25 +8,22 @@ import {Game} from '../screens/game'; @@ -8,25 +8,22 @@ import {Game} from '../screens/game';
import {Questions} from '../screens/questions';
import {PrivacyPolicy} from '../../privacy-policy/screens/privacy-policy';
import {UseOfTerms} from '../../terms-of-use/screens/use-of-terms';
import firestore from '@react-native-firebase/firestore';
const Stack = createNativeStackNavigator();
export const OnboardingGroup: FC = () => {
return (
<Stack.Navigator
screenOptions={{
headerShown: false,
animation: 'slide_from_left',
}}
initialRouteName={RouteKey.Loading}>
<Stack.Screen name={RouteKey.Questions} component={Questions} />
<Stack.Screen name={RouteKey.Package} component={Game} />
<Stack.Screen name={RouteKey.Package} component={SelectPackages} />
<Stack.Screen name={RouteKey.Onboarding} component={Onboarding} />
<Stack.Screen name={RouteKey.Loading} component={LoadingScreen} />
<Stack.Screen name={RouteKey.LanguageSelect} component={LanguageSelect} />
<Stack.Screen name={RouteKey.Game} component={SelectPackages} />
<Stack.Screen name={RouteKey.Game} component={Game} />
<Stack.Screen name={RouteKey.Setting} component={Setting} />
<Stack.Screen name={RouteKey.PrivacyPolicy} component={PrivacyPolicy} />
<Stack.Screen name={RouteKey.UseOfTerms} component={UseOfTerms} />

27
src/module/root/screens/game.tsx

@ -1,29 +1,26 @@ @@ -1,29 +1,26 @@
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {
colors,
Header,
RouteKey,
ScreenLayout,
IRouteParams,
} from '../../shared';
import React from 'react';
import {colors, Header, RouteKey, ScreenLayout, useNav} from '../../shared';
import React, {FC} from 'react';
import {NameTitle} from '../../shared/components/name-title/name-title';
import {RedButton} from '../../shared/components/buttons/red-button';
import {useTranslation} from 'react-i18next';
interface IProps extends IRouteParams {}
import {useRoute} from '@react-navigation/native';
export const Game: React.FC<IProps> = ({navigation, route}) => {
const {title} = route.params;
export const Game: FC = () => {
const {t} = useTranslation();
const nav = useNav();
const {params}: any = useRoute();
const title = params.title;
const goBack = () => {
navigation.navigate(RouteKey.Game);
nav.navigate(RouteKey.Package);
};
const randomGame = () => {
const isQuestions = Math.random() < 0.5;
navigation.navigate(RouteKey.Questions, {isQuestions, title});
nav.navigate(RouteKey.Questions, {isQuestions, title});
};
return (
@ -43,8 +40,6 @@ export const Game: React.FC<IProps> = ({navigation, route}) => { @@ -43,8 +40,6 @@ export const Game: React.FC<IProps> = ({navigation, route}) => {
<RedButton
name={t('buttonsTranslation.truth')}
isQuestions={true}
navigation={navigation}
route={route}
title={title}
/>
<TouchableOpacity onPress={randomGame}>
@ -53,8 +48,6 @@ export const Game: React.FC<IProps> = ({navigation, route}) => { @@ -53,8 +48,6 @@ export const Game: React.FC<IProps> = ({navigation, route}) => {
<RedButton
name={t('buttonsTranslation.dare')}
isQuestions={false}
navigation={navigation}
route={route}
title={title}
/>
</View>

38
src/module/root/screens/loading-screen.tsx

@ -1,22 +1,15 @@ @@ -1,22 +1,15 @@
import {
ActivityIndicator,
Animated,
StyleSheet,
Text,
View,
} from 'react-native';
import React, {FC, useEffect, useState} from 'react';
import {ScreenLayout, colors, RouteKey} from '../../shared';
import {ActivityIndicator, StyleSheet, View} from 'react-native';
import React, {useEffect} from 'react';
import {ScreenLayout, colors, RouteKey, useNav} from '../../shared';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {useNavigation, CommonActions} from '@react-navigation/native';
import {StorageKey, storageService} from '../../services/async-storage.service';
import {StorageKey} from '../../services/async-storage.service';
import {useTranslation} from 'react-i18next';
import {useAppDispatch} from '../../../store/hooks';
import {fetchPostsAsync} from '../../services/game-items/game-items-slice';
export const LoadingScreen = () => {
const {i18n} = useTranslation();
const navigate = useNavigation();
const nav = useNav();
const dispatch = useAppDispatch();
@ -42,26 +35,11 @@ export const LoadingScreen = () => { @@ -42,26 +35,11 @@ export const LoadingScreen = () => {
}
if (isOnBoard && language) {
navigate.dispatch(
CommonActions.reset({
index: 0,
routes: [{name: RouteKey.Game}],
}),
);
nav.navigate(RouteKey.Package);
} else if (language && !isOnBoard) {
navigate.dispatch(
CommonActions.reset({
index: 0,
routes: [{name: RouteKey.Onboarding}],
}),
);
nav.navigate(RouteKey.Onboarding);
} else if (!language) {
navigate.dispatch(
CommonActions.reset({
index: 0,
routes: [{name: RouteKey.LanguageSelect}],
}),
);
nav.navigate(RouteKey.LanguageSelect);
}
};

12
src/module/root/screens/on-boarding.screen.tsx

@ -6,17 +6,20 @@ import { @@ -6,17 +6,20 @@ import {
colors,
ScreenLayout,
} from '../../shared';
import {ContentOnBoarding} from '../components';
interface IProps extends IRouteParams {}
export const Onboarding: FC<IProps> = ({navigation}) => {
const [currentIndex, setCurrentIndex] = useState(0);
const onPressItem = (data: any) => {
const nextIndex = currentIndex + 1;
if (nextIndex < data.length) {
setCurrentIndex(nextIndex);
}
};
const goBack = () => {
if (currentIndex < 1) {
navigation.navigate(RouteKey.LanguageSelect);
@ -24,6 +27,7 @@ export const Onboarding: FC<IProps> = ({navigation}) => { @@ -24,6 +27,7 @@ export const Onboarding: FC<IProps> = ({navigation}) => {
setCurrentIndex(currentIndex - 1);
}
};
return (
<ScreenLayout
backgroundColor={colors.primaryColor}
@ -34,12 +38,6 @@ export const Onboarding: FC<IProps> = ({navigation}) => { @@ -34,12 +38,6 @@ export const Onboarding: FC<IProps> = ({navigation}) => {
leftIcon="arrow"
onPressLeft={() => goBack()}
rightIcon="none"
// onPressRight={() =>
// {console.log('Option');
// navigation.navigate(RouteKey.Setting, {
// previous_screen: RouteKey.Onboarding,
// })}
// }
/>
}>
<ContentOnBoarding

29
src/module/root/screens/questions.tsx

@ -1,18 +1,11 @@ @@ -1,18 +1,11 @@
import {
StyleSheet,
Text,
TouchableOpacity,
View,
Image,
Modal,
} from 'react-native';
import {StyleSheet, View, Image} from 'react-native';
import {
colors,
Header,
RouteKey,
ScreenLayout,
IRouteParams,
PrimaryBtn,
useNav,
} from '../../shared';
import React, {useState} from 'react';
import {NameTitle} from '../../shared/components/name-title/name-title';
@ -23,24 +16,24 @@ import { @@ -23,24 +16,24 @@ import {
nextStep,
resetSteps,
} from '../../services/current-step/current-step-slice';
import {shuffleTruths} from '../../services/truths/truth-slice';
import {shuffleDares} from '../../services/dares/dares-slice';
import {shuffleItems} from '../../services/game-items/game-items-slice';
interface IProps extends IRouteParams {}
import {useRoute} from '@react-navigation/native';
export const Questions: React.FC<IProps> = ({navigation, route}) => {
export const Questions: React.FC = () => {
const [isVisible, setIsVisible] = useState(false);
const nav = useNav();
const {params}: any = useRoute();
const dispatch = useAppDispatch();
const {title, isQuestions} = params;
const {title} = route.params;
const dispatch = useAppDispatch();
const goBack = () => {
navigation.navigate(RouteKey.Game);
nav.navigate(RouteKey.Game, {title});
};
const goGameScreen = () => {
navigation.navigate(RouteKey.Package, {title});
nav.navigate(RouteKey.Package);
dispatch(nextStep());
};
@ -69,7 +62,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => { @@ -69,7 +62,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => {
title={title}
/>
<NameTitle name="Player" />
<QuestionBlock isQuestions={route.params.isQuestions} />
<QuestionBlock isQuestions={isQuestions} />
<MainModal
isVisible={isVisible}
rate={true}

28
src/module/root/screens/settings.screen.tsx

@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
import React, {FC} from 'react';
import { useTranslation } from 'react-i18next';
import {StyleSheet, View} from 'react-native';
import {useTranslation} from 'react-i18next';
import {View} from 'react-native';
import {SettingsItem} from '../../setting/components/Settings-Item.component';
import {SettingsData} from '../../setting/config/data-setting.config';
import {Header, IRouteParams, colors, ScreenLayout} from '../../shared';
import {Header, IRouteParams, colors, ScreenLayout, useNav} from '../../shared';
interface IProps extends IRouteParams {}
export const Setting: FC<IProps> = ({route, navigation}) => {
const {previous_screen, title} = route.params;
export const Setting: FC<IProps> = () => {
const nav = useNav();
const {t} = useTranslation();
@ -21,7 +21,7 @@ export const Setting: FC<IProps> = ({route, navigation}) => { @@ -21,7 +21,7 @@ export const Setting: FC<IProps> = ({route, navigation}) => {
leftIcon="arrow"
rightIcon="inst"
title={t('pageTitles.setting')}
onPressLeft={() => navigation.navigate(previous_screen)}
onPressLeft={() => nav.goBack()}
/>
}>
<View>
@ -37,19 +37,3 @@ export const Setting: FC<IProps> = ({route, navigation}) => { @@ -37,19 +37,3 @@ export const Setting: FC<IProps> = ({route, navigation}) => {
</ScreenLayout>
);
};
const styles = StyleSheet.create({
title: {
fontSize: 24,
color: '#99EDCC',
fontWeight: 'bold',
},
button: {
flex: 0,
width: 22,
height: 22,
alignSelf: 'center',
alignItems: 'center',
justifyContent: 'center',
},
});

0
src/module/shared/atoms/index.ts

17
src/module/shared/components/buttons/red-button.tsx

@ -1,28 +1,21 @@ @@ -1,28 +1,21 @@
import {useNavigation} from '@react-navigation/native';
import React from 'react';
import {StyleSheet, TouchableOpacity, Text} from 'react-native';
import {colors} from '../../colors';
import {RouteKey} from '../../enums';
import {IRouteParams} from '../../interfaces';
import {useNav} from '../../hooks';
interface IProps extends IRouteParams {
interface IProps {
name: string;
isQuestions: boolean;
title: string;
}
export const RedButton: React.FC<IProps> = ({
name,
isQuestions,
navigation,
title,
}) => {
export const RedButton: React.FC<IProps> = ({name, isQuestions, title}) => {
const nav = useNav();
return (
<TouchableOpacity
style={styles.container}
onPress={() =>
navigation.navigate(RouteKey.Questions, {isQuestions, title})
}>
onPress={() => nav.navigate(RouteKey.Questions, {isQuestions, title})}>
<Text style={styles.title}>{name}</Text>
</TouchableOpacity>
);

1
src/module/shared/hooks/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './use-nav.hook';

11
src/module/shared/hooks/use-nav.hook.ts

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
import {useNavigation as useNavigationNative} from '@react-navigation/native';
type UseNavigation = () => {
navigate: (key: string, params?: Record<any, any>) => void;
push: (key: string, params?: Record<any, any>) => void;
goBack: () => void;
reset: any;
dispatch: any;
};
export const useNav = useNavigationNative as UseNavigation;

2
src/module/shared/index.ts

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
export * from './atoms';
export * from './colors';
export * from './components';
export * from './config';
export * from './enums';
export * from './helpers';
export * from './interfaces';
export * from './hooks';

1
truth

@ -1 +0,0 @@ @@ -1 +0,0 @@
Subproject commit 2c7879e7d0397394a84d3cd6ed7a4007ca19ef24

27
vendor/bundle/ruby/2.7.0/bin/fuzzy_match vendored

@ -1,27 +0,0 @@ @@ -1,27 +0,0 @@
#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'fuzzy_match' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('fuzzy_match', 'fuzzy_match', version)
else
gem "fuzzy_match", version
load Gem.bin_path("fuzzy_match", "fuzzy_match", version)
end

27
vendor/bundle/ruby/2.7.0/bin/httpclient vendored

@ -1,27 +0,0 @@ @@ -1,27 +0,0 @@
#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'httpclient' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('httpclient', 'httpclient', version)
else
gem "httpclient", version
load Gem.bin_path("httpclient", "httpclient", version)
end

27
vendor/bundle/ruby/2.7.0/bin/pod vendored

@ -1,27 +0,0 @@ @@ -1,27 +0,0 @@
#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'cocoapods' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('cocoapods', 'pod', version)
else
gem "cocoapods", version
load Gem.bin_path("cocoapods", "pod", version)
end

23
vendor/bundle/ruby/2.7.0/bin/ruby_executable_hooks vendored

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
#!/usr/bin/env ruby
title = "ruby #{ARGV*" "}"
$0 = ARGV.shift
Process.setproctitle(title) if Process.methods.include?(:setproctitle)
require 'rubygems'
begin
require 'executable-hooks/hooks'
Gem::ExecutableHooks.run($0)
rescue LoadError
warn "unable to load executable-hooks/hooks" if ENV.key?('ExecutableHooks_DEBUG')
end unless $0.end_with?('/executable-hooks-uninstaller')
content = File.read($0)
if (index = content.index("\n#!ruby\n")) && index > 0
skipped_content = content.slice!(0..index)
start_line = skipped_content.count("\n") + 1
eval content, binding, $0, start_line
else
eval content, binding, $0
end

27
vendor/bundle/ruby/2.7.0/bin/sandbox-pod vendored

@ -1,27 +0,0 @@ @@ -1,27 +0,0 @@
#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'cocoapods' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('cocoapods', 'sandbox-pod', version)
else
gem "cocoapods", version
load Gem.bin_path("cocoapods", "sandbox-pod", version)
end

27
vendor/bundle/ruby/2.7.0/bin/xcodeproj vendored

@ -1,27 +0,0 @@ @@ -1,27 +0,0 @@
#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'xcodeproj' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('xcodeproj', 'xcodeproj', version)
else
gem "xcodeproj", version
load Gem.bin_path("xcodeproj", "xcodeproj", version)
end

BIN
vendor/bundle/ruby/2.7.0/cache/CFPropertyList-3.0.5.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/activesupport-6.1.5.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/addressable-2.8.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/algoliasearch-1.27.5.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/atomos-0.1.3.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/claide-1.1.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-1.11.3.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-core-1.11.3.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-deintegrate-1.0.5.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-downloader-1.5.1.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-plugins-1.0.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-search-1.0.1.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-trunk-1.6.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/cocoapods-try-1.2.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/colored2-3.1.2.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/concurrent-ruby-1.1.9.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/escape-0.0.4.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/ethon-0.15.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/ffi-1.15.5.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/fourflusher-2.3.1.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/fuzzy_match-2.0.4.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/gh_inspector-1.1.3.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/httpclient-2.8.3.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/i18n-1.10.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/json-2.6.1.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/minitest-5.15.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/molinillo-0.8.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/nanaimo-0.3.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/nap-1.1.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/netrc-0.11.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/public_suffix-4.0.6.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/rexml-3.2.5.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/ruby-macho-2.5.1.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/typhoeus-1.4.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/tzinfo-2.0.4.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/xcodeproj-1.21.0.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/cache/zeitwerk-2.5.4.gem vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/ffi_c.bundle vendored

Binary file not shown.

0
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/gem.build_complete vendored

4090
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/gem_make.out vendored

File diff suppressed because it is too large Load Diff

229
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/ffi-1.15.5/mkmf.log vendored

@ -1,229 +0,0 @@ @@ -1,229 +0,0 @@
"pkg-config --exists libffi"
| pkg-config --libs libffi
=> "-lffi\n"
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.7 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.7 -lffi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
| pkg-config --cflags-only-I libffi
=> "-I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi\n"
| pkg-config --cflags-only-other libffi
=> "\n"
| pkg-config --libs-only-l libffi
=> "-lffi\n"
package configuration for libffi
incflags: -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi
cflags:
ldflags:
libs: -lffi
have_library: checking for ffi_prep_closure_loc() in -lffi... -------------------- yes
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lruby.2.7 -lffi -lffi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ffi.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: int (* volatile tp)(void)=(int (*)(void))&t;
11: printf("%d", (*tp)());
12: }
13:
14: return !!argv[argc];
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_closure_loc; return !p; }
/* end */
--------------------
have_func: checking for ffi_prep_cif_var()... -------------------- yes
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lffi -lruby.2.7 -lffi -lffi "
conftest.c:14:57: error: use of undeclared identifier 'ffi_prep_cif_var'
int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_cif_var; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_cif_var; return !p; }
/* end */
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lffi -lruby.2.7 -lffi -lffi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: extern void ffi_prep_cif_var();
15: int t(void) { ffi_prep_cif_var(); return 0; }
/* end */
--------------------
have_func: checking for ffi_raw_call()... -------------------- yes
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lffi -lruby.2.7 -lffi -lffi "
conftest.c:14:57: error: use of undeclared identifier 'ffi_raw_call'
int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_raw_call; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_raw_call; return !p; }
/* end */
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lffi -lruby.2.7 -lffi -lffi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: extern void ffi_raw_call();
15: int t(void) { ffi_raw_call(); return 0; }
/* end */
--------------------
have_func: checking for ffi_prep_raw_closure()... -------------------- yes
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lffi -lruby.2.7 -lffi -lffi "
conftest.c:14:57: error: use of undeclared identifier 'ffi_prep_raw_closure'
int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_raw_closure; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_raw_closure; return !p; }
/* end */
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lffi -lruby.2.7 -lffi -lffi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: extern void ffi_prep_raw_closure();
15: int t(void) { ffi_prep_raw_closure(); return 0; }
/* end */
--------------------
block in append_ldflags: checking for whether -pthread is accepted as LDFLAGS... -------------------- yes
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lffi -lffi -lruby.2.7 -pthread "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
--------------------
extconf.h is:
/* begin */
1: #ifndef EXTCONF_H
2: #define EXTCONF_H
3: #define HAVE_FFI_PREP_CIF_VAR 1
4: #define HAVE_FFI_RAW_CALL 1
5: #define HAVE_FFI_PREP_RAW_CLOSURE 1
6: #define HAVE_RAW_API 1
7: #endif
/* end */

0
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/gem.build_complete vendored

13
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/gem_make.out vendored

@ -1,13 +0,0 @@ @@ -1,13 +0,0 @@
current directory: /Users/mac/work/truthordare/vendor/bundle/ruby/2.7.0/gems/json-2.6.1/ext/json
/Users/mac/.rvm/rubies/ruby-2.7.4/bin/ruby -I /Users/mac/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0 -r ./siteconf20230203-22685-1uqct8.rb extconf.rb
creating Makefile
current directory: /Users/mac/work/truthordare/vendor/bundle/ruby/2.7.0/gems/json-2.6.1/ext/json
make "DESTDIR=" clean
current directory: /Users/mac/work/truthordare/vendor/bundle/ruby/2.7.0/gems/json-2.6.1/ext/json
make "DESTDIR="
make: Nothing to be done for `all'.
current directory: /Users/mac/work/truthordare/vendor/bundle/ruby/2.7.0/gems/json-2.6.1/ext/json
make "DESTDIR=" install

BIN
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/json/ext/generator.bundle vendored

Binary file not shown.

BIN
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/json/ext/parser.bundle vendored

Binary file not shown.

118
vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-21/2.7.0/json-2.6.1/mkmf.log vendored

@ -1,118 +0,0 @@ @@ -1,118 +0,0 @@
have_func: checking for rb_enc_raise() in ruby.h... -------------------- yes
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.7 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.7 "
conftest.c:16:57: error: use of undeclared identifier 'rb_enc_raise'
int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_enc_raise; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: int (* volatile tp)(void)=(int (*)(void))&t;
11: printf("%d", (*tp)());
12: }
13:
14: return !!argv[argc];
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_enc_raise; return !p; }
/* end */
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.7 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: int (* volatile tp)(void)=(int (*)(void))&t;
11: printf("%d", (*tp)());
12: }
13:
14: return !!argv[argc];
15: }
16: extern void rb_enc_raise();
17: int t(void) { rb_enc_raise(); return 0; }
/* end */
--------------------
have_func: checking for rb_enc_interned_str() in ruby.h... -------------------- no
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.7 "
conftest.c:16:57: error: use of undeclared identifier 'rb_enc_interned_str'
int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_enc_interned_str; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: int (* volatile tp)(void)=(int (*)(void))&t;
11: printf("%d", (*tp)());
12: }
13:
14: return !!argv[argc];
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_enc_interned_str; return !p; }
/* end */
"gcc -o conftest -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/x86_64-darwin21 -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/backward -I/Users/mac/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -O2 -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-2.7.4/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.7 "
Undefined symbols for architecture x86_64:
"_rb_enc_interned_str", referenced from:
_t in conftest-26355a.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: int (* volatile tp)(void)=(int (*)(void))&t;
11: printf("%d", (*tp)());
12: }
13:
14: return !!argv[argc];
15: }
16: extern void rb_enc_interned_str();
17: int t(void) { rb_enc_interned_str(); return 0; }
/* end */
--------------------

19
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/LICENSE vendored

@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
Copyright (c) 2010 Christian Kruse, <cjk@wwwtech.de>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

79
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/README.md vendored

@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
CFPropertyList implementation
class to read, manipulate and write both XML and binary property list
files (plist(5)) as defined by Apple. Have a look at CFPropertyList::List
for more documentation.
# Caution!
In version 3.0.0 we dropped Ruby 1.8 compatibility. If you are using
Ruby 1.8 consider to update Ruby; if you can't upgrade, don't upgrade
CFPropertyList.
# Installation
You could either use ruby gems and install it via
```bash
gem install CFPropertyList
```
or you could clone this repository and place it somewhere in your load path.
Example:
```ruby
require 'cfpropertylist'
```
If you're using Rails, you can add it into your Gemfile
```ruby
gem 'CFPropertyList'
```
# Usage
## create a arbitrary data structure of basic data types
```ruby
data = {
'name' => 'John Doe',
'missing' => true,
'last_seen' => Time.now,
'friends' => ['Jane Doe','Julian Doe'],
'likes' => {
'me' => false
}
}
```
## create CFPropertyList::List object
```ruby
plist = CFPropertyList::List.new
```
## call CFPropertyList.guess() to create corresponding CFType values
```ruby
plist.value = CFPropertyList.guess(data)
```
## write plist to file
```ruby
plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY)
```
## … later, read it again
```ruby
plist = CFPropertyList::List.new(:file => "example.plist")
data = CFPropertyList.native_types(plist.value)
```
# Author and license
**Author:** Christian Kruse (mailto:cjk@wwwtech.de)
**Copyright:** Copyright (c) 2010
**License:** MIT License

43
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/README.rdoc vendored

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
CFPropertyList implementation
class to read, manipulate and write both XML and binary property list
files (plist(5)) as defined by Apple. Have a look at CFPropertyList::List
for more documentation.
== Installation
You could either use ruby gems and install it via
gem install CFPropertyList
or you could clone this repository and place it somewhere in your load path.
== Example
require 'cfpropertylist'
# create a arbitrary data structure of basic data types
data = {
'name' => 'John Doe',
'missing' => true,
'last_seen' => Time.now,
'friends' => ['Jane Doe','Julian Doe'],
'likes' => {
'me' => false
}
}
# create CFPropertyList::List object
plist = CFPropertyList::List.new
# call CFPropertyList.guess() to create corresponding CFType values
plist.value = CFPropertyList.guess(data)
# write plist to file
plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY)
# … later, read it again
plist = CFPropertyList::List.new(:file => "example.plist")
data = CFPropertyList.native_types(plist.value)
Author:: Christian Kruse (mailto:cjk@wwwtech.de)
Copyright:: Copyright (c) 2010
License:: MIT License

7
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/THANKS vendored

@ -1,7 +0,0 @@ @@ -1,7 +0,0 @@
Special thanks to:
Steve Madsen for providing a lot of performance patches and bugfixes!
Have a look at his Github account: <http://github.com/sjmadsen>

6
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist.rb vendored

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# -*- coding: utf-8 -*-
require 'cfpropertylist/rbCFPropertyList'
# eof

594
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbBinaryCFPropertyList.rb vendored

@ -1,594 +0,0 @@ @@ -1,594 +0,0 @@
# -*- coding: utf-8 -*-
require 'stringio'
module CFPropertyList
# Binary PList parser class
class Binary
# Read a binary plist file
def load(opts)
@unique_table = {}
@count_objects = 0
@object_refs = 0
@written_object_count = 0
@object_table = []
@object_ref_size = 0
@offsets = []
fd = nil
if(opts.has_key?(:file))
fd = File.open(opts[:file],"rb")
file = opts[:file]
else
fd = StringIO.new(opts[:data],"rb")
file = "<string>"
end
# first, we read the trailer: 32 byte from the end
fd.seek(-32,IO::SEEK_END)
buff = fd.read(32)
offset_size, object_ref_size, number_of_objects, top_object, table_offset = buff.unpack "x6CCx4Nx4Nx4N"
# after that, get the offset table
fd.seek(table_offset, IO::SEEK_SET)
coded_offset_table = fd.read(number_of_objects * offset_size)
raise CFFormatError.new("#{file}: Format error!") unless coded_offset_table.bytesize == number_of_objects * offset_size
@count_objects = number_of_objects
# decode offset table
if(offset_size != 3)
formats = ["","C*","n*","","N*"]
@offsets = coded_offset_table.unpack(formats[offset_size])
else
@offsets = coded_offset_table.unpack("C*").each_slice(3).map {
|x,y,z| (x << 16) | (y << 8) | z
}
end
@object_ref_size = object_ref_size
val = read_binary_object_at(file,fd,top_object)
fd.close
val
end
# Convert CFPropertyList to binary format; since we have to count our objects we simply unique CFDictionary and CFArray
def to_str(opts={})
@unique_table = {}
@count_objects = 0
@object_refs = 0
@written_object_count = 0
@object_table = []
@offsets = []
binary_str = "bplist00"
@object_refs = count_object_refs(opts[:root])
opts[:root].to_binary(self)
next_offset = 8
offsets = @object_table.map do |object|
offset = next_offset
next_offset += object.bytesize
offset
end
binary_str << @object_table.join
table_offset = next_offset
offset_size = Binary.bytes_needed(table_offset)
if offset_size < 8
# Fast path: encode the entire offset array at once.
binary_str << offsets.pack((%w(C n N N)[offset_size - 1]) + '*')
else
# Slow path: host may be little or big endian, must pack each offset
# separately.
offsets.each do |offset|
binary_str << "#{Binary.pack_it_with_size(offset_size,offset)}"
end
end
binary_str << [offset_size, object_ref_size(@object_refs)].pack("x6CC")
binary_str << [@object_table.size].pack("x4N")
binary_str << [0].pack("x4N")
binary_str << [table_offset].pack("x4N")
binary_str
end
def object_ref_size object_refs
Binary.bytes_needed(object_refs)
end
# read a „null” type (i.e. null byte, marker byte, bool value)
def read_binary_null_type(length)
case length
when 0 then 0 # null byte
when 8 then CFBoolean.new(false)
when 9 then CFBoolean.new(true)
when 15 then 15 # fill type
else
raise CFFormatError.new("unknown null type: #{length}")
end
end
protected :read_binary_null_type
# read a binary int value
def read_binary_int(fname,fd,length)
if length > 4
raise CFFormatError.new("Integer greater than 16 bytes: #{length}")
end
nbytes = 1 << length
buff = fd.read(nbytes)
CFInteger.new(
case length
when 0 then buff.unpack("C")[0]
when 1 then buff.unpack("n")[0]
when 2 then buff.unpack("N")[0]
# 8 byte integers are always signed
when 3 then buff.unpack("q>")[0]
# 16 byte integers are used to represent unsigned 8 byte integers
# where the unsigned value is stored in the lower 8 bytes and the
# upper 8 bytes are unused.
when 4 then buff.unpack("Q>Q>")[1]
end
)
end
protected :read_binary_int
# read a binary real value
def read_binary_real(fname,fd,length)
raise CFFormatError.new("Real greater than 8 bytes: #{length}") if length > 3
nbytes = 1 << length
buff = fd.read(nbytes)
CFReal.new(
case length
when 0 # 1 byte float? must be an error
raise CFFormatError.new("got #{length+1} byte float, must be an error!")
when 1 # 2 byte float? must be an error
raise CFFormatError.new("got #{length+1} byte float, must be an error!")
when 2 then
buff.reverse.unpack("e")[0]
when 3 then
buff.reverse.unpack("E")[0]
else
fail "unexpected length: #{length}"
end
)
end
protected :read_binary_real
# read a binary date value
def read_binary_date(fname,fd,length)
raise CFFormatError.new("Date greater than 8 bytes: #{length}") if length > 3
nbytes = 1 << length
buff = fd.read(nbytes)
CFDate.new(
case length
when 0 then # 1 byte CFDate is an error
raise CFFormatError.new("#{length+1} byte CFDate, error")
when 1 then # 2 byte CFDate is an error
raise CFFormatError.new("#{length+1} byte CFDate, error")
when 2 then
buff.reverse.unpack("e")[0]
when 3 then
buff.reverse.unpack("E")[0]
end,
CFDate::TIMESTAMP_APPLE
)
end
protected :read_binary_date
# Read a binary data value
def read_binary_data(fname,fd,length)
CFData.new(read_fd(fd, length), CFData::DATA_RAW)
end
protected :read_binary_data
def read_fd fd, length
length > 0 ? fd.read(length) : ""
end
# Read a binary string value
def read_binary_string(fname,fd,length)
buff = read_fd fd, length
@unique_table[buff] = true unless @unique_table.has_key?(buff)
CFString.new(buff)
end
protected :read_binary_string
# Convert the given string from one charset to another
def Binary.charset_convert(str,from,to="UTF-8")
return str.dup.force_encoding(from).encode(to) if str.respond_to?("encode")
Iconv.conv(to,from,str)
end
# Count characters considering character set
def Binary.charset_strlen(str,charset="UTF-8")
if str.respond_to?(:encode)
size = str.length
else
utf8_str = Iconv.conv("UTF-8",charset,str)
size = utf8_str.scan(/./mu).size
end
# UTF-16 code units in the range D800-DBFF are the beginning of
# a surrogate pair, and count as one additional character for
# length calculation.
if charset =~ /^UTF-16/
if str.respond_to?(:encode)
str.bytes.to_a.each_slice(2) { |pair| size += 1 if (0xd8..0xdb).include?(pair[0]) }
else
str.split('').each_slice(2) { |pair| size += 1 if ("\xd8".."\xdb").include?(pair[0]) }
end
end
size
end
# Read a unicode string value, coded as UTF-16BE
def read_binary_unicode_string(fname,fd,length)
# The problem is: we get the length of the string IN CHARACTERS;
# since a char in UTF-16 can be 16 or 32 bit long, we don't really know
# how long the string is in bytes
buff = fd.read(2*length)
@unique_table[buff] = true unless @unique_table.has_key?(buff)
CFString.new(Binary.charset_convert(buff,"UTF-16BE","UTF-8"))
end
protected :read_binary_unicode_string
def unpack_with_size(nbytes, buff)
format = ["C*", "n*", "N*", "N*"][nbytes - 1];
if nbytes == 3
buff = "\0" + buff.scan(/.{1,3}/).join("\0")
end
return buff.unpack(format)
end
# Read an binary array value, including contained objects
def read_binary_array(fname,fd,length)
ary = []
# first: read object refs
if(length != 0)
buff = fd.read(length * @object_ref_size)
objects = unpack_with_size(@object_ref_size, buff) #buff.unpack(@object_ref_size == 1 ? "C*" : "n*")
# now: read objects
0.upto(length-1) do |i|
object = read_binary_object_at(fname,fd,objects[i])
ary.push object
end
end
CFArray.new(ary)
end
protected :read_binary_array
# Read a dictionary value, including contained objects
def read_binary_dict(fname,fd,length)
dict = {}
# first: read keys
if(length != 0) then
buff = fd.read(length * @object_ref_size)
keys = unpack_with_size(@object_ref_size, buff)
# second: read object refs
buff = fd.read(length * @object_ref_size)
objects = unpack_with_size(@object_ref_size, buff)
# read real keys and objects
0.upto(length-1) do |i|
key = read_binary_object_at(fname,fd,keys[i])
object = read_binary_object_at(fname,fd,objects[i])
dict[key.value] = object
end
end
CFDictionary.new(dict)
end
protected :read_binary_dict
# Read an object type byte, decode it and delegate to the correct
# reader function
def read_binary_object(fname,fd)
# first: read the marker byte
buff = fd.read(1)
object_length = buff.unpack("C*")
object_length = object_length[0] & 0xF
buff = buff.unpack("H*")
object_type = buff[0][0].chr
if(object_type != "0" && object_length == 15) then
object_length = read_binary_object(fname,fd)
object_length = object_length.value
end
case object_type
when '0' # null, false, true, fillbyte
read_binary_null_type(object_length)
when '1' # integer
read_binary_int(fname,fd,object_length)
when '2' # real
read_binary_real(fname,fd,object_length)
when '3' # date
read_binary_date(fname,fd,object_length)
when '4' # data
read_binary_data(fname,fd,object_length)
when '5' # byte string, usually utf8 encoded
read_binary_string(fname,fd,object_length)
when '6' # unicode string (utf16be)
read_binary_unicode_string(fname,fd,object_length)
when '8'
CFUid.new(read_binary_int(fname, fd, object_length).value)
when 'a' # array
read_binary_array(fname,fd,object_length)
when 'd' # dictionary
read_binary_dict(fname,fd,object_length)
end
end
protected :read_binary_object
# Read an object type byte at position $pos, decode it and delegate to the correct reader function
def read_binary_object_at(fname,fd,pos)
position = @offsets[pos]
fd.seek(position,IO::SEEK_SET)
read_binary_object(fname,fd)
end
protected :read_binary_object_at
# pack an +int+ of +nbytes+ with size
def Binary.pack_it_with_size(nbytes,int)
case nbytes
when 1 then [int].pack('c')
when 2 then [int].pack('n')
when 4 then [int].pack('N')
when 8
[int >> 32, int & 0xFFFFFFFF].pack('NN')
else
raise CFFormatError.new("Don't know how to pack #{nbytes} byte integer")
end
end
def Binary.pack_int_array_with_size(nbytes, array)
case nbytes
when 1 then array.pack('C*')
when 2 then array.pack('n*')
when 4 then array.pack('N*')
when 8
array.map { |int| [int >> 32, int & 0xFFFFFFFF].pack('NN') }.join
else
raise CFFormatError.new("Don't know how to pack #{nbytes} byte integer")
end
end
# calculate how many bytes are needed to save +count+
def Binary.bytes_needed(count)
case
when count < 2**8 then 1
when count < 2**16 then 2
when count < 2**32 then 4
when count < 2**64 then 8
else
raise CFFormatError.new("Data size too large: #{count}")
end
end
# Create a type byte for binary format as defined by apple
def Binary.type_bytes(type, length)
if length < 15
[(type << 4) | length].pack('C')
else
bytes = [(type << 4) | 0xF]
if length <= 0xFF
bytes.push(0x10, length).pack('CCC') # 1 byte length
elsif length <= 0xFFFF
bytes.push(0x11, length).pack('CCn') # 2 byte length
elsif length <= 0xFFFFFFFF
bytes.push(0x12, length).pack('CCN') # 4 byte length
elsif length <= 0x7FFFFFFFFFFFFFFF
bytes.push(0x13, length >> 32, length & 0xFFFFFFFF).pack('CCNN') # 8 byte length
else
raise CFFormatError.new("Integer too large: #{int}")
end
end
end
def count_object_refs(object)
case object
when CFArray
contained_refs = 0
object.value.each do |element|
if CFArray === element || CFDictionary === element
contained_refs += count_object_refs(element)
end
end
return object.value.size + contained_refs
when CFDictionary
contained_refs = 0
object.value.each_value do |value|
if CFArray === value || CFDictionary === value
contained_refs += count_object_refs(value)
end
end
return object.value.keys.size * 2 + contained_refs
else
return 0
end
end
def Binary.ascii_string?(str)
if str.respond_to?(:ascii_only?)
str.ascii_only?
else
str !~ /[\x80-\xFF]/mn
end
end
# Uniques and transforms a string value to binary format and adds it to the object table
def string_to_binary(val)
val = val.to_s
@unique_table[val] ||= begin
if !Binary.ascii_string?(val)
val = Binary.charset_convert(val,"UTF-8","UTF-16BE")
bdata = Binary.type_bytes(0b0110, Binary.charset_strlen(val,"UTF-16BE"))
val.force_encoding("ASCII-8BIT") if val.respond_to?("encode")
@object_table[@written_object_count] = bdata << val
else
bdata = Binary.type_bytes(0b0101,val.bytesize)
@object_table[@written_object_count] = bdata << val
end
@written_object_count += 1
@written_object_count - 1
end
end
# Codes an integer to binary format
def int_to_binary(value)
# Note: nbytes is actually an exponent. number of bytes = 2**nbytes.
nbytes = 0
nbytes = 1 if value > 0xFF # 1 byte unsigned integer
nbytes += 1 if value > 0xFFFF # 4 byte unsigned integer
nbytes += 1 if value > 0xFFFFFFFF # 8 byte unsigned integer
nbytes += 1 if value > 0x7FFFFFFFFFFFFFFF # 8 byte unsigned integer, stored in lower half of 16 bytes
nbytes = 3 if value < 0 # signed integers always stored in 8 bytes
Binary.type_bytes(0b0001, nbytes) <<
if nbytes < 4
[value].pack(["C", "n", "N", "q>"][nbytes])
else # nbytes == 4
[0,value].pack("Q>Q>")
end
end
# Codes a real value to binary format
def real_to_binary(val)
Binary.type_bytes(0b0010,3) << [val].pack("E").reverse
end
# Converts a numeric value to binary and adds it to the object table
def num_to_binary(value)
@object_table[@written_object_count] =
if value.is_a?(CFInteger)
int_to_binary(value.value)
else
real_to_binary(value.value)
end
@written_object_count += 1
@written_object_count - 1
end
def uid_to_binary(value)
nbytes = 0
nbytes = 1 if value > 0xFF # 1 byte integer
nbytes += 1 if value > 0xFFFF # 4 byte integer
nbytes += 1 if value > 0xFFFFFFFF # 8 byte integer
nbytes = 3 if value < 0 # 8 byte integer, since signed
@object_table[@written_object_count] = Binary.type_bytes(0b1000, nbytes) <<
if nbytes < 3
[value].pack(
if nbytes == 0 then "C"
elsif nbytes == 1 then "n"
else "N"
end
)
else
# 64 bit signed integer; we need the higher and the lower 32 bit of the value
high_word = value >> 32
low_word = value & 0xFFFFFFFF
[high_word,low_word].pack("NN")
end
@written_object_count += 1
@written_object_count - 1
end
# Convert date value (apple format) to binary and adds it to the object table
def date_to_binary(val)
val = val.getutc.to_f - CFDate::DATE_DIFF_APPLE_UNIX # CFDate is a real, number of seconds since 01/01/2001 00:00:00 GMT
@object_table[@written_object_count] =
(Binary.type_bytes(0b0011, 3) << [val].pack("E").reverse)
@written_object_count += 1
@written_object_count - 1
end
# Convert a bool value to binary and add it to the object table
def bool_to_binary(val)
@object_table[@written_object_count] = val ? "\x9" : "\x8" # 0x9 is 1001, type indicator for true; 0x8 is 1000, type indicator for false
@written_object_count += 1
@written_object_count - 1
end
# Convert data value to binary format and add it to the object table
def data_to_binary(val)
@object_table[@written_object_count] =
(Binary.type_bytes(0b0100, val.bytesize) << val)
@written_object_count += 1
@written_object_count - 1
end
# Convert array to binary format and add it to the object table
def array_to_binary(val)
saved_object_count = @written_object_count
@written_object_count += 1
#@object_refs += val.value.size
values = val.value.map { |v| v.to_binary(self) }
bdata = Binary.type_bytes(0b1010, val.value.size) <<
Binary.pack_int_array_with_size(object_ref_size(@object_refs),
values)
@object_table[saved_object_count] = bdata
saved_object_count
end
# Convert dictionary to binary format and add it to the object table
def dict_to_binary(val)
saved_object_count = @written_object_count
@written_object_count += 1
#@object_refs += val.value.keys.size * 2
keys_and_values = val.value.keys.map { |k| CFString.new(k).to_binary(self) }
keys_and_values.concat(val.value.values.map { |v| v.to_binary(self) })
bdata = Binary.type_bytes(0b1101,val.value.size) <<
Binary.pack_int_array_with_size(object_ref_size(@object_refs), keys_and_values)
@object_table[saved_object_count] = bdata
return saved_object_count
end
end
end
# eof

26
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbCFPlistError.rb vendored

@ -1,26 +0,0 @@ @@ -1,26 +0,0 @@
# -*- coding: utf-8 -*-
#
# Exceptions used:
# CFPlistError:: General base exception
# CFFormatError:: Format error
# CFTypeError:: Type error
#
# Easy and simple :-)
#
# Author:: Christian Kruse (mailto:cjk@wwwtech.de)
# Copyright:: Copyright (c) 2010
# License:: MIT License
# general plist error. All exceptions thrown are derived from this class.
class CFPlistError < StandardError
end
# Exception thrown when format errors occur
class CFFormatError < CFPlistError
end
# Exception thrown when type errors occur
class CFTypeError < CFPlistError
end
# eof

449
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbCFPropertyList.rb vendored

@ -1,449 +0,0 @@ @@ -1,449 +0,0 @@
# -*- coding: utf-8 -*-
require 'kconv'
require 'date'
require 'time'
#
# CFPropertyList implementation
#
# class to read, manipulate and write both XML and binary property list
# files (plist(5)) as defined by Apple. Have a look at CFPropertyList::List
# for more documentation.
#
# == Example
# require 'cfpropertylist'
#
# # create a arbitrary data structure of basic data types
# data = {
# 'name' => 'John Doe',
# 'missing' => true,
# 'last_seen' => Time.now,
# 'friends' => ['Jane Doe','Julian Doe'],
# 'likes' => {
# 'me' => false
# }
# }
#
# # create CFPropertyList::List object
# plist = CFPropertyList::List.new
#
# # call CFPropertyList.guess() to create corresponding CFType values
# # pass in optional :convert_unknown_to_string => true to convert things like symbols into strings.
# plist.value = CFPropertyList.guess(data)
#
# # write plist to file
# plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY)
#
# # … later, read it again
# plist = CFPropertyList::List.new(:file => "example.plist")
# data = CFPropertyList.native_types(plist.value)
#
# Author:: Christian Kruse (mailto:cjk@wwwtech.de)
# Copyright:: Copyright (c) 2010
# License:: MIT License
module CFPropertyList
class << self
attr_accessor :xml_parser_interface
end
# interface class for PList parsers
class ParserInterface
# load a plist
def load(opts={})
return ""
end
# convert a plist to string
def to_str(opts={})
return true
end
end
class XMLParserInterface < ParserInterface
def new_node(name)
end
def new_text(val)
end
def append_node(parent, child)
end
end
end
dirname = File.dirname(__FILE__)
require dirname + '/rbCFPlistError.rb'
require dirname + '/rbCFTypes.rb'
require dirname + '/rbBinaryCFPropertyList.rb'
require dirname + '/rbPlainCFPropertyList.rb'
begin
require dirname + '/rbLibXMLParser.rb'
temp = LibXML::XML::Parser::Options::NOBLANKS # check if we have a version with parser options
temp = false # avoid a warning
try_nokogiri = false
CFPropertyList.xml_parser_interface = CFPropertyList::LibXMLParser
rescue LoadError, NameError
try_nokogiri = true
end
if try_nokogiri then
begin
require dirname + '/rbNokogiriParser.rb'
CFPropertyList.xml_parser_interface = CFPropertyList::NokogiriXMLParser
rescue LoadError
require dirname + '/rbREXMLParser.rb'
CFPropertyList.xml_parser_interface = CFPropertyList::ReXMLParser
end
end
module CFPropertyList
# Create CFType hierarchy by guessing the correct CFType, e.g.
#
# x = {
# 'a' => ['b','c','d']
# }
# cftypes = CFPropertyList.guess(x)
#
# pass optional options hash. Only possible value actually:
# +convert_unknown_to_string+:: Convert unknown objects to string calling to_str()
# +converter_method+:: Convert unknown objects to known objects calling +method_name+
#
# cftypes = CFPropertyList.guess(x,:convert_unknown_to_string => true,:converter_method => :to_hash, :converter_with_opts => true)
def guess(object, options = {})
case object
when Integer then CFInteger.new(object)
when UidFixnum then CFUid.new(object)
when Float then CFReal.new(object)
when TrueClass, FalseClass then CFBoolean.new(object)
when Blob
CFData.new(object, CFData::DATA_RAW)
when String, Symbol
CFString.new(object.to_s)
when Time, DateTime, Date
CFDate.new(object)
when Array, Enumerator
ary = Array.new
object.each do |o|
ary.push CFPropertyList.guess(o, options)
end
CFArray.new(ary)
when Hash
hsh = Hash.new
object.each_pair do |k,v|
k = k.to_s if k.is_a?(Symbol)
hsh[k] = CFPropertyList.guess(v, options)
end
CFDictionary.new(hsh)
else
case
when Object.const_defined?('BigDecimal') && object.is_a?(BigDecimal)
CFReal.new(object)
when object.respond_to?(:read)
raw_data = object.read
# treat the data as a bytestring (ASCII-8BIT) if Ruby supports it. Do this by forcing
# the encoding, on the assumption that the bytes were read correctly, and just tagged with
# an inappropriate encoding, rather than transcoding.
raw_data.force_encoding(Encoding::ASCII_8BIT) if raw_data.respond_to?(:force_encoding)
CFData.new(raw_data, CFData::DATA_RAW)
when options[:converter_method] && object.respond_to?(options[:converter_method])
if options[:converter_with_opts]
CFPropertyList.guess(object.send(options[:converter_method],options),options)
else
CFPropertyList.guess(object.send(options[:converter_method]),options)
end
when options[:convert_unknown_to_string]
CFString.new(object.to_s)
else
raise CFTypeError.new("Unknown class #{object.class.to_s}. Try using :convert_unknown_to_string if you want to use unknown object types!")
end
end
end
# Converts a CFType hiercharchy to native Ruby types
def native_types(object,keys_as_symbols=false)
return if object.nil?
if(object.is_a?(CFDate) || object.is_a?(CFString) || object.is_a?(CFInteger) || object.is_a?(CFReal) || object.is_a?(CFBoolean)) || object.is_a?(CFUid) then
return object.value
elsif(object.is_a?(CFData)) then
return CFPropertyList::Blob.new(object.decoded_value)
elsif(object.is_a?(CFArray)) then
ary = []
object.value.each do
|v|
ary.push CFPropertyList.native_types(v)
end
return ary
elsif(object.is_a?(CFDictionary)) then
hsh = {}
object.value.each_pair do
|k,v|
k = k.to_sym if keys_as_symbols
hsh[k] = CFPropertyList.native_types(v)
end
return hsh
end
end
module_function :guess, :native_types
# Class representing a CFPropertyList. Instantiate with #new
class List
# Format constant for binary format
FORMAT_BINARY = 1
# Format constant for XML format
FORMAT_XML = 2
# Format constant for the old plain format
FORMAT_PLAIN = 3
# Format constant for automatic format recognizing
FORMAT_AUTO = 0
@@parsers = [Binary, CFPropertyList.xml_parser_interface, PlainParser]
# Path of PropertyList
attr_accessor :filename
# the original format of the PropertyList
attr_accessor :format
# the root value in the plist file
attr_accessor :value
# default value for XML generation; if true generate formatted XML
attr_accessor :formatted
# initialize a new CFPropertyList, arguments are:
#
# :file:: Parse a file
# :format:: Format is one of FORMAT_BINARY or FORMAT_XML. Defaults to FORMAT_AUTO
# :data:: Parse a string
#
# All arguments are optional
def initialize(opts={})
@filename = opts[:file]
@format = opts[:format] || FORMAT_AUTO
@data = opts[:data]
@formatted = opts[:formatted]
load(@filename) unless @filename.nil?
load_str(@data) unless @data.nil?
end
# returns a list of registered parsers
def self.parsers
@@parsers
end
# set a list of parsers
def self.parsers=(val)
@@parsers = val
end
# Load an XML PropertyList
# filename = nil:: The filename to read from; if nil, read from the file defined by instance variable +filename+
def load_xml(filename=nil)
load(filename,List::FORMAT_XML)
end
# read a binary plist file
# filename = nil:: The filename to read from; if nil, read from the file defined by instance variable +filename+
def load_binary(filename=nil)
load(filename,List::FORMAT_BINARY)
end
# read a plain plist file
# filename = nil:: The filename to read from; if nil, read from the file defined by instance variable +filename+
def load_plain(filename=nil)
load(filename,List::FORMAT_PLAIN)
end
# load a plist from a XML string
# str:: The string containing the plist
def load_xml_str(str=nil)
load_str(str,List::FORMAT_XML)
end
# load a plist from a binary string
# str:: The string containing the plist
def load_binary_str(str=nil)
load_str(str,List::FORMAT_BINARY)
end
# load a plist from a plain string
# str:: The string containing the plist
def load_plain_str(str=nil)
load_str(str,List::FORMAT_PLAIN)
end
# load a plist from a string
# str = nil:: The string containing the plist
# format = nil:: The format of the plist
def load_str(str=nil,format=nil)
str = @data if str.nil?
format = @format if format.nil?
@value = {}
case format
when List::FORMAT_BINARY, List::FORMAT_XML, List::FORMAT_PLAIN then
prsr = @@parsers[format-1].new
@value = prsr.load({:data => str})
when List::FORMAT_AUTO then # what we now do is ugly, but neccessary to recognize the file format
filetype = str[0..5]
version = str[6..7]
prsr = nil
if filetype == "bplist" then
raise CFFormatError.new("Wrong file version #{version}") unless version == "00"
prsr = Binary.new
@format = List::FORMAT_BINARY
else
if str =~ /^<(\?xml|!DOCTYPE|plist)/
prsr = CFPropertyList.xml_parser_interface.new
@format = List::FORMAT_XML
else
prsr = PlainParser.new
@format = List::FORMAT_PLAIN
end
end
@value = prsr.load({:data => str})
end
end
# Read a plist file
# file = nil:: The filename of the file to read. If nil, use +filename+ instance variable
# format = nil:: The format of the plist file. Auto-detect if nil
def load(file=nil,format=nil)
file = @filename if file.nil?
format = @format if format.nil?
@value = {}
raise IOError.new("File #{file} not readable!") unless File.readable? file
case format
when List::FORMAT_BINARY, List::FORMAT_XML, List::FORMAT_PLAIN then
prsr = @@parsers[format-1].new
@value = prsr.load({:file => file})
when List::FORMAT_AUTO then # what we now do is ugly, but neccessary to recognize the file format
magic_number = IO.read(file,12)
raise IOError.new("File #{file} is empty.") unless magic_number
filetype = magic_number[0..5]
version = magic_number[6..7]
prsr = nil
if filetype == "bplist" then
raise CFFormatError.new("Wrong file version #{version}") unless version == "00"
prsr = Binary.new
@format = List::FORMAT_BINARY
else
if magic_number =~ /^<(\?xml|!DOCTYPE|plist)/
prsr = CFPropertyList.xml_parser_interface.new
@format = List::FORMAT_XML
else
prsr = PlainParser.new
@format = List::FORMAT_PLAIN
end
end
@value = prsr.load({:file => file})
end
raise CFFormatError.new("Invalid format or parser error!") if @value.nil?
end
# Serialize CFPropertyList object to specified format and write it to file
# file = nil:: The filename of the file to write to. Uses +filename+ instance variable if nil
# format = nil:: The format to save in. Uses +format+ instance variable if nil
def save(file=nil,format=nil,opts={})
format = @format if format.nil?
file = @filename if file.nil?
if format != FORMAT_BINARY && format != FORMAT_XML && format != FORMAT_PLAIN
raise CFFormatError.new("Format #{format} not supported, use List::FORMAT_BINARY or List::FORMAT_XML")
end
if(!File.exists?(file)) then
raise IOError.new("File #{file} not writable!") unless File.writable?(File.dirname(file))
elsif(!File.writable?(file)) then
raise IOError.new("File #{file} not writable!")
end
opts[:root] = @value
opts[:formatted] = @formatted unless opts.has_key?(:formatted)
prsr = @@parsers[format-1].new
content = prsr.to_str(opts)
File.open(file, 'wb') {
|fd|
fd.write content
}
end
# convert plist to string
# format = List::FORMAT_BINARY:: The format to save the plist
# opts={}:: Pass parser options
def to_str(format=List::FORMAT_BINARY,opts={})
if format != FORMAT_BINARY && format != FORMAT_XML && format != FORMAT_PLAIN
raise CFFormatError.new("Format #{format} not supported, use List::FORMAT_BINARY or List::FORMAT_XML")
end
prsr = @@parsers[format-1].new
opts[:root] = @value
opts[:formatted] = @formatted unless opts.has_key?(:formatted)
return prsr.to_str(opts)
end
end
end
class Array
# convert an array to plist format
def to_plist(options={})
options[:plist_format] ||= CFPropertyList::List::FORMAT_BINARY
plist = CFPropertyList::List.new
plist.value = CFPropertyList.guess(self, options)
plist.to_str(options[:plist_format], options)
end
end
class Enumerator
# convert an array to plist format
def to_plist(options={})
options[:plist_format] ||= CFPropertyList::List::FORMAT_BINARY
plist = CFPropertyList::List.new
plist.value = CFPropertyList.guess(self, options)
plist.to_str(options[:plist_format], options)
end
end
class Hash
# convert a hash to plist format
def to_plist(options={})
options[:plist_format] ||= CFPropertyList::List::FORMAT_BINARY
plist = CFPropertyList::List.new
plist.value = CFPropertyList.guess(self, options)
plist.to_str(options[:plist_format], options)
end
end
# eof

349
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbCFTypes.rb vendored

@ -1,349 +0,0 @@ @@ -1,349 +0,0 @@
# -*- coding: utf-8 -*-
#
# CFTypes, e.g. CFString, CFInteger
# needed to create unambiguous plists
#
# Author:: Christian Kruse (mailto:cjk@wwwtech.de)
# Copyright:: Copyright (c) 2009
# License:: MIT License
require 'base64'
module CFPropertyList
##
# Blob is intended to distinguish between a Ruby String instance that should
# be converted to a CFString type and a Ruby String instance that should be
# converted to a CFData type
class Blob < String
end
##
# UidFixnum is intended to distinguish between a Ruby Integer
# instance that should be converted to a CFInteger/CFReal type and a
# Ruby Integer instance that should be converted to a CFUid type.
class UidFixnum < Integer
end
# This class defines the base class for all CFType classes
#
class CFType
# value of the type
attr_accessor :value
def initialize(value=nil)
@value = value
end
def to_xml(parser)
end
def to_binary(bplist)
end
def to_plain(plist)
end
end
# This class holds string values, both, UTF-8 and UTF-16BE
# It will convert the value to UTF-16BE if necessary (i.e. if non-ascii char contained)
class CFString < CFType
# convert to XML
def to_xml(parser)
n = parser.new_node('string')
n = parser.append_node(n, parser.new_text(@value)) unless @value.nil?
n
end
# convert to binary
def to_binary(bplist)
bplist.string_to_binary(@value);
end
def to_plain(plist)
if @value =~ /^\w+$/
@value
else
quoted
end
end
def quoted
str = '"'
@value.each_char do |c|
str << case c
when '"'
'\\"'
when '\\'
'\\'
when "\a"
"\\a"
when "\b"
"\\b"
when "\f"
"\\f"
when "\n"
"\n"
when "\v"
"\\v"
when "\r"
"\\r"
when "\t"
"\\t"
else
c
end
end
str << '"'
end
end
# This class holds integer/fixnum values
class CFInteger < CFType
# convert to XML
def to_xml(parser)
n = parser.new_node('integer')
n = parser.append_node(n, parser.new_text(@value.to_s))
n
end
# convert to binary
def to_binary(bplist)
bplist.num_to_binary(self)
end
def to_plain(plist)
@value.to_s
end
end
# This class holds float values
class CFReal < CFType
# convert to XML
def to_xml(parser)
n = parser.new_node('real')
n = parser.append_node(n, parser.new_text(@value.to_s))
n
end
# convert to binary
def to_binary(bplist)
bplist.num_to_binary(self)
end
def to_plain(plist)
@value.to_s
end
end
# This class holds Time values. While Apple uses seconds since 2001,
# the rest of the world uses seconds since 1970. So if you access value
# directly, you get the Time class. If you access via get_value you either
# geht the timestamp or the Apple timestamp
class CFDate < CFType
TIMESTAMP_APPLE = 0
TIMESTAMP_UNIX = 1
DATE_DIFF_APPLE_UNIX = 978307200
# create a XML date strimg from a time object
def CFDate.date_string(val)
# 2009-05-13T20:23:43Z
val.getutc.strftime("%Y-%m-%dT%H:%M:%SZ")
end
# parse a XML date string
def CFDate.parse_date(val)
# 2009-05-13T20:23:43Z
val =~ %r{^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$}
year,month,day,hour,min,sec = $1, $2, $3, $4, $5, $6
return Time.utc(year,month,day,hour,min,sec).getlocal
end
# set value to defined state
def initialize(value = nil,format=CFDate::TIMESTAMP_UNIX)
if(value.is_a?(Time) || value.nil?) then
@value = value.nil? ? Time.now : value
elsif value.instance_of? Date
@value = Time.utc(value.year, value.month, value.day, 0, 0, 0)
elsif value.instance_of? DateTime
@value = value.to_time.utc
else
set_value(value,format)
end
end
# set value with timestamp, either Apple or UNIX
def set_value(value,format=CFDate::TIMESTAMP_UNIX)
if(format == CFDate::TIMESTAMP_UNIX) then
@value = Time.at(value)
else
@value = Time.at(value + CFDate::DATE_DIFF_APPLE_UNIX)
end
end
# get timestamp, either UNIX or Apple timestamp
def get_value(format=CFDate::TIMESTAMP_UNIX)
if(format == CFDate::TIMESTAMP_UNIX) then
@value.to_i
else
@value.to_f - CFDate::DATE_DIFF_APPLE_UNIX
end
end
# convert to XML
def to_xml(parser)
n = parser.new_node('date')
n = parser.append_node(n, parser.new_text(CFDate::date_string(@value)))
n
end
# convert to binary
def to_binary(bplist)
bplist.date_to_binary(@value)
end
def to_plain(plist)
@value.strftime("%Y-%m-%d %H:%M:%S %z")
end
end
# This class contains a boolean value
class CFBoolean < CFType
# convert to XML
def to_xml(parser)
parser.new_node(@value ? 'true' : 'false')
end
# convert to binary
def to_binary(bplist)
bplist.bool_to_binary(@value);
end
def to_plain(plist)
@value ? "true" : "false"
end
end
# This class contains binary data values
class CFData < CFType
# Base64 encoded data
DATA_BASE64 = 0
# Raw data
DATA_RAW = 1
# set value to defined state, either base64 encoded or raw
def initialize(value=nil,format=DATA_BASE64)
if(format == DATA_RAW)
@raw_value = value
else
@value = value
end
end
# get base64 encoded value
def encoded_value
@value ||= "\n#{Base64.encode64(@raw_value).gsub("\n", '').scan(/.{1,76}/).join("\n")}\n"
end
# get base64 decoded value
def decoded_value
@raw_value ||= Blob.new(Base64.decode64(@value))
end
# convert to XML
def to_xml(parser)
n = parser.new_node('data')
n = parser.append_node(n, parser.new_text(encoded_value()))
n
end
# convert to binary
def to_binary(bplist)
bplist.data_to_binary(decoded_value())
end
def to_plain(plist)
"<" + decoded_value.unpack("H*").join("") + ">"
end
end
# This class contains an array of values
class CFArray < CFType
# create a new array CFType
def initialize(val=[])
@value = val
end
# convert to XML
def to_xml(parser)
n = parser.new_node('array')
@value.each do |v|
n = parser.append_node(n, v.to_xml(parser))
end
n
end
# convert to binary
def to_binary(bplist)
bplist.array_to_binary(self)
end
def to_plain(plist)
ary = @value.map { |v| v.to_plain(plist) }
"( " + ary.join(", ") + " )"
end
end
# this class contains a hash of values
class CFDictionary < CFType
# Create new CFDictonary type.
def initialize(value={})
@value = value
end
# convert to XML
def to_xml(parser)
n = parser.new_node('dict')
@value.each_pair do |key, value|
k = parser.append_node(parser.new_node('key'), parser.new_text(key.to_s))
n = parser.append_node(n, k)
n = parser.append_node(n, value.to_xml(parser))
end
n
end
# convert to binary
def to_binary(bplist)
bplist.dict_to_binary(self)
end
def to_plain(plist)
str = "{ "
cfstr = CFString.new()
@value.each do |k,v|
cfstr.value = k
str << cfstr.to_plain(plist) + " = " + v.to_plain(plist) + "; "
end
str << "}"
end
end
class CFUid < CFType
def to_xml(parser)
CFDictionary.new({'CF$UID' => CFInteger.new(@value)}).to_xml(parser)
end
# convert to binary
def to_binary(bplist)
bplist.uid_to_binary(@value)
end
def to_plain(plist)
CFDictionary.new({'CF$UID' => CFInteger.new(@value)}).to_plain(plist)
end
end
end
# eof

149
vendor/bundle/ruby/2.7.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbLibXMLParser.rb vendored

@ -1,149 +0,0 @@ @@ -1,149 +0,0 @@
# -*- coding: utf-8 -*-
require 'libxml'
module CFPropertyList
# XML parser
class LibXMLParser < XMLParserInterface
LibXML::XML::Error.set_handler(&LibXML::XML::Error::QUIET_HANDLER)
PARSER_OPTIONS = LibXML::XML::Parser::Options::NOBLANKS|LibXML::XML::Parser::Options::NONET
# read a XML file
# opts::
# * :file - The filename of the file to load
# * :data - The data to parse
def load(opts)
doc = nil
if(opts.has_key?(:file)) then
doc = LibXML::XML::Document.file(opts[:file],:options => PARSER_OPTIONS)
else
doc = LibXML::XML::Document.string(opts[:data],:options => PARSER_OPTIONS)
end
if doc
root = doc.root.first
return import_xml(root)
end
rescue LibXML::XML::Error => e
raise CFFormatError.new('invalid XML: ' + e.message)
end
# serialize CFPropertyList object to XML
# opts = {}:: Specify options: :formatted - Use indention and line breaks
def to_str(opts={})
doc = LibXML::XML::Document.new
doc.root = LibXML::XML::Node.new('plist')
doc.encoding = LibXML::XML::Encoding::UTF_8
doc.root['version'] = '1.0'
doc.root << opts[:root].to_xml(self)
# ugly hack, but there's no other possibility I know
str = doc.to_s(:indent => opts[:formatted])
str1 = String.new
first = false
str.each_line do |line|
str1 << line
unless(first) then
str1 << "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" if line =~ /^\s*<\?xml/
end
first = true
end
str1.force_encoding('UTF-8') if str1.respond_to?(:force_encoding)
return str1
end
def new_node(name)
LibXML::XML::Node.new(name)
end
def new_text(val)
LibXML::XML::Node.new_text(val)
end
def append_node(parent, child)
parent << child
end
protected
# get the value of a DOM node
def get_value(n)
content = if n.children?
n.first.content
else
n.content
end
content.force_encoding('UTF-8') if content.respond_to?(:force_encoding)
content
end
# import the XML values
def import_xml(node)
ret = nil
case node.name
when 'dict'
hsh = Hash.new
key = nil
if node.children? then
node.children.each do |n|
next if n.text? # avoid a bug of libxml
next if n.comment?
if n.name == "key" then
key = get_value(n)
else
raise CFFormatError.new("Format error!") if key.nil?
hsh[key] = import_xml(n)
key = nil
end
end
end
if hsh['CF$UID'] and hsh.keys.length == 1
ret = CFUid.new(hsh['CF$UID'].value)
else
ret = CFDictionary.new(hsh)
end
when 'array'
ary = Array.new
if node.children? then
node.children.each do |n|
next if n.text? # avoid a bug of libxml
next if n.comment?
ary.push import_xml(n)
end
end
ret = CFArray.new(ary)
when 'true'
ret = CFBoolean.new(true)
when 'false'
ret = CFBoolean.new(false)
when 'real'
ret = CFReal.new(get_value(node).to_f)
when 'integer'
ret = CFInteger.new(get_value(node).to_i)
when 'string'
ret = CFString.new(get_value(node))
when 'data'
ret = CFData.new(get_value(node))
when 'date'
ret = CFDate.new(CFDate.parse_date(get_value(node)))
end
return ret
end
end
end
# eof

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save