Module: SeleniumMonkeypatch
- Defined in:
- lib/birdsong/monkeypatch.rb
Overview
Design taken from blog.appsignal.com/2021/08/24/responsible-monkeypatching-in-ruby.html
Defined Under Namespace
Modules: InstanceMethods
Constant Summary collapse
- @@logger =
Logger.new(STDOUT)
Class Method Summary collapse
Class Method Details
.apply_patch ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/birdsong/monkeypatch.rb', line 11 def apply_patch target_class = find_class target_method = find_method(target_class) unless target_method raise "Could not find class or method when patching Selenium::WebDriver::DevTools.send_cmd" end @@logger.info "#{__FILE__} is monkeypatching Selenium::WebDriver::DevTools.send_cmd" target_class.prepend(InstanceMethods) end |