Sha256: 21c262a51acb63a99a22c8a3ddab5c87153bad57f29b95f499c84b41b227f86b

Contents?: true

Size: 324 Bytes

Versions: 1

Compression:

Stored size: 324 Bytes

Contents

require "launchy"

class Mechanize
  def show_me_the_page
    file_path = ::File.expand_path("../m.#{Time.now.to_i}.html", __FILE__)

    file = ::File.new(file_path, "w")
    file.write(current_page.body)
    file.close

    Launchy::Browser.run("file://#{file_path}")

    system("sleep 2 && rm #{file_path} &")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
barnie-0.1.3 spec/support/show_me_the_page.rb