Class: BrowserFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/browser_finder.rb

Instance Method Summary collapse

Constructor Details

#initializeBrowserFinder

Returns a new instance of BrowserFinder.


5
6
7
# File 'lib/browser_finder.rb', line 5

def initialize
  @ie = '"C:/Program Files/Internet Explorer/iexplore.exe" "%1"'
end

Instance Method Details

#getBrowserFromRegistryObject


14
15
16
17
18
19
20
21
# File 'lib/browser_finder.rb', line 14

def getBrowserFromRegistry
  
    Win32::Registry::HKEY_CLASSES_ROOT.open('http\shell\open\command') do |reg|
        reg_typ, reg_val = reg.read('')          
        return reg_val
    end
  
end

#getDefaultObject


9
10
11
12
# File 'lib/browser_finder.rb', line 9

def getDefault
  browser = getBrowserFromRegistry()
  return browser != '' ? browser : @ie
end