lib/appium_lib/appium.rb in appium_lib-9.7.1 vs lib/appium_lib/appium.rb in appium_lib-9.7.2

- old
+ new

@@ -73,10 +73,11 @@ data[:appium_lib][:require] = expand_required_files(parent_dir, data[:appium_lib][:require]) end data end + # @see load_settings alias load_appium_txt load_settings # @param [String] base_dir parent directory of loaded appium.txt (toml) # @param [String] file_paths # @return [Array] list of require files as an array, nil if require doesn't exist @@ -117,10 +118,13 @@ # only for the shared module use case. # # if modules is a module instead of an array, then the constants of # that module are promoted on. # otherwise, the array of modules will be used as the promotion target. + # + # @param [Array<Module>] modules An array of modules + # @param [Driver] driver A driver to extend for def promote_singleton_appium_methods(modules, driver = $driver) raise 'Global $driver is nil' if driver.nil? target_modules = [] @@ -151,29 +155,31 @@ end ## # Promote appium methods to class instance methods # - # @param class_array [Array<Class>] An array of classes + # @param [Array<Class>] class_array An array of classes + # @param [Driver] driver A driver to extend for # # To promote methods to all classes: # - # ```ruby - # Appium.promote_appium_methods Object - # ``` + # @example # + # Appium.promote_appium_methods Object + # # It's better to promote on specific classes instead of Object # - # ```ruby - # # promote on rspec - # Appium.promote_appium_methods RSpec::Core::ExampleGroup - # ``` + # @example # - # ```ruby - # # promote on minispec - # Appium.promote_appium_methods Minitest::Spec - # ``` + # # promote on rspec + # Appium.promote_appium_methods RSpec::Core::ExampleGroup + # + # @example + # + # # promote on minispec + # Appium.promote_appium_methods Minitest::Spec + # def promote_appium_methods(class_array, driver = $driver) raise 'Driver is nil' if driver.nil? # Wrap single class into an array class_array = [class_array] unless class_array.class == Array # Promote Appium driver methods to class instance methods. @@ -196,7 +202,7 @@ end end end nil # return nil end - end -end + end # class << self +end # module Appium