Sha256: d8d27070264c753eb8b1c93514f3d01cc4cd95d24b835f4f873c0a031c6553db

Contents?: true

Size: 1.14 KB

Versions: 14

Compression:

Stored size: 1.14 KB

Contents

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

14 entries across 14 versions & 1 rubygems

Version Path
appium_lib_core-3.0.2 lib/appium_lib_core.rb
appium_lib_core-3.0.1 lib/appium_lib_core.rb
appium_lib_core-3.0.0 lib/appium_lib_core.rb
appium_lib_core-2.3.4 lib/appium_lib_core.rb
appium_lib_core-2.3.3 lib/appium_lib_core.rb
appium_lib_core-2.3.2 lib/appium_lib_core.rb
appium_lib_core-2.3.1 lib/appium_lib_core.rb
appium_lib_core-2.3.0 lib/appium_lib_core.rb
appium_lib_core-2.2.2 lib/appium_lib_core.rb
appium_lib_core-2.2.1 lib/appium_lib_core.rb
appium_lib_core-2.2.0 lib/appium_lib_core.rb
appium_lib_core-2.1.1 lib/appium_lib_core.rb
appium_lib_core-2.1.0 lib/appium_lib_core.rb
appium_lib_core-2.0.6 lib/appium_lib_core.rb