Skip to content

Commit 70b55db

Browse files
committed
Remove deprecated API of positional arguments
1 parent cd5a899 commit 70b55db

1 file changed

Lines changed: 6 additions & 24 deletions

File tree

lib/css_parser/parser.rb

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,11 @@ def compact! # :nodoc:
410410
# See add_block! for options.
411411
#
412412
# Deprecated: originally accepted three params: `uri`, `base_uri` and `media_types`
413-
def load_uri!(uri, options = {}, deprecated = nil)
413+
def load_uri!(uri, options = {})
414414
uri = Addressable::URI.parse(uri) unless uri.respond_to? :scheme
415415

416416
opts = {base_uri: nil, media_types: :all}
417-
418-
if options.is_a? Hash
419-
opts.merge!(options)
420-
else
421-
opts[:base_uri] = options if options.is_a? String
422-
opts[:media_types] = deprecated if deprecated
423-
end
417+
opts.merge!(options)
424418

425419
if uri.scheme == 'file' or uri.scheme.nil?
426420
uri.path = File.expand_path(uri.path)
@@ -438,15 +432,9 @@ def load_uri!(uri, options = {}, deprecated = nil)
438432
end
439433

440434
# Load a local CSS file.
441-
def load_file!(file_name, options = {}, deprecated = nil)
435+
def load_file!(file_name, options = {})
442436
opts = {base_dir: nil, media_types: :all}
443-
444-
if options.is_a? Hash
445-
opts.merge!(options)
446-
else
447-
opts[:base_dir] = options if options.is_a? String
448-
opts[:media_types] = deprecated if deprecated
449-
end
437+
opts.merge!(options)
450438

451439
file_path = @options[:file_resource]
452440
.find_file(file_name, base_dir: opts[:base_dir])
@@ -462,15 +450,9 @@ def load_file!(file_name, options = {}, deprecated = nil)
462450
end
463451

464452
# Load a local CSS string.
465-
def load_string!(src, options = {}, deprecated = nil)
453+
def load_string!(src, options = {})
466454
opts = {base_dir: nil, media_types: :all}
467-
468-
if options.is_a? Hash
469-
opts.merge!(options)
470-
else
471-
opts[:base_dir] = options if options.is_a? String
472-
opts[:media_types] = deprecated if deprecated
473-
end
455+
opts.merge!(options)
474456

475457
add_block!(src, opts)
476458
end

0 commit comments

Comments
 (0)