module OpenURI

Public Class Methods

open_uri(name, options = {}) click to toggle source

The original open_uri takes *args but then doesn’t do anything with them. Assume we can only handle a hash.

# File lib/nesta-plugin-drop/openuri_monkeypatch.rb, line 15
def self.open_uri name, options = {}
  value = options.delete :allow_unsafe_redirects
  if value
    class <<self
      remove_method :redirectable?
      alias_method :redirectable?, :redirectable_baller?
     end
   else
     class <<self
       remove_method :redirectable?
       alias_method :redirectable?, :redirectable_cautious?
     end
   end
   self.open_uri_original name, options
end
Also aliased as: open_uri_original
open_uri_original(name, options = {})
Alias for: open_uri
redirectable?(uri1, uri2)
Also aliased as: redirectable_cautious?
redirectable_baller?(uri1, uri2) click to toggle source
# File lib/nesta-plugin-drop/openuri_monkeypatch.rb, line 7
def redirectable_baller? uri1, uri2
  valid = /\A(?:https?|ftp)\z/i
  valid =~ uri1.scheme.downcase && valid =~ uri2.scheme
end
Also aliased as: redirectable?
redirectable_cautious?(uri1, uri2)
Also aliased as: redirectable?
Alias for: redirectable?