Sha256: 77907efd257ac9a682af4120a7b567c6b263c7ffb3d49158a307e58e944a1d17

Contents?: true

Size: 523 Bytes

Versions: 15

Compression:

Stored size: 523 Bytes

Contents

class Browser
  def supported?; true; end
  def setup ; end
  def open(url) ; end
  def teardown ; end

  def host
    require 'rbconfig'
    Config::CONFIG['host']
  end
  
  def macos?
    host.include?('darwin')
  end
  
  def windows?
    host.include?('mswin')
  end
  
  def linux?
    host.include?('linux')
  end

  def open(url)
    case
    when macos?
      `open #{url}`
    when windows?
      `start #{url}`
    else
      puts "I don't know how to open a browser for #{url} on your system"
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
distil-0.13.6 lib/distil/browser.rb
distil-0.13.5 lib/distil/browser.rb
distil-0.13.4 lib/distil/browser.rb
distil-0.13.3 lib/distil/browser.rb
distil-0.13.2 lib/distil/browser.rb
distil-0.13.1 lib/distil/browser.rb
distil-0.13.0 lib/distil/browser.rb
distil-0.12.6 lib/distil/browser.rb
distil-0.12.4 lib/distil/browser.rb
distil-0.12.3 lib/distil/browser.rb
distil-0.12.2 lib/distil/browser.rb
distil-0.12.1 lib/distil/browser.rb
distil-0.12.0 lib/distil/browser.rb
distil-0.11.8 lib/distil/browser.rb
distil-0.11.6 lib/distil/browser.rb