Sha256: 533e292c437db87fb31188f148185999076fbe3f9b3b48d3a5da6e937eb2685f

Contents?: true

Size: 1.68 KB

Versions: 13

Compression:

Stored size: 1.68 KB

Contents

# frozen_string_literal: true

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'selenium-webdriver'

require_relative 'appium_lib_core/version'
require_relative 'appium_lib_core/common'
require_relative 'appium_lib_core/driver'

require_relative 'appium_lib_core/device'

# Call patch after requiring other files
require_relative 'appium_lib_core/patch'

module Appium
  # convert all keys (including nested) to symbols
  #
  # based on deep_symbolize_keys & deep_transform_keys from rails
  # https://github.com/rails/docrails/blob/a3b1105ada3da64acfa3843b164b14b734456a50/activesupport/lib/active_support/core_ext/hash/keys.rb#L84
  # @param [Hash] hash Hash value to make symbolise
  def self.symbolize_keys(hash)
    raise ArgumentError, 'symbolize_keys requires a hash' unless hash.is_a? Hash

    hash.each_with_object({}) do |pair, acc|
      key = begin
        pair[0].to_sym
      rescue StandardError => e
        ::Appium::Logger.warn(e.message)
        pair[0]
      end

      value = pair[1]
      acc[key] = value.is_a?(Hash) ? symbolize_keys(value) : value
    end
  end

  module Core
    # @see Appium::Core::Driver.for
    def self.for(*args)
      Core::Driver.for(*args)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
appium_lib_core-4.7.1 lib/appium_lib_core.rb
appium_lib_core-4.7.0 lib/appium_lib_core.rb
appium_lib_core-4.6.0 lib/appium_lib_core.rb
appium_lib_core-5.0.0.beta1 lib/appium_lib_core.rb
appium_lib_core-4.5.0 lib/appium_lib_core.rb
appium_lib_core-4.4.1 lib/appium_lib_core.rb
appium_lib_core-4.4.0 lib/appium_lib_core.rb
appium_lib_core-4.3.1 lib/appium_lib_core.rb
appium_lib_core-4.3.0 lib/appium_lib_core.rb
appium_lib_core-4.2.1 lib/appium_lib_core.rb
appium_lib_core-4.2.0 lib/appium_lib_core.rb
appium_lib_core-4.1.1 lib/appium_lib_core.rb
appium_lib_core-4.1.0 lib/appium_lib_core.rb