lib/webdrivers/edge_finder.rb in webdrivers-5.0.0 vs lib/webdrivers/edge_finder.rb in webdrivers-5.1.0

- old
+ new

@@ -67,21 +67,20 @@ end nil end def linux_location - # directories = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /snap/bin /opt/google/chrome] - # files = %w[microsoft-edge] # Based on Microsoft Edge 89.0.760.0 dev - # - # directories.each do |dir| - # files.each do |file| - # option = "#{dir}/#{file}" - # return option if File.exist?(option) - # end - # end - # - # nil - raise 'Default location not yet known' + directories = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /snap/bin /opt/microsoft/edge] + files = %w[microsoft-edge microsoft-edge-beta microsoft-edge-dev] + + directories.each do |dir| + files.each do |file| + option = "#{dir}/#{file}" + return option if File.exist?(option) + end + end + + nil end def win_version(location) System.call("powershell (Get-ItemProperty '#{location}').VersionInfo.ProductVersion")&.strip end