@@ -455,17 +455,17 @@ def expand_font_shorthand! # :nodoc:
455455 else
456456 font_props [ 'font-family' ] = m
457457 end
458- elsif m =~ /normal|inherit/i
458+ elsif /normal|inherit/i . match? ( m )
459459 [ 'font-style' , 'font-weight' , 'font-variant' ] . each do |font_prop |
460460 font_props [ font_prop ] ||= m
461461 end
462- elsif m =~ /italic|oblique/i
462+ elsif /italic|oblique/i . match? ( m )
463463 font_props [ 'font-style' ] = m
464- elsif m =~ /small-caps/i
464+ elsif /small-caps/i . match? ( m )
465465 font_props [ 'font-variant' ] = m
466- elsif m =~ /[1-9]00$|bold|bolder|lighter/i
466+ elsif /[1-9]00$|bold|bolder|lighter/i . match? ( m )
467467 font_props [ 'font-weight' ] = m
468- elsif m =~ CssParser ::FONT_UNITS_RX
468+ elsif CssParser ::FONT_UNITS_RX . match? ( m )
469469 if m . include? ( '/' )
470470 font_props [ 'font-size' ] , font_props [ 'line-height' ] = m . split ( '/' , 2 )
471471 else
@@ -488,7 +488,7 @@ def expand_list_style_shorthand! # :nodoc:
488488 value = declaration . value . dup
489489
490490 replacement =
491- if value =~ CssParser ::RE_INHERIT
491+ if CssParser ::RE_INHERIT . match? ( value )
492492 LIST_STYLE_PROPERTIES . to_h { |key | [ key , 'inherit' ] }
493493 else
494494 {
@@ -559,7 +559,7 @@ def create_border_shorthand! # :nodoc:
559559 next if declaration . important
560560 # can't merge if any value contains a space (i.e. has multiple values)
561561 # we temporarily remove any spaces after commas for the check (inside rgba, etc...)
562- next if declaration . value . gsub ( /,\s / , ',' ) . strip =~ / \s /
562+ next if / \s / . match? ( declaration . value . gsub ( /,\s / , ',' ) . strip )
563563
564564 declaration . value
565565 end . compact
0 commit comments