Class: Mechanize::File
- Inherits:
-
Object
- Object
- Mechanize::File
- Defined in:
- lib/mechanize/file.rb
Instance Method Summary collapse
Instance Method Details
#browse ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/mechanize/file.rb', line 2 def browse = Time.now.to_f.round(3).to_s.sub('.', '_') file_name = + '.html' if uri file_name = uri.to_s.parameterize + '_' + file_name end file_path = Pathname.new(ENV['TMPDIR']).join(file_name) save(file_path) system("open -a 'Google Chrome' 'file://#{file_path}'") end |