lib/css_parser/parser.rb in css_parser-1.4.4 vs lib/css_parser/parser.rb in css_parser-1.4.5
- old
+ new
@@ -39,10 +39,11 @@
:io_exceptions => true}.merge(options)
# array of RuleSets
@rules = []
+ @redirect_count = nil
@loaded_uris = []
# unprocessed blocks of CSS
@blocks = []
@@ -186,12 +187,12 @@
# Iterate through CSS selectors.
#
# +media_types+ can be a symbol or an array of symbols.
# See RuleSet#each_selector for +options+.
- def each_selector(media_types = :all, options = {}) # :yields: selectors, declarations, specificity, media_types
- each_rule_set(media_types) do |rule_set, media_types|
+ def each_selector(all_media_types = :all, options = {}) # :yields: selectors, declarations, specificity, media_types
+ each_rule_set(all_media_types) do |rule_set, media_types|
rule_set.each_selector(options) do |selectors, declarations, specificity|
yield selectors, declarations, specificity, media_types
end
end
end
@@ -485,10 +486,10 @@
@redirect_count = nil
raise RemoteFileError if @options[:io_exceptions]
return '', nil
elsif res.code.to_i >= 300 and res.code.to_i < 400
if res.response['Location'] != nil
- return read_remote_file Addressable::URI.parse(URI::encode(res.response['Location']))
+ return read_remote_file Addressable::URI.parse(URI.escape(res.response['Location']))
end
end
case res['content-encoding']
when 'gzip'