/usr/lib/ruby/vendor_ruby/em-synchrony/mechanize.rb is in ruby-em-synchrony 1.0.5-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | require 'mechanize'
module EventMachine
module Synchrony
class Mechanize < ::Mechanize
def initialize(*args, &blk)
super
@agent.instance_variable_get(:@http).singleton_class.send(:include, DeferedNetHttpPersistentRequest)
end
module DeferedNetHttpPersistentRequest
def self.included(base)
base.class_eval do
alias :request_without_defer :request
alias :request :request_with_defer
end
end
def request_with_defer(*args, &blk)
EM::Synchrony.defer do
request_without_defer(*args, &blk)
end
end
end
end
end
end
|