Class: BrowserFinder
- Inherits:
-
Object
- Object
- BrowserFinder
- Defined in:
- lib/browser_finder.rb
Instance Method Summary collapse
- #getBrowserFromRegistry ⇒ Object
- #getDefault ⇒ Object
-
#initialize ⇒ BrowserFinder
constructor
A new instance of BrowserFinder.
Constructor Details
#initialize ⇒ BrowserFinder
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
#getBrowserFromRegistry ⇒ Object
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 |
#getDefault ⇒ Object
9 10 11 12 |
# File 'lib/browser_finder.rb', line 9 def getDefault browser = getBrowserFromRegistry() return browser != '' ? browser : @ie end |