@@ -84,9 +84,9 @@ module Appium
84
84
class Driver
85
85
@@loaded = false
86
86
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
90
90
# Creates a new driver.
91
91
#
92
92
# ```ruby
@@ -112,17 +112,14 @@ class Driver
112
112
# Appium::Driver.new(apk).start_driver
113
113
# ```
114
114
#
115
- # @param options [Object] A hash containing various options.
115
+ # @param opts [Object] A hash containing various options.
116
116
# @return [Driver]
117
- def initialize options = { }
117
+ def initialize opts = { }
118
118
# quit last driver
119
119
$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
-
125
120
opts = { } if opts . nil?
121
+ # convert to downcased symbols
122
+ opts . each_pair { |k , v | opts [ k . to_s . downcase . strip . intern ] = v }
126
123
127
124
@default_wait = opts . fetch :wait , 30
128
125
@@ -174,9 +171,11 @@ def initialize options={}
174
171
patch_webdriver_element
175
172
176
173
# 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 } "
179
177
if @debug
178
+ ap opts
180
179
puts "OS is: #{ @os } "
181
180
patch_webdriver_bridge
182
181
end
0 commit comments