Sha256: 0c7f58ea73e27de28825710ae54ca88539bdba2433d3a1e6417f4c6813292925

Contents?: true

Size: 647 Bytes

Versions: 2

Compression:

Stored size: 647 Bytes

Contents

if RUBY_PLATFORM != "java"
  require 'akephalos/remote_client'
  Akephalos::Client = Akephalos::RemoteClient
else
  require 'akephalos/htmlunit'
  require 'akephalos/page'
  require 'akephalos/node'

  module Akephalos
    class Client
      def initialize
        @_client = WebClient.new
        @_client.setCssErrorHandler(com.gargoylesoftware.htmlunit.SilentCssErrorHandler.new)
      end

      def visit(url)
        @page = Page.new(@_client.getPage(url))
      end

      def page
        if @page != (page = @_client.getCurrentWindow.getEnclosedPage)
          @page = Page.new(page)
        end
        @page
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
akephalos-0.0.3 lib/akephalos/client.rb
akephalos-0.0.2 lib/akephalos/client.rb