From 7f9df7a08bedf5938fb63c2e59c4011ceaaf1585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohnic=CC=81?= Date: Thu, 16 Aug 2012 15:07:32 +0200 Subject: [PATCH] fix EM Synchrony PATCH and OPTIONS methods --- lib/faraday/adapter/em_synchrony.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/faraday/adapter/em_synchrony.rb b/lib/faraday/adapter/em_synchrony.rb index 22df1c48..cae88c76 100644 --- a/lib/faraday/adapter/em_synchrony.rb +++ b/lib/faraday/adapter/em_synchrony.rb @@ -71,7 +71,9 @@ require 'faraday/adapter/em_synchrony/parallel_manager' # add missing patch(), options() methods EventMachine::HTTPMethods.module_eval do - ([:patch, :options] - instance_methods).each do |type| + [:patch, :options].each do |type| + next if method_defined? :"a#{type}" + alias_method :"a#{type}", type if method_defined? type module_eval %[ def #{type}(options = {}, &blk) f = Fiber.current