Skip to content

Commit 558d4af

Browse files
Fix opts
1 parent adfdc18 commit 558d4af

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

lib/appium_lib/driver.rb

+11-12
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ module Appium
8484
class Driver
8585
@@loaded = false
8686

87-
attr_reader :app_path, :app_name, :app_package, :app_activity,
88-
:app_wait_activity, :sauce_username, :sauce_access_key,
89-
:port, :os, :debug
87+
attr_reader :default_wait, :app_path, :app_name, :selendroid,
88+
:app_package, :app_activity, :app_wait_activity,
89+
:sauce_username, :sauce_access_key, :port, :os, :debug
9090
# Creates a new driver.
9191
#
9292
# ```ruby
@@ -112,17 +112,14 @@ class Driver
112112
# Appium::Driver.new(apk).start_driver
113113
# ```
114114
#
115-
# @param options [Object] A hash containing various options.
115+
# @param opts [Object] A hash containing various options.
116116
# @return [Driver]
117-
def initialize options={}
117+
def initialize opts={}
118118
# quit last driver
119119
$driver.driver_quit if $driver
120-
121-
opts = {}
122-
# convert to downcased symbols
123-
options.each_pair { |k,v| opts[k.to_s.downcase.strip.intern] = v }
124-
125120
opts = {} if opts.nil?
121+
# convert to downcased symbols
122+
opts.each_pair { |k,v| opts[k.to_s.downcase.strip.intern] = v }
126123

127124
@default_wait = opts.fetch :wait, 30
128125

@@ -174,9 +171,11 @@ def initialize options={}
174171
patch_webdriver_element
175172

176173
# enable debug patch
177-
@debug = opts.fetch :debug, defined?(Pry)
178-
174+
# !!'constant' == true
175+
@debug = opts.fetch :debug, !!defined?(Pry)
176+
puts "Debug is: #{@debug}"
179177
if @debug
178+
ap opts
180179
puts "OS is: #{@os}"
181180
patch_webdriver_bridge
182181
end

0 commit comments

Comments
 (0)