watir 3.0.0 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1,2 @@
1
- require 'watir/loader'
1
+ require File.expand_path('watir/version', File.dirname(__FILE__))
2
+ require File.expand_path('watir/loader', File.dirname(__FILE__))
@@ -1,2 +1,50 @@
1
- require 'watir-classic'
2
- require 'watir/version'
1
+ module Watir
2
+ class Browser
3
+ class << self
4
+ def new(browser=nil, *args)
5
+ if browser && browser.to_sym != :ie && Watir.driver == :classic
6
+ Watir.driver = :webdriver
7
+ end
8
+ Watir.load_driver
9
+
10
+ if Watir.driver == :webdriver
11
+ # remove this class method for WebDriver to avoid endless loop
12
+ singleton_class = class << self; self end
13
+ singleton_class.send :remove_method, :new
14
+ end
15
+
16
+ new browser, *args
17
+ end
18
+ end
19
+ end
20
+
21
+ class << self
22
+ def load_driver
23
+ require "watir-#{driver}"
24
+ rescue LoadError
25
+ warn "watir-#{driver} gem is missing. Install it with the following command:"
26
+ warn " gem install watir-#{driver}"
27
+ exit 1
28
+ end
29
+
30
+ def driver
31
+ @driver || ENV["WATIR_DRIVER"] || default_driver
32
+ end
33
+
34
+ def driver=(driver)
35
+ allowed_drivers = %w[webdriver classic]
36
+ unless allowed_drivers.map(&:to_sym).include?(driver.to_sym)
37
+ raise "Supported drivers are #{allowed_drivers.join(", ")}."
38
+ end
39
+ @driver = driver
40
+ end
41
+
42
+ def default_driver
43
+ if ENV['OS'] == 'Windows_NT'
44
+ :classic
45
+ else
46
+ :webdriver
47
+ end
48
+ end
49
+ end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Watir
2
- BUNDLE_VERSION = '3.0.0'
2
+ BUNDLE_VERSION = '4.0.0.rc1'
3
3
  end
@@ -15,7 +15,4 @@ Gem::Specification.new do |s|
15
15
  s.files = %x{git ls-files}.split("\n")
16
16
  s.require_paths = ["lib"]
17
17
  s.add_dependency "commonwatir", Watir::BUNDLE_VERSION
18
-
19
- # bundled gems
20
- s.add_dependency "watir-classic", '~> 3'
21
18
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
5
- prerelease:
4
+ version: 4.0.0.rc1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Bret Pettichord
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-23 00:00:00.000000000 Z
12
+ date: 2012-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: commonwatir
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 3.0.0
21
+ version: 4.0.0.rc1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,23 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 3.0.0
30
- - !ruby/object:Gem::Dependency
31
- name: watir-classic
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: '3'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '3'
29
+ version: 4.0.0.rc1
46
30
  description: Automated testing tool for web applications. By Testers. For Testers.
47
31
  email:
48
32
  - bret@pettichord.com
@@ -70,13 +54,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
54
  required_rubygems_version: !ruby/object:Gem::Requirement
71
55
  none: false
72
56
  requirements:
73
- - - ! '>='
57
+ - - ! '>'
74
58
  - !ruby/object:Gem::Version
75
- version: '0'
59
+ version: 1.3.1
76
60
  requirements: []
77
61
  rubyforge_project: watir
78
- rubygems_version: 1.8.21
62
+ rubygems_version: 1.8.24
79
63
  signing_key:
80
64
  specification_version: 3
81
65
  summary: Watir
82
66
  test_files: []
67
+ has_rdoc: