watir-rails 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +0 -0
- data/.gitignore +0 -0
- data/.travis.yml +0 -0
- data/.yardopts +0 -0
- data/CHANGES.md +4 -0
- data/Gemfile +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/gemfiles/Gemfile.rails-3.x +0 -0
- data/gemfiles/Gemfile.rails-4.x +0 -0
- data/lib/watir/rails/browser.rb +45 -45
- data/lib/watir/rails/middleware.rb +0 -0
- data/lib/watir/rails/version.rb +1 -1
- data/lib/watir/rails.rb +8 -2
- data/spec/spec_helper.rb +0 -0
- data/spec/support/watir.rb +11 -11
- data/spec/watir/rails/browser_spec.rb +0 -0
- data/spec/watir/rails/middleware_spec.rb +0 -0
- data/spec/watir/rails_spec.rb +0 -0
- data/watir-rails.gemspec +1 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3f4596aba0f22d5d0b00aeeb2bcb5b27235b573675eef6b34e41b1bdfca8592
|
4
|
+
data.tar.gz: 7e60e1cf800f2e2603566d81c25fa946c674903b6550594142c3ad8feca17d57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f92b51730934fa6dfa1726413802d5a358f93583263f2a65099075f3c4c06e959d75c0449365a6040e48b7f29618046bea46ab79ee361e535bc99d5eb5e0925
|
7
|
+
data.tar.gz: b250aa4862442974c4b1d8b0af79206deaeb9c94ac2f901c70ed4ce8a281101e8ff0f727e63d8b107c82b5092c2590e8971f39f3cbe1d757d2b948da8840ed92
|
data/.github/workflows/ci.yml
CHANGED
File without changes
|
data/.gitignore
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/.yardopts
CHANGED
File without changes
|
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/gemfiles/Gemfile.rails-3.x
CHANGED
File without changes
|
data/gemfiles/Gemfile.rails-4.x
CHANGED
File without changes
|
data/lib/watir/rails/browser.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
module Watir
|
2
|
-
# Reopened Watir::Browser class for working with Rails
|
3
|
-
class Browser
|
4
|
-
# @private
|
5
|
-
alias_method :_original_initialize, :initialize
|
6
|
-
|
7
|
-
# Will start Rails instance for Watir automatically and then invoke the
|
8
|
-
# original Watir::Browser#initialize method.
|
9
|
-
def initialize(*args)
|
10
|
-
Rails.boot
|
11
|
-
_original_initialize *args
|
12
|
-
add_exception_hook unless Rails.ignore_exceptions?
|
13
|
-
end
|
14
|
-
|
15
|
-
# @private
|
16
|
-
alias_method :_original_goto, :goto
|
17
|
-
|
18
|
-
# Opens the url with the browser instance.
|
19
|
-
# Will add {Rails.host} and {Rails.port} to the url when path is specified.
|
20
|
-
#
|
21
|
-
# @example Go to the regular url:
|
22
|
-
# browser.goto "http://google.com"
|
23
|
-
#
|
24
|
-
# @example Go to the controller path:
|
25
|
-
# browser.goto home_path
|
26
|
-
#
|
27
|
-
# @param [String] url URL to be navigated to.
|
28
|
-
def goto(url)
|
29
|
-
url = "http://#{Rails.host}:#{Rails.port}#{url}" unless url =~ %r{^(about|data|https?):}i
|
30
|
-
_original_goto url
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def add_exception_hook
|
36
|
-
after_hooks.add do
|
37
|
-
if error = Rails.error
|
38
|
-
Rails.error = nil
|
39
|
-
raise error
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
1
|
+
module Watir
|
2
|
+
# Reopened Watir::Browser class for working with Rails
|
3
|
+
class Browser
|
4
|
+
# @private
|
5
|
+
alias_method :_original_initialize, :initialize
|
6
|
+
|
7
|
+
# Will start Rails instance for Watir automatically and then invoke the
|
8
|
+
# original Watir::Browser#initialize method.
|
9
|
+
def initialize(*args)
|
10
|
+
Rails.boot
|
11
|
+
_original_initialize *args
|
12
|
+
add_exception_hook unless Rails.ignore_exceptions?
|
13
|
+
end
|
14
|
+
|
15
|
+
# @private
|
16
|
+
alias_method :_original_goto, :goto
|
17
|
+
|
18
|
+
# Opens the url with the browser instance.
|
19
|
+
# Will add {Rails.host} and {Rails.port} to the url when path is specified.
|
20
|
+
#
|
21
|
+
# @example Go to the regular url:
|
22
|
+
# browser.goto "http://google.com"
|
23
|
+
#
|
24
|
+
# @example Go to the controller path:
|
25
|
+
# browser.goto home_path
|
26
|
+
#
|
27
|
+
# @param [String] url URL to be navigated to.
|
28
|
+
def goto(url)
|
29
|
+
url = "http://#{Rails.host}:#{Rails.port}#{url}" unless url =~ %r{^(about|data|https?):}i
|
30
|
+
_original_goto url
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def add_exception_hook
|
36
|
+
after_hooks.add do
|
37
|
+
if error = Rails.error
|
38
|
+
Rails.error = nil
|
39
|
+
raise error
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
File without changes
|
data/lib/watir/rails/version.rb
CHANGED
data/lib/watir/rails.rb
CHANGED
@@ -146,8 +146,14 @@ module Watir
|
|
146
146
|
rescue LoadError
|
147
147
|
end
|
148
148
|
|
149
|
-
|
150
|
-
|
149
|
+
begin
|
150
|
+
require 'rack/handler/webrick'
|
151
|
+
return Rack::Handler::WEBrick.run(app, :Port => port, :AccessLog => [], :Logger => WEBrick::Log::new(nil, 0))
|
152
|
+
rescue LoadError
|
153
|
+
end
|
154
|
+
|
155
|
+
require 'rackup/handler/webrick'
|
156
|
+
Rackup::Handler::WEBrick.run(app, :Port => port, :AccessLog => [], :Logger => WEBrick::Log::new(nil, 0))
|
151
157
|
end
|
152
158
|
end
|
153
159
|
end
|
data/spec/spec_helper.rb
CHANGED
File without changes
|
data/spec/support/watir.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
# Needed to simulate watir gem.
|
2
|
-
|
3
|
-
module Watir
|
4
|
-
class Browser
|
5
|
-
def initialize(*args)
|
6
|
-
end
|
7
|
-
|
8
|
-
def goto(url)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
# Needed to simulate watir gem.
|
2
|
+
|
3
|
+
module Watir
|
4
|
+
class Browser
|
5
|
+
def initialize(*args)
|
6
|
+
end
|
7
|
+
|
8
|
+
def goto(url)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
File without changes
|
File without changes
|
data/spec/watir/rails_spec.rb
CHANGED
File without changes
|
data/watir-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jarmo Pertman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webrick
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Use Watir (http://github.com/watir/watir) in Rails.
|
98
112
|
email:
|
99
113
|
- jarmo.p@gmail.com
|
@@ -126,7 +140,7 @@ homepage: http://github.com/watir/watir-rails
|
|
126
140
|
licenses:
|
127
141
|
- MIT
|
128
142
|
metadata: {}
|
129
|
-
post_install_message:
|
143
|
+
post_install_message:
|
130
144
|
rdoc_options: []
|
131
145
|
require_paths:
|
132
146
|
- lib
|
@@ -141,8 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
155
|
- !ruby/object:Gem::Version
|
142
156
|
version: '0'
|
143
157
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
145
|
-
signing_key:
|
158
|
+
rubygems_version: 3.1.6
|
159
|
+
signing_key:
|
146
160
|
specification_version: 4
|
147
161
|
summary: Use Watir (http://github.com/watir/watir) in Rails.
|
148
162
|
test_files:
|