lib/appium_lib/common/patch.rb in appium_lib-0.9.1 vs lib/appium_lib/common/patch.rb in appium_lib-0.10.0

- old
+ new

@@ -56,12 +56,12 @@ # https://github.com/appium/appium/wiki/Automating-mobile-gestures # @return [OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 } def location_rel xy = self.location w = $driver.window_size - OpenStruct.new( x: xy.x.to_f / w.width.to_f, - y: xy.y.to_f / w.height.to_f ) + OpenStruct.new( x: "#{xy.x.to_f} / #{w.width.to_f}", + y: "#{xy.y.to_f} / #{w.height.to_f}" ) end end end # module Appium::Common # Print JSON posted to Appium. Not scoped to an Appium module. @@ -101,10 +101,10 @@ # to /execute # path may be nil, session, or not have anything after the session_id. path_str = path path_str = '/' + path_str unless path_str.nil? || path_str.length <= 0 || path_str[0] == '/' - path_match = path.match /.*\h{8}-\h{4}-\h{4}-\h{4}-\h{12}/ + path_match = path.match /.*\h{8}-?\h{4}-?\h{4}-?\h{4}-?\h{12}/ path_str = path.sub(path_match[0], '') unless path_match.nil? puts "#{verb} #{path_str}" unless command_hash.nil? || command_hash.length == 0 print_command = command_hash.clone \ No newline at end of file