Skip to content

Commit

Permalink
JariBakken: Move ruby bindings to top level rb/ folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
jari.bakken committed Sep 23, 2010
0 parents commit d7944a6
Show file tree
Hide file tree
Showing 67 changed files with 6,169 additions and 0 deletions.
76 changes: 76 additions & 0 deletions CHANGES
@@ -0,0 +1,76 @@
0.0.28 (2010-08-23)
===================

* Fix behaviour of Element#==, Element#eql? and Element#hash (#hash still has issues on IE / remote).
* Include remote server backtrace in raised errors (if available).
* Chrome: Untrusted certificate support.
* IE: Fix NoMethodError when getElementAttribute returns nil.
* Driver#[] shorthand can take a locator hash, not just an id string.

0.0.27 (2010-07-22)
===================

* Fixes for Element#attribute on IE / Firefox

0.0.26 (2010-07-19)
===================

* Work around Curb issue: http://github.com/taf2/curb/issues/issue/40

0.0.25 (2010-07-19)
===================

* Prevent Firefox from launching in offline mode (issue #587).
* Add ability to set Firefox' binary path through Selenium::WebDriver::Firefox::Binary.path=
* Add ability to install Firefox XPIs through Profile#add_extension.
* Better packaging/building of Firefox/Chrome extensions, which adds rubyzip as a dependency.
* Remote client supports HTTPS (issue #613 - thanks kkaempf).
* Fix error message for TimeOutError in the IE driver (issue #602)
* Add ability to use Chrome's default profile.
* Fix for frame behaviour in Chrome (issue #273).
* Standard gem directory structure (issue #475).

0.0.24 (2010-06-17)
==================

* Fix issues with quitting Firefox/Chrome on Windows + MRI.


0.0.23 (2010-06-15)
===================

* Improved the HTTP clients:
- hopefully fix some occasional socket errors on Windows
- rescue error on driver.close() with curb

0.0.22 (2010-06-11)
===================

* Bugfix: Workaround for http://github.com/taf2/curb/issues/issue/33 - curb would sometimes use DELETE for GET requests.
* Minor doc fix
* Add ability to set timeout for HTTP clients

0.0.21 (2010-06-11)
===================

* User can specify :http_client for the Firefox driver.
* Refactor HTTP client code
* Add Remote::Http::Curb as an alternative to the default (net/http) client.


0.0.20 (2010-06-03)
===================

* Fix bug where Firefox would hang on quit().

0.0.19 (2010-05-31)
===================

* Add a max redirect check to the remote driver
* Add Firefox::Profile#assume_untrusted_certificate_issuer=
* Add implicit waits (Selenium::WebDriver::Timeouts)
* at_exit hook to clean temporary profiles
* Fix for Errno::ECONNABORTED errors on Windows
* Fix issue where Firefox::Profile#secure_ssl= would have no effect
* Fix issue where locating elements by :css would fail in the Chrome driver.
* IE driver now works on 64-bit rubies.
30 changes: 30 additions & 0 deletions README
@@ -0,0 +1,30 @@
= selenium-webdriver

This gem provides Ruby bindings for WebDriver and has been tested to work on MRI (1.8.6 through 1.9), JRuby and Rubinius.

= INSTALL

gem install selenium-webdriver

= LINKS

* http://gemcutter.org/gems/selenium-webdriver
* http://selenium.googlecode.com/svn/trunk/docs/api/rb/index.html
* http://code.google.com/p/selenium/wiki/RubyBindings
* http://code.google.com/p/selenium/issues/list

= LICENSE

Copyright 2009-2010 WebDriver committers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
123 changes: 123 additions & 0 deletions build.desc
@@ -0,0 +1,123 @@
rubygem(
version = "0.0.28",
name = "selenium-webdriver",
dir = "build/rb",
deps = [
"//rb:chrome",
"//rb:common",
"//rb:firefox",
"//rb:ie",
"//rb:remote"
]
)

rubydocs(
files = [
"rb/lib/**/*.rb",
"CHANGES"
],
readme = "rb/README",
output_dir = "build/rubydocs"
)

ruby_library(name = "common",
srcs = [
"lib/selenium/webdriver/common/**/*.rb",
"lib/selenium/webdriver/common.rb",
"lib/selenium/webdriver.rb",
"lib/selenium-webdriver.rb",
"CHANGES",
"README"
]
)

ruby_library(name = "chrome",
srcs = [
"lib/selenium/webdriver/chrome/**/*.rb",
"lib/selenium/webdriver/chrome.rb"
],
resources = [
{"//chrome:chrome_extension" : "rb/lib/selenium/webdriver/chrome/extension.zip"}
],
deps = [
":common",
":remote"
]
)

ruby_test(name = "chrome",
srcs = [
"spec/selenium/webdriver/*_spec.rb",
"spec/selenium/webdriver/chrome/**/*_spec.rb"
],
include = [ "build/rb/lib" ],
deps = [ ":chrome" ]
)

ruby_library(name = "firefox",
srcs = [
"lib/selenium/webdriver/firefox/**/*.rb",
"lib/selenium/webdriver/firefox.rb"
],
resources = [
{ "//firefox:webdriver" : "rb/lib/selenium/webdriver/firefox/extension/webdriver.xpi"},
{ "//firefox:noblur" : "rb/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so" },
{ "//firefox:noblur64" : "rb/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so" }
],
deps = [ ":remote" ]
)

ruby_test(name = "firefox",
srcs = [
"spec/selenium/webdriver/*_spec.rb",
"spec/selenium/webdriver/firefox/**/*_spec.rb"
],
deps = [":firefox"],
include = [ "build/rb/lib" ]
)


ruby_library(name = "ie",
srcs = [
"lib/selenium/webdriver/ie/**/*.rb",
"lib/selenium/webdriver/ie.rb"
],
resources = [
{"//jobbie:ie_win32_dll" : "rb/lib/selenium/webdriver/ie/native/win32/InternetExplorerDriver.dll"},
{"//jobbie:ie_x64_dll" : "rb/lib/selenium/webdriver/ie/native/x64/InternetExplorerDriver.dll"}
],
deps = [ ":common" ]
)

ruby_test(name = "ie",
srcs = [
"spec/selenium/webdriver/*_spec.rb",
"spec/selenium/webdriver/ie/**/*_spec.rb"
],
include = ["build/rb/lib"],
deps = [ ":ie" ]
)

ruby_library(name = "remote",
srcs = [
"lib/selenium/webdriver/remote/**/*.rb",
"lib/selenium/webdriver/remote.rb"
],
deps = [
":common"
]
)

ruby_test(name = "remote",
srcs = [
"spec/selenium/webdriver/*_spec.rb",
"spec/selenium/webdriver/remote/**/*_spec.rb"
],
include = ["build/rb/lib"],
deps = [
"//remote/server:server:uber",
"//remote/server:test",
":remote"
]
)

1 change: 1 addition & 0 deletions lib/selenium-webdriver.rb
@@ -0,0 +1 @@
require "selenium/webdriver"
55 changes: 55 additions & 0 deletions lib/selenium/webdriver.rb
@@ -0,0 +1,55 @@
require "tmpdir"
require "fileutils"
require "date"

have_lib = lambda { |lib|
begin
require lib
true
rescue LoadError
false
end
}

unless have_lib["yajl/json_gem"] || have_lib["json"]
raise LoadError, <<-END
You need to require rubygems or install one of these gems:
yajl-ruby (best on MRI)
json
json-jruby (native JRuby)
json_pure (any platform)
END
end

require "selenium/webdriver/common"


module Selenium
module WebDriver
Point = Struct.new(:x, :y)
Dimension = Struct.new(:width, :height)

autoload :IE, 'selenium/webdriver/ie'
autoload :Remote, 'selenium/webdriver/remote'
autoload :Chrome, 'selenium/webdriver/chrome'
autoload :Firefox, 'selenium/webdriver/firefox'

def self.root
@root ||= File.expand_path(File.join(File.dirname(__FILE__), ".."))
end

#
# @see Selenium::WebDriver::Driver.for
#

def self.for(*args)
WebDriver::Driver.for(*args)
end

end # WebDriver
end # Selenium

Thread.abort_on_exception = true
19 changes: 19 additions & 0 deletions lib/selenium/webdriver/chrome.rb
@@ -0,0 +1,19 @@
require "selenium/webdriver/chrome/launcher"
require "selenium/webdriver/chrome/command_executor"
require "selenium/webdriver/chrome/bridge"

require "fileutils"
require "thread"
require "socket"

module Selenium
module WebDriver

module Chrome
def self.path=(path)
Launcher.binary_path = path
end
end

end
end

0 comments on commit d7944a6

Please sign in to comment.