vendor/bundle/ruby/2.1.0/gems/httpauth-0.2.1/lib/httpauth/basic.rb
# Returns the name of the realm in a WWW-Authenticate header
#
# * <tt>authenticate</tt>: The contents of the WWW-Authenticate header
Returns the name of the realm in a WWW-Authenticate header
authenticate: The contents of the WWW-Authenticate header
Returns the name of the realm in a WWW - Authenticate header authenticate : The contents of the WWW - Authenticate header
def unpack_challenge(authenticate)
        if authenticate =~ /Basic\srealm=\"([^\"]*)\"/
          return Regexp.last_match[1]
        else
          if authenticate =~ /^Basic/
            fail(UnwellformedHeader, "Can't parse the WWW-Authenticate header, it's probably not well formed")
          else
            fail(ArgumentError, 'HTTPAuth::Basic can only unpack Basic Authentication headers')
          end
        end
      end
def unpack_challenge ( authenticate ) if authenticate =~ / Basic \s realm= \" ([^ \" ]*) \" / return Regexp . last_match [ 1 ] else if authenticate =~ / ^Basic / fail ( UnwellformedHeader , "Can't parse the WWW-Authenticate header, it's probably not well formed" ) else fail ( ArgumentError , 'HTTPAuth::Basic can only unpack Basic Authentication headers' ) end end end
Returns the name of the realm in a WWW-Authenticate header
 <tt>authenticate</tt>: The contents of the WWW-Authenticate header
Returns the name of the realm in a WWW - Authenticate header <tt > authenticate< / tt > : The contents of the WWW - Authenticate header
authenticate