Sha256: dfd83ed62a1c3f739cb9b0b5c633a31f633ec3764538c0cec195d0ee94a363e6

Contents?: true

Size: 2 KB

Versions: 16

Compression:

Stored size: 2 KB

Contents

require 'os'
require 'selenium-webdriver'
require 'xpath'
require 'rubyXL'
require 'irb'
require 'fileutils'
require 'binding_of_caller'
require 'pathname'
require 'pry'
require 'highline'
require 'csv'

require 'webdrone/version'
require 'webdrone/error'
require 'webdrone/browser'
require 'webdrone/open'
require 'webdrone/shot'
require 'webdrone/find'
require 'webdrone/clic'
require 'webdrone/exec'
require 'webdrone/mark'
require 'webdrone/form'
require 'webdrone/xlsx'
require 'webdrone/conf'
require 'webdrone/ctxt'
require 'webdrone/wait'
require 'webdrone/text'
require 'webdrone/vrfy'
require 'webdrone/html'
require 'webdrone/logg'

module Webdrone
  def self.create(*args)
    a0 = Webdrone::Browser.new *args
    if block_given?
      begin
        yield a0
      rescue => exception
        Webdrone.report_error(a0, exception)
      ensure
        a0.quit
      end
    else
      a0
    end
  end

  def self.irb_console(binding = nil)
    puts "Webdrone: Webdrone.irb_console IS DEPRECATED, please use a0.console instead."
    return if IRB.CurrentContext and not binding
    binding = Kernel.binding.of_caller(1) if binding == nil
    IRB.start_session(binding)
  end

  @@running_pry = false
  def self.pry_console(binding = nil)
    if @@running_pry
      puts "Webdrone: pry console already running."
    else
      @@running_pry = true
      binding = Kernel.binding.of_caller(1) unless binding
      binding.pry
      @@running_pry = false
    end
  end
end

module IRB
  def self.start_session(binding)
    unless $a0_irb_setup_done
      IRB.setup(nil)
      $a0_irb_setup_done = true
    end

    workspace = WorkSpace.new(binding)

    if @CONF[:SCRIPT]
      irb = Irb.new(workspace, @CONF[:SCRIPT])
    else
      irb = Irb.new(workspace)
    end

    @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
    @CONF[:MAIN_CONTEXT] = irb.context

    trap("SIGINT") do
      irb.signal_handle
    end

    begin
      catch(:IRB_EXIT) do
        irb.eval_input
      end
    ensure
      IRB.irb_at_exit
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
webdrone-1.7.8 lib/webdrone.rb
webdrone-1.7.4 lib/webdrone.rb
webdrone-1.7.2 lib/webdrone.rb
webdrone-1.7.0 lib/webdrone.rb
webdrone-1.6.2 lib/webdrone.rb
webdrone-1.6.0 lib/webdrone.rb
webdrone-1.5.0 lib/webdrone.rb
webdrone-1.4.8 lib/webdrone.rb
webdrone-1.4.6 lib/webdrone.rb
webdrone-1.4.4 lib/webdrone.rb
webdrone-1.4.2 lib/webdrone.rb
webdrone-1.4.0 lib/webdrone.rb
webdrone-1.3.6 lib/webdrone.rb
webdrone-1.3.4 lib/webdrone.rb
webdrone-1.3.2 lib/webdrone.rb
webdrone-1.3.0 lib/webdrone.rb