lib/spidr/page.rb in spidr-0.2.6 vs lib/spidr/page.rb in spidr-0.2.7
- old
+ new
@@ -287,14 +287,33 @@
# The raw Cookie String sent along with the page.
#
# @return [String]
# The raw Cookie from the response.
#
+ # @since 0.2.7
+ #
+ def raw_cookie
+ (@response['Set-Cookie'] || '')
+ end
+
+ #
+ # The raw Cookie String sent along with the page.
+ #
+ # @return [String]
+ # The raw Cookie from the response.
+ #
+ # @deprecated
+ # Deprecated in 0.2.7 and will be removed in 0.3.0.
+ # Use {#raw_cookie} instead.
+ #
# @since 0.2.2
#
def cookie
- (@response['Set-Cookie'] || '')
+ STDERR.puts 'DEPRECATION: Spidr::Page#cookie will be removed in 0.3.0'
+ STDERR.puts 'DEPRECATION: Use Spidr::Page#raw_cookie instead'
+
+ return raw_cookie
end
#
# The Cookie values sent along with the page.
#
@@ -505,10 +524,10 @@
# The normalized URI.
#
def to_absolute(link)
begin
url = @url.merge(link.to_s)
- rescue URI::InvalidURIError
+ rescue URI::InvalidURIError, URI::InvalidComponentError
return nil
end
unless (url.path.nil? || url.path.empty?)
# make sure the path does not contain any .. or . directories,