### Install libffi Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Installs the compiled libffi library and its header files to the designated location (defaulting to /usr/local). ```shell make install ``` -------------------------------- ### Run libffi Tests Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Executes the test suite for libffi to verify its functionality. This requires DejaGNU to be installed. ```shell make check ``` -------------------------------- ### Configure libffi with Specific Installation Prefix Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Demonstrates how to use the `--prefix` option with the `configure` script to specify a custom installation directory for libffi libraries and header files. ```shell ./configure --prefix=/path/to/install/libffi ``` -------------------------------- ### Install mappls-map-react-native SDK Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Add-Mappls-SDK.md This command installs the Mappls Map React Native SDK package using npm. Ensure you have Node.js and npm installed on your system. ```bash npm install mappls-map-react-native ``` -------------------------------- ### Configure libffi with LLVM clang-cl on Windows Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Sets up libffi to be built on Windows using the LLVM project's clang-cl compiler. It directs the configuration script to use clang-cl for C, C++, and preprocessing steps. ```shell path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP" ``` -------------------------------- ### Build libffi Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Compiles the libffi library after configuration. This command assumes GNU make is being used. ```shell make ``` -------------------------------- ### Ruby Logger Development Setup Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/logger-1.7.0/README.md Provides commands for setting up the development environment for the Ruby logger gem, including installing dependencies and running tests. These commands are useful for developers who wish to contribute to the logger project or test local changes. ```bash $ bin/setup # Then run the tests as: $ rake test ``` -------------------------------- ### Ruby Logger Basic Usage Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/logger-1.7.0/README.md Demonstrates how to initialize and use the Ruby Logger utility to output messages to standard output (STDOUT) and standard error (STDERR). It shows how to log messages at different levels such as debug, info, and error. This is a fundamental example for getting started with the logger. ```ruby require 'logger' # Create a Logger that prints to STDOUT log = Logger.new(STDOUT) log.debug("Created Logger") log.info("Program finished") # Create a Logger that prints to STDERR error_log = Logger.new(STDERR) error_log = error_log.error("fatal error") ``` -------------------------------- ### Build libffi Static Library for ARM64 with MSVC Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Instructions for building a static ARM64 library using MSVC. It points to a specific Visual Studio solution file and indicates the location of required header files. ```shell cd msvc_build/aarch64 "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.com" Ffi_staticLib.sln /build Debug /project Ffi_staticLib ``` -------------------------------- ### Configure libffi for Windows with MSVC Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Configures the libffi build process for Windows using Microsoft's Visual C++ compiler. It specifies compiler and linker paths, defines DLL building flags, and sets up environment variables. ```shell path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP" CXXCPP="cl -nologo -EP" CPPFLAGS="-DFFI_BUILDING_DLL" ``` -------------------------------- ### Generate configure script with autotools Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Generates the 'configure' script from source files using autotools. This is necessary when building libffi from git repository sources. ```shell ./autogen.sh ``` -------------------------------- ### Configure libffi for SPARC Solaris with GNU tools Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Sets environment variables `AS` and `LD` to point to the GNU assembler and linker, which are required for SPARC Solaris builds, before running the configure script. ```shell AS=/path/to/gnu/as LD=/path/to/gnu/ld ./configure ``` -------------------------------- ### Configure libffi for 64-bit Windows with MSVC Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Configures libffi for 64-bit Windows builds using Microsoft Visual C++. It includes the `-m64` flag for the compiler and C++ compiler, and suggests appropriate `--build` target specification. ```shell path/to/configure CC="path/to/msvcc.sh -m64" CXX="path/to/msvcc.sh -m64" LD=link CPP="cl -nologo -EP" CXXCPP="cl -nologo -EP" CPPFLAGS="-DFFI_BUILDING_DLL" --build= ``` -------------------------------- ### Install Typhoeus Gem via Bundler or Gem Install Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md Provides instructions for installing the Typhoeus gem. It covers installation using Bundler, the standard Ruby package manager, and also using the `gem install` command directly. This is essential for setting up the library in a project. ```bash bundle add typhoeus ``` ```bash gem install typhoeus ``` -------------------------------- ### Disable Documentation Build for libffi Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Prevents the generation and installation of documentation during the libffi build process by using the `--disable-docs` flag. ```shell ./configure --disable-docs ``` -------------------------------- ### Setup Fourflusher Development Environment Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/fourflusher-2.3.1/README.md Command to install dependencies for local development of the 'fourflusher' gem after checking out the repository. ```bash bin/setup ``` -------------------------------- ### Ruby Gem Installation via Command Line Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/colored2-3.1.2/README.md Instructions for installing the Colored2 gem directly using the 'gem install' command. ```shell $ gem install colored2 ``` -------------------------------- ### httpclient CLI Usage Example Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/httpclient-2.9.0/README.md Illustrates the command-line interface (CLI) usage of the httpclient gem. It shows how to make a GET request directly from the terminal and how to enter an interactive IRB shell with an HTTPClient instance. ```bash # Example 1: GET request from CLI httpclient get https://www.google.co.jp/?q=ruby # Example 2: Interactive IRB shell httpclient ``` -------------------------------- ### Ruby HTTPClient GET Request Example Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/httpclient-2.9.0/README.md This snippet demonstrates how to perform an HTTP GET request using the httpclient library in Ruby. It shows a basic GET request to a specified URI with a query parameter. ```ruby require 'httpclient' client = HTTPClient.new response = client.get "https://www.google.co.jp/", :q => :ruby puts response.content ``` -------------------------------- ### Install Mutex_m Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/mutex_m-0.3.0/README.md Instructions for installing the Mutex_m gem using Bundler or directly via the gem command. ```ruby gem 'mutex_m' ``` ```bash bundle install ``` ```bash gem install mutex_m ``` -------------------------------- ### Enable Debugging Checks in libffi Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Enables extra run-time debugging checks within libffi by using the `--enable-debug` flag during the configuration process. This is useful for diagnosing issues. ```shell ./configure --enable-debug ``` -------------------------------- ### iOS Setup: Add Mappls Post-Install Hook Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Add-Mappls-SDK.md Integrates the Mappls Maps SDK into your iOS project by adding a post-install hook to the Podfile. This ensures proper setup of Mappls SDK components after dependencies are installed via CocoaPods. ```ruby post_install do |installer| # Other post install hooks... $MAPPLS_MAPS.post_install(installer) end ``` -------------------------------- ### Configure FFI Gem Installation with System libffi Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/README.md Provides commands to configure the installation of the FFI gem to either force the usage of the system's libffi library or prevent it. This is useful for managing dependencies and ensuring compatibility. ```bash # Manually install the gem using system libffi gem install ffi -- --enable-system-libffi ``` ```bash # Configure bundle install to use system libffi bundle config build.ffi --enable-system-libffi ``` -------------------------------- ### Install Concurrent Ruby C Extensions Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.3/README.md Instructions for installing the optional C extensions gem for Concurrent Ruby to enhance performance on MRI. Installation can be done via gem command or by adding to the Gemfile. ```ruby gem install concurrent-ruby-ext ``` ```ruby gem 'concurrent-ruby-ext' ``` -------------------------------- ### Ruby: Install GhInspector Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/gh_inspector-1.1.3/README.md Instructions for installing the GhInspector gem using Bundler. This involves adding the gem to your application's Gemfile and then running the bundle command to install it. ```ruby gem 'gh_inspector' ``` -------------------------------- ### Ruby Gem Installation Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/logger-1.7.0/README.md Shows how to install the 'logger' gem for Ruby projects using Bundler or directly via the gem command. This is a prerequisite for using the logger utility in your Ruby applications. ```ruby gem 'logger' ``` ```bash $ bundle # Or install it yourself as: $ gem install logger ``` -------------------------------- ### Install CFPropertyList Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/CFPropertyList-3.0.7/README.md Instructions for installing the CFPropertyList gem using RubyGems. This is the recommended method for integrating the library into your Ruby projects. ```bash gem install CFPropertyList ``` -------------------------------- ### Start Reaper Thread for Connection Pool in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.3/README.md Provides an example of starting a separate thread to periodically reap idle connections from a ConnectionPool. This automates the process of managing idle connections. ```ruby cp = ConnectionPool.new { Redis.new } # Start a reaper thread to reap connections that have been idle for 300 seconds (5 minutes). Thread.new do loop do cp.reap(300) { |conn| conn.close } sleep 300 end end ``` -------------------------------- ### Check GNU Diff Utility Installation Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc Shows how to verify the installation and proper configuration of the GNU diff utility, which is necessary for Minitest's test reporting. This command is particularly relevant for developers on Windows experiencing diff-related test failures. ```bash diff.exe -v ``` -------------------------------- ### Install Concurrent Ruby Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.3/README.md This command installs the concurrent-ruby gem using the RubyGems package manager. It's a direct way to add the library to your project's environment. ```shell gem install concurrent-ruby ``` -------------------------------- ### Install cocoapods-downloader gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/cocoapods-downloader-2.1/README.markdown This command installs the cocoapods-downloader library using RubyGems. It may require sudo privileges depending on your system configuration. ```bash [sudo] gem install cocoapods-downloader ``` -------------------------------- ### Rails Time Zone Select Helper Example Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/CHANGES.md Demonstrates how to use the `time_zone_select` helper in Ruby on Rails to create a dropdown list of all available time zones. This requires the TZInfo gem to be installed and configured. ```erb <%= time_zone_select 'user', 'time_zone', TZInfo::Timezone.all.sort, :model => TZInfo::Timezone %> ``` -------------------------------- ### Install Concurrent Ruby Edge Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.3/README.md Instructions for installing the separate Edge gem for Concurrent Ruby. This can be done directly using the gem command or by adding it to the Gemfile. ```shell gem install concurrent-ruby-edge ``` ```ruby gem 'concurrent-ruby-edge', require: 'concurrent-edge' ``` -------------------------------- ### Ruby Rakefile Minitest Task Setup Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc This Ruby code demonstrates how to configure Minitest tests to run using Rake tasks by adding the `minitest/test_task` library to your Rakefile. It shows both default setup and explicit configuration options. ```ruby require "minitest/test_task" Minitest::TestTask.create # named test, sensible defaults # or more explicitly: Minitest::TestTask.create(:test) do |t| t.libs << "test" t.libs << "lib" t.warning = false t.test_globs = ["test/**/*_test.rb"] end task :default => :test ``` -------------------------------- ### Run Tests with Bundler Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/netrc-0.11.0/Readme.md Installs project dependencies using Bundler and then executes all Ruby test files within the 'test' directory. This is a standard command for verifying the functionality of the library. ```shell $ bundle install $ bundle exec ruby -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' ``` -------------------------------- ### Install Molinillo Gem (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/molinillo-0.8.0/README.md Installs the Molinillo gem for dependency resolution. This can be done directly using 'gem install' or by adding it to your application's Gemfile and running 'bundle install'. ```ruby gem 'molinillo', :git => 'https://github.com/CocoaPods/Molinillo' ``` ```bash $ bundle install ``` ```bash $ gem install molinillo ``` -------------------------------- ### Install cocoapods-search Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/cocoapods-search-1.0.1/README.md This command installs the cocoapods-search plugin as a separate gem. This is only necessary if you do not already have CocoaPods installed, as it is included by default with CocoaPods. ```bash gem install cocoapods-search ``` -------------------------------- ### Install mappls-search-widgets-react-native Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Place-Autocomplete.md Installs the mappls-search-widgets-react-native package using npm. This is the first step to integrate the search widget functionality. ```command npm install mappls-search-widgets-react-native ``` -------------------------------- ### Install Fourflusher Gem (Standalone) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/fourflusher-2.3.1/README.md Command to install the 'fourflusher' gem globally on a local machine using the gem command. ```bash $ gem install fourflusher ``` -------------------------------- ### Install Mappls Tracking Widget and Map Component Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Tracking Widget.md Installs the necessary Mappls tracking and map components for React Native using npm. Ensures that peer dependencies like the Mappls Map React Native component are also installed. ```command npm install mappls-tracking-react-native npm install mappls-map-react-native ``` -------------------------------- ### Install Fourflusher Gem Locally (Development) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/fourflusher-2.3.1/README.md Command to install the 'fourflusher' gem onto the local machine using Bundler during development. ```bash bundle exec rake install ``` -------------------------------- ### Install ruby-macho Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ruby-macho-2.5.1/README.md Installs the ruby-macho library using RubyGems. This is the primary method for adding the library to your Ruby environment. ```bash gem install ruby-macho ``` -------------------------------- ### Ruby Gem Installation with Bundler Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/colored2-3.1.2/README.md Standard procedure for adding the Colored2 gem to a Ruby project's Gemfile for dependency management using Bundler. ```ruby gem 'colored2' ``` -------------------------------- ### Install CLAide using RubyGems Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/claide-1.1.0/README.md This command installs the CLAide library using the RubyGems package manager. It is a prerequisite for using CLAide in your Ruby projects. ```bash [sudo] gem install claide ``` -------------------------------- ### Install Fourflusher Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/fourflusher-2.3.1/README.md Instructions for adding the 'fourflusher' gem to a Ruby project's Gemfile and installing it using Bundler. ```ruby gem 'fourflusher' ``` -------------------------------- ### Install mappls-nearby-widget-react-native using npm Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Nearby-Widget.md Installs the Mappls Nearby Widget for React Native using npm. It's recommended to also install the peer dependency `mappls-map-react-native`. ```bash npm install mappls-nearby-widget-react-native npm install mappls-map-react-native ``` -------------------------------- ### Install Public Suffix Ruby Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/public_suffix-4.0.7/README.md Instructions for installing the Public Suffix gem using the RubyGems package manager or by adding it to a project's Gemfile for Bundler integration. ```shell gem install public_suffix ``` ```ruby gem 'public_suffix' ``` -------------------------------- ### Install NKF Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/nkf-0.2.0/README.md Instructions for installing the NKF Ruby gem using Bundler or directly via gem install. This makes the NKF functionality available in your Ruby application. ```ruby gem 'nkf' ``` -------------------------------- ### Perform HTTP GET Request with Parameters in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md Provides a helper method `http_request` to simplify making GET requests. It allows specifying the URL, HTTP method, and request parameters. ```ruby easy = Ethon::Easy.new easy.http_request("www.example.com", :get, { params: {a: 1} }) easy.perform #=> :ok ``` -------------------------------- ### Android Setup: Add Mappls Repository (Kotlin) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Add-Mappls-SDK.md Configures the Mappls Maven repository in your Android project's settings.gradle.kts file. This allows Gradle to fetch Mappls SDK dependencies. Ensure your project uses Kotlin for build scripts. ```kotlin dependencyResolutionManagement { repositories { google() mavenCentral() maven(url = "https://maven.mappls.com/repository/mappls/") } } ``` -------------------------------- ### HTTP/2 Request Configuration in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md Shows how to configure Ethon::Easy for HTTP/2 requests. It includes examples for different HTTP/2 connection negotiation methods like `httpv2_0`, `httpv2_prior_knowledge`, and `httpv2_tls`. ```ruby multi = Ethon::Multi.new easy = Ethon::Easy.new easy.http_request("www.example.com/get", :get, { http_version: :httpv2_0 }) # Sending a request with http version 2 will send an Upgrade header to the server, which many older servers will not support # See below for more info: https://everything.curl.dev/http/http2 # If this is a problem, send the below: easy.http_request("www.example.com/get", :get, { http_version: :httpv2_prior_knowledge }) # To set the server to use http2 with https and http1 with http, send the following: easy.http_request("www.example.com/get", :get, { http_version: :httpv2_tls }) multi.add(easy) multi.perform ``` -------------------------------- ### Install and Require Minitest Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc Instructions for installing the Minitest gem and requiring it in your Ruby project. This ensures you are using the latest version of Minitest and not the built-in one, especially on Ruby 1.9. ```ruby sudo gem install minitest gem "minitest" # ensures you"re using the gem, and not the built-in MT require "minitest/autorun" # ... usual testing stuffs ... ``` -------------------------------- ### Get Timezone Transitions (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md Illustrates the use of the `transitions_up_to` method to retrieve an array of `TZInfo::TimezoneTransition` objects. These objects represent changes in timezone rules between specified start and end times. The example maps the local end time, observed UTC offset, and abbreviation for each transition. ```ruby transitions = tz.transitions_up_to(Time.utc(2019, 1, 1), Time.utc(2017, 1, 1)) transitions.map do |t| [t.local_end_at.to_time, t.offset.observed_utc_offset, t.offset.abbreviation] end # => [[2017-03-12 02:00:00 -0500, -14400, "EDT"], # [2017-11-05 02:00:00 -0400, -18000, "EST"], # [2018-03-11 02:00:00 -0500, -14400, "EDT"], # [2018-11-04 02:00:00 -0400, -18000, "EST"]] ``` -------------------------------- ### Android Setup: Add Mappls Repository (Groovy) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Add-Mappls-SDK.md Configures the Mappls Maven repository in your Android project's settings.gradle file using Groovy syntax. This enables Gradle to download Mappls SDK dependencies. This is for projects using Groovy for build scripts. ```groovy dependencyResolutionManagement { repositories { google() mavenCentral() maven { url 'https://maven.mappls.com/repository/mappls/' } } } ``` -------------------------------- ### Minitest Documentation Enhancements Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/History.rdoc Improves documentation for various Minitest components, including examples for `assert_raises`, documentation for `Reporter` classes, and clarifications for expectation usage with blocks. ```markdown # Added examples to documentation for assert_raises. # Added documentation for Reporter classes. # Improved documentation for _/value/expect, especially for blocks. ``` -------------------------------- ### Get Namespace Prefixes using REXML::Element#prefixes - Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Explains the `prefixes` method, which returns an array of string prefixes for all defined namespaces in an element and its ancestors. This helps in identifying the available namespace shortcuts. ```ruby xml_string = <<-EOT EOT d = Document.new(xml_string, {compress_whitespace: :all}) d.elements['//a'].prefixes # => ["x", "y"] d.elements['//b'].prefixes # => ["x", "y"] d.elements['//c'].prefixes # => ["x", "y", "z"] ``` -------------------------------- ### Install Mappls Geofence Widget and Peer Dependencies Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Geofence-Widget.md This command installs the Mappls Geofence Widget for React Native and its required peer dependency, mappls-map-react-native. Ensure these packages are installed before proceeding with the setup. ```command npm install mappls-geofence-widget-react-native npm install mappls-map-react-native ``` -------------------------------- ### Basic HTTP GET Request with Authentication in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/nap-1.1.0/README.md Demonstrates how to perform a basic GET request to fetch data from a JSON API and parse the response. It includes handling for successful responses, forbidden access (authentication errors), and general errors. ```ruby gem 'nap' require 'rest' require 'json' response = REST.get('http://twitter.com/statuses/friends_timeline.json', {}, {:username => '_evan', :password => 'buttonscat'} ) if response.ok? timeline = JSON.parse(response.body) puts(timeline.map do |item| "#{item['user']['name']}\n\n#{item['text']}" end.join("\n\n--\n\n")) elsif response.forbidden? puts "Are you sure you're `_evan' and your password is the name of your cat?" else puts "Something went wrong (#{response.status_code})" puts response.body end ``` -------------------------------- ### Tracking Event Callback Example (JavaScript) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Tracking Widget.md This example illustrates the usage of the `trackingEventCallback` to handle real-time tracking events. It shows how to log the event name and value, demonstrating the data received for events like `updateWithinBuffer` and `updateOutsideBuffer`, including distances and route computation status. ```javascript trackingEventCallback={(eventName:any,eventValue:any) =>{ console.log("trackingEventCallback",eventName + ":::::::" + eventValue) }} ``` -------------------------------- ### Fuzzy Match - Ruby Quickstart Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/fuzzy_match-2.0.4/README.markdown Demonstrates the basic usage of FuzzyMatch in Ruby, including requiring the library and performing a simple find operation on a list of strings. ```ruby require 'fuzzy_match' FuzzyMatch.new(['seamus', 'andy', 'ben']).find('Shamus') ``` -------------------------------- ### Make a Single HTTP GET Request with Typhoeus Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md Demonstrates how to perform a single HTTP GET request using the Typhoeus gem. It includes the option to follow redirects. This is a basic starting point for interacting with web services. ```ruby Typhoeus.get("www.example.com", followlocation: true) ``` -------------------------------- ### Get All Defined Namespaces using REXML::Element#namespaces - Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Demonstrates the `namespaces` method which returns a hash of all namespaces defined in an element and its ancestors. This is useful for understanding the full namespace context of an element. ```ruby xml_string = <<-EOT EOT d = Document.new(xml_string) d.elements['//a'].namespaces # => {"x"=>"1", "y"=>"2"} d.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"} d.elements['//c'].namespaces # => {"x"=>"1", "y"=>"2", "z"=>"3"} ``` -------------------------------- ### Create and Perform Basic HTTP Request in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md Demonstrates how to initialize an Ethon::Easy object with a URL and perform a request. This is the most basic way to interact with the Ethon library. ```ruby easy = Ethon::Easy.new(url: "www.example.com") easy.perform #=> :ok ``` -------------------------------- ### Include CFPropertyList in Ruby Project Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/CFPropertyList-3.0.7/README.md Example of how to require the CFPropertyList library in a Ruby script. This makes the library's classes and methods available for use. ```ruby require 'cfpropertylist' ``` -------------------------------- ### Create REXML Element Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Demonstrates the creation of a new REXML::Element using the REXML::Element::new constructor. This is the fundamental step for building XML structures. ```ruby require 'rexml/element' ele = REXML::Element.new('foo') puts ele ``` -------------------------------- ### Suppress Purify Warnings with libffi Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/ext/ffi_c/libffi/README.md Includes extra code to suppress certain warnings when using the Purify memory debugging tool with libffi. This option may impact performance and should only be used with Purify. ```shell ./configure --enable-purify-safety ``` -------------------------------- ### Unit Tests with minitest/test Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc Demonstrates how to write unit tests using minitest/test. It includes setting up a test class, using assertions like `assert_equal` and `refute_match`, and skipping tests with `skip`. ```ruby require "minitest/autorun" class TestMeme < Minitest::Test def setup @meme = Meme.new end def test_that_kitty_can_eat assert_equal "OHAI!", @meme.i_can_has_cheezburger? end def test_that_it_will_not_blend refute_match /^no/i, @meme.will_it_blend? end def test_that_will_be_skipped skip "test this later" end end ``` -------------------------------- ### Get Unique Timezone Offsets (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md Shows how to use the `offsets_up_to` method to obtain an array of `TZInfo::TimezoneOffset` objects representing the unique offsets used by a timezone up to a specified time. The example extracts the observed UTC offset and abbreviation for each offset. ```ruby offsets = tz.offsets_up_to(Time.utc(2019, 1, 1)) offsets.map {|o| [o.observed_utc_offset, o.abbreviation] } # => [[-17762, "LMT"], # [-18000, "EST"], # [-14400, "EDT"], # [-14400, "EWT"], # [-14400, "EPT"]] ``` -------------------------------- ### Fix Typhoeus Option Names (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/UPGRADE.md Demonstrates how to fix renamed option names in Typhoeus requests. The example shows the error for an invalid option ('follow_location') and the correct usage ('followlocation'). This ensures proper request execution by using the updated option names. ```ruby Typhoeus.get("www.example.com", follow_location: true) # Ethon::Errors::InvalidOption: The option: follow_location is invalid. # Please try followlocation instead of follow_location. # ... [Backtrace] Typhoeus.get("www.example.com", followlocation: true).code #=> 200 ``` -------------------------------- ### Require Concurrent Ruby SDK Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.3/README.md This snippet shows how to load the entire concurrent-ruby gem. It's the standard way to begin using the library's core functionalities. ```ruby require 'concurrent' ``` -------------------------------- ### Install cocoapods-deintegrate Plugin Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/cocoapods-deintegrate-1.0.5/README.md This command installs the cocoapods-deintegrate CocoaPods plugin globally using RubyGems. It allows you to deintegrate CocoaPods from your Xcode project. Ensure you have RubyGems and CocoaPods installed. ```bash $ [sudo] gem install cocoapods-deintegrate ``` -------------------------------- ### Ruby Minitest Command Line Help Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc This command displays the available runtime options for Minitest when run from the command line. It includes options for seed, verbosity, filtering tests, and enabling features like 'pride' mode. ```bash % ruby -Ilib:test test/minitest/test_minitest_test.rb --help ``` -------------------------------- ### Ruby Minitest Mocking Example Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc This Ruby code demonstrates how to use Minitest::Mock to create mock objects for testing. It shows setting up expectations on a mock object and verifying that those expectations are met during the test. ```ruby class MemeAsker def initialize(meme) @meme = meme end def ask(question) method = question.tr(" ", "_") + "?" @meme.__send__(method) end end require "minitest/autorun" describe MemeAsker, :ask do describe "when passed an unpunctuated question" do it "should invoke the appropriate predicate method on the meme" do @meme = Minitest::Mock.new @meme_asker = MemeAsker.new @meme @meme.expect :will_it_blend?, :return_value @meme_asker.ask "will it blend" @meme.verify end end end ``` -------------------------------- ### Load Native Library and Attach Function in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2/README.md Demonstrates how to use Ruby-FFI to load a native library (like libc) and attach a specific function (puts). This allows calling C functions directly from Ruby. It requires the 'ffi' gem to be installed. ```ruby require 'ffi' module MyLib extend FFI::Library ffi_lib 'c' attach_function :puts, [ :string ], :int end MyLib.puts 'Hello, World using libc!' ``` -------------------------------- ### Perform HTTP POST Request with Parameters and Body in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md Demonstrates using the `http_request` helper for POST requests, including setting request parameters and the request body. ```ruby easy = Ethon::Easy.new easy.http_request("www.example.com", :post, { params: { a: 1 }, body: { b: 2 } }) easy.perform #=> :ok ``` -------------------------------- ### Require and Include REXML Module in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Demonstrates how to make the REXML library available in your Ruby script and how to use the 'include' keyword for easier access to REXML classes and methods. Without inclusion, full qualification is required. ```ruby require 'rexml' # Option 1: Fully qualify references # REXML::Document # Option 2: Include the module to omit REXML:: prefix include REXML Document REXML::Document ``` -------------------------------- ### HTTP Request with Redirects Enabled in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md Shows how to create an Ethon::Easy object and configure it to automatically follow HTTP redirects. This is useful when dealing with URLs that might redirect to different locations. ```ruby easy = Ethon::Easy.new(url: "www.example.com", followlocation: true) easy.perform #=> :ok ``` -------------------------------- ### Open and Inspect Xcode Project Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/xcodeproj-1.25.1/README.md Demonstrates how to open an existing Xcode project file using the Xcodeproj library and iterate through its targets to print their names. This is a foundational step for any programmatic manipulation of Xcode projects. ```ruby require 'xcodeproj' project_path = '/your_path/your_project.xcodeproj' project = Xcodeproj::Project.open(project_path) project.targets.each do |target| puts target.name end ``` -------------------------------- ### Ruby: Initialize and Use GhInspector Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/gh_inspector-1.1.3/README.md Demonstrates how to initialize the GhInspector and perform searches for GitHub issues. It shows two methods: searching based on an exception and searching using a direct query string. Both methods accept optional custom UI delegates. ```ruby require 'gh_inspector' inspector = GhInspector::Inspector.new "orta", "eigen" # Either use an error: inspector.search_exception an_error, ArtsyUI.new # Or use a specific query: inspector.search_query "Someone set us up the bomb" ``` ```ruby require 'gh_inspector' inspector = GhInspector::Inspector.new "fastlane", "fastlane" inspector.search_query "Someone set us up the bomb", FastlaneUI.new ``` -------------------------------- ### Run Code Before Tests Using Constants in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc Illustrates how to execute code once before a group of tests begins by assigning a `begin...end` block to a constant within a `describe` block. This is useful for expensive initializations or sharing state, but requires careful management to avoid interfering with test integrity. ```ruby describe Blah do SETUP = begin # ... this runs once when describe Blah starts end # ... end ``` -------------------------------- ### Install Nanaimo Gem Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/nanaimo-0.3.0/README.md Instructions to add the Nanaimo gem to your application's Gemfile or install it directly using the gem command. This gem is for Ruby and has no external dependencies. ```ruby gem 'nanaimo' ``` ```bash $ bundle $ gem install nanaimo ``` -------------------------------- ### Define Minitest Plugin Options and Initialization (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc This Ruby code demonstrates how to define a Minitest plugin. It includes methods to register custom command-line options using OptionParser and to initialize the plugin by adding a custom reporter. ```ruby module Minitest def self.plugin_bogus_options(opts, options) opts.on "--myci", "Report results to my CI" do options[:myci] = true options[:myci_addr] = get_myci_addr options[:myci_port] = get_myci_port end end def self.plugin_bogus_init(options) self.reporter << MyCI.new(options) if options[:myci] end end ``` -------------------------------- ### Parse XML from URL in Ruby using REXML and Open-URI Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Demonstrates parsing XML directly from a web URL. It uses the 'open-uri' library to fetch the content and then passes the resulting IO stream to REXML::Document.new. ```ruby require 'rexml' require 'open-uri' url = "https://www.w3schools.com/xml/books.xml" begin io = URI.open(url) doc = REXML::Document.new(io) rescue => e puts "Error fetching or parsing XML: #{e.message}" end ``` -------------------------------- ### Basic Usage of cocoapods-downloader Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/cocoapods-downloader-2.1/README.markdown Demonstrates how to use the cocoapods-downloader library in Ruby to download files from a git repository. It shows setting the target path, options, cache settings, and performing the download. ```ruby require 'cocoapods-downloader' target_path = './Downloads/MyDownload' options = { :git => 'example.com' } options = Pod::Downloader.preprocess_options(options) downloader = Pod::Downloader.for_target(target_path, options) downloader.cache_root = '~/Library/Caches/APPNAME' downloader.max_cache_size = 500 downloader.download downloader.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' } ``` -------------------------------- ### Getting Brief String Representation of REXML Element Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Illustrates the use of the `inspect` method on an REXML::Element object to get a concise string representation. It shows how the output differs based on whether the element has children or attributes. ```ruby doc.root.inspect # => " ...
Element.new('foo').inspect # => ""
doc.root.elements.first.inspect # => " ...
``` -------------------------------- ### iOS Podfile Configuration for Mappls SDK Source: https://context7.com/mappls-api/mappls-react-native-sdk/llms.txt Configures the iOS project's Podfile to integrate the Mappls SDK. It adds a post-install hook to properly set up the Mappls map components. ```ruby # ios/Podfile post_install do |installer| $MAPPLS_MAPS.post_install(installer) end ``` -------------------------------- ### Install Mappls Direction Widget for React Native Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Direction-Widget.md Installs the core Mappls Direction Widget package for React Native using npm. This is the primary step to include the widget's functionality in your project. ```bash npm install mappls-direction-widget-react-native ``` -------------------------------- ### Configure Typhoeus Globally (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/UPGRADE.md Shows how to set up global configurations for Typhoeus. This allows enabling features like verbose logging, memoization, or connection blocking across all requests. It simplifies managing request behavior by providing a central configuration point. ```ruby Typhoeus.configure do |config| config.verbose = true config.memoize = true end ``` -------------------------------- ### Create and Add Element to REXML Document Root Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Shows how to create a new REXML::Element and simultaneously add it as the root of a REXML::Document using the REXML::Document#add_element method with a string argument. ```ruby require 'rexml/document' my_doc = REXML::Document.new my_doc.add_element('foo') puts my_doc.root ``` -------------------------------- ### Create a New XML Document - REXML Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Create a new XML document object using the REXML::Document::new method. Can be initialized with a source string or left empty for a new document. Input: Optional XML source string. Output: REXML::Document object. ```ruby doc = Document.new(source_string) empty_doc = REXML::Document.new ``` -------------------------------- ### REXML: Retrieve Parent Element Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Illustrates using the `parent` method to get the parent of an REXML element. This method is inherited from `REXML::Child`. ```ruby ele = doc.root # => ... /> ele.parent # => ... /> ele = doc.root.elements.first # => ... /> ele.parent # => ... /> ``` -------------------------------- ### Ruby Minitest Command Line Execution Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc This command shows how to execute Minitest tests directly from the command line using the Ruby interpreter. It includes options for specifying the test file path and passing Minitest-specific arguments. ```bash % ruby -Ilib:test test/minitest/test_minitest_test.rb ``` -------------------------------- ### REXML: Retrieve Containing Document Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Demonstrates how to use the `document` method to get the containing REXML document of an element. Returns nil if the element has no containing document. ```ruby ele = doc.root.elements.first # => ... ele.document # => ... /> ele = Element.new('foo') # => ele.document # => nil ``` -------------------------------- ### Retrieve Element Children - REXML Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Gets an REXML::Elements object containing all direct element children of an REXML::Element. The size method returns the count of these children. ```ruby eles = doc.root.elements eles # => # ... > eles.size # => 4 eles.each {|e| p [e.class], e } ``` -------------------------------- ### Migrate to Connection Pool using Wrapper in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.3/README.md Explains how to use `ConnectionPool::Wrapper` to gradually migrate existing global connections to a connection pool. The wrapper uses `method_missing` for seamless integration, although direct 'with' usage is recommended for performance-sensitive code. ```ruby $redis = ConnectionPool::Wrapper.new(size: 5, timeout: 3) { Redis.new } $redis.sadd('foo', 1) $redis.smembers('foo') $redis.with do |conn| conn.sadd('foo', 1) conn.smembers('foo') end ``` -------------------------------- ### Using ConnectionPool with 'then' in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.3/README.md Shows how to use the 'then' method to support both a connection pool and a raw client. This provides compatibility for existing codebases and simplifies migration. ```ruby $redis.then { |r| r.set 'foo' 'bar' } ``` -------------------------------- ### REXML: Get Index in Parent Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Demonstrates `index_in_parent` to find the 0-based index of an element among its parent's direct children. This differs from 1-based array indexing. ```ruby doc.root.children # => # ["\n\n", # ... , # "\n\n", # ... , # "\n\n", # ... , # "\n\n", # ... , # "\n\n"] ele = doc.root.elements[1] # => ... /> ele.index_in_parent # => 2 ele = doc.root.elements[2] # => ... /> ele.index_in_parent# => 4 ``` -------------------------------- ### Get All CDATA Children (REXML) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tasks/rdoc/element.rdoc Retrieves all CDATA sections within an REXML Element using the `cdatas` method. It returns an array of the CDATA content. ```ruby require 'rexml/document' xml_string = <<-EOT EOT d = REXML::Document.new(xml_string) d.root.cdatas # => ["foo", "bar"] ``` -------------------------------- ### Get Previous Element Sibling in REXML Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tasks/rdoc/element.rdoc Illustrates how to retrieve the previous sibling element of a given REXML::Element. Returns nil if there is no previous sibling. ```ruby d = REXML::Document.new 'text' d.root.elements['c'].previous_element #-> d.root.elements['b'].previous_element #-> nil ``` -------------------------------- ### Perform Quick HTTP Requests with Typhoeus Convenience Methods Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md Highlights Typhoeus's shortcut methods for common HTTP verbs (GET, HEAD, PUT, PATCH, POST, DELETE, OPTIONS). These methods simplify making single requests without explicitly creating a `Request` object, taking the same arguments as the constructor. ```ruby Typhoeus.get("www.example.com") Typhoeus.head("www.example.com") Typhoeus.put("www.example.com/posts/1", body: "whoo, a body") Typhoeus.patch("www.example.com/posts/1", body: "a new body") Typhoeus.post("www.example.com/posts", body: { title: "test post", content: "this is my test"}) Typhoeus.delete("www.example.com/posts/1") Typhoeus.options("www.example.com") ``` -------------------------------- ### Run I18n Tests with Rake Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/README.md Commands to run the test suite for the Ruby I18n library. This includes the standard 'rake test' command and running individual test files. ```bash rake test ruby -Ilib:test test/api/simple_test.rb ``` -------------------------------- ### Get Next Element Sibling in REXML Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tasks/rdoc/element.rdoc Shows how to retrieve the next sibling element of a given REXML::Element. Returns nil if there is no next sibling. ```ruby d = REXML::Document.new 'text' d.root.elements['b'].next_element #-> d.root.elements['c'].next_element #-> nil ``` -------------------------------- ### Access Translation in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/README.md Demonstrates how to access translations defined in the I18n library using the 'I18n.t' method. This example retrieves the translation for the 'test' key. ```ruby I18n.t(:test) ``` -------------------------------- ### REXML: Get Child Count Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Shows the usage of the `size` method to obtain the total number of direct child nodes (including text nodes) within an REXML element. ```ruby doc.root.size # => 9 ``` -------------------------------- ### Create and Write Plist Data in Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/CFPropertyList-3.0.7/README.md Demonstrates creating a basic Ruby data structure and converting it into a CFPropertyList object using CFPropertyList.guess(). It then shows how to write this data to a binary plist file. ```ruby data = { 'name' => 'John Doe', 'missing' => true, 'last_seen' => Time.now, 'friends' => ['Jane Doe','Julian Doe'], 'likes' => { 'me' => false } } plist = CFPropertyList::List.new plist.value = CFPropertyList.guess(data) plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY) ``` -------------------------------- ### Get XML Document Version (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tasks/rdoc/document.rdoc Explains how to retrieve the XML version declared in the document using the `version` method. It parses the `version` attribute from the XML declaration. ```ruby d = REXML::Document.new('') d.version ``` -------------------------------- ### Define Translation in YAML Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/README.md Example of a simple translation file in YAML format for the 'en' locale. This file defines a 'test' key with its corresponding English translation. ```yaml en: test: "This is a test" ``` -------------------------------- ### iOS Podfile Configuration for Tracking Widget Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/docs/v2.0.0/Tracking Widget.md Configures the iOS Podfile to include the Mappls Tracking Widget by adding the `$MAPPLS_TRACKING_WIDGET.post_install(installer)` hook within the `post_install` block. This is a crucial step for enabling the widget's functionality on iOS. ```ruby post_install do |installer| # Other post install hooks... $MAPPLS_TRACKING_WIDGET.post_install(installer) end ``` -------------------------------- ### Add Concurrent Ruby to Gemfile Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.3/README.md This snippet shows how to add concurrent-ruby as a dependency in a Ruby on Rails project's Gemfile. After adding, you need to run `bundle install`. ```ruby gem 'concurrent-ruby', require: 'concurrent' ``` -------------------------------- ### Run All I18n Tests Across Gemfiles Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/README.md Command to execute all tests for the Ruby I18n library against all specified Gemfiles, ensuring compatibility across different configurations. ```bash ruby test/run_all.rb ``` -------------------------------- ### Install I18n Gem for Ruby Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/README.md Instructions to add the 'i18n' gem to a Ruby project's Gemfile for standalone usage without Rails. This enables internationalization features. ```ruby gem 'i18n' ``` -------------------------------- ### Handling Processing Instructions in REXML Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tutorial.rdoc Illustrates how to access and identify processing instructions within an XML document, which are stored as REXML::Instruction objects. This is useful for custom XML processing. ```ruby # Assuming 'doc' is a parsed REXML::Document object # The output would look like: # [REXML::Instruction, ] # [REXML::Instruction, ] ``` -------------------------------- ### Retrieve the First Text Node from REXML Element Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tasks/rdoc/element.rdoc Demonstrates how to get the first text node associated with a REXML::Element. This method returns the text content as a string. ```ruby d = REXML::Document.new('textmore') e = d.root e.to_a # => [, "text", , "more", ] e.get_text # => "text" ``` -------------------------------- ### Get REXML Root Element (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tasks/rdoc/document.rdoc Illustrates how to access the root element of the XML document using the `root` method. This method returns the top-level element of the XML structure. ```ruby xml_string = '' d = REXML::Document.new(xml_string) d.root ``` -------------------------------- ### Get REXML Node Type (Ruby) Source: https://github.com/mappls-api/mappls-react-native-sdk/blob/main/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.1/doc/rexml/tasks/rdoc/document.rdoc Demonstrates retrieving the node type of a REXML object using the `node_type` method. For a Document object, this method returns the symbol `:document`. ```ruby xml_string = '' d = REXML::Document.new(xml_string) d.node_type ```