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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70a4bf116e756c213c309ccd099175324a364a69bdf3e9e7b43889b2430220b3
4
- data.tar.gz: 5debf047f4f0fef4474bc81b712dc47f085cc14989e4ae068bab2283f6cfb655
3
+ metadata.gz: f3f4596aba0f22d5d0b00aeeb2bcb5b27235b573675eef6b34e41b1bdfca8592
4
+ data.tar.gz: 7e60e1cf800f2e2603566d81c25fa946c674903b6550594142c3ad8feca17d57
5
5
  SHA512:
6
- metadata.gz: 28658a949209812b349e100afcf9a7d7850a09080f1bd23b4e784a9250b8a1c21c04f37d9cdccfeb07e60c0a13b095e3a3727ab3c99246ae433509d105ddd5ea
7
- data.tar.gz: 7f2f3901a136c79515f2a323e95c302898db125ab478ffcb13b81069eafcddbe4e40d1b5462f2b48508d132415c58267a92dae0210e608e81ed410d1f8b0c14f
6
+ metadata.gz: 7f92b51730934fa6dfa1726413802d5a358f93583263f2a65099075f3c4c06e959d75c0449365a6040e48b7f29618046bea46ab79ee361e535bc99d5eb5e0925
7
+ data.tar.gz: b250aa4862442974c4b1d8b0af79206deaeb9c94ac2f901c70ed4ce8a281101e8ff0f727e63d8b107c82b5092c2590e8971f39f3cbe1d757d2b948da8840ed92
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
@@ -1,3 +1,7 @@
1
+ ### 2.4.0 - 2025/10/03
2
+
3
+ * Support Webrick for Ruby 3.0+. PR #37 by Norbert Szivós.
4
+
1
5
  ### 2.3.0 - 2023/02/18
2
6
 
3
7
  * Make `Watir::Rails.boot` use previously selected port in subsequent calls. PR #34 by Bartek Bulat.
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
File without changes
File without changes
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Watir
2
2
  class Rails
3
- VERSION = "2.3.0"
3
+ VERSION = "2.4.0"
4
4
  end
5
5
  end
data/lib/watir/rails.rb CHANGED
@@ -146,8 +146,14 @@ module Watir
146
146
  rescue LoadError
147
147
  end
148
148
 
149
- require 'rack/handler/webrick'
150
- Rack::Handler::WEBrick.run(app, :Port => port, :AccessLog => [], :Logger => WEBrick::Log::new(nil, 0))
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
@@ -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
File without changes
data/watir-rails.gemspec CHANGED
@@ -24,4 +24,5 @@ Gem::Specification.new do |gem|
24
24
  gem.add_development_dependency "yard"
25
25
  gem.add_development_dependency "redcarpet"
26
26
  gem.add_development_dependency "rspec", "~> 3.0"
27
+ gem.add_development_dependency "webrick"
27
28
  end
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.3.0
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: 2023-02-18 00:00:00.000000000 Z
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.3.25
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: