lib/httpx/extensions.rb in httpx-0.20.5 vs lib/httpx/extensions.rb in httpx-0.21.0

- old
+ new

@@ -52,10 +52,18 @@ end end Numeric.__send__(:include, NegMethods) end + module NumericExtensions + refine Numeric do + def infinite? + self == Float::INFINITY + end unless Numeric.method_defined?(:infinite?) + end + end + module StringExtensions refine String do def delete_suffix!(suffix) suffix = Backports.coerce_to_str(suffix) chomp! if frozen? @@ -133,13 +141,9 @@ end unless IO.method_defined?(:wait) && IO.instance_method(:wait).arity == 2 end end module RegexpExtensions - # If you wonder why this is there: the oauth feature uses a refinement to enhance the - # Regexp class locally with #match? , but this is never tested, because ActiveSupport - # monkey-patches the same method... Please ActiveSupport, stop being so intrusive! - # :nocov: refine(Regexp) do def match?(*args) !match(*args).nil? end end